Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using EdiFabric.Core.Model.Edi;
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() + @"\..\..\..\Files\PrescriptionRequest_NEWRX.txt");
List<IEdiItem> ncpdpItems;
using (var ncpdpReader = new NcpdpScriptReader(ncpdpStream, "EdiFabric.Templates.Ncpdp"))
ncpdpItems = ncpdpReader.ReadToEnd().ToList();
var prescriptionRequests = ncpdpItems.OfType<TSNEWRX>();
}
}
}