In responding to thispost, I did a test and found out a something that I did not realize:
You need to follow the EXACT naming standard in element declaration. I modified the schema to look like this:
<xs:element minOccurs=”1” maxOccurs=”1” name=”MSH.10_MessageControlId“>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs=”1” maxOccurs=”1” name=”CM_MSG.0_MessageControlId” type=”ST” />
<xs:element minOccurs=”0” maxOccurs=”1” name=”CM_MSG.1_X” type=”ST” />
</xs:sequence>
</xs:complexType>
</xs:element>
I modified the sample message to look like this:
MSH|^~\&|IE|MCM|BTAHL7InterfaceEngine||199601121005||ADT^A03|000001^1|P|2.3.1
And the resulting xml looks like this:
<ns0:MSH_24_GLO_DEF xmlns:ns0=”http://microsoft.com/HealthCare/HL7/2X”>
<MSH>
<MSH.2_EncodingCharacters>^~\&</MSH.2_EncodingCharacters>
<MSH.3_SendingApplication><HD.0_NamespaceId>IE</HD.0_NamespaceId></MSH.3_SendingApplication>
<MSH.4_SendingFacility><HD.0_NamespaceId>MCM</HD.0_NamespaceId></MSH.4_SendingFacility>
<MSH.5_ReceivingApplication>
<HD.0_NamespaceId>BTAHL7InterfaceEngine</HD.0_NamespaceId>
</MSH.5_ReceivingApplication>
<MSH.6_ReceivingFacility>
<HD.0_NamespaceId></HD.0_NamespaceId>
</MSH.6_ReceivingFacility>
<MSH.7_DateTimeOfMessage>
<TS.1>199601121005</TS.1>
</MSH.7_DateTimeOfMessage>
<MSH.8_Security></MSH.8_Security>
<MSH.9_MessageType>
<CM_MSG.0_MessageType>ADT</CM_MSG.0_MessageType>
<CM_MSG.1_TriggerEvent>A03</CM_MSG.1_TriggerEvent>
</MSH.9_MessageType>
<MSH.10_MessageControlId>
<CM_MSG.0_MessageControlId>000001</CM_MSG.0_MessageControlId>
<CM_MSG.1_X>1</CM_MSG.1_X>
</MSH.10_MessageControlId>
<MSH.11_ProcessingId>
<PT.0_ProcessingId>P</PT.0_ProcessingId>
</MSH.11_ProcessingId>
<MSH.12_VersionId>
<VID.0_VersionId>2.3.1</VID.0_VersionId>
</MSH.12_VersionId>
</MSH>
</ns0:MSH_24_GLO_DEF>