web stats
Unable to add new field in OBR segment - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2019, 01:37 PM
Kogan20 Kogan20 is offline
What's HL7?
 
Join Date: Mar 2019
Location: Sydney, Australia
Posts: 4
Kogan20 is on a distinguished road
Unhappy Unable to add new field in OBR segment

Hi Everyone,

I am new to Mirth,

Got an opportunity to work in Mirth recently to add an entry in the OBR field. With the help of this forum, I was able to edit an existing data, that works perfectly fine. But failing to add a data to a field which doesn't exist in the source HL7. Below is the example,

SourceHL7

Code:
PV2|||||||System Alert Off~0437689973~ABC-KOTHAI-AUS
OBR|1||ABCDEDFGH|754051^ABCEDEF^MDC|||20190225133500+0000||||||||||||||||||F
In the DestinationHL7, I want to check if PV2.7.2 has "KOTHAI", if yes, then update the OBR.16 as below

Code:
OBR|1||ABCDEDFGH|754051^ABCEDEF^MDC|||20190225133500+0000|||||||||KOTHAI|||||||||F
With the below Javascript, I am able to see the last value in OBR is changed as M but no "KOTHAI" is available. I could see the change in Transformed data but not in Encoded data. Could you let me know what am I doing wrong.

Code:
 tmp=msg; 
var code = tmp['ORU_R01.PATIENT_RESULT']['ORU_R01.PATIENT']['ORU_R01.VISIT']['PV2']['PV2.7'][2].toString();
if (code.indexOf("ARSTALL") != -1 )
{

tmp['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.25'] = "M";
tmp['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.16'] = "KOTHAI";
}else {

tmp['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.25'] = "F";
}
Reply With Quote
  #2  
Old 03-11-2019, 10:17 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 750
agermano is on a distinguished road
Default

You're using the strict parser, so you need to make sure everything is named correctly depending on hl7 datatype.

I think you want to do this:
Code:
tmp['ORU_R01.PATIENT_RESULT']['ORU_R01.ORDER_OBSERVATION']['OBR']['OBR.16']['XCN.1'] = "KOTHAI";
Reply With Quote
  #3  
Old 06-10-2019, 09:17 PM
Kogan20 Kogan20 is offline
What's HL7?
 
Join Date: Mar 2019
Location: Sydney, Australia
Posts: 4
Kogan20 is on a distinguished road
Unhappy

Hi Tony,
Thanks for this,
I am unable to add a new field to the segment.
Maybe I need to let you know how I have configured my Channel. Attached is the FileReader and FileWriter config.

Below is the msg format.

Code:
MSH|^~\&|Care|Company|HealthLink|PMS3Medd|20190610220158||ORU^R01^ORU_R01|20190610220158737721|P^T|2.3.1|||AL|NE|||||IHE_PCD_ORU_R01^IHE PCD^1.3.6.1.4.1.19376.1.6.1.9.1^ISO
PID|||MODEL:ABCD^^^MDT^U~Test101^^^^Patient ID~KoRocks^^^^External Patient ID||Black^Jack||19870823000000+0000||||11 Sunnymeade Close^^Carlford^NSW^2077^Australia
PV1|1|U
OBR|1||1F3C98CF-09F7-4F3C-8C7A-7921B46CF42B|754051^MDC_IDC_ENUM_SESS_TYPE_Remote^MDC|||20180814191100+0000||||||||||||||||||C
OBX|1|CWE|720900^MDC_IDC_DEV_MFG^MDC||753744^MDC_IDC_ENUM_MFG_MDT^MDC||||||C
OBX|2|ST|720898^MDC_IDC_DEV_MODEL^MDC||Evera XT DR DDBB2D4||||||C
OBX|3|ST|720899^MDC_IDC_DEV_SERIAL^MDC||BWD606197S||||||C
OBX|4|CWE|721026^MDC_IDC_SESS_TYPE^MDC||754051^MDC_IDC_ENUM_SESS_TYPE_Remote^MDC||||||C
OBX|5|CWE|720897^MDC_IDC_DEV_TYPE^MDC||753666^MDC_IDC_ENUM_DEV_TYPE_ICD^MDC||||||C
OBX|6|ST|1001039^MDT_EVALUATION_MISCELLANEOUSCOMMENT^MDT||Device: Model XT DR DDBB2D4 Serial Number: ABCD606197S Date of Interrogation: 15-Aug-2018 05:11:21 \X0A\Clinical Status Since 13-Aug-2014 \X0A\Treated \X0A\VF (Off)  \X0A\FVT (Off)  \X0A\VT (Off)  \X0A\AT/AF(Monitor)  \X0A0A\Monitored \X0A\VT (Off)  \X0A\VT-NS (>4 beats, >188 bpm) 0 \X0A\High Rate-NS 0 \X0A\SVT: VT/VF Rx Withheld 0 \X0A\V. Oversensing-TWave Rx Withheld 0 \X0A\V. Oversensing-Noise Rx Withheld 0 \X0A\AT/AF 0 \X0A0A\Time in AT/AF 0.0 hr/day (0.0%) \X0A0A\Functional Last Week \X0A\Patient Activity NA < 1 week \X0A\Cardiac Compass Trends (Aug-2018 to Aug-2018) \X0A\Therapy Summary VT/VF AT/AF \X0A\Pace-Terminated Episodes 0 0 \X0A\Shock-Terminated Episodes 0 0 \X0A\Total Shocks 0 0 \X0A\Aborted Charges 0 0 \X0A\Pacing  (% of Time Since 13-Aug-2014) \X0A\Total VP 0.0% (MVP On) \X0A\AS-VS 0.0%  \X0A\AS-VP 0.0%  \X0A\AP-VS 0.0%  \X0A\AP-VP 0.0%  \X0A\OBSERVATIONS (2) \X0A\ Remaining Longevity is not available, potentially due to cold temperature. Store at room temperature for 48 hours and re-interrogate. \X0A\ VF Detection is OFF. \X0A\Device Status \X0A\Remaining Longevity Pre-Implant \X0A\(15-Aug-2018) \X0A\(based on initial interrogation) \X0A0A\ Atrial RV \X0A\Pacing Impedance - - -  - - -  \X0A\Defibrillation Impedance  RV=- - - \X0A0A\Capture Threshold - - -  V @ 0.40 ms - - -  V @ 0.40 ms \X0A\Measured On - - -  - - -  \X0A\Programmed Amplitude/Pulse Width 3.50 V / 0.40 ms 3.50 V / 0.40 ms \X0A0A\Measured P/ R Wave - - -  - - -  \X0A\Programmed Sensitivity 0.30 mV 0.30 mV \X0A\Parameter Summary \X0A\Mode AAI<=>DDD Lower Rate 60 bpm Paced AV 180 ms \X0A\Mode Switch 171 bpm Upper Track 130 bpm Sensed AV 150 ms \X0A\  Upper Sensor 120 bpm   \X0A0A\Detection  Rates Therapies   \X0A\AT/AF Monitor >171 bpm All Rx Off \X0A\VF OFF  (Detection is OFF)    ATP During Charging, 35J x 6 \X0A\FVT OFF  All Rx Off \X0A\VT OFF  All Rx Off \X0A0A\Enhancements On:  TWave, Noise(Timeout)||||||C
OBX|7|ED|18750-0^Cardiac Electrophysiology Report^LN|1|Application^pdf^^Base64^
Now, I need to update the PV1 segment as

