-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathWriteHL7ToStream.cs
32 lines (29 loc) · 948 Bytes
/
WriteHL7ToStream.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
using EdiFabric.Examples.HL7.Common;
using EdiFabric.Framework.Writers;
using System.Diagnostics;
using System.IO;
using System.Reflection;
namespace EdiFabric.Examples.HL7.WriteHL7
{
class WriteHL7ToStream
{
/// <summary>
/// Generate and write HL7 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 Hl7Writer(stream))
{
// Write the dispense
writer.Write(SegmentBuilders.BuildDispense("LAB1", "LAB", "DEST2", "DEST", "1"));
}
Debug.Write(stream.LoadToString());
}
}
}
}