Hello All,
I am trying to generate HL7 Msg with the help of XSLT. Values are getting filled in it by Objects from Code page.
I am able to generate the String but Pipe are not appearing in the entire msg.
Following is the XSLT and code I am using.
XSLT :
="1.0"="UTF-8"
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes" method="text"/>
<xsl:param name="SendingApplication">SendingApplication</xsl:param>
<xsl:param name="SendingFacility">SendingFacility</xsl:param>
<xsl:param name="ReceivingApplication">ReceivingApplication</xsl:param>
<xsl:param name="ReceivingFacility">ReceivingFacility</xsl:param>
<xsl:template match="/">
<hl7>
<MSH fieldDelimiter="|" componentDelimiter="^" repeatDelimiter="~" escapeDelimiter="\" subcomponentDelimiter="&">
<field>MSH</field>
<field><xsl:value-of select="$SendingApplication"/></field>
<field><xsl:value-of select="$SendingFacility"/></field>
<field><xsl:value-of select="$ReceivingApplication"/></field>
<field><xsl:value-of select="$ReceivingFacility"/></field>
<field/>
<field/>
<field>ORM<component>O01</component></field>
<field/>
<field>P</field>
<field>2.3</field>
<field/>
<field/>
<field/>
<field/>
<field/>
</MSH>
</hl7>
</xsl:template>
</xsl:stylesheet>
.cs :
private void button1_Click(object sender, EventArgs e)
private void button1_Click(object sender, EventArgs e)
{
XslCompiledTransform xslt = new XslCompiledTransform();
xslt.Load("mapping.xslt");
XsltArgumentList args = new XsltArgumentList();
args.AddParam("SendingApplication", "", "Value");
string hl7MsgString = string.Empty;
XmlDocument xmlDoc = new XmlDocument();
StringWriter writer = new System.IO.StringWriter();
xslt.Transform(xmlDoc, args, writer);
hl7MsgString = writer.ToString();
writer.Close();
}
And following is the resulting string :
"MSHRISSendingFacilityReceivingApplicationReceivingFacilityORMO01P2.3"
Please help in Getting Pipe in between the HL7 string.