I have this function and it does not work
always return "Invalid message , must be start with MSH"
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
msg : TdiORU_R01_25;
begin
msg:=TdiORU_R01_25.Create;
msg.LoadFromFile('oru_r01_24.xml');
Memo1.Lines.Text:=msg.AsString;
msg.Free;
end;
Code: Select all
msg.LoadFromFile('oru_r01_24.xml',ftXML);
enviroment : DelphiXE7 and Standar Edition DelphiHL7v27Std1.6.13
the "oru_r01_24.xml" file conten :
Code: Select all
<ORU_R01 xmlns="urn:hl7-org:v2xml">
<MSH>
<MSH.1>|</MSH.1>
<MSH.2>^~\&</MSH.2>
<MSH.3>
<HD.1>GHH LAB</HD.1>
</MSH.3>
<MSH.4>
<HD.1>ELAB-3</HD.1>
</MSH.4>
<MSH.5>
<HD.1>GHH OE</HD.1>
</MSH.5>
<MSH.6>
<HD.1>BLDG4</HD.1>
</MSH.6>
<MSH.7>
<TS.1>20171101220908</TS.1>
</MSH.7>
<MSH.9>
<MSG.1>ORU</MSG.1>
<MSG.2>R01</MSG.2>
</MSH.9>
<MSH.10>CNTRL-3456</MSH.10>
<MSH.11>
<PT.1>P</PT.1>
</MSH.11>
<MSH.12>
<VID.1>2.5</VID.1>
</MSH.12>
</MSH>
<ORU_R01.PATIENT_RESULT>
<ORU_R01.PATIENT>
<PID>
<PID.5>
<XPN.1>
<FN.1>EVERYWOMAN</FN.1>
</XPN.1>
<XPN.2>EVE</XPN.2>
<XPN.3>E</XPN.3>
<XPN.7>L</XPN.7>
</PID.5>
<PID.6>
<XPN.1>
<FN.1>JONES</FN.1>
</XPN.1>
</PID.6>
<PID.8>F</PID.8>
<PID.11>
<XAD.1>
<SAD.1>153 FERNWOOD DR.</SAD.1>
</XAD.1>
<XAD.3>STATESVILLE</XAD.3>
<XAD.4>OH</XAD.4>
<XAD.5>35292</XAD.5>
</PID.11>
<PID.13>
<XTN.1>(206)3345232</XTN.1>
</PID.13>
<PID.14>
<XTN.1>(206)752-121</XTN.1>
</PID.14>
<PID.20>
<DLN.2>OH</DLN.2>
<DLN.3>20030520</DLN.3>
</PID.20>
</PID>
</ORU_R01.PATIENT>
<ORU_R01.ORDER_OBSERVATION>
<OBR>
<OBR.1>1</OBR.1>
<OBR.2>
<EI.1>845439</EI.1>
<EI.2>GHH OE</EI.2>
</OBR.2>
<OBR.3>
<EI.1>1045813</EI.1>
<EI.2>GHH LAB</EI.2>
</OBR.3>
<OBR.4>
<CE.1>1554-5</CE.1>
<CE.2>GLUCOSE</CE.2>
<CE.3>LN</CE.3>
</OBR.4>
<OBR.16>
<XCN.1>555-55-5555</XCN.1>
<XCN.2>
<FN.1>PRIMARY</FN.1>
</XCN.2>
<XCN.3>PATRICIA P</XCN.3>
<XCN.7>MD</XCN.7>
<XCN.9>
<HD.1>LEVEL SEVEN HEALTHCARE, INC.</HD.1>
</XCN.9>
</OBR.16>
<OBR.25>F</OBR.25>
</OBR>
<ORU_R01.OBSERVATION>
<OBX>
<OBX.1>1</OBX.1>
<OBX.2>SN</OBX.2>
<OBX.3>
<CE.1>1554-5</CE.1>
<CE.2>GLUCOSE POST 12H CFST</CE.2>
<CE.3>LN</CE.3>
</OBX.3>
<OBX.5>
<SN.2>182</SN.2>
</OBX.5>
<OBX.6>
<CE.1>mg/dl</CE.1>
</OBX.6>
<OBX.7>70-105</OBX.7>
<OBX.11>F</OBX.11>
</OBX>
</ORU_R01.OBSERVATION>
</ORU_R01.ORDER_OBSERVATION>
</ORU_R01.PATIENT_RESULT>
</ORU_R01>