Code:
PV1|1|O|4.PREOP||||||060093FB^KOVAC^PAUL MARK^^^DR^^^AUSHICPR^^^^^|||||||||
Attached Images
File Type: png config.png (64.2 KB, 3 views)
Reply With Quote
  #4  
Old 06-11-2019, 04:44 AM
kirt kirt is offline
Mirth Newb
 
Join Date: Feb 2016
Location: Quebec City
Posts: 10
kirt is on a distinguished road
Default

Are you using a message template? If not and you're working in a transformer, I suggest the msg variable directly. One typically see use of the "tmp" variable is used for channels that use a message template (I under it is not an abbreviation for temporary). Furthermore, you modified the "tmp" variable but you didn't subsequently update the "msg" variable which is what you're sending, I reckon.

To assign a value to OBR.25, I suggest you work directly with the msg varaible and resolve you target field right down to the first sub-component - OBR.25.1:

msg["OBR"]["OBR.25"]["OBR.25.1"] = "MyUpdatedContent";
Reply With Quote
  #5  
Old 06-11-2019, 02:01 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 750
agermano is on a distinguished road
Default

@kirt's advice is good to update msg directly instead of tmp. When you specify an outbound template, that template will be deserialized to the tmp variable, and tmp will be used to produce your encoded data. If you don't specify an outbound template, tmp will be undefined and msg will be used to produce your encoded data.

The first line of shared code employs what I consider bad practice of using
Code:
tmp=msg;
This will point tmp at the same object at which msg points. This means it doesn't matter which variable you use because they will both modify the same object, and they will both retrieve the same object.

That being said, what mirth version are you using? It looks old from your screenshots.
Reply With Quote
  #6  
Old 06-11-2019, 06:25 PM
Kogan20 Kogan20 is offline
What's HL7?
 
Join Date: Mar 2019
Location: Sydney, Australia
Posts: 4
Kogan20 is on a distinguished road
Smile

Thanks Kirt and Tony for the updates,

Yes, I used the template first to know how the segment field looks like.

I was able to update the PV1 segment with the below code in Javascript console.

Code:
tmp=msg;
tmp['PV1']['PV1.2']['PV1.2.7']="KOTHAI"
the output looks like this
Code:
PV1|1|U^^^^^^KOTHAI
If this is bad coding, apologize. Can I just update the "msg", I need to revise this a lot, because I need to update the PV1 based on a lookup table.

@Tony, the version installed on our server is Mirth Connect Server 2.2.1.5861

Is this too old?
I now have a another question, probably I will create a separate post for that.
Not sure if I can tag you to that post.

Thanks,
Ko
Reply With Quote
  #7  
Old 06-12-2019, 12:57 AM
mdehoog mdehoog is offline
Mirth Guru
 
Join Date: Mar 2011
Location: Apeldoorn the Netherlands
Posts: 284
mdehoog is on a distinguished road
Send a message via Skype™ to mdehoog
Default Oh yeah. That IS OLD!!

Mirth Connect Server 2.2.1.5861
Is this too old?


Oh yeah. That IS OLD!!

Wed, 29 Feb 2012 19:59:51 UTC

We are now at 3.7.1. So I suggest to update ASAP.
__________________
X Connections
https://documentor.email
https://www.x-connections.com
Reply With Quote
  #8  
Old 06-13-2019, 09:54 PM
Kogan20 Kogan20 is offline
What's HL7?
 
Join Date: Mar 2019
Location: Sydney, Australia
Posts: 4
Kogan20 is on a distinguished road
Default

Oh no, I will need to check with our US team if we can use the latest version.
Thanks for your reply.
Reply With Quote
  #9  
Old 06-14-2019, 11:32 AM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 750
agermano is on a distinguished road
Default

http://www.mirthcorp.com/community/w...+Upgrade+Guide

Upgrading from 2.x to 3.x can be a pretty big change for some.
Reply With Quote
Reply

Tags
hl7 message, javascript transformer, mirth

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:44 AM.


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