gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-30 01:29:28 26 4
gpt4 key购买 nike

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

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com