web stats
Database Reader to LLP Sender: Generating multiple OBR segments from database query - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-08-2009, 03:31 AM
sriram.putrevu sriram.putrevu is offline
What's HL7?
 
Join Date: Dec 2008
Posts: 3
sriram.putrevu
Default Database Reader to LLP Sender: Generating multiple OBR segments from database query

Channel Configuration:

Source: Database Reader
Destination: LLP Sender

I have to send Lab order information from a clinic to a Lab. We are using ORM^O01 for the same.

I'm reading Patient information, visit information, insurance information, observation requests(tests to be performed) and diagnosis information from SQL Server 2005 database.

In the HL7 document to be sent to the lab, we plan to send single patient and single visit information and multiple observation requests (OBR) for this visit.

we have written an sql query for the same. Now we've mapped the columns generated from the sql query to the outbound template (using transformer). But how do i map/write script for generating multiple OBR segments from the transformer.

Any help would be appreciated.

Thanks,
Sriram
Reply With Quote
  #2  
Old 05-10-2009, 11:52 PM
dheeraj dheeraj is offline
OBX.1 Kenobi
 
Join Date: Apr 2009
Location: India
Posts: 46
dheeraj is on a distinguished road
Default

Hi,

I am also facing the similar problem as I have to insert drug information corresponding to a patient in a HL7 v3.0 file and everytime I querry database with one of the select statements, it is returning just one record, and not the whole information. can anybody tell me whether how to get more than one record from the database in mirth. Thanks for reading the post and any info. will be highly appreciated.

Thanks and Regards,
Dheeraj Bansal
Reply With Quote
  #3  
Old 09-06-2010, 10:15 AM
lijun lijun is offline
OBX.1 Kenobi
 
Join Date: Jul 2010
Posts: 27
lijun is on a distinguished road
Default

hi dheeraj, have you figured this out? I am having the same issue and the sql that returns multiple rows when it is run on DB only get one record back in Mirth. Any help will be appreciated!
Reply With Quote
  #4  
Old 09-06-2010, 02:01 PM
AlexToft AlexToft is offline
OBX.3 Kenobi
 
Join Date: Sep 2010
Location: Leeds, UK
Posts: 160
AlexToft is on a distinguished road
Default

Could you post the SQL query and a [suitably anonymised] database row?
Reply With Quote
  #5  
Old 09-06-2010, 06:57 PM
apatwa apatwa is offline
OBX.2 Kenobi
 
Join Date: May 2010
Location: Nashville, TN
Posts: 94
apatwa is on a distinguished road
Default

@sriram & @dheeraj, we are using e4x for Mirth.
You can construct a HL7 message by following:
Code:
var hl7 = new XML();
hl7['MSH'] = 
<MSH>
  <MSH.1>|</MSH.1>
  <MSH.2>&</MSH.2>
//... rest of MSH
</MSH>;
If you want to add multiple OBRs and OBXs, here's what you do:
Code:
var obr_cnt = 1;
var obx_cnt = 1;

// obr_obj is an array of objects from which you want to construct OBR segments

for each (var obj in obr_obj) {

  hl7['OBR'][obr_cnt-1] = 
  <OBR>
    <OBR.1>{obr_cnt}</OBR.1>
    <OBR.2>{obj.foo}</OBR.2>
    // ..rest of OBR
  </OBR>;
  
  obr_cnt++;
}

// **************************
// do the same for obx
// **************************

// finally... convert XML to hl7 string

var hl7_str = SerializerFactory.getHL7Serializer(false, false, true).fromXML(hl7);
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 12:31 AM.


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