我有一个HL7消息导出.有一个字段在输入中有一个tild符号(〜).HL7将其转换为符号"\ R \"
我也尝试使用VBScript使用ASCII值(126)作为'〜'字符导出此值.但这也被HL7转换为"\ R \"
如何导出'〜'?任何帮助,将不胜感激.
此字符(〜)表示此字段可以有多个值。考虑给定HL7消息中的此PID.3字段
12345^^^XYZ~6789^^^PQR
这意味着,该患者有2个来自不同来源的患者ID,即。XYZ和PQR。这是(〜)字符在功能上的含义。
如果我遵循问题正文中的声明,我相信您想实现(〜)的功能。
为此,请尝试以下过程。我不了解vbscript,所以我不能给你代码,但是我有一些相同的Javascript代码,我想你可以在vbscript上模仿相同的代码。我把那个任务留给你。
//Calculates number of current repetitions by counting the length var pidfieldlen=msg.PID['PID.3'].length(); //Store the last field node var lastpidnode=msg['PID']['PID.3'][pidfieldlen-1]; //If length is 5,node index is 4 //Create new pid field and append with last pid node var newpidfield=<PID.3/> //Creating new separate element for PID.3 newpidfield['PID.3.1']="567832" //Adding Field Values newpidfield['PID.3.4']="NEW SOURCE" lastpidnode.appendChild(newpidfield) //Adding above created to the last node
这会将PID.3转换为
12345^^^XYZ~6789^^^PQR~567832^^^NEW SOURCE
传输消息时,HL7将重复字符"〜"转义为"\ R \".在使用该字段时,接收器应该更改回您的波形符号.
但还有第二种方法可以解决这个问题.HL7允许更改编码字符.不幸的是,并非所有HL7引擎都支持它.