web stats
For Duplicate FT1 Segment Add Modifier to FT1.26.1 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-12-2013, 02:44 PM
ssobhi9 ssobhi9 is offline
What's HL7?
 
Join Date: Oct 2013
Posts: 1
ssobhi9 is on a distinguished road
Default For Duplicate FT1 Segment Add Modifier to FT1.26.1

Given the following message, if the FT1 segment is duplicated, I need to add the value/modifier '51' to FT1.26.1.

FT1|1|||20131210141212|20131211103006|C|80053^COMP REHENSIVE METABOLIC PANEL W/GFR|||1|||PHYS||||||V58.69||||1973284||80053^COMPR EHENSIVE METABOLIC PANEL W/GFR|
FT1|2|||20131210141212|20131211103006|C|85025^COMP LETE BLOOD COUNT|||1|||PHYS||||||V58.69||||1973284||85025^COM PLETE BLOOD COUNT|
FT1|3|||20131210141212|20131211103006|C|86140^C-REACTIVE PROTEIN (CRP)|||1|||PHYS||||||710.9||||1973284||86140^C-REACTIVE PROTEIN (CRP)|
FT1|4|||20131210141212|20131211103006|C|85652^SED RATE |||1|||PHYS||||||710.9||||1973284||85652^SED RATE |
FT1|5|||20131210141212|20131211103006|C|86160^COMP LEMENT C3 AND C4|||1|||PHYS||||||790.99||||1973284||86160^COMPLE MENT C3 AND C4|
FT1|6|||20131210141212|20131211103006|C|86160^COMP LEMENT C3 AND C4|||1|||PHYS||||||790.99||||1973284||86160^COMPLE MENT C3 AND C4|

In a similar instance, if the FT1 segment is replicated 4 times over, I need to add the value/modifier '91' to FT1.26.1 for only the last two FT1 segments.

I did make an attempt in following the instructions posted on this link:

http://www.mirthcorp.com/community/f...ferrerid=27983

Any insight is greatly appreciated.
Reply With Quote
  #2  
Old 12-13-2013, 11:54 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,282
cory_cole is on a distinguished road
Default

var i = 0;

if(msg['FT1'].length > 1)
{
for each (ft1 in msg.FT1)
{
if(i < 3)
{
ft1['FT1.26']['FT1.26.1'] = '51';
}
else
{
ft1['FT1.26']['FT1.26.1'] = '91';
}
}
}
Reply With Quote
Reply

Tags
array, duplicate segment, loop segments, modifiers

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:51 PM.


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