Putting a set of text lines for a report into OBX segments

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Putting a set of text lines for a report into OBX segments

  • Creator
    Topic
  • #52482
    Terence Gucwa
    Participant

      After much frustration, I’d like to see what others suggest.

      I’ve asked to format a relatively complex report of Text Lines from an incoming HRL, and then put it into an ORU message that looks something like this:

      MSH|^~&|PCMS|LACP|CERNER|LACP|20101116211601||ORU^R03|123456789|T|2.2

      PID|||1234||TEST^PATIENT||20030607|F||||||||||1032000924

      PV1|1|E|ECC^^^F^^^F||||800^ECC^Physician|||MED|ECC||||||800^ECC^Physician|ERQ||6

      OBR|||30021018|PCMS DOC^PCMS Document|||20101116132014||||||||||||||||||F

      OBX|1|TX| PCMS DOC^PCMS Document ||Text Line 1||||||F

      OBX|2|TX| PCMS DOC^PCMS Document ||Text Line 2||||||F

      OBX|3|TX| PCMS DOC^PCMS Document ||Text Line 3||||||F

      OBX|4|TX| PCMS DOC^PCMS Document ||Text Line 4||||||F

      OBX|5|TX| PCMS DOC^PCMS Document ||Text Line 1||||||F

      How can I set up the report such that I can then iterate over the report, placing each line into consecutive OBX segments.  My various experiments have failed.  Can I make a list from the text lines and then use that list as a basis for an ITERATE?

    Viewing 2 reply threads
    • Author
      Replies
      • #74391
        Jim Kosloskey
        Participant

          This is probably doable – might not even need any Tcl.

          A lot will depend on the construct of your HRL and its relationship to the text lines.

          What is the structure of your HRL and where in that structure are the text lines (a record layout would be helpful)?

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

        • #74392
          Terence Gucwa
          Participant

            The “report” doesn’t exist until the translation itselfl; the translation has to make the “report”.  The HRL is a home-made combination of single-value fields and repeating groups extract from the Probation Dept’s case management system.  Simplified, the HRL contains a singly-occuring VRL with identifying and singly occuing info:

            lname

            fname

            fingerprint-based-id

            gender

            location

            dept-of-chidlren-family-servers-case-name

            etc.

            And several repeating VRLs:

            { family } While family.seg-type = ‘FM’

              name

              relationship

              etc.

            { int_party }  While int_party.seg-type = ‘IP’

              name

              association-type

              etc.

            { arrest }  While arrest.seg-type = ‘AR’

              offense-date

              etc.

            So, presumably, the translation would put a report into either an xlt  temporary variable (@report) or into a tcl global variable (global _report), and then place it into OBX segments in an ITERATE.

            Could that ITERATE be over a field, or list?

            Or, alternatively, I guess each OBX segment could be constructed individually, duplicating the COPY staetments for all the other fields in each OBX segment.

          • #74393
            Jim Kosloskey
            Participant

              One way is to ITERATE over the repeating VRL segments (this would be a segment ITERATion) and place the fields from each repeition directly into the OBX or concatenated into a temp variable which then would be placed into the apporpriate OBX field(s).

              You might need to maintain your own counter for the OBX – it really depends on the relationships of the VRL segments to each other and to the OBX occurrences.

              Email me and we can discuss the details (I think there could be a lot of questions to get a clear understanding).

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

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