PDA

View Full Version : Changing HL7 version 2.3 to 2.5


Bobbit
01-05-2007, 01:10 PM
I need to convert HL7 version 2.3 to 2.5. I was trying to do this in the Pre Processing Script but it's not working or maybe I don't know how to make it work. I already have one script in my pre processing block which is;

message = message.replace("|ORU|", "|ORU^R01|");
return message;

How can I add another pre process script in converting MSH 12 2.3 to 2.5?



Thanks!

albertosaez
01-05-2007, 01:19 PM
Try:

message=message.replace("|ORU|", "|ORU^R01|");
message=message.replace(/\|2\.3/i,'|2.5|');
return message;

Bobbit
01-05-2007, 01:25 PM
Sir,

Oh, it changed. I'm having a status of REJECTED.

Thanks!

chrisl
01-05-2007, 01:29 PM
message=message.replace("|ORU|", "|ORU^R01|");
message=message.replace(/\|2\.3\|/i,'|2.5|');
return message;

Try that - is REJECTED expected?

Bobbit
01-05-2007, 01:35 PM
Chris,

the code you gave did not convert 2.3 to 2.5. The REJECTED status awhile ago was due to the previous code given. When REJECTED, it is not displaying the Encoded Message.

Thanks!

chrisl
01-05-2007, 02:18 PM
Did the original code (Alberto's) work ok for you?

Bobbit
01-05-2007, 02:31 PM
No, sir. It resulted in a REJECTED status.


Thanks

chrisl
01-05-2007, 02:51 PM
What does your filter look like? Is it checking a message type/version?

albertosaez
01-05-2007, 04:46 PM
Please, could you post your Channel definition, and an message input example ?

Bobbit
01-05-2007, 07:52 PM
Here's my sample message being inputed;

MSH|^~\&|1100|HD|ORC|HD000158|200605190839||ORU^R01|0964|P |2.3
PID|1|461288875|10804311310|461288875|SURNAME^GIVE NNAME||19250623|M||||||||||42101465^^^03^^F|551231 233
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|1|604170348^LAB|10804311310^LAB|188243^Fungus Culture With Stain^L|||200604171432|||||||200604180000||||60417 0348||604170348||200605190839||BN|F
OBX|1|ST|188244^Fungus Stain^L||Final report|||||N|F|||200604221513|BN
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|2|604170348^LAB|10804311310^LAB|080564^Result^ L|||200604171432||||G|||200604180000||||604170348| |604170348||200605190839||BN|F|080564|||188243
OBX|1|TX|080565^Result 1^L||Comment|||||N|F|||200604221513|BN
NTE|1|L|KOH/Calcofluor preparation: no fungus observed.
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|3|604170348^LAB|10804311310^LAB|188243^Fungus Culture With Stain^L|||200604171432|||||||200604180000||||60417 0348||604170348||200605190839||BN|F
OBX|1|ST|008482^Fungus (Mycology) Culture^L||Final report|||||N|F|||200605190721|BN
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|4|604170348^LAB|10804311310^LAB|080092^Result^ L|||200604171432||||G|||200604180000||||604170348| |604170348||200605190839||BN|F|080092|||188243
OBX|1|TX|080094^Result 1^L||Comment|||||N|F|||200605190721|BN
NTE|1|L|NO YEAST OR MOLD ISOLATED AFTER 4 WEEKS.
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|5|604170348^LAB|10804311310^LAB|182402^AFB Culture and Smear,Broth^L|||200604171432|||||||200604180000||| |604170348||604170348||200605190839||BN|X
OBX|1|TX|182402^AFB Culture and Smear,Broth^L||Test Not Performed.|||||N|X|||200605111525|BN
NTE|1|L|Test Not Performed. Specimen deterioration or loss has
NTE|2|L|occurred such that testing is no longer possible.
ORC|RE|604170348^LAB|10804311310^LAB||||||20060418 0000|||^NORTHWEST^T
OBR|6|604170348^LAB|10804311310^LAB|977032^Referen ce Micro Problem Test^L|||200604171432|||||||200604180000||||604170 348||604170348||200605190839||BN|X
OBX|1|ST|977032^Reference Micro Problem Test^L||Comment:|||||N|X|||200605111525|BN
NTE|1|L|Test Not Performed. Specimen deterioration or loss has
NTE|2|L|occurred such that testing is no longer possible.
NTE|3|L| TEST: 182402 AFB Culture and Smear,Broth
NTE|4|L| CLIENT CONTACTED 5/11/06 @3:10PM (JACOB N.).
ZPS|1|BN|LabCorp Burlington|1447 York Court^^Burlington^NC^272152230|8882005439||MD^Hanc ock^Frank^^^^MD

chrisl
01-05-2007, 11:26 PM
Can you export your channel as well?

albertosaez
01-06-2007, 02:59 AM
I don't know why the message is set to REJECTED...

But, I've tested your message in a simple channel, and and all works fine with the next preprocessor:


message=message.replace(/\|2\.3/i,'|2.5');
return message;


In the message you've posted there was no '|' ending at the version number, and the message type was set to ORU^R01, so the first step is no longer needed.

chrisl
01-06-2007, 04:12 AM
Bobbit - The rejected status is due to your Filter script rejecting the message. Check your code there and make sure you are using the right mappings for the message type. If you wrote your filter against version 2.3, but are changing the message to 2.5, you might run into issues with different segment orders/names/etc. causing your filter to reject otherwise valid messages.

-Chris

Bobbit
01-06-2007, 06:28 AM
Thanks Chris and Alberto, it's working now. The code in my filter is checking MSH 9 for R01 which was in version 2.3. I just drag the one that came from version 2.5 at it worked. Thank you very much!

jimkski
01-31-2007, 11:59 AM
Quick question:

This thread seems to indicate that you only have to change the Message Type string and Version ID in the MSH segment and Mirth will automatically convert the message between HL7 versions. Is that right? Does it handle all the work of mapping between changed data types in the various HL7 versions? How does it decide how to map from one representation to another?

Thanks.

-Jim

chrisl
01-31-2007, 12:28 PM
Jim,

Mirth will parse a message based on the version and type. In most cases fields will be consistent between versions and types, however if the original messages contains a field or segment not in the changed version or type, it will fail to parse.

For greatest reliability, it is recommended to do a complete mapping of fields to create a new type or version.

-Chris