简体   繁体   English

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

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

I was wondering if any wonderful person with experience of using nHAPI in C# would be able to help a newbie out with the OBR-15 field (Specimen Source) of an HL7 message? 我想知道在C#中使用nHAPI的经验是否能够用HL7消息的OBR-15字段(标本源)帮助新手? I've dug around and I can't find any documentation online to help me out, so I'd be grateful for any suggestions. 我已经挖了,我在网上找不到任何文件来帮助我,所以我很感激任何建议。

My problem is, I can't find the correct method for filling the OBR-15 field using nHAPI. 我的问题是,我找不到使用nHAPI填充OBR-15字段的正确方法。 I'm hoping to send an OBR segment that looks like this (I've removed data from all other fields except OBR15, so my actually message isn't as bare as this): 我希望发送一个看起来像这样的OBR片段(我从除了OBR15以外的所有其他字段中删除了数据,所以我的实际消息并不像这样):

OBR|1||||||||||||||T034^Blood|||||||||||||||||||| OBR | 1个|||||||||||||| T034 ^血||||||||||||||||||||

I've tried every way possible to form this field with no success. 我已经尽一切可能形成这个领域但没有成功。 I'm always getting an ampersand that appears in the front everything I'm sending, which means that the field is unreadable in downstream applications: 我总是得到一个&符号,它出现在我正在发送的所有内容中,这意味着该字段在下游应用程序中是不可读的:

OBR|1||||||||||||||&T034^^^^^^&Blood|||||||||||||||||||| OBR | 1 ||||||||||||||&T034 ^^^^^^及血液||||||||||||||||||||

My OBR-15 code snippet (I've just kept the relevant stuff in here, as otherwise this section would be massive): 我的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;
        }
    }
}

I'm using nHapi (v2.5.0.6) and visual studio 2015. If I've missed anything out or you require any further information, just let me know and I'll provide it. 我正在使用nHapi(v2.5.0.6)和visual studio 2015.如果我遗漏了任何内容或者您需要任何进一步的信息,请告诉我,我会提供。 Thanks! 谢谢!

I solved it by declaring OBR-15 the following way: 我通过以下方式声明OBR-15来解决它:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM