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

标签 c# hl7 nhapi

我想知道是否有任何在 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";

关于c# - HL7 - 在 c# 中使用 nHapi 解析样本源 (OBR-15),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51731682/

相关文章:

c# - (Func, Action, Predicate) VS 转换器和比较委托(delegate) c#

c# - 从 [SomePaymentProcesingCompany] 汇款到银行账户

c# - 如何调用 Azure HTTP 触发器函数

xml - 将 HL7 段转换为 XML

java - 使用 Java 正则表达式从文件中选择 HL7 数据

c# - 在没有先验消息类型知识的情况下解析 HL7

c# - c# - 如何从指定字符串中拆分单词?

image - HL7 V3 ED 数据类型是在 HL7 消息/文档中发送多媒体数据的唯一可能性吗?

c# - HL7 ORM_o01 nHapi 上的 OBR 重复