문제

I'm using Mirth to read HL7 messages in. the EMR provider has requested that for physicians in a specified practice, we should insert a practice code in MSH field 6. I have a list of the physician codes; what I need is to say "If the physician code (ORC.12.1) is in this list, then change MSH.6 to this value." I'm not entirely sure how to do this, and unfortunately the Mirth documentation is (to put it lightly) rather sparse in this area.

I can get the transformer to extract the physician code - but how do I do the conditional update?

도움이 되었습니까?

해결책

You'll have to use a JavaScript Transformer Step.

Basically, it will look like:

var code = msg['ORC']['ORC.12']['ORC.12.1'].toString();
var msh6 = msg['MSH']['MSH.6'].toString();
if (isInMyList(code))
    msh6 = 'MySpecialReceivingFacility';

tmp['MSH']['MSH.6'] = msh6;

Recommend saving a transformer with a simple variable mapper out to file and inspecting the javascript for a jumpstart at basic error handling, etc.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top