Clinical Quality Language Specification
1.5.3 - Release 1 Errata 2

Clinical Quality Language Specification, published by Clinical Decision Support WG. This guide is not an authorized publication; it is the continuous build for version 1.5.3 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/HL7/cql/ and changes regularly. See the Directory of published versions

Binary: Chlamydia Screening Decision Support ELM in JSON (with debug information)

    
{
   "library" : {
      "identifier" : {
         "id" : "ChlamydiaScreening_CDS",
         "version" : "2"
      },
      "schemaIdentifier" : {
         "id" : "urn:hl7-org:elm",
         "version" : "r1"
      },
      "usings" : {
         "def" : [ {
            "localIdentifier" : "System",
            "uri" : "urn:hl7-org:elm-types:r1"
         }, {
            "localId" : "1",
            "locator" : "3:1-3:11",
            "localIdentifier" : "QUICK",
            "uri" : "http://hl7.org/fhir"
         } ]
      },
      "codeSystems" : {
         "def" : [ {
            "localId" : "2",
            "locator" : "5:1-5:45",
            "name" : "SNOMED",
            "id" : "http://snomed.info/sct",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         } ]
      },
      "valueSets" : {
         "def" : [ {
            "localId" : "3",
            "locator" : "7:1-7:69",
            "name" : "Female Administrative Sex",
            "id" : "2.16.840.1.113883.3.560.100.2",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "4",
            "locator" : "8:1-8:91",
            "name" : "Other Female Reproductive Conditions",
            "id" : "2.16.840.1.113883.3.464.1003.111.12.1006",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "5",
            "locator" : "9:1-9:69",
            "name" : "Genital Herpes",
            "id" : "2.16.840.1.113883.3.464.1003.110.12.1049",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "6",
            "locator" : "10:1-10:98",
            "name" : "Genococcal Infections and Venereal Diseases",
            "id" : "2.16.840.1.113883.3.464.1003.112.12.1001",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "7",
            "locator" : "11:1-11:106",
            "name" : "Inflammatory Diseases of Female Reproductive Organs",
            "id" : "2.16.840.1.113883.3.464.1003.112.12.1004",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "8",
            "locator" : "12:1-12:64",
            "name" : "Chlamydia",
            "id" : "2.16.840.1.113883.3.464.1003.112.12.1003",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "9",
            "locator" : "13:1-13:58",
            "name" : "HIV",
            "id" : "2.16.840.1.113883.3.464.1003.120.12.1003",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "10",
            "locator" : "14:1-14:63",
            "name" : "Syphilis",
            "id" : "2.16.840.1.113883.3.464.1003.112.12.1002",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "11",
            "locator" : "15:1-15:112",
            "name" : "Complications of Pregnancy, Childbirth and the Puerperium",
            "id" : "2.16.840.1.113883.3.464.1003.111.12.1012",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "12",
            "locator" : "16:1-16:69",
            "name" : "Pregnancy Test",
            "id" : "2.16.840.1.113883.3.464.1003.111.12.1011",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "13",
            "locator" : "17:1-17:63",
            "name" : "Pap Test",
            "id" : "2.16.840.1.113883.3.464.1003.108.12.1017",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "14",
            "locator" : "18:1-18:81",
            "name" : "Lab Tests During Pregnancy",
            "id" : "2.16.840.1.113883.3.464.1003.111.12.1007",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "15",
            "locator" : "19:1-19:100",
            "name" : "Lab Tests for Sexually Transmitted Infections",
            "id" : "2.16.840.1.113883.3.464.1003.110.12.1051",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "16",
            "locator" : "20:1-20:74",
            "name" : "Chlamydia Screening",
            "id" : "2.16.840.1.113883.3.464.1003.110.12.1052",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         }, {
            "localId" : "17",
            "locator" : "21:1-21:63",
            "name" : "Reason for not performing Chlamydia Screening",
            "id" : "TBD",
            "accessLevel" : "Public",
            "resultTypeSpecifier" : {
               "type" : "ListTypeSpecifier",
               "elementType" : {
                  "name" : "{urn:hl7-org:elm-types:r1}Code",
                  "type" : "NamedTypeSpecifier"
               }
            }
         } ]
      },
      "statements" : {
         "def" : [ {
            "name" : "Patient",
            "context" : "Patient",
            "expression" : {
               "type" : "SingletonFrom",
               "operand" : {
                  "dataType" : "{http://hl7.org/fhir}Patient",
                  "templateId" : "patient-qicore-qicore-patient",
                  "type" : "Retrieve"
               }
            }
         }, {
            "localId" : "30",
            "locator" : "25:1-26:95",
            "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
            "name" : "InDemographic",
            "context" : "Patient",
            "accessLevel" : "Public",
            "annotation" : [ {
               "type" : "Annotation",
               "s" : {
                  "value" : [ "define \"InDemographic\":\r\n\tAgeInYears() >= 16 and AgeInYears() < 24 and \"Patient\".\"gender\" in \"Female Administrative Sex\"" ]
               }
            } ],
            "expression" : {
               "localId" : "29",
               "locator" : "26:2-26:95",
               "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
               "type" : "And",
               "operand" : [ {
                  "localId" : "24",
                  "locator" : "26:2-26:41",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "And",
                  "operand" : [ {
                     "localId" : "20",
                     "locator" : "26:2-26:19",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "GreaterOrEqual",
                     "operand" : [ {
                        "localId" : "18",
                        "locator" : "26:2-26:13",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer",
                        "precision" : "Year",
                        "type" : "CalculateAge",
                        "operand" : {
                           "path" : "birthDate",
                           "type" : "Property",
                           "source" : {
                              "name" : "Patient",
                              "type" : "ExpressionRef"
                           }
                        }
                     }, {
                        "localId" : "19",
                        "locator" : "26:18-26:19",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer",
                        "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                        "value" : "16",
                        "type" : "Literal"
                     } ]
                  }, {
                     "localId" : "23",
                     "locator" : "26:25-26:41",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Less",
                     "operand" : [ {
                        "localId" : "21",
                        "locator" : "26:25-26:36",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer",
                        "precision" : "Year",
                        "type" : "CalculateAge",
                        "operand" : {
                           "path" : "birthDate",
                           "type" : "Property",
                           "source" : {
                              "name" : "Patient",
                              "type" : "ExpressionRef"
                           }
                        }
                     }, {
                        "localId" : "22",
                        "locator" : "26:40-26:41",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Integer",
                        "valueType" : "{urn:hl7-org:elm-types:r1}Integer",
                        "value" : "24",
                        "type" : "Literal"
                     } ]
                  } ]
               }, {
                  "localId" : "28",
                  "locator" : "26:47-26:95",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "InValueSet",
                  "code" : {
                     "localId" : "26",
                     "locator" : "26:47-26:64",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}String",
                     "path" : "gender",
                     "type" : "Property",
                     "source" : {
                        "localId" : "25",
                        "locator" : "26:47-26:55",
                        "resultTypeName" : "{http://hl7.org/fhir}Patient",
                        "name" : "Patient",
                        "type" : "ExpressionRef"
                     }
                  },
                  "valueset" : {
                     "localId" : "27",
                     "locator" : "26:69-26:95",
                     "name" : "Female Administrative Sex",
                     "resultTypeSpecifier" : {
                        "type" : "ListTypeSpecifier",
                        "elementType" : {
                           "name" : "{urn:hl7-org:elm-types:r1}Code",
                           "type" : "NamedTypeSpecifier"
                        }
                     }
                  }
               } ]
            }
         }, {
            "localId" : "66",
            "locator" : "28:1-40:81",
            "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
            "name" : "SexuallyActive",
            "context" : "Patient",
            "accessLevel" : "Public",
            "annotation" : [ {
               "type" : "Annotation",
               "s" : {
                  "value" : [ "define \"SexuallyActive\":\r\n\texists ([\"Condition\": \"Other Female Reproductive Conditions\"])\r\n\tor exists ([\"Condition\": \"Genital Herpes\"])\r\n\tor exists ([\"Condition\": \"Genococcal Infections and Venereal Diseases\"])\r\n\tor exists ([\"Condition\": \"Inflammatory Diseases of Female Reproductive Organs\"])\r\n\tor exists ([\"Condition\": \"Chlamydia\"])\r\n\tor exists ([\"Condition\": \"HIV\"])\r\n\tor exists ([\"Condition\": \"Syphilis\"])\r\n\tor exists ([\"Condition\": \"Complications of Pregnancy, Childbirth and the Puerperium\"])\r\n\tor exists ([\"DiagnosticOrder\": \"Pregnancy Test\"])\r\n\tor exists ([\"DiagnosticOrder\": \"Pap Test\"])\r\n\tor exists ([\"DiagnosticOrder\": \"Lab Tests During Pregnancy\"])\r\n\tor exists ([\"DiagnosticOrder\": \"Lab Tests for Sexually Transmitted Infections\"])" ]
               }
            } ],
            "expression" : {
               "localId" : "65",
               "locator" : "29:2-40:81",
               "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
               "type" : "Or",
               "operand" : [ {
                  "localId" : "62",
                  "locator" : "29:2-39:62",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "Or",
                  "operand" : [ {
                     "localId" : "59",
                     "locator" : "29:2-38:44",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Or",
                     "operand" : [ {
                        "localId" : "56",
                        "locator" : "29:2-37:50",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                        "type" : "Or",
                        "operand" : [ {
                           "localId" : "53",
                           "locator" : "29:2-36:87",
                           "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                           "type" : "Or",
                           "operand" : [ {
                              "localId" : "50",
                              "locator" : "29:2-35:38",
                              "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                              "type" : "Or",
                              "operand" : [ {
                                 "localId" : "47",
                                 "locator" : "29:2-34:33",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                 "type" : "Or",
                                 "operand" : [ {
                                    "localId" : "44",
                                    "locator" : "29:2-33:39",
                                    "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                    "type" : "Or",
                                    "operand" : [ {
                                       "localId" : "41",
                                       "locator" : "29:2-32:81",
                                       "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                       "type" : "Or",
                                       "operand" : [ {
                                          "localId" : "38",
                                          "locator" : "29:2-31:73",
                                          "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                          "type" : "Or",
                                          "operand" : [ {
                                             "localId" : "35",
                                             "locator" : "29:2-30:44",
                                             "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                             "type" : "Or",
                                             "operand" : [ {
                                                "localId" : "32",
                                                "locator" : "29:2-29:63",
                                                "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                                "type" : "Exists",
                                                "operand" : {
                                                   "localId" : "31",
                                                   "locator" : "29:9-29:63",
                                                   "dataType" : "{http://hl7.org/fhir}Condition",
                                                   "templateId" : "condition-qicore-qicore-condition",
                                                   "codeProperty" : "code",
                                                   "type" : "Retrieve",
                                                   "resultTypeSpecifier" : {
                                                      "type" : "ListTypeSpecifier",
                                                      "elementType" : {
                                                         "name" : "{http://hl7.org/fhir}Condition",
                                                         "type" : "NamedTypeSpecifier"
                                                      }
                                                   },
                                                   "codes" : {
                                                      "name" : "Other Female Reproductive Conditions",
                                                      "type" : "ValueSetRef"
                                                   }
                                                }
                                             }, {
                                                "localId" : "34",
                                                "locator" : "30:5-30:44",
                                                "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                                "type" : "Exists",
                                                "operand" : {
                                                   "localId" : "33",
                                                   "locator" : "30:12-30:44",
                                                   "dataType" : "{http://hl7.org/fhir}Condition",
                                                   "templateId" : "condition-qicore-qicore-condition",
                                                   "codeProperty" : "code",
                                                   "type" : "Retrieve",
                                                   "resultTypeSpecifier" : {
                                                      "type" : "ListTypeSpecifier",
                                                      "elementType" : {
                                                         "name" : "{http://hl7.org/fhir}Condition",
                                                         "type" : "NamedTypeSpecifier"
                                                      }
                                                   },
                                                   "codes" : {
                                                      "name" : "Genital Herpes",
                                                      "type" : "ValueSetRef"
                                                   }
                                                }
                                             } ]
                                          }, {
                                             "localId" : "37",
                                             "locator" : "31:5-31:73",
                                             "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                             "type" : "Exists",
                                             "operand" : {
                                                "localId" : "36",
                                                "locator" : "31:12-31:73",
                                                "dataType" : "{http://hl7.org/fhir}Condition",
                                                "templateId" : "condition-qicore-qicore-condition",
                                                "codeProperty" : "code",
                                                "type" : "Retrieve",
                                                "resultTypeSpecifier" : {
                                                   "type" : "ListTypeSpecifier",
                                                   "elementType" : {
                                                      "name" : "{http://hl7.org/fhir}Condition",
                                                      "type" : "NamedTypeSpecifier"
                                                   }
                                                },
                                                "codes" : {
                                                   "name" : "Genococcal Infections and Venereal Diseases",
                                                   "type" : "ValueSetRef"
                                                }
                                             }
                                          } ]
                                       }, {
                                          "localId" : "40",
                                          "locator" : "32:5-32:81",
                                          "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                          "type" : "Exists",
                                          "operand" : {
                                             "localId" : "39",
                                             "locator" : "32:12-32:81",
                                             "dataType" : "{http://hl7.org/fhir}Condition",
                                             "templateId" : "condition-qicore-qicore-condition",
                                             "codeProperty" : "code",
                                             "type" : "Retrieve",
                                             "resultTypeSpecifier" : {
                                                "type" : "ListTypeSpecifier",
                                                "elementType" : {
                                                   "name" : "{http://hl7.org/fhir}Condition",
                                                   "type" : "NamedTypeSpecifier"
                                                }
                                             },
                                             "codes" : {
                                                "name" : "Inflammatory Diseases of Female Reproductive Organs",
                                                "type" : "ValueSetRef"
                                             }
                                          }
                                       } ]
                                    }, {
                                       "localId" : "43",
                                       "locator" : "33:5-33:39",
                                       "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                       "type" : "Exists",
                                       "operand" : {
                                          "localId" : "42",
                                          "locator" : "33:12-33:39",
                                          "dataType" : "{http://hl7.org/fhir}Condition",
                                          "templateId" : "condition-qicore-qicore-condition",
                                          "codeProperty" : "code",
                                          "type" : "Retrieve",
                                          "resultTypeSpecifier" : {
                                             "type" : "ListTypeSpecifier",
                                             "elementType" : {
                                                "name" : "{http://hl7.org/fhir}Condition",
                                                "type" : "NamedTypeSpecifier"
                                             }
                                          },
                                          "codes" : {
                                             "name" : "Chlamydia",
                                             "type" : "ValueSetRef"
                                          }
                                       }
                                    } ]
                                 }, {
                                    "localId" : "46",
                                    "locator" : "34:5-34:33",
                                    "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                    "type" : "Exists",
                                    "operand" : {
                                       "localId" : "45",
                                       "locator" : "34:12-34:33",
                                       "dataType" : "{http://hl7.org/fhir}Condition",
                                       "templateId" : "condition-qicore-qicore-condition",
                                       "codeProperty" : "code",
                                       "type" : "Retrieve",
                                       "resultTypeSpecifier" : {
                                          "type" : "ListTypeSpecifier",
                                          "elementType" : {
                                             "name" : "{http://hl7.org/fhir}Condition",
                                             "type" : "NamedTypeSpecifier"
                                          }
                                       },
                                       "codes" : {
                                          "name" : "HIV",
                                          "type" : "ValueSetRef"
                                       }
                                    }
                                 } ]
                              }, {
                                 "localId" : "49",
                                 "locator" : "35:5-35:38",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                 "type" : "Exists",
                                 "operand" : {
                                    "localId" : "48",
                                    "locator" : "35:12-35:38",
                                    "dataType" : "{http://hl7.org/fhir}Condition",
                                    "templateId" : "condition-qicore-qicore-condition",
                                    "codeProperty" : "code",
                                    "type" : "Retrieve",
                                    "resultTypeSpecifier" : {
                                       "type" : "ListTypeSpecifier",
                                       "elementType" : {
                                          "name" : "{http://hl7.org/fhir}Condition",
                                          "type" : "NamedTypeSpecifier"
                                       }
                                    },
                                    "codes" : {
                                       "name" : "Syphilis",
                                       "type" : "ValueSetRef"
                                    }
                                 }
                              } ]
                           }, {
                              "localId" : "52",
                              "locator" : "36:5-36:87",
                              "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                              "type" : "Exists",
                              "operand" : {
                                 "localId" : "51",
                                 "locator" : "36:12-36:87",
                                 "dataType" : "{http://hl7.org/fhir}Condition",
                                 "templateId" : "condition-qicore-qicore-condition",
                                 "codeProperty" : "code",
                                 "type" : "Retrieve",
                                 "resultTypeSpecifier" : {
                                    "type" : "ListTypeSpecifier",
                                    "elementType" : {
                                       "name" : "{http://hl7.org/fhir}Condition",
                                       "type" : "NamedTypeSpecifier"
                                    }
                                 },
                                 "codes" : {
                                    "name" : "Complications of Pregnancy, Childbirth and the Puerperium",
                                    "type" : "ValueSetRef"
                                 }
                              }
                           } ]
                        }, {
                           "localId" : "55",
                           "locator" : "37:5-37:50",
                           "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                           "type" : "Exists",
                           "operand" : {
                              "localId" : "54",
                              "locator" : "37:12-37:50",
                              "dataType" : "{http://hl7.org/fhir}DiagnosticOrder",
                              "templateId" : "diagnosticorder-qicore-qicore-diagnosticorder",
                              "codeProperty" : "item[].code",
                              "type" : "Retrieve",
                              "resultTypeSpecifier" : {
                                 "type" : "ListTypeSpecifier",
                                 "elementType" : {
                                    "name" : "{http://hl7.org/fhir}DiagnosticOrder",
                                    "type" : "NamedTypeSpecifier"
                                 }
                              },
                              "codes" : {
                                 "name" : "Pregnancy Test",
                                 "type" : "ValueSetRef"
                              }
                           }
                        } ]
                     }, {
                        "localId" : "58",
                        "locator" : "38:5-38:44",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                        "type" : "Exists",
                        "operand" : {
                           "localId" : "57",
                           "locator" : "38:12-38:44",
                           "dataType" : "{http://hl7.org/fhir}DiagnosticOrder",
                           "templateId" : "diagnosticorder-qicore-qicore-diagnosticorder",
                           "codeProperty" : "item[].code",
                           "type" : "Retrieve",
                           "resultTypeSpecifier" : {
                              "type" : "ListTypeSpecifier",
                              "elementType" : {
                                 "name" : "{http://hl7.org/fhir}DiagnosticOrder",
                                 "type" : "NamedTypeSpecifier"
                              }
                           },
                           "codes" : {
                              "name" : "Pap Test",
                              "type" : "ValueSetRef"
                           }
                        }
                     } ]
                  }, {
                     "localId" : "61",
                     "locator" : "39:5-39:62",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Exists",
                     "operand" : {
                        "localId" : "60",
                        "locator" : "39:12-39:62",
                        "dataType" : "{http://hl7.org/fhir}DiagnosticOrder",
                        "templateId" : "diagnosticorder-qicore-qicore-diagnosticorder",
                        "codeProperty" : "item[].code",
                        "type" : "Retrieve",
                        "resultTypeSpecifier" : {
                           "type" : "ListTypeSpecifier",
                           "elementType" : {
                              "name" : "{http://hl7.org/fhir}DiagnosticOrder",
                              "type" : "NamedTypeSpecifier"
                           }
                        },
                        "codes" : {
                           "name" : "Lab Tests During Pregnancy",
                           "type" : "ValueSetRef"
                        }
                     }
                  } ]
               }, {
                  "localId" : "64",
                  "locator" : "40:5-40:81",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "Exists",
                  "operand" : {
                     "localId" : "63",
                     "locator" : "40:12-40:81",
                     "dataType" : "{http://hl7.org/fhir}DiagnosticOrder",
                     "templateId" : "diagnosticorder-qicore-qicore-diagnosticorder",
                     "codeProperty" : "item[].code",
                     "type" : "Retrieve",
                     "resultTypeSpecifier" : {
                        "type" : "ListTypeSpecifier",
                        "elementType" : {
                           "name" : "{http://hl7.org/fhir}DiagnosticOrder",
                           "type" : "NamedTypeSpecifier"
                        }
                     },
                     "codes" : {
                        "name" : "Lab Tests for Sexually Transmitted Infections",
                        "type" : "ValueSetRef"
                     }
                  }
               } ]
            }
         }, {
            "localId" : "98",
            "locator" : "42:1-45:82",
            "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
            "name" : "NoScreening",
            "context" : "Patient",
            "accessLevel" : "Public",
            "annotation" : [ {
               "type" : "Annotation",
               "s" : {
                  "value" : [ "define \"NoScreening\":\r\n  not exists ([\"DiagnosticReport\": \"Chlamydia Screening\"] R where R.\"issued\" during Interval[Today() - 1 years, Today()] and R.\"result\" is not null)\r\n  and not exists ([\"ProcedureRequest\": \"Chlamydia Screening\"] P where P.\"orderedOn\" same day or after Today())\r\n\tand not exists ([\"Observation\": \"Reason for not performing Chlamydia Screening\"])" ]
               }
            } ],
            "expression" : {
               "localId" : "97",
               "locator" : "43:3-45:82",
               "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
               "type" : "And",
               "operand" : [ {
                  "localId" : "93",
                  "locator" : "43:3-44:110",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "And",
                  "operand" : [ {
                     "localId" : "83",
                     "locator" : "43:3-43:148",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Not",
                     "operand" : {
                        "localId" : "82",
                        "locator" : "43:7-43:148",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                        "type" : "Exists",
                        "operand" : {
                           "localId" : "81",
                           "locator" : "43:14-43:148",
                           "type" : "Query",
                           "resultTypeSpecifier" : {
                              "type" : "ListTypeSpecifier",
                              "elementType" : {
                                 "name" : "{http://hl7.org/fhir}DiagnosticReport",
                                 "type" : "NamedTypeSpecifier"
                              }
                           },
                           "source" : [ {
                              "localId" : "68",
                              "locator" : "43:15-43:59",
                              "alias" : "R",
                              "resultTypeSpecifier" : {
                                 "type" : "ListTypeSpecifier",
                                 "elementType" : {
                                    "name" : "{http://hl7.org/fhir}DiagnosticReport",
                                    "type" : "NamedTypeSpecifier"
                                 }
                              },
                              "expression" : {
                                 "localId" : "67",
                                 "locator" : "43:15-43:57",
                                 "dataType" : "{http://hl7.org/fhir}DiagnosticReport",
                                 "templateId" : "diagnosticreport-qicore-qicore-diagnosticreport",
                                 "codeProperty" : "name",
                                 "type" : "Retrieve",
                                 "resultTypeSpecifier" : {
                                    "type" : "ListTypeSpecifier",
                                    "elementType" : {
                                       "name" : "{http://hl7.org/fhir}DiagnosticReport",
                                       "type" : "NamedTypeSpecifier"
                                    }
                                 },
                                 "codes" : {
                                    "name" : "Chlamydia Screening",
                                    "type" : "ValueSetRef"
                                 }
                              }
                           } ],
                           "relationship" : [ ],
                           "where" : {
                              "localId" : "80",
                              "locator" : "43:61-43:147",
                              "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                              "type" : "And",
                              "operand" : [ {
                                 "localId" : "76",
                                 "locator" : "43:67-43:120",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                 "type" : "In",
                                 "operand" : [ {
                                    "localId" : "70",
                                    "locator" : "43:67-43:76",
                                    "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                    "path" : "issued",
                                    "scope" : "R",
                                    "type" : "Property"
                                 }, {
                                    "localId" : "75",
                                    "locator" : "43:85-43:120",
                                    "lowClosed" : true,
                                    "highClosed" : true,
                                    "type" : "Interval",
                                    "resultTypeSpecifier" : {
                                       "type" : "IntervalTypeSpecifier",
                                       "pointType" : {
                                          "name" : "{urn:hl7-org:elm-types:r1}DateTime",
                                          "type" : "NamedTypeSpecifier"
                                       }
                                    },
                                    "low" : {
                                       "localId" : "73",
                                       "locator" : "43:94-43:110",
                                       "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                       "type" : "Subtract",
                                       "operand" : [ {
                                          "localId" : "71",
                                          "locator" : "43:94-43:100",
                                          "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                          "type" : "Today"
                                       }, {
                                          "localId" : "72",
                                          "locator" : "43:104-43:110",
                                          "resultTypeName" : "{urn:hl7-org:elm-types:r1}Quantity",
                                          "value" : 1,
                                          "unit" : "years",
                                          "type" : "Quantity"
                                       } ]
                                    },
                                    "high" : {
                                       "localId" : "74",
                                       "locator" : "43:113-43:119",
                                       "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                       "type" : "Today"
                                    }
                                 } ]
                              }, {
                                 "localId" : "79",
                                 "locator" : "43:126-43:147",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                                 "type" : "Not",
                                 "operand" : {
                                    "type" : "IsNull",
                                    "operand" : {
                                       "localId" : "78",
                                       "locator" : "43:126-43:135",
                                       "path" : "result",
                                       "scope" : "R",
                                       "type" : "Property",
                                       "resultTypeSpecifier" : {
                                          "type" : "ListTypeSpecifier",
                                          "elementType" : {
                                             "name" : "{urn:hl7-org:elm-types:r1}Any",
                                             "type" : "NamedTypeSpecifier"
                                          }
                                       }
                                    }
                                 }
                              } ]
                           }
                        }
                     }
                  }, {
                     "localId" : "92",
                     "locator" : "44:7-44:110",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Not",
                     "operand" : {
                        "localId" : "91",
                        "locator" : "44:11-44:110",
                        "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                        "type" : "Exists",
                        "operand" : {
                           "localId" : "90",
                           "locator" : "44:18-44:110",
                           "type" : "Query",
                           "resultTypeSpecifier" : {
                              "type" : "ListTypeSpecifier",
                              "elementType" : {
                                 "name" : "{http://hl7.org/fhir}ProcedureRequest",
                                 "type" : "NamedTypeSpecifier"
                              }
                           },
                           "source" : [ {
                              "localId" : "85",
                              "locator" : "44:19-44:63",
                              "alias" : "P",
                              "resultTypeSpecifier" : {
                                 "type" : "ListTypeSpecifier",
                                 "elementType" : {
                                    "name" : "{http://hl7.org/fhir}ProcedureRequest",
                                    "type" : "NamedTypeSpecifier"
                                 }
                              },
                              "expression" : {
                                 "localId" : "84",
                                 "locator" : "44:19-44:61",
                                 "dataType" : "{http://hl7.org/fhir}ProcedureRequest",
                                 "templateId" : "procedurerequest-qicore-qicore-procedurerequest",
                                 "codeProperty" : "type",
                                 "type" : "Retrieve",
                                 "resultTypeSpecifier" : {
                                    "type" : "ListTypeSpecifier",
                                    "elementType" : {
                                       "name" : "{http://hl7.org/fhir}ProcedureRequest",
                                       "type" : "NamedTypeSpecifier"
                                    }
                                 },
                                 "codes" : {
                                    "name" : "Chlamydia Screening",
                                    "type" : "ValueSetRef"
                                 }
                              }
                           } ],
                           "relationship" : [ ],
                           "where" : {
                              "localId" : "89",
                              "locator" : "44:65-44:109",
                              "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                              "precision" : "Day",
                              "type" : "SameOrAfter",
                              "operand" : [ {
                                 "localId" : "87",
                                 "locator" : "44:71-44:83",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                 "path" : "orderedOn",
                                 "scope" : "P",
                                 "type" : "Property"
                              }, {
                                 "localId" : "88",
                                 "locator" : "44:103-44:109",
                                 "resultTypeName" : "{urn:hl7-org:elm-types:r1}DateTime",
                                 "type" : "Today"
                              } ]
                           }
                        }
                     }
                  } ]
               }, {
                  "localId" : "96",
                  "locator" : "45:6-45:82",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "Not",
                  "operand" : {
                     "localId" : "95",
                     "locator" : "45:10-45:82",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "type" : "Exists",
                     "operand" : {
                        "localId" : "94",
                        "locator" : "45:17-45:82",
                        "dataType" : "{http://hl7.org/fhir}Observation",
                        "templateId" : "observation-qicore-qicore-observation",
                        "codeProperty" : "code",
                        "type" : "Retrieve",
                        "resultTypeSpecifier" : {
                           "type" : "ListTypeSpecifier",
                           "elementType" : {
                              "name" : "{http://hl7.org/fhir}Observation",
                              "type" : "NamedTypeSpecifier"
                           }
                        },
                        "codes" : {
                           "name" : "Reason for not performing Chlamydia Screening",
                           "type" : "ValueSetRef"
                        }
                     }
                  }
               } ]
            }
         }, {
            "localId" : "104",
            "locator" : "47:1-47:78",
            "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
            "name" : "NeedScreening",
            "context" : "Patient",
            "accessLevel" : "Public",
            "annotation" : [ {
               "type" : "Annotation",
               "s" : {
                  "value" : [ "define \"NeedScreening\": \"InDemographic\" and \"SexuallyActive\" and \"NoScreening\"" ]
               }
            } ],
            "expression" : {
               "localId" : "103",
               "locator" : "47:25-47:78",
               "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
               "type" : "And",
               "operand" : [ {
                  "localId" : "101",
                  "locator" : "47:25-47:60",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "type" : "And",
                  "operand" : [ {
                     "localId" : "99",
                     "locator" : "47:25-47:39",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "name" : "InDemographic",
                     "type" : "ExpressionRef"
                  }, {
                     "localId" : "100",
                     "locator" : "47:45-47:60",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                     "name" : "SexuallyActive",
                     "type" : "ExpressionRef"
                  } ]
               }, {
                  "localId" : "102",
                  "locator" : "47:66-47:78",
                  "resultTypeName" : "{urn:hl7-org:elm-types:r1}Boolean",
                  "name" : "NoScreening",
                  "type" : "ExpressionRef"
               } ]
            }
         }, {
            "localId" : "109",
            "locator" : "51:1-55:1",
            "name" : "ChlamydiaScreeningRequest",
            "context" : "Patient",
            "accessLevel" : "Public",
            "annotation" : [ {
               "type" : "Annotation",
               "s" : {
                  "value" : [ "define \"ChlamydiaScreeningRequest\": Tuple {\r\n  type: Code '442487003' from \"SNOMED\" display 'Screening for Chlamydia trachomatis (procedure)',\r\n  status: 'proposed'\r\n  // values for other elements of the request...\r\n}" ]
               }
            } ],
            "resultTypeSpecifier" : {
               "type" : "TupleTypeSpecifier",
               "element" : [ {
                  "name" : "type",
                  "type" : {
                     "name" : "{urn:hl7-org:elm-types:r1}Code",
                     "type" : "NamedTypeSpecifier"
                  }
               }, {
                  "name" : "status",
                  "type" : {
                     "name" : "{urn:hl7-org:elm-types:r1}String",
                     "type" : "NamedTypeSpecifier"
                  }
               } ]
            },
            "expression" : {
               "localId" : "108",
               "locator" : "51:37-55:1",
               "type" : "Tuple",
               "resultTypeSpecifier" : {
                  "type" : "TupleTypeSpecifier",
                  "element" : [ {
                     "name" : "type",
                     "type" : {
                        "name" : "{urn:hl7-org:elm-types:r1}Code",
                        "type" : "NamedTypeSpecifier"
                     }
                  }, {
                     "name" : "status",
                     "type" : {
                        "name" : "{urn:hl7-org:elm-types:r1}String",
                        "type" : "NamedTypeSpecifier"
                     }
                  } ]
               },
               "element" : [ {
                  "name" : "type",
                  "value" : {
                     "localId" : "106",
                     "locator" : "52:9-52:96",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}Code",
                     "code" : "442487003",
                     "display" : "Screening for Chlamydia trachomatis (procedure)",
                     "type" : "Code",
                     "system" : {
                        "localId" : "105",
                        "locator" : "52:31-52:38",
                        "name" : "SNOMED",
                        "resultTypeSpecifier" : {
                           "type" : "ListTypeSpecifier",
                           "elementType" : {
                              "name" : "{urn:hl7-org:elm-types:r1}Code",
                              "type" : "NamedTypeSpecifier"
                           }
                        }
                     }
                  }
               }, {
                  "name" : "status",
                  "value" : {
                     "localId" : "107",
                     "locator" : "53:11-53:20",
                     "resultTypeName" : "{urn:hl7-org:elm-types:r1}String",
                     "valueType" : "{urn:hl7-org:elm-types:r1}String",
                     "value" : "proposed",
                     "type" : "Literal"
                  }
               } ]
            }
         } ]
      }
   }
}