DFT (charge) Xlate

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf DFT (charge) Xlate

  • Creator
    Topic
  • #49210
    Ricci Graham
    Participant

      I am writing an Xlate for charges (dft) and I have run into a problem I hope someone can help me with. I receive an HL7 record where the FT1 segment looks like the following:

      FT1|1|||20070406||ICD||UNSPECIFIED RENAL FAILURE||1|||||||||586|9999^Doe, MD^John D.^^^^|||||

      FT1|2|||20070406||ICD||CHF UNSPECIFIED||1|||||||||428.0|9999^Doe, MD^John D.^^^^|||||

      FT1|3|||20070406||ICD||OTHER SPEC CARDIAC DYSRHYTHMIAS||1|||||||||427.89|9999^Doe, MD^John D.^^^^|||||

      FT1|4|||20070406||CPT|93010|Electrocardiogram, Routine W/ At Least 12 Leads; Interpretation & Report Only||1|||ED|||||||9999^Doe, MD^John D.^^^^||||93010|

      FT1|5|||20070406||CPT|99291|Critical Care First 30-74 Minutes||1|||ED|||||||9999^Doe, MD^John D.^^^^||||99291|25

      I need to turn it into an HL7 record that looks like the following:

      CHG||04062007|93010|Electrocardiogram, Routine W/ At Least 12 Leads, Interpretation & Report Only|1|9999|Doe, John D., MD|586|UNSPECIFIED RENAL FAILURE|428.0|CHF UNSPECIFIED|427.89|OTHER SPEC CARDIAC DYSRHYTHMIAS||93010||||

      CHG||04062007|99291|Critical Care First 30-74 Minutes|1|9999|Doe, John D., MD||586|UNSPECIFIED RENAL FAILURE|428.0|CHF UNSPECIFIED|427.89|OTHER SPEC CARDIAC DYSRHYTHMIAS||99291||||

      How do I pull the CPT info out of the last two lines and the ICD info out of the first three lines to build two “CHG” lines?

      Any help or suggestions would be greatly appreciated.

      Thanks,

      Ricci

    Viewing 2 reply threads
    • Author
      Replies
      • #61108
        Vince Angulo
        Participant

          Never had a situation quite like this, but shooting from the hip I’d consider iterating over the FT1s twice.

          First pass to save off the ICD info to variables;

          Second pass to use the CPTs to build the CHG segments and copy in the ICD variables.

          That should work in an Xlate, but I’m sure there’s probably a more elegant way to do it in a tcl proc.

        • #61109
          John Mercogliano
          Participant

            I would do the following assuming that both the CHG and FT1’s are at the segment level:

            Psuedo Code:

            copy 0 to $%s3  #you need this to reference the outbound CHG segments.

            Iterate bases FT1 variable %s1

            if ft1(%s1).#6 == CPT

              #here you copy the appropriate CPT values to your CHG segment

              # Example

              copy FT1(%s1).#7 to CHG(%s3).#3

              Iterate bases FT1 variable %s2

                 if ft1(%s2).#6 == ICD

                    #here you copy the appropriate ICD values to your CHG segment

                    # Example

                    copy FT1(%s2).#19 to CHG(%s3).#8    

                  endif

              end %s2 iterate

            endif

            math add 1 to $%s3

            end %s1 iterate

            Hope this gives you some ideas.

            John Mercogliano
            Sentara Healthcare
            Hampton Roads, VA

          • #61110
            Ricci Graham
            Participant

              John and Vince,

              Thanks so much for the advice, this headed me in the right direction. Jim Koslosky also talked me through this on the phone and gave me great advice and direction on this. The code turned out great and works beautifully.

              Thanks,

              Again,

              Ricci

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