[英]carat and New line issues using NHAPI tool in .NET
I'm using NHapi v22
tool for sending HL7 messages. 我正在使用NHapi v22
工具发送HL7消息。 Issue is I'm not able to create component separator(^) and new line. 问题是我无法创建组件分隔符(^)和换行符。 Please tell me how to code for it in C#. 请告诉我如何用C#编写代码。
Following is the code: 以下是代码:
MSH|^~\&|xyz|xyz|FLOW|FLOW|201601201525||ADT\S\A04|201601201525123456789|P|2.3|||NE|NE
I need to get like this- ADT^A04
我需要像这样-ADT ADT^A04
I believe the issue here is that \\S\\ is an escape character for ^ (component separator). 我相信这里的问题是\\ S \\是^(组件分隔符)的转义字符。 Your message should contain an actual component separator with the actual ^ in it, not the escape character. 您的消息应包含实际的分隔符,其中包含实际的^,而不是转义符。
"ADT" should appear in MSH-9-1 and "A04" should appear in MSH-9-2 as opposed to how I suspect you are doing it with "ADT^A01" in MSH-9. MSH-9-1中应出现“ ADT”,MSH-9-2中应出现“ A04”,这与我怀疑您对MSH-9中的“ ADT ^ A01”所做的事情相反。
Does this help? 这有帮助吗? Please feel free to contact me directly if you need more specialized advice. 如果您需要更多专业建议,请随时直接与我联系。
edit: I don't normally use NHapi but I suspect you may need to do something along this line: 编辑:我通常不使用NHapi,但我怀疑您可能需要沿着这条线做一些事情:
terser.set("/MSH-9-1", "ADT");
terser.set("/MSH-9-2", "A01");
as opposed to something you might be doing 而不是你可能正在做的事情
terser.set("/MSH-9", "ADT^A01");
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.