通过XSLT生成HL7消息时,管道(字段分隔符)不存在 [英] Pipe(Field Seperator) not coming when generating HL7 Msg by XSLT

查看:73
本文介绍了通过XSLT生成HL7消息时,管道(字段分隔符)不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在尝试借助XSLT生成HL7消息.值被代码"页面中的对象"填充.

我能够生成字符串,但管道未出现在整个消息中.

以下是我正在使用的XSLT和代码.

XSLT:


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 :


<?xml version="1.0" encoding="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="&amp;">
<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/> <!-- Date/time of Message -->
<field/> <!-- Security -->
<field>ORM<component>O01</component></field>
<field/> <!-- Message Control ID -->
<field>P</field>
<field>2.3</field>
<field/> <!-- Sequence Number -->
<field/> <!-- Continuation Pointer -->
<field/> <!-- Accept Acknowledgment Type -->
<field/> <!-- Application Acknowledgment Type -->
<field/> <!-- Country Code -->
</MSH>
</hl7>
</xsl:template>
</xsl:stylesheet>




.cs:




.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();

}





然后是结果字符串:

"MSHRISSendingFacilityReceivingApplicationReceivingFacilityORMO01P2.3"

请帮助在HL7字符串之间插入管道.





And following is the resulting string :

"MSHRISSendingFacilityReceivingApplicationReceivingFacilityORMO01P2.3"

Please help in Getting Pipe in between the HL7 string.

推荐答案

SendingApplication" > < /field > < 字段 > < xsl:value-of 选择 ="
SendingApplication"/></field> <field><xsl:value-of select="


SendingFacility" / > < /field > < 字段 > < xsl:value-of 选择 ="
SendingFacility"/></field> <field><xsl:value-of select="


ReceivingApplication" / > < /field > < 字段 > < xsl:value-of 选择 ="
ReceivingApplication"/></field> <field><xsl:value-of select="


这篇关于通过XSLT生成HL7消息时,管道(字段分隔符)不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