简体   繁体   English

欢乐,在每条消息后更改文件编写器目标

[英]Mirth, Change File Writter Destination after each message

Im working with a Mirth Channel.我正在与欢乐频道合作。

Source is a Database Reader, Destination currently is a File Writter.源是数据库读取器,目标当前是文件写入器。

Im attempting to get a xml message from the database, transform it to HL7 and store it on a flat file.我试图从数据库中获取 xml 消息,将其转换为 HL7 并将其存储在平面文件中。 Each HL7 message needs to be stored on a separate flat file.每个 HL7 消息都需要存储在单独的平面文件中。

So far mirth gets the xml, transforms it into HL7 but it stores all the messages in the same flat file.到目前为止,mirth 获取 xml,将其转换为 HL7,但它将所有消息存储在同一个平面文件中。

Any tips on what should i try?关于我应该尝试什么的任何提示? Should i use JavaScript writter instead of a File Writter?我应该使用 JavaScript 编写器而不是文件编写器吗?

In light of your response that the format of the file name is not important, this is a simple solution.鉴于您的回答是文件名的格式并不重要,这是一个简单的解决方案。 Just drag-and-drop "Message ID" from the destination Mappings box to the File Name box.只需将“消息 ID”从目标映射框拖放到文件名框。 Every message for this channel will have a unique message id.此频道的每条消息都将具有唯一的消息 ID。

Alternatively, you can type ${message.messageId} into the File Name box.或者,您可以在“文件名”框中键入${message.messageId}

The file writer destination has two fields to be filled the directory and file name.文件编写器目标有两个字段要填充目录和文件名。 In this case, I suggest combining string literals with a couple of global or system variables such as count, date, rawdata etc. (check the bottom right pane of the destination transformer for this).在这种情况下,我建议将字符串文字与几个全局或系统变量(例如计数、日期、原始数据等)组合在一起(检查目标转换器的右下窗格)。 In the below example, I am using the count feature to serialize messages that are converted to HL7 in addition to the system date variable which will show the date a message is processed.在下面的示例中,除了将显示消息处理日期的系统日期变量之外,我还使用计数功能来序列化转换为 HL7 的消息。

Custom name for file name in the Mirth Connect file writer Mirth Connect 文件编写器中文件名的自定义名称

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM