Create message from xml

Discussion of open issues, suggestions and bugs regarding to (known as Delphi HL7) HL7 Components
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Create message from xml

Post by miguito »

I'm testing the components for their use in an application where you send and receive XML-formatted text instead of HL7.
If you receive a text can convert HL7 to XML with "AsString".
But I cant find a way to assign the XML text and convert it to HL7.

Is there any way?

Thanks in advance
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Create message from xml

Post by admin »

Hi;

You can get/set XML document AsXML property.

Code: Select all

procedure TForm1.bGenerateXMLMsg(Sender: TObject);
var
    msg : TdiORU_R01_24;
    msh : TdiMSH_24;
    pid: TdiPID_24;
    obr: TdiOBR_24;
    obx: TdiOBX_24;
    sn : TdiSN_24;
begin
    msg:=TdiORU_R01_24.Create;

    //MSH
    msh:= msg.MSH;
    msh.SendingApplication.NamespaceID.AsString:='GHH LAB';
    msh.SendingFacility.NamespaceID.AsString:='ELAB-3';
    msh.ReceivingApplication.NamespaceID.AsString:='GHH OE';
    msh.ReceivingFacility.NamespaceID.AsString:='BLDG4';
    msh.DateTimeOfMessage.TimeOfAnEvent.AsString:='200202150930';
    msh.MessageControlID.AsString:='CNTRL-3456';
    
    //PID
    pid:=msg.PATIENTRESULT[0].PATIENT.PID;
    pid.PatientIdentifierList[0].ID.AsString:='555-44-4444';
    pid.PatientName[0].Familyname.Surname.AsString:='EVERYWOMAN';
    pid.PatientName[0].Givenname.AsString:='EVE';
    pid.PatientName[0].Secondandfurthergivennamesorinitialsthereof.AsString:='E';
    pid.PatientName[0].Nametypecode.AsString:='L';
    pid.MothersMaidenName[0].Familyname.Surname.AsString:='JONES';
    pid.DateTimeOfBirth.TimeOfAnEvent.AsString:='196203520';
    pid.AdministrativeSex.AsString:='F';
    pid.PatientAddress[0].Streetaddress.Streetormailingaddress.AsString:='153 FERNWOOD DR.';
    pid.PatientAddress[0].City.AsString:='STATESVILLE';
    pid.PatientAddress[0].Stateorprovince.AsString:='OH';
    pid.PatientAddress[0].Ziporpostalcode.AsString:='35292';
    pid.PhoneNumberHome[0].Telephonenumber.AsString:='(206)3345232';
    pid.PhoneNumberBusiness[0].Telephonenumber.AsString:='(206)752-121';
    pid.PatientAccountNumber.ID.AsString:='AC555444444';
    pid.DriversLicenseNumberPatient.Driverslicensenumber.AsString:='67-A4335';
    pid.DriversLicenseNumberPatient.Issuingstate_province_country.AsString:='OH';
    pid.DriversLicenseNumberPatient.Expirationdate.AsString:='20030520';

    // OBR
    obr:=msg.PATIENTRESULT[0].ORDEROBSERVATION[0].OBR;
    obr.SetIDOBR.AsString:='1';
    obr.PlacerOrderNumber.Entityidentifier.AsString:='845439';
    obr.PlacerOrderNumber.NamespaceID.AsString:='GHH OE';
    obr.FillerOrderNumber.Entityidentifier.AsString:='1045813';
    obr.FillerOrderNumber.NamespaceID.AsString:='GHH LAB';
    obr.UniversalServiceIdentifier.Identifier.AsString:='1554-5';
    obr.UniversalServiceIdentifier.Text.AsString:='GLUCOSE';
    obr.UniversalServiceIdentifier.Nameofcodingsystem.AsString:='LN';
    obr.ObservationDateTime.TimeOfAnEvent.AsString:='200202150730';
    obr.OrderingProvider[0].IDnumber.AsString:='555-55-5555';
    obr.OrderingProvider[0].Familyname.Surname.AsString:='PRIMARY';
    obr.OrderingProvider[0].Givenname.AsString:='PATRICIA P';
    obr.OrderingProvider[0].Degree.AsString:='MD';
    obr.OrderingProvider[0].Assigningauthority.NamespaceID.AsString:='LEVEL SEVEN HEALTHCARE, INC.';
    obr.ResultStatus.AsString:='F';
    obr.PrincipalResultInterpreter.OPName.IDNumber.AsString:='444-44-4444';
    obr.PrincipalResultInterpreter.OPName.FamilyName.AsString:='HIPPOCRATES';
    obr.PrincipalResultInterpreter.OPName.GivenName.AsString:='HOWARD H';
    obr.PrincipalResultInterpreter.OPName.Degree.AsString:='MD';

    // OBX
    obx:=msg.PATIENTRESULT[0].ORDEROBSERVATION[0].OBSERVATION[0].OBX;
    obx.SetIDOBX.AsString:='1';
    obx.ValueType.AsString:='SN';
    obx.ObservationIdentifier.Identifier.AsString:='1554-5';
    obx.ObservationIdentifier.Text.AsString:='GLUCOSE POST 12H CFST';
    obx.ObservationIdentifier.Nameofcodingsystem.AsString:='LN';

    sn:=TdiSN_24.Create;
    sn.Num1.AsString:='182';
    obx.ObservationValue[0]:= sn;
    obx.Units.Identifier.AsString:= 'mg/dl';
    obx.ReferencesRange.AsString:='70-105';
    obx.AbnormalFlags.AsString:='H';
    obx.ObservationResultStatus.AsString:='F';
    
    // XML format
    Memo1.Lines.Text:=msg.AsXML;

    FreeAndNil(msg);

