none
SQL Adapter to HL7 MFN mapping problem RRS feed

  • Question

  • 2006R2.  I am attempting to map the data from a polling SQL result to a HL7 MFN^M15 message.  Here is the error I get when I test it in VS:

    Error 6 Output validation error: The element 'IIM_InventoryItemMaster' has invalid child element 'IIM_1_PrimaryKeyValueIim'. List of possible elements expected: 'IIM_2_ServiceItemCode'. C:\livedrop\out.xml 

    I cannot find any good examples of pushing data from  SQL response to ta HL7 Message.  Any help is greatly appreciated.

    Here is the SQL xsd:

      <?xml version="1.0" encoding="utf-16" ?>
    - <xs:schema xmlns:b="http://schemas.microsoft.com/BizTalk/2003" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://Fill_Inventory.NewFills" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
    - <xs:annotation>
    - <xs:appinfo>
      <msbtssql:sqlScript value="exec [UnprocessedCanisterFills]" xmlns:msbtssql="http://schemas.microsoft.com/BizTalk/2003" />
      </xs:appinfo>
      </xs:annotation>
    - <xs:element name="NewFills">
    - <xs:complexType>
    - <xs:sequence>
      <xs:element xmlns:q1="http://Fill_Inventory.NewFills" minOccurs="0" maxOccurs="unbounded" name="PackagedDrug" type="q1:PackagedDrugType" />
      </xs:sequence>
      </xs:complexType>
      </xs:element>
    - <xs:complexType name="PackagedDrugType">
    - <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element xmlns:q2="http://Fill_Inventory.NewFills" maxOccurs="unbounded" name="Canister" type="q2:CanisterType" />
      </xs:choice>
      <xs:attribute name="NDC" type="xs:string" use="required" />
      </xs:complexType>
    - <xs:complexType name="CanisterType">
      <xs:attribute name="FillDate" type="xs:string" />
      <xs:attribute name="Quantity" type="xs:int" />
      <xs:attribute name="LotNumber" type="xs:string" />
      <xs:attribute name="ExpirationDate" type="xs:string" />
      </xs:complexType>
      </xs:schema
    Here is the test data:
    - <NewFills xmlns="http://Fill_Inventory.NewFills">
    - <PackagedDrug NDC="003781817">
      <Canister FillDate="2011-02-10T00:00:00" Quantity="30" LotNumber="3020264" ExpirationDate="2012-08-10T00:00:00" />
      </PackagedDrug>
    - <PackagedDrug NDC="681800482">
      <Canister FillDate="2011-02-10T00:00:00" Quantity="90" LotNumber="3103190B" ExpirationDate="2012-07-10T00:00:00" />
      </PackagedDrug>
      </NewFills>
    I can send the XSLT if you need to see it.
    Monday, March 14, 2011 9:47 PM

Answers

  • Hey,

    This is a general Output Validation Error.

    Error 6 Output validation error: The element 'IIM_InventoryItemMaster' has invalid child element 'IIM_1_PrimaryKeyValueIim'. List of possible elements expected: 'IIM_2_ServiceItemCode'. C:\livedrop\out.xml 

    This means, As per your output schema definition,The node 'IIM_InventoryItemMaster' is having "IIM_2_ServiceItemCode" as a required node(minoccurs and maxoccurs as 1). But as per your xslt, you are not creating this node but directly creating the next node(probably or a futher one) which is 'IIM_1_PrimaryKeyValueIim'.

    You also have Validate Output property on your map set to true. So the XML generated by the XSLT is validated against the Output Schema and hence it fails.

    Resolution : 1. If you dont want to validate the xml generarted(Biztalk maps are not validated at runtime), then set ValidateOutput to 'false' in your map and test.

    2.If the validation of the xml generated is essential, then map the required node IIM_2_ServiceItemCode or make this node as optional(minoccurs = 0) in the output schema.

    Thanks.

    Please mark this as answered if it helps.


    Sriram N http://srirambiztalks.wordpress.com/
    Tuesday, March 15, 2011 3:25 AM

