Reply To: MLP to Batch

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf MLP to Batch Reply To: MLP to Batch

#57126
Gene Salay
Participant

    Here’s what I have (and let me say Thanks in adv up here since the bottom is way down!!):

    My inbound thread is running the upoc protocol with a read TPS of get_FTP.

    My TSP Inbound Data field has three procs:

    tps_batch_envelope_ORMIS_chgs

    tps_pre_HL7_batch

    raw_hl7_ack  (probably don’t need this, I’m thinking)

    The first one, tps_batch_envelope_ORMIS_chgs (listed below) should be replacing the characters we discussed, and putting on the batch and file headers and footers.  It does appear to be replacing the characters and putting on the footers, but the FHS and BHS from this proc aren’t there, and neither is the MSH from tps_pre_HL7_batch.

    Also curious:

    1. other batches I’ve reviewed have x0a between every segment and message – no x0ds.

    2. in tps_pre_HL7_batch, why the “^” in these lines:

               set fhs [lsearch -regexp $msgs “^FHS”]

               set msh_loc [lsearch -regexp $msgs “^MSH”]

    Here’s the batch envelope proc:

    run {

               # ‘run’ mode always has a MSGID; fetch and process it

                    keylget args MSGID mh

                    set msg [msgget $mh]

               # Get rid of all x1c and x0b

          regsub -all — {[x1cx0b]} $msg {} msg

               # Build envelope

          set fhs “FHS|^~\&|||||||||r”

          set bhs “BHS|^~\&|||||||||r”

          set bts “BTS|||r”

          set fts “FTS|1rn”

               # Build batch

          append newmsg1 $fhs $bhs $msg $bts $fts

               #Replace two carriage returns with carriage return line feed

               #Doing now because adding BHSr on front may result in rr again.

          regsub -all — {rr} $newmsg1 “rn” newmsg2

               # Pile it back on the train

          msgset $mh $newmsg2

               # Wash hands

                lappend dispList “CONTINUE $mh”

         

               }