end;

-------------
XML Output
-------------
 
<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>200202150930</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.4</VID.1>
		</MSH.12>
	</MSH>
	<ORU_R01.PATIENTRESULT>
		<ORU_R01.PATIENT>
			<PID>
				<PID.3>
					<CX.1>555-44-4444</CX.1>
				</PID.3>
				<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.7>
					<TS.1>196203520</TS.1>
				</PID.7>
				<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.18>
					<CX.1>AC555444444</CX.1>
				</PID.18>
				<PID.20>
					<DLN.1>67-A4335</DLN.1>
					<DLN.2>OH</DLN.2>
					<DLN.3>20030520</DLN.3>
				</PID.20>
			</PID>
		</ORU_R01.PATIENT>
		<ORU_R01.ORDEROBSERVATION>
			<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.7>
					<TS.1>200202150730</TS.1>
				</OBR.7>
				<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.32>
					<NDL.1>
						<CNN.1>444-44-4444</CNN.1>
						<CNN.2>HIPPOCRATES</CNN.2>
						<CNN.3>HOWARD H</CNN.3>
						<CNN.7>MD</CNN.7>
					</NDL.1>
				</OBR.32>
			</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.8>H</OBX.8>
					<OBX.11>F</OBX.11>
				</OBX>
			</ORU_R01.OBSERVATION>
		</ORU_R01.ORDEROBSERVATION>
	</ORU_R01.PATIENTRESULT>
</ORU_R01>
Best regards.
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Re: Create message from xml

Post by miguito »

I have a function "validate" that has a parameter with XML text.
I want to convert that text into a "TdiORM_O01_25".
But if I write "compORM_O01_25.AsXML: = parameter" I find
asXML the property is read-only.

Code: Select all

function Validate(text_XML: string): TdiACK_25;
begin
...
end;

VALOR DE "text_XML"
-------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1" ?>
<p:ORM_O01 xmlns:p="urn:hl7-org:v2xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema_instance">
	<p:MSH>
		<p:MSH.1>|</p:MSH.1>
		<p:MSH.2>^~\&</p:MSH.2>
		<p:MSH.3><p:HD.1>XXX</p:HD.1></p:MSH.3>
		<p:MSH.4></p:MSH.4>
		<p:MSH.5><p:HD.1>YYY</p:HD.1></p:MSH.5>
		<p:MSH.6></p:MSH.6>
		<p:MSH.7><p:TS.1>20120402143932</p:TS.1></p:MSH.7>
		<p:MSH.8></p:MSH.8>
		<p:MSH.9>
			<p:MSG.1>ORM</p:MSG.1>
			<p:MSG.2>O01</p:MSG.2>
		</p:MSH.9>
         ......................
			</p:ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
		</p:ORM_O01.ORDER_DETAIL>
	</p:ORM_O01.ORDER>
</p:ORM_O01>
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Create message from xml

