web stats
Remove duplicate seg - lesson 101 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 11-05-2012, 11:18 AM
wallflower wallflower is offline
Mirth Newb
 
Join Date: Oct 2012
Posts: 24
wallflower is on a distinguished road
Question Remove duplicate seg - lesson 101

I am new to Mirth Connect and new to javascript. We are using Mirth Connect 2+ version.

Can someone please show me the entire syntax to remove a repeating seg in a HL7 message. Below is an example message.

I would like to remove the repeating PR1 segments. Thanks in advance for any assistance.


MSH|^~\&|TEST|MDE|||201211051211||ADT^A08|666235-20121105121131449|P|2.3
PID|1||M0099032||LNAME^FNAME MI|19430724|F|||1547 VALERIA WAY^^GREAT FALLS^MT^59405||888-888-8800 |||||D35860394|123-45-6378||||||||||
PV1|1|||||||||||||||||||||||||||||||||||||||||||20 101101|20101101||0
DG1|1|I9|161.9|Malignant neo larynx NOS||MIDASF|||||||||1|||||||||||
DG1|2|I9|680.2|Carbuncle of trunk||MIDASF|||||||||0|||||||||||
PR1|1|C|87205|SMEAR GRAM STAIN||||||||||1
PR1|2|C|87070|CULTURE BACTERIA OTHER||||||||||0
Reply With Quote
  #2  
Old 11-05-2012, 11:30 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,111
narupley is on a distinguished road
Default

You can delete segments like so:

Code:
delete msg.PR1;
Look here for more info: http://wso2.org/project/mashup/0.2/d...uickstart.html
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
  #3  
Old 11-05-2012, 11:36 AM
wallflower wallflower is offline
Mirth Newb
 
Join Date: Oct 2012
Posts: 24
wallflower is on a distinguished road
Default Loops

Thanks for the quick response. And this takes into account all of the segs? I do not have to loop through in some way to remove each? Again thanks in advance for the assistance.
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 07:25 AM.


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