5 Replies Latest reply: Dec 19, 2013 4:50 PM by Andrew Lindquist RSS

    Give one description based on hierarchy

    Andrew Lindquist

      I have an app that uses hospital claims data, where each claim could have several codes and each code has a certain description (Lab, Surgery, etc.). I only want to bring in one description for the entire claim regardless of how many different descriptions are associated with that claim. To decide what description to use, I need to use the following hierarchy:

       

      If any of the codes on the claim are considered "Surgery", make the whole claim description "Surgery".

      Otherwise, if any if any of the codes on the claim are considered "Lab", make the whole claim description "Lab".

      Otherwise, make the whole claim description "Other".

       

      Here's a simplified version of the data:

       

      Claim #CodeDescWhat I want Desc to Be
      112345SurgerySurgery
      156789LabSurgery
      111111OtherSurgery
      298765LabLab
      211111OtherLab

       

      So for claim # 1, I want a column where all 3 lines would be "Surgery".

      For claim # 2, I want a column where both lines would be "Lab".

       

      Any ideas?
      Thanks