Click here to Skip to main content
15,891,951 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi,

How can I convert a generic xml to HL7 format using java or anything?
Posted

1 solution

XML
<destinationConnectors>
<com.webreach.mirth.model.Connector>
<name>Destination 1</name>
<properties>
<property name="scheme">file</property>
<property name="binary">0</property>
<property name="username">anonymous</property>
<property name="outputPattern">${ORIGINALNAME}</property>
<property name="validateConnections">1</property>
<property name="DataType">File Writer</property>
<property name="FTPAnonymous">1</property>
<property name="charsetEncoding">DEFAULT_ENCODING</property>
<property name="password">anonymous</property>
<property name="passive">1</property>
<property name="template">${message.encodedData}</property>
<property name="outputAppend">0</property>
<property name="host">C:/mirth/xmlout</property>
</properties>
<transformer>
<steps/>
<inboundProtocol>HL7V2</inboundProtocol>
<outboundProtocol>HL7V2</outboundProtocol>
</transformer>
<filter>
<rules/>
</filter>
<transportName>File Writer</transportName>
<mode>DESTINATION</mode>
<enabled>true</enabled>
</com.webreach.mirth.model.Connector>
</destinationConnectors>
<properties>

If I then go into the default transformer applied to Destination 1 -> Message Template tab and change the Outbound Message Template to HL7 v3.0, the transformer section in the exported channel xml file (see attachment) changes to:
<transformer>
<steps/>
<inboundTemplate></inboundTemplate>
<outboundTemplate></outboundTemplate>
<inboundProtocol>HL7V2</inboundProtocol>
<outboundProtocol>HL7V3</outboundProtocol>
<inboundProperties/>
<outboundProperties/>
</transformer>
 
Share this answer
 
Comments
Member 15440126 26-Nov-21 0:19am    
Can you you please let us know full code for XML to HL7 conversion with example.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900