Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

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