1
 ORU_R01_OBSERVATION observation = orderObservation.GetOBSERVATION(0);
 OBX obx = observation.OBX;
 obx.ValueType.Value = "AD";
 obx.ObservationIdentifier.Identifier.Value = "Report";
 obx.ObservResultStatus.Value = "F";

在这里我想添加OBX-5 观察值。我怎样才能添加这个?

4

2 回答 2

1

我知道这是一个很晚的答案,但我希望它可以帮助将来的人。这就是我设置 OBX 段值的方式。

ORU_R01 oru = new ORU_R01();
ORU_R01_ORDER_OBSERVATION orderObservation = oru.GetRESPONSE().GetORDER_OBSERVATION();
OBX obx = orderObservation.GetOBSERVATION(0).OBX;
obx.ValueType.Value = "AD";
obx.ObservationIdentifier.Identifier.Value = "Report";
obx.ObservResultStatus.Value = "F";
CE ce = new CE(oru);
ce.Identifier.Value = obv.ObservationValue;
Varies value = obx.GetObservationValue(0);
value.Data = ce;

希望这可以帮助。

于 2015-03-13T12:11:18.980 回答
-1

这是@hardrada最初指向的代码:这是一个迟到的答案,因为我最近一直在尝试自己寻找类似的东西,而且我觉得没有足够的HL7示例

它是通过回程机器在这里找到的:

http://web.archive.org/web/20130318202508/http://www.ecomb.ch/nhapi-example-for-creating-a-hl7-message-with-msh-pid-pv1-obr-and- obx-段/

private string createHL7()
{
    ORU_R01 oruR01 = new ORU_R01();
    ORU_R01_ORDER_OBSERVATION orderObservation = oruR01.GetRESPONSE().GetORDER_OBSERVATION();

    ORU_R01_PATIENT patient = oruR01.GetRESPONSE().PATIENT;
    ORU_R01_VISIT visit = patient.VISIT;
    PV1 pv1 = visit.PV1;

    OBR obr = orderObservation.OBR;

    ORU_R01_OBSERVATION observation = orderObservation.GetOBSERVATION(0);
    OBX obx = observation.OBX;

    oruR01.MSH.FieldSeparator.Value = "|";
    oruR01.MSH.EncodingCharacters.Value = @"^~\&";
    oruR01.MSH.SendingApplication.NamespaceID.Value = "SP";
    oruR01.MSH.SendingFacility.NamespaceID.Value = "SPZH";
    oruR01.MSH.ReceivingApplication.NamespaceID.Value = "MF";
    oruR01.MSH.ReceivingFacility.NamespaceID.Value = "INTRA";
    oruR01.MSH.DateTimeOfMessage.TimeOfAnEvent.SetLongDate(DateTime.Now);
    oruR01.MSH.ProcessingID.ProcessingID.Value = "P";
    oruR01.MSH.VersionID.Value = "2.3";

    PID pid = oruR01.GetRESPONSE().PATIENT.PID;
    pid.SetIDPatientID.Value = "12345";
    pid.PatientName.FamilyName.Value = "Joe";
    pid.PatientName.GivenName.Value = "Bloggs";
    pid.DateOfBirth.TimeOfAnEvent.SetLongDate(DateTime.MinValue);
    pid.Sex.Value = "M";

    pv1.SetIDPatientVisit.Value = "1";
    pv1.VisitNumber.ID.Value = "3333333";

    obr.FillerOrderNumber.UniversalID.Value = "123456";
    obr.UniversalServiceIdentifier.Text.Value = "Document";
    obr.ObservationEndDateTime.TimeOfAnEvent.SetLongDate(DateTime.Now);
    obr.ResultStatus.Value = "F";

    obx.SetIDOBX.Value = "0";
    obx.ValueType.Value = "RP";
    obx.ObservationIdentifier.Identifier.Value = "Report";

    PipeParser parser = new PipeParser();
    string encodedMessage = parser.Encode(oruR01);

    return encodedMessage;
}
于 2017-03-24T12:45:47.207 回答