HL7 - 在 c# 中使用 nHapi 解析样本源 (OBR-15)

HL7 - Parsing Specimen Source (OBR-15) using nHapi in c#

我想知道是否有在 C# 中使用 nHAPI 经验的好人能够帮助新手解决 HL7 消息的 OBR-15 字段(样本源)?我四处寻找,但找不到任何在线文档来帮助我,所以我将不胜感激任何建议。

我的问题是,我找不到使用 nHAPI 填充 OBR-15 字段的正确方法。我希望发送一个看起来像这样的 OBR 段(我已经从除 OBR15 之外的所有其他字段中删除了数据,所以我的实际消息并不像这样简单):

OBR|1||||||||||||||T034^Blood||||||||||||||||||||

我已经尝试了所有可能的方法来形成这个字段,但都没有成功。我发送的所有内容总是在前面出现一个符号,这意味着该字段在下游应用程序中不可读:

OBR|1||||||||||||||&T034^^^^^^&Blood||||||||||||||||||||

我的 OBR-15 代码片段(我只是把相关的东西放在这里,否则这部分会很大):

using System;
using System.Collections.Generic;
using System.Web.Services;
using NHapi.Model.V24.Message;
using NHapi.Model.V24.Segment;
using NHapi.Model.V24.Group;
using System.Data;
using System.Text;
using NHapi.Base.Parser;
using NHapi.Model.V24.Datatype;
using System.Text.RegularExpressions;
using System.Configuration;
using System.Data.SqlClient;


namespace HL7WebService
{

    public class HL7Reporting : System.Web.Services.WebService
    {
        private ORU_R01 Create_ORU_R01(Dictionary <string,string> reportData, int reportNumber)
        {
            ORU_R01 oruR01 = new ORU_R01();

            // lots of stuff removed for clarity

            ORU_R01_ORDER_OBSERVATION oruR01OrderObs = oruR01.GetPATIENT_RESULT().GetORDER_OBSERVATION(1);
            OBR obr = oruR01OrderObs.OBR;

            // OBR-15 Specimen Source
            obr.SpecimenSource.SpecimenSourceNameOrCode.Text.Value = "T034";
            obr.SpecimenSource.SpecimenRole.Text.Value = "Blood";

            // lots of other stuff removed for clarity

            return oruR01;
        }
    }
}

我使用的是 nHapi (v2.5.0.6) 和 visual studio 2015。如果我遗漏了什么或者您需要任何进一步的信息,请告诉我,我会提供。谢谢!

我通过以下方式声明 OBR-15 解决了这个问题:

obr.SpecimenSource.SpecimenSourceNameOrCode.Identifier.Value = "T034"; 
obr.SpecimenSource.Additives.Value = "Blood";