add unique number to field

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf add unique number to field

  • Creator
    Topic
  • #47799
    Jason Bond
    Participant

      I have a one time file conversion from a vrl to hl7 to run to import data from one emr to another.  I need a unique number identifier for each patient.  So I need to have a proc or tool to add a number to a field and count up by one for each message.  Any ideas would be greatly appreciated.

      Thank you,

      Jason Bond

      Systems Analyst Interfaces

      Samaritan Health

    Viewing 2 reply threads
    • Author
      Replies
      • #56748
        David Caragay
        Participant

          Jason,

          Take a look at the counter commands in TCL. If all you want to do is increment a number by one and then add it to a message, this is one way to handle it.  

          CtrInitCounter

          CtrNextValue

          CtrCurrentValue

          CtrResetValue

          If you are new to TCL, this is a good one to write since it is relatively easy to code.  Let me know if you need tcl code examples.  The proc can be an inbound or xlt proc, depending on where you want to add the number.

        • #56749
          Brian Goad
          Participant

            Jason Bond wrote:

            I have a one time file conversion from a vrl to hl7 to run to import data from one emr to another.  I need a unique number identifier for each patient.  So I need to have a proc or tool to add a number to a field and count up by one for each message.  Any ideas would be greatly appreciated.

            Jason you say you need a unique number for each patient, does that mean you are looking for something that will create a number for the patient and if farther into the file you find the same patient use the number you created? Or would you create a new number for this message.

            In other words:

            ADT’s

            A01 for admit

            A08 for update

            have same unique ID

            Brian

          • #56750
            David Caragay
            Participant

              Jason,

              Here is a sample code fragment you can revise for an xlt proc.  Similar code can by used in an IB tcl proc.

              set counter_file

              set count [CtrCurrentValue counter_file]

              if {$count == 1} {

                   CtrInitCounter $counter_file file 2 99999

              }

              set count [CtrNextValue $counter_file]

              set xlateOutVals $control_id

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