Announcement

Collapse
No announcement yet.

Inefficient XML management in Mirth Outbound

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Inefficient XML management in Mirth Outbound

    Are there any options to using this incredibly inefficient method of adding to the outbound XML? Effectively make a huge template and remove instead of adding...

    channelinfo.txt (31266 bytes)

    Post edited by: caultonpos, at: 01/20/2008 18:22

  • #2
    Re:Inefficient XML management in Mirth Outbound

    Please, edit your post and add the XML as attachements.

    Comment


    • #3
      Re:Inefficient XML management in Mirth Outbound

      You can avoid to repeat the <ResultModel> repetition at the template with the next sentence at the start of the for loop

      Code:
       if(i>0) tmp['ResultModel'][i]=tmp['ResultModel'][i-i];
      In context:

      Code:
      i=0;
      // logger.error("starting Obx " + msg['OBX'].length);
      
      
      // OBX
      for (obx in msg..OBX){
          if (i>0) tmp['ResultModel'][i]=tmp['ResultModel'][i-i];
          tmp['ResultModel'][i]['resultDt']['datetime'] = msg['OBR'][0]['OBR.7']['OBR.7.1'].toString();
          tmp['ResultModel'][i]['labTestRef']['idvalue'] = msg['OBX'][i]['OBX.3']['OBX.3.1'].toString();
          tmp['ResultModel'][i]['labTestRef']['identifierSource'] = "LOINC";
          tmp['ResultModel'][i]['labTestRef']['display'] = msg['OBX'][i]['OBX.3']['OBX.3.2'].toString();
          if (msg['OBX'][i]['OBX.2']['OBX.2.1'].toString() == "NM"??) {
             tmp['ResultModel'][i]['dataTypeRef']['id'] = 56990; // DOUBLE
             tmp['ResultModel'][i]['valueDouble'] = msg['OBX'][i]['OBX.5']['OBX.5.1'].toString();
          } else {
             tmp['ResultModel'][i]['dataTypeRef']['id'] = 79128; // STRING
             tmp['ResultModel'][i]['valueString'] = msg['OBX'][i]['OBX.5']['OBX.5.1'].toString();
          }
          tmp['ResultModel'][i]['valueUnitRef']['display'] = msg['OBX'][i]['OBX.6']['OBX.6.1'].toString();
      
          i++;

      Comment


      • #4
        Re:Inefficient XML management in Mirth Outbound

        Thanks that worked

        Comment

        Working...
        X