Convert XML to HL7 messages using Mirth Connect

后端 未结 3 955
感动是毒
感动是毒 2021-01-01 03:54

I\'m working with Mirth Connect v2.0 and getting stuck on one task, transformation of XML to HL7 v3. I\'ve connected to an Ms-Access Database (the hospital system is in Acce

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-01 04:27

    I am converting XML into hl7 using sample xml data, you can use your own. You can paste the below code in soure transformer:

      var length = msg['orderList']['order'].length();
       var rcount = 0;
       for(var i=0;i");
        SEG['OBR.1']['OBR.1.1']=i+1;
        SEG['OBR.16']['OBR.16.1']=msg['orderList']['order'][i]['provider'].toString();
        tmp['OBR'][i]=SEG;
        var reslen = msg['orderList']['order'][i]['result'].length();
        logger.info(reslen);
        for(var j=0;j");
            RSEG['OBX.1']['OBX.1.1'] = rcount;
            RSEG['OBX.3']['OBX.3.1'] = msg['orderList']['order'][i]['result'][j]['resultcode'].toString();
            RSEG['OBX.3']['OBX.3.2']=msg['orderList']['order'][i]['result'][j]['text'].toString();
            RSEG['OBX.7'] = msg['orderList']['order'][i]['result'][j]['range'].toString();
            RSEG['OBX.6']['OBX.6.2'] = msg['orderList']['order'][i]['result'][j]['unit'].toString();
            tmp['OBX'][rcount]=RSEG;
            rcount++;
        }
    }
    logger.info(**SerializerFactory.getSerializer('HL7V2').fromXML(tmp)**);
    

    Dont forgot to create a HL& template in source outbound

    **MSH|^~\&|||||||||
    PID|||||||||||||||||||||||||||
    ORC|||||||||||||||||||**
    

    sample XML

    
    
    XXXXXXXXXXX, XXXX.XXXXXXXXXX
    
    XXXXXX XXXX XXXX Med XXXXInformation XXXXX FlXXXX XXXX St XXXXXX XXXXXX, XX XXXXXXXX/XXXX-XXXXXXX/XXX-XXXX2.XXXXX-X1.XXXXX
    57423 result 7685-1 Hemoglobin test2 3to52 mg result 7685-1 Hemoglobin test2 3to52 mg 57423 result 7685-1 Hemoglobin test2 3to52 mg

提交回复
热议问题