Post by admin »

Thank you for the information.
We have a bug.
Please wait for the update.
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Re: Create message from xml

Post by miguito »

I would like to know if I can solve this problem in a couple of days
because I need to get it ready for next week.
And if I have no choice, this project will try to do the XML parsing.

I hope to hear from you soon,
a greeting
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Create message from xml

Post by admin »

Hi,
Please, download trial again.
You can parse xml now. But our xml parser can not handle xml namespaces prefix.
Please remove "p:" prefix.
<p:ORM_O01 xmlns:p="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema_instance">

Sample xml:

Code: Select all

<ORM_O01 xmlns:p="urn:hl7-org:v2xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema_instance">
   <MSH>
      <MSH.1>|</MSH.1>
      <MSH.2>^~\&</MSH.2>
      <MSH.3><HD.1>XXX</HD.1></MSH.3>
      <MSH.4></MSH.4>
      <MSH.5><HD.1>YYY</HD.1></MSH.5>
      <MSH.6></MSH.6>
      <MSH.7><TS.1>20120402143932</TS.1></MSH.7>
      <MSH.8></MSH.8>
      <MSH.9>
         <MSG.1>ORM</MSG.1>
         <MSG.2>O01</MSG.2>
      </MSH.9>
         ......................
         </ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
      </ORM_O01.ORDER_DETAIL>
   </ORM_O01.ORDER>
</ORM_O01>
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Re: Create message from xml

Post by miguito »

I have cleaned the computer components that were installed, and installed new ones. but
more I try not to put a text in XML format to the component
TdiORM_O01_25.
Unless I'm doing wrong. Any suggestions?

regards
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Create message from xml

Post by admin »

Can you send xml file to: support@dephihl7.com
miguito
Posts: 12
Joined: Thu Apr 05, 2012 4:44 pm

Re: Create message from xml

Post by miguito »

I continued to test and I think the problem is on the labels of the structure. To send me a file with the following structure:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" ?>
<ORM_O01 xmlns:p="urn:hl7-org:v2xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema_instance">
	<MSH>
		<MSH.1>|</MSH.1>
		<MSH.2>^~\&</MSH.2>
		<MSH.3><HD.1>CMQMS</HD.1></MSH.3>
		<MSH.4></MSH.4>
		<MSH.5><HD.1>CRQMS</HD.1></MSH.5>
		<MSH.6></MSH.6>
		<MSH.7><TS.1>20120402143932</TS.1></MSH.7>
		<MSH.8></MSH.8>
		<MSH.9>
			<MSG.1>ORM</MSG.1>
			<MSG.2>O01</MSG.2>
		</MSH.9>
		<MSH.10>1368</MSH.10>
		<MSH.11>
			<PT.1>P</PT.1>
		</MSH.11>
		<MSH.12>
			<VID.1>2.5</VID.1>
		</MSH.12>
		<MSH.13></MSH.13>
		<MSH.14></MSH.14>
		<MSH.15>AL</MSH.15>
		<MSH.16></MSH.16>
		<MSH.17></MSH.17>
		<MSH.18></MSH.18>
		<MSH.19></MSH.19>
	</MSH>
	<ORM_O01.PATIENT>
		<PID>
			<PID.1></PID.1>
			<PID.2></PID.2>
			<PID.3>
				<CX.1>119182</CX.1>
				<CX.5>PI</CX.5>
			</PID.3>
			<PID.3>
				<CX.1></CX.1>
				<CX.5>JHN</CX.5>
			</PID.3>
			<PID.3>
				<CX.1>55223311N</CX.1>
				<CX.5>NNESP</CX.5>
			</PID.3>
			<PID.4></PID.4>
			<PID.5>
				<XPN.1>
					<FN.1>ESTEBAN</FN.1>
				</XPN.1>
				<XPN.2>GRACIELA</XPN.2>
				<XPN.3>RIESCO</XPN.3>
			</PID.5>
			<PID.6></PID.6>
			<PID.7>
				<TS.1>19550101</TS.1>
			</PID.7>
			<PID.8>F</PID.8>
			<PID.9></PID.9>
			<PID.10></PID.10>
			<PID.11>
				<XAD.1>
					<SAD.1></SAD.1>
				</XAD.1>
				<XAD.2></XAD.2>
				<XAD.3>LUGO</XAD.3>
				<XAD.4>LUGO</XAD.4>
				<XAD.5>27001</XAD.5>
			</PID.11>
			<PID.12></PID.12>
			<PID.13>
				<XTN.1>1</XTN.1>
			</PID.13>
			<PID.14>
				<XTN.1></XTN.1>
			</PID.14>
			<PID.15></PID.15>
			<PID.16></PID.16>
			<PID.17></PID.17>
			<PID.18></PID.18>
			<PID.19></PID.19>
			<PID.20></PID.20>
			<PID.21></PID.21>
			<PID.22></PID.22>
			<PID.23></PID.23>
			<PID.24></PID.24>
			<PID.25></PID.25>
			<PID.26></PID.26>
			<PID.27></PID.27>
			<PID.28></PID.28>
			<PID.29></PID.29>
			<PID.30></PID.30>
		</PID>
