[英]How to add OBX-5 Observation Value using NHapi dll in c#?
ORU_R01_OBSERVATION observation = orderObservation.GetOBSERVATION(0);
OBX obx = observation.OBX;
obx.ValueType.Value = "AD";
obx.ObservationIdentifier.Identifier.Value = "Report";
obx.ObservResultStatus.Value = "F";
Here i want to add the OBX-5 Observation Value . 在这里,我想添加OBX-5观测值 。 How can i add this ?
我该如何添加呢?
I know this is a very late answer but I hope it can help someone in future. 我知道这是一个很晚的答案,但我希望它将来能对某人有所帮助。 This is how I set my OBX segment value.
这就是我设置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;
Hope this helps. 希望这可以帮助。
This is the code that originally pointed to by @hardrada : this is a late answer because i've been trying to find something like this myself recently, and I feel there aren't enough HL7 examples about 这是@hardrada最初指向的代码 :这是一个很晚的答案,因为我最近一直在努力寻找类似的东西,而且我觉得关于HL7的例子还不够多。
it was found via the wayback machine here : 它是通过Wayback机器在这里找到的:
http://web.archive.org/web/20130318202508/http://www.ecomb.ch/nhapi-example-for-creating-a-hl7-message-with-msh-pid-pv1-obr-and-obx-segment/ 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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.