-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathReadNCPDPFileToEnd.cs
More file actions
35 lines (31 loc) · 1.26 KB
/
Copy pathReadNCPDPFileToEnd.cs
File metadata and controls
35 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using EdiFabric.Core.Model.Edi;
using EdiFabric.Examples.NCPDP.Script.Common;
using EdiFabric.Framework.Readers;
using EdiFabric.Templates.Script106;
namespace EdiFabric.Examples.NCPDP.Script.ReadNCPDP
{
class ReadNCPDPFileToEnd
{
/// <summary>
/// Reads the NCPDP stream from start to end.
/// This method loads the file into memory. Do not use for large files.
/// The sample file contains two claims - a valid one and an invalid one.
/// </summary>
public static void Run()
{
Debug.WriteLine("******************************");
Debug.WriteLine(MethodBase.GetCurrentMethod().Name);
Debug.WriteLine("******************************");
Stream ncpdpStream = File.OpenRead(Directory.GetCurrentDirectory() + Config.TestFilesPath + @"\PrescriptionRequest_NEWRX.txt");
List<IEdiItem> ncpdpItems;
using (var ncpdpReader = new NcpdpScriptReader(ncpdpStream, "EdiFabric.Templates.Ncpdp"))
ncpdpItems = ncpdpReader.ReadToEnd().ToList();
var prescriptionRequests = ncpdpItems.OfType<TSNEWRX>();
}
}
}