web stats
Filtering a message - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2016, 04:51 AM
Thoughts_Shared Thoughts_Shared is offline
OBX.2 Kenobi
 
Join Date: Dec 2016
Posts: 58
Thoughts_Shared is on a distinguished road
Unhappy Filtering a message

I am new to mirth and trying to filter an HL7 message based on the below structure:

MSH
[SFT]
EVN
PID
[PD1]
[{ROL}]
PV1
[PV2]
[{ROL}]
DB1

But I am not able to get the segment to repeat properly in the right order. I am using version 3.4.2

Any help would really be appreciated

Last edited by Thoughts_Shared; 12-11-2016 at 08:33 PM.
Reply With Quote
  #2  
Old 12-13-2016, 02:15 PM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 565
kirbykn2 is on a distinguished road
Default

I don't understand the question. Try rewording it and ask again.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #3  
Old 12-13-2016, 09:15 PM
Thoughts_Shared Thoughts_Shared is offline
OBX.2 Kenobi
 
Join Date: Dec 2016
Posts: 58
Thoughts_Shared is on a distinguished road
Default

Using the below code I am able to validate MSH EVN PID PV1 [PD1] or MSH EVN PID PV1 [ROL]. But still not able to validate MSH EVN PID PV1 [PD1] [{ROL}]

var index = 0;
var GroupIndex = 0;
var rGroupIndex = 0;

for each (seg in msg.children()) {
var segName = seg.name().toString();
if (index == 0 && segName != 'MSH' || index == 1 && segName != 'EVN' || index == 2 && segName != 'PID' || index == 3 && segName != 'PV1') {
return false;
} else if (index > 3 && index < msg.children().length() - 1) {
if (GroupIndex == 0 && segName != 'PD1' || rGroupIndex == 0 && segName != 'ROL')
GroupIndex++;
return false;
}
index++;
}
return true;

How do I validate a message for the format MSH EVN PID PV1 [PD1] [{ROL}]
Reply With Quote
Reply

Tags
filter, message structure, segments

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 05:31 PM.


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