Default an Active Null in Translate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Default an Active Null in Translate

  • Creator
    Topic
  • #52134
    Elijah Park
    Participant

      Has anyone successfully been able to get a “Copy” action (frl -> hl7) to default to @active_null if the Source value is not present?

      It’s not working for me and I would immediately attribute it to the fact that an frl field is never “empty” (in my case it’s all spaces); however, when I send it through XLT Test, my xlateInVals show an empty list, meaning this should trigger the default value, right?

      Oh, and I’m currently on v 5.7.

    Viewing 1 reply thread
    • Author
      Replies
      • #73185
        Jim Kosloskey
        Participant

          Daniel,

          In a flat record message/record no field is ever null (empty) – otherwise it could not be fixed length. Instead many times spaces are used to fille the field. Sometimes it is zeros if the field is numeric by definition.

          So you would need something (tcl probably) to test to see if the field were all spaces or zeros or whatever (I have a Xltp type proc that does that let me know via email if you want that).

          Then you can test in the Xlate using an IF Actikon to see if the result of the proc is true and if so copy =”” to the HL/7 field (or you could use your own proc and return the active null.

          But are you sure you want to do this? The Active null in Hl/7 means the sending system wants the receiving system to ‘delete’ the field – make sure all spaces means delete.

          email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

        • #73186
          Elijah Park
          Participant

            Thanks Jim. I am sure I want to send “”. In order to accurately reflect what’s on the source system, I must delete the value on the target, especially if it’s an optional field on the source and has been removed.

            I will take your advice and use my own proc to return an active null.

        Viewing 1 reply thread
        • The forum ‘Cloverleaf’ is closed to new topics and replies.