-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathWriteNCPDPToStream.cs
34 lines (31 loc) · 1.07 KB
/
WriteNCPDPToStream.cs
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
using System.Diagnostics;
using System.IO;
using System.Reflection;
using EdiFabric.Examples.NCPDP.Script.Common;
using EdiFabric.Framework.Writers;
namespace EdiFabric.Examples.NCPDP.Script.WriteNCPDP
{
class WriteNCPDPToStream
{
/// <summary>
/// Generate and write NCPDP document to a stream
/// </summary>
public static void Run()
{
Debug.WriteLine("******************************");
Debug.WriteLine(MethodBase.GetCurrentMethod().Name);
Debug.WriteLine("******************************");
using (var stream = new MemoryStream())
{
using (var writer = new NcpdpScriptWriter(stream))
{
// Write the interchange header
writer.Write(SegmentBuilders.BuildInterchangeHeader());
// Write the prescription request
writer.Write(SegmentBuilders.BuildPrescriptionRequest());
}
Debug.Write(stream.LoadToString());
}
}
}
}