web stats
splitting the HL7 message - Mirth Community

Go Back   Mirth Community > Open Source HIT > General Discussion

Reply
 
Thread Tools Display Modes
  #1  
Old 02-22-2008, 08:04 PM
dabimahesh dabimahesh is offline
What's HL7?
 
Join Date: Feb 2008
Posts: 5
dabimahesh
Default splitting the HL7 message

One Lab result HL7 message is combination of multiple HL7 messages, can I split that to generate multiple HL7 messages by using mirth?
Reply With Quote
  #2  
Old 02-25-2008, 06:57 AM
jbartels jbartels is offline
Mirth Guru
 
Join Date: Oct 2006
Posts: 719
jbartels is on a distinguished road
Default Re:splitting the HL7 message

dabimahesh wrote:
Quote:
One Lab result HL7 message is combination of multiple HL7 messages, can I split that to generate multiple HL7 messages by using mirth?
Yes you can. I have a channel that does that and I have attached it.

This channel sends the first message immediately and then delays the remaining messages. This is a constraint of the receiving system which needed some time to process the lab request in each message to prevent duplicates. Split_ORU_R01.xml (6257 bytes)
__________________
Jon Bartels

Zen is hiring!!!!
http://consultzen.com/careers/
Talented healthcare IT professionals wanted. Engineers to sales to management.
Good benefits, great working environment, genuinely interesting work.
Reply With Quote
  #3  
Old 02-25-2008, 10:12 AM
djfmirth djfmirth is offline
Mirth Newb
 
Join Date: Nov 2007
Posts: 17
djfmirth
Default Re:splitting the HL7 message

I'm also trying to process lab results messages but would like to process the entire message.

However this requires the ability to process the structure that is implied by the segment ordering.
For example, the message below (details removed and segments indented to indicate their implied position within the tree)
has 2 OBRs, the first of which has 5 OBXs, one of which has 3 NTEs.

MSH
PID
OBR
OBX
OBX
NTE
NTE
NTE
OBX
OBX
OBX
OBR
OBX
NTE
NTE
OBX
NTE
OBX
NTE

My question is, can Mirth deal with this kind of structure?

I've tried code of the following form to walk the implied tree:

