Announcement

Collapse
No announcement yet.

Patients w/ multiple insurance

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

  • Patients w/ multiple insurance

    Mirth v1.1
    =======

    Drag-and-drop in Transformer always refers only to the first insurance.

    Pasted a sample A08 message with patient having three insurance.

    The HL7 Tree shows three "ADT_A01.INSURANCE" nodes and each one when expanded shows the different insurance details.

    When I drag-and-drop the insurance name,

    msg['ADT_A01.INSURANCE']['IN1']['IN1.4']['XON.1']

    under each ADT_A01.INSURANCE node, it always refer to the first insurance.

    How to access multiple patient insurance details?

    Thanks in advance!

  • #2
    Re: Patients w/ multiple insurance

    Code:
    msg['ADT_A01.INSURANCE']['IN1']['IN1.4']['XON.1'][0]
    
    msg['ADT_A01.INSURANCE']['IN1']['IN1.4']['XON.1'][1]
    
    msg['ADT_A01.INSURANCE']['IN1']['IN1.4']['XON.1'][2]
    ...etc

    Or you could do:

    Code:
    for (insurance in msg..IN1){
       logger.info(insurance['IN1.4']['XON.1'].text());
    }
    (you could do msg..IN1 or any other field name, however I am not sure how E4X handles string field names with periods).

    Hope this helps,
    -Chris
    Chris Lang

    Comment


    • #3
      Re: Patients w/ multiple insurance

      Thank you very much, Chris!

      The msg..IN1 was throwing exception:
      =========
      org.mule.umo.transformer.TransformerException: TypeError: Cannot read property "XON.1" from undefined (<cmd>#323) (org.mozilla.javascript.EcmaError)
      =========

      But the other syntax worked!

      Used a simple while loop to get all the insurance info.
      =========
      var i = 0;
      // Check if the InsuranceCarrierID exist
      while (msg[&#039;ADT_A01.INSURANCE&#039;][&#039;IN1&#039;][&#039;IN1.3&#039;][&#039;CX.1&#039;][i] != null) {

      ...

      i = i + 1;
      }
      =========

      Thanks a lot!

      Comment

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