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