Code:
  for each (obr in msg..OBR) {
    for each (obx in obr) {
      for each (nte in obx) {
    }
  }
but without success.

Looking at the transformed message in the admin console indicates that
Mirth considers all of these segments to be directly connected to a common root ie there appears to be no nested hierarchy as far as Mirth is concerned.

I'm new to Mirth and am having to try and figure things out by educated guesswork (and uneducated guesswork hence this post!) and searching the forum.
However, I can't be the first person to want to do this so if you (or anyone else) could point me in the right direction that would be greatly appreciated.
Reply With Quote
  #4  
Old 02-25-2008, 10:18 AM
djfmirth djfmirth is offline
Mirth Newb
 
Join Date: Nov 2007
Posts: 17
djfmirth
Default Re:splitting the HL7 message

I'm also trying to process lab results messages but would like to process the entire message.

However this requires the ability to process the structure that is implied by the segment ordering.
For example, the message below (details removed and segments indented to indicate their implied position within the tree)
has 2 OBRs, the first of which has 5 OBXs, one of which has 3 NTEs.

MSH
PID
OBR
OBX
OBX
NTE
NTE
NTE
OBX
OBX
OBX
OBR
OBX
NTE
NTE
OBX
NTE
OBX
NTE

My question is, can Mirth deal with this kind of structure?

I've tried code of the following form to walk the implied tree:

Code:
  for each (obr in msg..OBR) {
    for each (obx in obr) {
      for each (nte in obx) {
    }
  }
but without success.

Looking at the transformed message in the admin console indicates that
Mirth considers all of these segments to be directly connected to a common root ie there appears to be no nested hierarchy as far as Mirth is concerned.

I'm new to Mirth and am having to try and figure things out by educated guesswork (and uneducated guesswork hence this post!) and searching the forum.
However, I can't be the first person to want to do this so if you (or anyone else) could point me in the right direction that would be greatly appreciated.
Reply With Quote
  #5  
Old 02-25-2008, 10:19 AM
djfmirth djfmirth is offline
Mirth Newb
 
Join Date: Nov 2007
Posts: 17
djfmirth
Default Re:splitting the HL7 message

I'm also trying to process lab results messages but would like to process the entire message.

However this requires the ability to process the structure that is implied by the segment ordering.
For example, the message below (details removed and segments indented to indicate their implied position within the tree)
has 2 OBRs, the first of which has 5 OBXs, one of which has 3 NTEs.

MSH
PID
OBR
OBX
OBX
NTE
NTE
NTE
OBX
OBX
OBX
OBR
OBX
NTE
NTE
OBX
NTE
OBX
NTE

My question is, can Mirth deal with this kind of structure?

I've tried code of the following form to walk the implied tree:

Code:
  for each (obr in msg..OBR) {
    for each (obx in obr) {
      for each (nte in obx) {
    }
  }
but without success.

Looking at the transformed message in the admin console indicates that
Mirth considers all of these segments to be directly connected to a common root ie there appears to be no nested hierarchy as far as Mirth is concerned.

I'm new to Mirth and am having to try and figure things out by educated guesswork (and uneducated guesswork hence this post!) and searching the forum.
However, I can't be the first person to want to do this so if you (or anyone else) could point me in the right direction that would be greatly appreciated.
Reply With Quote
  #6  
Old 02-25-2008, 10:20 AM
djfmirth djfmirth is offline
Mirth Newb
 
Join Date: Nov 2007
Posts: 17
djfmirth
Default Re:splitting the HL7 message

I'm also trying to process lab results messages but would like to process the entire message.

However this requires the ability to process the structure that is implied by the segment ordering.
For example, the message below (details removed and segments indented to indicate their implied position within the tree)
has 2 OBRs, the first of which has 5 OBXs, one of which has 3 NTEs.

MSH
PID
OBR
OBX
OBX
NTE
NTE
NTE
OBX
OBX
OBX
OBR
OBX
NTE
NTE
OBX
NTE
OBX
NTE

My question is, can Mirth deal with this kind of structure?

I've tried code of the following form to walk the implied tree:

Code:
  for each (obr in msg..OBR) {
    for each (obx in obr) {
      for each (nte in obx) {
    }
  }
but without success.

Looking at the transformed message in the admin console indicates that
Mirth considers all of these segments to be directly connected to a common root ie there appears to be no nested hierarchy as far as Mirth is concerned.

I'm new to Mirth and am having to try and figure things out by educated guesswork (and uneducated guesswork hence this post!) and searching the forum.
However, I can't be the first person to want to do this so if you (or anyone else) could point me in the right direction that would be greatly appreciated.
Reply With Quote
  #7  
Old 02-29-2008, 04:20 PM
gauchomike gauchomike is offline
Mirth Newb
 
Join Date: Jun 2007
Posts: 16
gauchomike
Default Re:splitting the HL7 message

In order to get the appropriate nesting I have found that you need to check the "Use Strict Parser" in the properties of the Inbound Message Template. You will notice that the Inbound Message Template Tree will nest the segments.
Reply With Quote
  #8  
Old 03-02-2008, 11:26 PM
simidau simidau is offline
OBX.2 Kenobi
 
Join Date: Feb 2008
Posts: 62
simidau
Default Re:splitting the HL7 message

I didn't notice this thread before as I was looking in the support section.

I am trying to deal with the same problem.

I tried the Parse strict option and the message is supposedly not valid hl7 under strict. So the problem is still there. I have no control over the sending side.

I'll paste the message that does not validate under strict option.

Code:
MSH|^~\&|dvscnr|vmhmdvip|LABRESULT|caradata|200307211731|PKI|ORU|591249|P|2.1
MSA|AA|591249
PID|1|1|2|3|Duck^Donald^D||19761010|M|||12 Disney Pl^Fantasy Land^Disneyland^USA 
PV1||O|""
OBR|1||M047507-07211730-01|T0301^General Micro Report^L|NM||200307190000|||||||200307190000||04498^Arator^Axel||||04498^Arator^Axel||200307211730
OBX|1|FT|0301^General Micro Report^L||SPECIMEN: Faeces, No 2 in series\.br\\.br\MACROSCOPIC APPEARANCE: Semiformed ; Normal colour\.br\\.br\MICROSCOPIC EXAMINATION:\.br\- No intestinal parasites\.br\\.br\ROTAVIRUS: Negative\.br\GIARDIA SPECIFIC ANTIGEN - Negative.\.br\\.br\OCCULT BLOOD - Positive by peroxidase method. Negative by specific anti-\.br\human haemoglobin antibody method.\.br\This suggests proximal G.I.T. bleed or diet/drug interference.           ***\.br\\.br\CULTURE:\.br\\.br\       No Salmonella, Shigella, Campylobacter or Yersinia isolated. ---\.br\|||""|||F
PID|2|1|2|3|Duck^Donald^D||19761010|M|||12 Disney Pl^Fantasy Land^Disneyland^USA 
PV1||O|""
OBR|1||L4920450-07211730-01|1918^Received from Health Waikato L^L|NM||200307081115|||||||200307080000||21892^Arator^Axel||||23460^Match^Footy||200307211730
OBX|1|ST|1004324^Specimen^L||THROAT||||||F
OBX|2|ST|1006800^VIRAL CULTURE^L||""||||||F
OBX|3|ST|1005632^ Respiratory Culture^L||NEGATIVE||||||F
NTE|1||  No Virus Isolated
PID|3|1|2|3|Duck^Donald^D||19761010|M|||12 Disney Pl^Fantasy Land^Disneyland^USA 
PV1||O|""
OBR|1||L4934336-07211730-01|30^Complete Blood Count^L|NM||200307211220|||||||200307210000||29045^Day^Doris||||29045^Day^Doris||200307211730
OBX|1|ST|8003^Haemoglobin^L||129|g/L|( 115 - 155 )||||F
OBX|2|ST|8002^  RBC^L||4.11|x10\S\12/L|(3.60 - 5.50)||||F
OBX|3|ST|8004^  Hct^L||0.37||(0.34 - 0.45)||||F
OBX|4|ST|8005^  MCV^L||89.8|fL|(80.0 - 99.0)||||F
OBX|5|ST|8006^  MCH^L||31.3|pg|(27.0 - 34.0)||||F
OBX|6|ST|8010^ESR^L||4|mm/Hr|(   1 - 30  )||||F
OBX|7|ST|8007^Platelet Count^L||248|x10\S\9/L|( 160 - 400 )||||F
OBX|8|ST|8009^Platelet Morphology^L||Normal||||||F
OBX|9|ST|8001^Total WBC^L||7.1|x10\S\9/L|( 4.0 - 11.0)||||F
OBX|10|ST|8016^  Neutrophils Seg^L||4.64|x10\S\9/L|( 2.0 - 7.0 )||||F
OBX|11|ST|8017^  Lymphocytes^L||1.53|x10\S\9/L|( 1.0 - 4.0 )||||F
OBX|12|ST|8018^  Monocytes^L||0.62|x10\S\9/L|( 0.2 - 1.0 )||||F
OBX|13|ST|8019^  Eosinophils^L||0.24|x10\S\9/L|( 0.0 - 0.6 )||||F
OBX|14|ST|8020^  Basophils^L||0.04|x10\S\9/L|( 0.0 - 0.2 )||||F
OBR|2||L4934336-07211730-02|42^Renal^L|NM||200307211220|||||||200307210000||29045^Day^Doris||||29045^Day^Doris||200307211730
OBX|1|ST|1540^S. Uric Acid^L||0.14|mmol/L|( 0.18-0.47 )|L|||F
PID|4|1|2|3|Duck^Donald^D||19761010|M|||12 Disney Pl^Fantasy Land^Disneyland^USA 
PV1||O|""
OBR|1||L4933563-07211730-01|15^Serological Tests for Syphilis^L|NM||200307210900|||||||200307210000||29045^Day^Doris||||29045^Day^Doris||200307211730
OBX|1|ST|4505^TPHA^L||NEGATIVE||||||F
PID|5|1|2|3|Duck^Donald^D||19761010|M|||12 Disney Pl^Fantasy Land^Disneyland^USA 
PV1||O|""
OBR|1||L4933563-07211730-01|15^Serological Tests for Syphilis^L|NM||200307210900|||||||200307210000||29045^Day^Doris||||23460^Match^Footy||200307211730
OBX|1|ST|4505^TPHA^L||NEGATIVE||||||F
Reply With Quote
  #9  
Old 03-02-2008, 11:46 PM
simidau simidau is offline
OBX.2 Kenobi
 
Join Date: Feb 2008
Posts: 62
simidau
Default Re:splitting the HL7 message

I can get it to work if someone can answer one question.
How do I iterate through each node.

How do I get the name/type of the node your currently using. I want do do something like

for each (obj in msg)
{
//find out what kind of node the obj is, ie. PID, OBR, ORX
}

how do I do the above?

Cheers
Reply With Quote
  #10  
Old 09-15-2008, 11:19 AM
medimedia medimedia is offline
What's HL7?
 
Join Date: Aug 2008
Location: Montreal, QC, Canada
Posts: 2
medimedia
Default Re:splitting the HL7 message

Did you solve that ?
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 10:26 PM.


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