<		<ORM_O01.PATIENT_VISIT>
			<PV1>
				<PV1.1>695</PV1.1>
				<PV1.2>O</PV1.2>
				<PV1.3></PV1.3>
				<PV1.4></PV1.4>
				<PV1.5></PV1.5>
				<PV1.6></PV1.6>
				<PV1.7></PV1.7>
				<PV1.8></PV1.8>
				<PV1.9></PV1.9>
				<PV1.10></PV1.10>
				<PV1.11></PV1.11>
				<PV1.12></PV1.12>
				<PV1.13></PV1.13>
				<PV1.14></PV1.14>
				<PV1.15></PV1.15>
				<PV1.16></PV1.16>
				<PV1.17></PV1.17>
				<PV1.18></PV1.18>
				<PV1.19></PV1.19>
				<PV1.20></PV1.20>
				<PV1.21></PV1.21>
				<PV1.22></PV1.22>
				<PV1.23></PV1.23>
				<PV1.24></PV1.24>
				<PV1.25></PV1.25>
				<PV1.26></PV1.26>
				<PV1.27></PV1.27>
				<PV1.28></PV1.28>
				<PV1.29></PV1.29>
				<PV1.30></PV1.30>
				<PV1.31></PV1.31>
				<PV1.32></PV1.32>
				<PV1.33></PV1.33>
				<PV1.34></PV1.34>
				<PV1.35></PV1.35>
				<PV1.36></PV1.36>
				<PV1.37></PV1.37>
				<PV1.38></PV1.38>
				<PV1.39></PV1.39>
				<PV1.40></PV1.40>
				<PV1.41></PV1.41>
				<PV1.42></PV1.42>
				<PV1.43></PV1.43>
				<PV1.44></PV1.44>
				<PV1.45></PV1.45>
				<PV1.46></PV1.46>
				<PV1.47></PV1.47>
				<PV1.48></PV1.48>
				<PV1.49></PV1.49>
				<PV1.50></PV1.50>
				<PV1.51></PV1.51>
				<PV1.52></PV1.52>
			</PV1>
		</ORM_O01.PATIENT_VISIT>
		<ORM_O01.INSURANCE>
			<IN1>
				<IN1.1>0</IN1.1>
				<IN1.2>
					<CE.1>0</CE.1>
				</IN1.2>
				<IN1.3>
					<CX.1>11701</CX.1>
				</IN1.3>
				<IN1.4></IN1.4>
				<IN1.5></IN1.5>
				<IN1.6></IN1.6>
				<IN1.7></IN1.7>
				<IN1.8></IN1.8>
				<IN1.9></IN1.9>
				<IN1.10></IN1.10>
				<IN1.11></IN1.11>
				<IN1.12></IN1.12>
				<IN1.13></IN1.13>
				<IN1.14></IN1.14>
				<IN1.15></IN1.15>
				<IN1.16></IN1.16>
				<IN1.17></IN1.17>
				<IN1.18></IN1.18>
				<IN1.19></IN1.19>
				<IN1.20></IN1.20>
				<IN1.21></IN1.21>
				<IN1.22></IN1.22>
				<IN1.23></IN1.23>
				<IN1.24></IN1.24>
				<IN1.25></IN1.25>
				<IN1.26></IN1.26>
				<IN1.27></IN1.27>
				<IN1.28></IN1.28>
				<IN1.29></IN1.29>
				<IN1.30></IN1.30>
				<IN1.31></IN1.31>
				<IN1.32></IN1.32>
				<IN1.33></IN1.33>
				<IN1.34></IN1.34>
				<IN1.35></IN1.35>
				<IN1.36></IN1.36>
				<IN1.37></IN1.37>
				<IN1.38></IN1.38>
				<IN1.39></IN1.39>
				<IN1.40></IN1.40>
				<IN1.41></IN1.41>
				<IN1.42></IN1.42>
				<IN1.43></IN1.43>
				<IN1.44></IN1.44>
				<IN1.45></IN1.45>
				<IN1.46></IN1.46>
				<IN1.47></IN1.47>
				<IN1.48></IN1.48>
				<IN1.49></IN1.49>
			</IN1>
		</ORM_O01.INSURANCE>
	</ORM_O01.PATIENT>
	<ORM_O01.ORDER>
		<ORC>
			<ORC.1>NW</ORC.1>
			<ORC.2>
				<EI.1>695</EI.1>
			</ORC.2>
			<ORC.3></ORC.3>
			<ORC.4></ORC.4>
			<ORC.5></ORC.5>
			<ORC.6></ORC.6>
			<ORC.7></ORC.7>
			<ORC.8></ORC.8>
			<ORC.9></ORC.9>
			<ORC.10></ORC.10>
			<ORC.11></ORC.11>
			<ORC.12>
				<XCN.1></XCN.1>
				<XCN.2>
					<FN.1>CMQMS</FN.1>
				</XCN.2>
				<XCN.3></XCN.3>
				<XCN.4></XCN.4>
			</ORC.12>
			<ORC.13></ORC.13>
			<ORC.14></ORC.14>
			<ORC.15></ORC.15>
			<ORC.16></ORC.16>
			<ORC.17></ORC.17>
			<ORC.18></ORC.18>
			<ORC.19></ORC.19>
		</ORC>
		<ORM_O01.ORDER_DETAIL>
			<ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
				<OBR>
					<OBR.1></OBR.1>
					<OBR.2>
						<EI.1>695</EI.1>
					</OBR.2>
					<OBR.3></OBR.3>
					<OBR.4>
						<CE.1>211</CE.1>
						<CE.2>HIPOFISIS</CE.2>
						<CE.3>L</CE.3>
					</OBR.4>
					<OBR.5>P</OBR.5>
					<OBR.6>
						<TS.1>20120402</TS.1>
					</OBR.6>
					<OBR.7>
						<TS.1>200907161000</TS.1>
					</OBR.7>
					<OBR.8></OBR.8>
					<OBR.9></OBR.9>
					<OBR.10>
						<XCN.1>2</XCN.1>
					</OBR.10>
					<OBR.11></OBR.11>
					<OBR.12></OBR.12>
					<OBR.13></OBR.13>
					<OBR.14></OBR.14>
					<OBR.15></OBR.15>
					<OBR.16></OBR.16>
					<OBR.17></OBR.17>
					<OBR.18></OBR.18>
					<OBR.19>E</OBR.19>
					<OBR.20></OBR.20>
					<OBR.21></OBR.21>
					<OBR.22></OBR.22>
					<OBR.23></OBR.23>
					<OBR.24></OBR.24>
					<OBR.25></OBR.25>
					<OBR.26></OBR.26>
					<OBR.27></OBR.27>
					<OBR.28></OBR.28>
					<OBR.29></OBR.29>
					<OBR.30></OBR.30>
					<OBR.31></OBR.31>
					<OBR.32></OBR.32>
					<OBR.33></OBR.33>
					<OBR.34></OBR.34>
					<OBR.35></OBR.35>
					<OBR.36></OBR.36>
					<OBR.37></OBR.37>
					<OBR.38></OBR.38>
					<OBR.39></OBR.39>
					<OBR.40></OBR.40>
					<OBR.41></OBR.41>
					<OBR.42></OBR.42>
					<OBR.43></OBR.43>
				</OBR>
			</ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP>
		</ORM_O01.ORDER_DETAIL>
	</ORM_O01.ORDER>
