Unable to add reference to Condition from Encounter.condition

XMLWordPrintable

    • Type: Bug/Issue
    • Resolution: Resolved
    • Priority: Major
    • Component/s: Test Case Builder
    • None
    • BONNIE
    • Bonnie FHIR
    • DISCHARGED ON ANTITHROMBOTIC THERAPY
    • 21F5386A-AC56-4C4F-98A7-476B5078E626
    • FHIR/CQL

      I tried to create a patient for FHIR version of CMS104 (21F5386A-AC56-4C4F-98A7-476B5078E626) that meets IPOP

      I  set birthdate to 12/02/1990 so age is >= 18

      Added Encounter: Non-Elective Inpatient Encounter

      Note that the PrincipalDiagnosis() function does a retrieve of a Condition resource.

      I wanted to add a Condition resource and then have the Encounter.diagnosis.condition reference it, but
      1. There was no way to add the Condition resource (not given the option)
      2. I tried to use Procedure as an alternative to reference (allowed by QI-Core [1]).  I added  Procedure: Comfort Measures (Under Clinical Summary heading) but I could not see a way to add the reference in Encounter.diagnosis.condition

      Not clear why Bonnie had Procedure Comfort Measures as an option; the logic never uses "Procedure".

      [1] http://hl7.org/fhir/us/qicore/STU4/StructureDefinition-qicore-encounter.html

      See relevant CQL logic below

      define "Initial Population":
      TJC."Encounter with Principal Diagnosis and Age"}}
       {{define "Encounter with Principal Diagnosis and Age":
      "All Stroke Encounter" AllStrokeEncounter
      with ["Patient"] BirthDate
      such that Global."CalendarAgeInYearsAt"(FHIRHelpers.ToDate(BirthDate.birthDate), start of FHIRHelpers.ToInterval(AllStrokeEncounter.period)) >= 18

      define "All Stroke Encounter": "Non Elective Inpatient Encounter" NonElectiveEncounter*where* Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Hemorrhagic Stroke" or Global.PrincipalDiagnosis(NonElectiveEncounter).code in "Ischemic Stroke"

      define "Non Elective Inpatient Encounter":
      ["Encounter": "Non-Elective Inpatient Encounter"] NonElectiveEncounter
      where Global."LengthInDays"(NonElectiveEncounter.period) <= 120
      and NonElectiveEncounter.period ends during "Measurement Period"

       {{define function "PrincipalDiagnosis"(Encounter Encounter ):
      (singleton from (Encounter.diagnosis D where FHIRHelpers.ToInteger(D.rank) = 1)) PD
      return singleton from ([Condition] C where C.id = "GetId"(PD.condition.reference))}}
       )

            Assignee:
            Noel Albritton (Inactive)
            Reporter:
            Paul Denning
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: