标签: hl7-dotnetcore

消息验证抛出“未找到消息”异常

我正在使用 hl7-dotnetcore 包来创建新的 HL7 消息。创建它们后,我想将其中一些序列化为字符串,将其中一些序列化为字节。我使用以下代码段创建了一个空的 .NET Core 控制台项目

internal class Program
{
    private static void Main(string[] args)
    {
        Message mdmMessage = new Message();

        mdmMessage.AddSegmentMSH(
            "sendingApplication",
            "sendingFacility",
            "receivingApplication",
            "receivingFacility",
            string.Empty,
            "MDM^T02",
            $"Id{DateTime.Now.Ticks}",
            "P",
            "2.6");

        HL7Encoding hl7Encoding = new HL7Encoding();

        //################################
        // Add a field e.g. TXA.1

        Segment txaSegment = new Segment("TXA", hl7Encoding);
        txaSegment.AddNewField("1", 1);
        mdmMessage.AddNewSegment(txaSegment);

        //################################
        // Add a component field e.g. PID.5.1

        Segment pidSegment = new Segment("PID", hl7Encoding);
        Field patientNameField = new Field(hl7Encoding);
        Component pidFamilyNameComponent = new Component("Doe", hl7Encoding);
        patientNameField.AddNewComponent(pidFamilyNameComponent, …
Run Code Online (Sandbox Code Playgroud)

c# hl7 .net-core hl7-dotnetcore

5
推荐指数
0
解决办法
190
查看次数

标签 统计

.net-core ×1

c# ×1

hl7 ×1

hl7-dotnetcore ×1