All replies

  • Here is the XSLT:

    <?xml version="1.0" encoding="UTF-16" ?>

    - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:var="http://schemas.microsoft.com/BizTalk/2003/var" exclude-result-prefixes="msxsl var s0 userCSharp" version="1.0" xmlns:s0="http://Fill_Inventory.NewFills" xmlns:ns3="http://microsoft.com/HealthCare/HL7/2X/2.5/DataTypes" xmlns:ns1="http://microsoft.com/HealthCare/HL7/2X" xmlns:ns2="http://microsoft.com/HealthCare/HL7/2X/2.5/Tables" xmlns:ns0="http://microsoft.com/HealthCare/HL7/2X/2.5/Segments" xmlns:userCSharp="http://schemas.microsoft.com/BizTalk/2003/userCSharp">
      <xsl:output omit-xml-declaration="yes" method="xml" version="1.0" />
    - <xsl:template match="/">
      <xsl:apply-templates select="/s0:NewFills" />
      </xsl:template>
    - <xsl:template match="/s0:NewFills">
      <xsl:variable name="var:v1" select="userCSharp:StringConcat("INV")" />
      <xsl:variable name="var:v2" select="userCSharp:StringConcat("Inventory Master File")" />
      <xsl:variable name="var:v3" select="userCSharp:StringConcat("UPD")" />
      <xsl:variable name="var:v4" select="userCSharp:StringConcat("AL")" />
      <xsl:variable name="var:v5" select="userCSharp:StringConcat("MUP")" />
      <xsl:variable name="var:v7" select="userCSharp:StringConcat("CE")" />
      <xsl:variable name="var:v11" select="userCSharp:StringConcat(" ")" />
      <xsl:variable name="var:v12" select="userCSharp:StringConcat("Drug Description-Need to add")" />
      <xsl:variable name="var:v13" select="userCSharp:StringConcat("MFG Name")" />
      <xsl:variable name="var:v14" select="userCSharp:StringConcat("OSS\F\TALYST")" />
    - <ns1:MFN_M15_25_GLO_DEF>
    - <MFI_MasterFileIdentification>
    - <MFI_1_MasterFileIdentifier>
    - <CE_0_Identifier>
      <xsl:value-of select="$var:v1" />
      </CE_0_Identifier>
    - <CE_1_Text>
      <xsl:value-of select="$var:v2" />
      </CE_1_Text>
      </MFI_1_MasterFileIdentifier>
    - <MFI_3_FileLevelEventCode>
      <xsl:value-of select="$var:v3" />
      </MFI_3_FileLevelEventCode>
    - <MFI_6_ResponseLevelCode>
      <xsl:value-of select="$var:v4" />
      </MFI_6_ResponseLevelCode>
      </MFI_MasterFileIdentification>
    - <MFE_MasterFileEntry>
    - <MFE_1_RecordLevelEventCode>
      <xsl:value-of select="$var:v5" />
      </MFE_1_RecordLevelEventCode>
    - <xsl:for-each select="s0:PackagedDrug">
      <xsl:variable name="var:v6" select="userCSharp:StringConcat(string(@NDC))" />
    - <MFE_4_PrimaryKeyValueMfe>
      <xsl:value-of select="$var:v6" />
      </MFE_4_PrimaryKeyValueMfe>
      </xsl:for-each>
    - <MFE_5_PrimaryKeyValueType>
      <xsl:value-of select="$var:v7" />
      </MFE_5_PrimaryKeyValueType>
      </MFE_MasterFileEntry>
    - <IIM_InventoryItemMaster>
    - <xsl:for-each select="s0:PackagedDrug">
      <xsl:variable name="var:v8" select="string(@NDC)" />
      <xsl:variable name="var:v9" select="userCSharp:StringConcat($var:v8)" />
      <xsl:variable name="var:v10" select="userCSharp:StringConcat("Drug Description-Need to add")" />
    - <IIM_1_PrimaryKeyValueIim>
    - <CWE_0_Identifier>
      <xsl:value-of select="$var:v9" />
      </CWE_0_Identifier>
    - <CWE_1_Text>
      <xsl:value-of select="$var:v10" />
      </CWE_1_Text>
      </IIM_1_PrimaryKeyValueIim>
      </xsl:for-each>
    - <IIM_2_ServiceItemCode>
    - <CWE_0_Identifier>
      <xsl:value-of select="$var:v11" />
      </CWE_0_Identifier>
    - <CWE_1_Text>
      <xsl:value-of select="$var:v12" />
      </CWE_1_Text>
      </IIM_2_ServiceItemCode>
    - <IIM_5_InventoryManufacturerName>
    - <CWE_1_Text>
      <xsl:value-of select="$var:v13" />
      </CWE_1_Text>
      </IIM_5_InventoryManufacturerName>
    - <IIM_6_InventoryLocation>
    - <CWE_0_Identifier>
      <xsl:value-of select="$var:v14" />
      </CWE_0_Identifier>
      </IIM_6_InventoryLocation>
      </IIM_InventoryItemMaster>
      </ns1:MFN_M15_25_GLO_DEF>
      </xsl:template>
    - <msxsl:script language="C#" implements-prefix="userCSharp">
    </msxsl:script>
      </xsl:stylesheet>
    Monday, March 14, 2011 9:47 PM
  • Hey,

    This is a general Output Validation Error.

    Error 6 Output validation error: The element 'IIM_InventoryItemMaster' has invalid child element 'IIM_1_PrimaryKeyValueIim'. List of possible elements expected: 'IIM_2_ServiceItemCode'. C:\livedrop\out.xml 

    This means, As per your output schema definition,The node 'IIM_InventoryItemMaster' is having "IIM_2_ServiceItemCode" as a required node(minoccurs and maxoccurs as 1). But as per your xslt, you are not creating this node but directly creating the next node(probably or a futher one) which is 'IIM_1_PrimaryKeyValueIim'.

    You also have Validate Output property on your map set to true. So the XML generated by the XSLT is validated against the Output Schema and hence it fails.

    Resolution : 1. If you dont want to validate the xml generarted(Biztalk maps are not validated at runtime), then set ValidateOutput to 'false' in your map and test.

    2.If the validation of the xml generated is essential, then map the required node IIM_2_ServiceItemCode or make this node as optional(minoccurs = 0) in the output schema.

    Thanks.

    Please mark this as answered if it helps.


    Sriram N http://srirambiztalks.wordpress.com/
    Tuesday, March 15, 2011 3:25 AM