</ORM_O01>
What will you base file to validate the structure? I thought it was the ORM_O01.xsd

Code: Select all

<?xml version ="1.0" encoding="UTF-8"?>
<!--
    v2.xml Message Definitions Version v2.5  - ORM_O01
    HL7® Version 2.5, © Health Level Seven, Inc.  All rights reserved.  HL7 and Health Level Seven are registered trademarks of Health Level Seven, Inc.
-->
<xsd:schema
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="urn:hl7-org:v2xml"
    xmlns:hl7="urn:com.sun:encoder-hl7-1.0"
    targetNamespace="urn:hl7-org:v2xml" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0">

    <!-- include segment definitions for version v2.5 -->
    <xsd:include schemaLocation="segments.xsd"/>

    <xsd:annotation>
	<xsd:appinfo source="urn:com.sun:encoder">
	    <encoding xmlns="urn:com.sun:encoder" name="HL7 v2 Encoding" namespace="urn:com.sun:encoder-hl7-1.0" style="hl7encoder-1.0"/>
	</xsd:appinfo>
    </xsd:annotation>

    <!--
	MESSAGE ORM_O01
    -->
    <!-- .. groups used in message ORM_O01 -->
    <xsd:complexType name="ORM_O01.PATIENT_VISIT.CONTENT">
        <xsd:sequence>
            <xsd:element ref="PV1" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="PV2" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.PATIENT_VISIT" type="ORM_O01.PATIENT_VISIT.CONTENT"/>
    <xsd:complexType name="ORM_O01.INSURANCE.CONTENT">
        <xsd:sequence>
            <xsd:element ref="IN1" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="IN2" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="IN3" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.INSURANCE" type="ORM_O01.INSURANCE.CONTENT"/>
    <xsd:complexType name="ORM_O01.PATIENT.CONTENT">
        <xsd:sequence>
            <xsd:element ref="PID" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="PD1" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="NTE" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ORM_O01.PATIENT_VISIT" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="ORM_O01.INSURANCE" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="GT1" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="AL1" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.PATIENT" type="ORM_O01.PATIENT.CONTENT"/>
    <xsd:complexType name="ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP.CONTENT">
        <xsd:choice>
            <xsd:element ref="OBR" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="RQD" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="RQ1" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="RXO" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="ODS" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="ODT" minOccurs="1" maxOccurs="1"/>
        </xsd:choice>
    </xsd:complexType>
    <xsd:element name="ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP" type="ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP.CONTENT"/>
    <xsd:complexType name="ORM_O01.OBSERVATION.CONTENT">
        <xsd:sequence>
            <xsd:element ref="OBX" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="NTE" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.OBSERVATION" type="ORM_O01.OBSERVATION.CONTENT"/>
    <xsd:complexType name="ORM_O01.ORDER_DETAIL.CONTENT">
        <xsd:sequence>
            <xsd:element ref="ORM_O01.OBRRQDRQ1RXOODSODT_SUPPGRP" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="NTE" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="CTD" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="DG1" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ORM_O01.OBSERVATION" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.ORDER_DETAIL" type="ORM_O01.ORDER_DETAIL.CONTENT"/>
    <xsd:complexType name="ORM_O01.ORDER.CONTENT">
        <xsd:sequence>
            <xsd:element ref="ORC" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="ORM_O01.ORDER_DETAIL" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="FT1" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="CTI" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="BLG" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01.ORDER" type="ORM_O01.ORDER.CONTENT"/>
    <!-- .. message definition ORM_O01 -->
    <xsd:complexType name="ORM_O01.CONTENT">
        <xsd:sequence>
            <xsd:element ref="MSH" minOccurs="1" maxOccurs="1"/>
            <xsd:element ref="NTE" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element ref="ORM_O01.PATIENT" minOccurs="0" maxOccurs="1"/>
            <xsd:element ref="ORM_O01.ORDER" minOccurs="1" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="ORM_O01" type="ORM_O01.CONTENT">
        <xsd:annotation>
            <xsd:appinfo source="urn:com.sun:encoder">
                <top xmlns="urn:com.sun:encoder">true</top>
            </xsd:appinfo>
        </xsd:annotation>
    </xsd:element>
</xsd:schema>
I returned the e-mail support@dephihl7.com, so I put the code files.

thanks
admin
Site Admin
Posts: 256
Joined: Sun Jun 05, 2011 8:06 pm

Re: Create message from xml

Post by admin »

Hi,
OBRRQDRQ1RXOODSODT_SUPPGRP is added.
Please download trial again.

Best regards.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests