web stats
HL7 embedded in XML - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2018, 09:07 AM
gary.white@nebraska.gov gary.white@nebraska.gov is offline
What's HL7?
 
Join Date: Jan 2011
Location: Lincoln, NE
Posts: 2
gary.white@nebraska.gov is on a distinguished road
Exclamation HL7 embedded in XML

Hello

This has probably been covered before or should be apparent.

How do I create a Database reader to input a row of xml from a table and extract the HL7 message or messages from a specific note in the column

Using NextGen Connect 3.6.1 and SQL Server. And I might as well give it up we are also using the latest version of PHINMS

here is the SQL select Statement

SELECT TOP (1) ss_251_sandbox.recordId AS recordId
,ss_251_sandbox.messageId AS messageId
,ss_251_sandbox.payloadName AS payloadName
,ss_251_sandbox.payloadBinaryContent AS payloadBinaryContent
,ss_251_sandbox.payloadTextContent AS payloadTextContent
,ss_251_sandbox.localFileName AS localFileName
,ss_251_sandbox.service AS service
,ss_251_sandbox.action AS action
,ss_251_sandbox.arguments AS arguments
,ss_251_sandbox.fromPartyId AS fromPartyId
,ss_251_sandbox.messageRecipient AS messageRecipient
,ss_251_sandbox.errorCode AS errorCode
,ss_251_sandbox.errorMessage AS errorMessage
,ss_251_sandbox.processingStatus AS processingStatus
,ss_251_sandbox.applicationStatus AS applicationStatus
,ss_251_sandbox.encryption AS encryption
,ss_251_sandbox.receivedTime AS received Time
,ss_251_sandbox.lastUpdateTime AS lastUpdateTime
,ss_251_sandbox.processId AS processId
FROM ss_251_sandbox
WHERE processingStatus = 'done-staging'
ORDER BY receivedTime

The list of one or more messages is in payloadTextContent column

Thanks in advance for your help.
Reply With Quote
  #2  
Old 11-05-2018, 05:28 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

Sounds like you already have it extracted from your query. What do you want to do with it?
Reply With Quote
  #3  
Old 11-06-2018, 03:46 AM
gary.white@nebraska.gov gary.white@nebraska.gov is offline
What's HL7?
 
Join Date: Jan 2011
Location: Lincoln, NE
Posts: 2
gary.white@nebraska.gov is on a distinguished road
Default

payloadTextContent is a text string with one or more messages


How do I assign each individual message so that NextGen Connect places a single message into the msg class?

Do I use the split() method?

Or am I making this harder that it needs to be?
Reply With Quote
  #4  
Old 11-06-2018, 05:41 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 530
agermano is on a distinguished road
Default

How you separate them depends on how the messages are stored in the text string. If it's just a list of messages without any delimiter, you could use a regex to split them on MSH segments.

You'll likely want to use a Javascript Reader instead of a database reader, since you want to process the individual HL7 messages as your message, and not the database query results.

If you need all of those other columns from your query, you could create RawMessages (see the User API) in your Javascript Reader with the individual hl7 as your message and all of the other columns added to the sourceMap of the new message.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 08:28 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Mirth Corporation