{"library":{"annotation":[{"translatorVersion":"3.10.0","translatorOptions":"DisableListDemotion,DisableListPromotion","signatureLevel":"Overloads","type":"CqlToElmInfo"}],"identifier":{"id":"CDSConnectCommonsForFHIRv401","version":"2.0.0"},"schemaIdentifier":{"id":"urn:hl7-org:elm","version":"r1"},"usings":{"def":[{"localIdentifier":"System","uri":"urn:hl7-org:elm-types:r1","annotation":[]},{"localIdentifier":"FHIR","uri":"http://hl7.org/fhir","version":"4.0.1","annotation":[]}]},"includes":{"def":[{"localIdentifier":"FHIRHelpers","path":"FHIRHelpers","version":"4.0.1","annotation":[]}]},"codeSystems":{"def":[{"name":"AIVERSTATUS","id":"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification","accessLevel":"Public","annotation":[]},{"name":"AICLINSTATUS","id":"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical","accessLevel":"Public","annotation":[]},{"name":"CONDVERSTATUS","id":"http://terminology.hl7.org/CodeSystem/condition-ver-status","accessLevel":"Public","annotation":[]},{"name":"CONDCLINSTATUS","id":"http://terminology.hl7.org/CodeSystem/condition-clinical","accessLevel":"Public","annotation":[]}]},"codes":{"def":[{"name":"AllergyIntolerance Confirmed code","id":"confirmed","display":"Confirmed","accessLevel":"Public","annotation":[],"codeSystem":{"name":"AIVERSTATUS","annotation":[]}},{"name":"AllergyIntolerance Active code","id":"active","display":"Active","accessLevel":"Public","annotation":[],"codeSystem":{"name":"AICLINSTATUS","annotation":[]}},{"name":"Condition Confirmed code","id":"confirmed","display":"Confirmed","accessLevel":"Public","annotation":[],"codeSystem":{"name":"CONDVERSTATUS","annotation":[]}},{"name":"Condition Active code","id":"active","display":"Active","accessLevel":"Public","annotation":[],"codeSystem":{"name":"CONDCLINSTATUS","annotation":[]}},{"name":"Condition Recurrence code","id":"recurrence","display":"Recurrence","accessLevel":"Public","annotation":[],"codeSystem":{"name":"CONDCLINSTATUS","annotation":[]}},{"name":"Condition Relapse code","id":"relapse","display":"Relapse","accessLevel":"Public","annotation":[],"codeSystem":{"name":"CONDCLINSTATUS","annotation":[]}}]},"concepts":{"def":[{"name":"AllergyIntolerance Confirmed","display":"Confirmed","accessLevel":"Public","annotation":[],"code":[{"name":"AllergyIntolerance Confirmed code","annotation":[]}]},{"name":"AllergyIntolerance Active","display":"Active","accessLevel":"Public","annotation":[],"code":[{"name":"AllergyIntolerance Active code","annotation":[]}]},{"name":"Condition Confirmed","display":"Confirmed","accessLevel":"Public","annotation":[],"code":[{"name":"Condition Confirmed code","annotation":[]}]},{"name":"Condition Active","display":"Active","accessLevel":"Public","annotation":[],"code":[{"name":"Condition Active code","annotation":[]}]},{"name":"Condition Recurrence","display":"Recurrence","accessLevel":"Public","annotation":[],"code":[{"name":"Condition Recurrence code","annotation":[]}]},{"name":"Condition Relapse","display":"Relapse","accessLevel":"Public","annotation":[],"code":[{"name":"Condition Relapse code","annotation":[]}]}]},"statements":{"def":[{"name":"PeriodToInterval","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"If","annotation":[],"condition":{"type":"IsNull","annotation":[],"signature":[],"operand":{"name":"Period","type":"OperandRef","annotation":[]}},"then":{"type":"As","annotation":[],"signature":[],"operand":{"type":"Null","annotation":[]},"asTypeSpecifier":{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}},"else":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"name":"Period","type":"OperandRef","annotation":[]}}},"high":{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"name":"Period","type":"OperandRef","annotation":[]}}}}},"operand":[{"name":"Period","annotation":[],"operandTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"RangeToInterval","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"If","annotation":[],"condition":{"type":"IsNull","annotation":[],"signature":[],"operand":{"name":"Range","type":"OperandRef","annotation":[]}},"then":{"type":"As","annotation":[],"signature":[],"operand":{"type":"Null","annotation":[]},"asTypeSpecifier":{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}},"else":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"low","type":"Property","annotation":[],"source":{"name":"Range","type":"OperandRef","annotation":[]}}]},"high":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"high","type":"Property","annotation":[],"source":{"name":"Range","type":"OperandRef","annotation":[]}}]}}},"operand":[{"name":"Range","annotation":[],"operandTypeSpecifier":{"name":"{http://hl7.org/fhir}Range","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"Verified","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Observation","type":"Property","annotation":[]}},{"type":"List","annotation":[],"element":[{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"final","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"corrected","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"amended","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"WithUnit","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"unit","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Quantity","type":"NamedTypeSpecifier","annotation":[]}}}},{"name":"Unit","type":"OperandRef","annotation":[]}]},{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"code","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Quantity","type":"NamedTypeSpecifier","annotation":[]}}}},{"name":"Unit","type":"OperandRef","annotation":[]}]}]}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"Unit","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"ObservationLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}instant","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]},{"type":"Overlaps","annotation":[],"signature":[],"operand":[{"name":"PeriodToInterval","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]},{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"issued","scope":"Observation","type":"Property","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MostRecent","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Last","annotation":[],"signature":[],"source":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}instant","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"name":"issued","type":"IdentifierRef","annotation":[]}}]}}]}}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"FirstObservation","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"First","annotation":[],"signature":[],"source":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}instant","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"effective","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"name":"issued","type":"IdentifierRef","annotation":[]}}]}}]}}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"QuantityValue","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},"operand":[{"name":"Observation","annotation":[],"operandTypeSpecifier":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"ConceptValue","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}CodeableConcept","type":"NamedTypeSpecifier","annotation":[]}}]},"operand":[{"name":"Observation","annotation":[],"operandTypeSpecifier":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"FindDate","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}instant","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"issued","type":"Property","annotation":[],"source":{"name":"Observation","type":"OperandRef","annotation":[]}}}]},"operand":[{"name":"Observation","annotation":[],"operandTypeSpecifier":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"HighestObservation","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Max","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"return":{"annotation":[],"expression":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]}}}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"AverageObservation","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Avg","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Observation","annotation":[],"expression":{"name":"Observations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"return":{"annotation":[],"expression":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"value","scope":"Observation","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]}}}},"operand":[{"name":"Observations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Observation","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"Confirmed","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"verificationStatus","scope":"Condition","type":"Property","annotation":[]}]},{"name":"Condition Confirmed","type":"ConceptRef","annotation":[]}]}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveCondition","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"And","annotation":[],"signature":[],"operand":[{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"clinicalStatus","scope":"Condition","type":"Property","annotation":[]}]},{"name":"Condition Active","type":"ConceptRef","annotation":[]}]},{"type":"IsNull","annotation":[],"signature":[],"operand":{"path":"abatement","scope":"Condition","type":"Property","annotation":[]}}]}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveOrRecurring","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"clinicalStatus","scope":"Condition","type":"Property","annotation":[]}]},{"name":"Condition Active","type":"ConceptRef","annotation":[]}]},{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"clinicalStatus","scope":"Condition","type":"Property","annotation":[]}]},{"name":"Condition Recurrence","type":"ConceptRef","annotation":[]}]}]},{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"clinicalStatus","scope":"Condition","type":"Property","annotation":[]}]},{"name":"Condition Relapse","type":"ConceptRef","annotation":[]}]}]}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ConditionLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"onset","scope":"Condition","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"Overlaps","annotation":[],"signature":[],"operand":[{"name":"PeriodToInterval","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"onset","scope":"Condition","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]},{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"recordedDate","scope":"Condition","type":"Property","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MostRecentCondition","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Last","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"name":"recordedDate","type":"IdentifierRef","annotation":[]}}]}}]}}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"FirstCondition","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"First","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Condition","annotation":[],"expression":{"name":"Conditions","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"onset","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"name":"recordedDate","type":"IdentifierRef","annotation":[]}}]}}]}}},"operand":[{"name":"Conditions","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Condition","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"Completed","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Procedure","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ProcedureInProgress","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Procedure","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"in-progress","type":"Literal","annotation":[]}]}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ProcedurePerformance","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Not","annotation":[],"signature":[],"operand":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Procedure","type":"Property","annotation":[]}},{"type":"List","annotation":[],"element":[{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"preparation","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"not-done","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"entered-in-error","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"unknown","type":"Literal","annotation":[]}]}]}}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ProcedureLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"performed","scope":"Procedure","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"Overlaps","annotation":[],"signature":[],"operand":[{"name":"PeriodToInterval","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"performed","scope":"Procedure","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MostRecentProcedure","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Last","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}}]}}]}}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"FirstProcedure","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"First","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Procedure","annotation":[],"expression":{"name":"Procedures","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"type":"Coalesce","annotation":[],"signature":[],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"path":"value","type":"Property","annotation":[],"source":{"path":"start","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}}]}},{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"path":"end","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"performed","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}}}}]}}},"operand":[{"name":"Procedures","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Procedure","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ServiceRequestActiveOrCompleted","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"ServiceRequests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"type":"List","annotation":[],"element":[{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"ServiceRequests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}ServiceRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveOrCompletedServiceRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"ServiceRequests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"type":"List","annotation":[],"element":[{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"ServiceRequests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}ServiceRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ServiceRequestLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"ServiceRequests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"authoredOn","scope":"Request","type":"Property","annotation":[]}},{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}]}},"operand":[{"name":"ServiceRequests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}ServiceRequest","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"ActiveServiceRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"ServiceRequests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]}},"operand":[{"name":"ServiceRequests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}ServiceRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"CompletedServiceRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"ServiceRequests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}},"operand":[{"name":"ServiceRequests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}ServiceRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveMedicationStatement","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Statement","annotation":[],"expression":{"name":"Statements","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"EffectivePeriod","annotation":[],"expression":{"name":"PeriodToInterval","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Statement","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]}}],"relationship":[],"where":{"type":"And","annotation":[],"signature":[],"operand":[{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Statement","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]},{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"IsNull","annotation":[],"signature":[],"operand":{"type":"End","annotation":[],"signature":[],"operand":{"name":"EffectivePeriod","type":"QueryLetRef","annotation":[]}}},{"type":"After","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"End","annotation":[],"signature":[],"operand":{"name":"EffectivePeriod","type":"QueryLetRef","annotation":[]}},{"type":"Now","annotation":[],"signature":[]}]}]}]}},"operand":[{"name":"Statements","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationStatement","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveMedicationRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"Requests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]}},"operand":[{"name":"Requests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveOrCompletedMedicationRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"Requests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]},{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"Requests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveOrCompletedMedicationStatement","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Statement","annotation":[],"expression":{"name":"Statements","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Statement","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]},{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Statement","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"Statements","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationStatement","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveCompletedOrStoppedMedicationRequest","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"Requests","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]},{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}]},{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Request","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"stopped","type":"Literal","annotation":[]}]}]}},"operand":[{"name":"Requests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationRequest","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"MedicationRequestLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Request","annotation":[],"expression":{"name":"Requests","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"authoredOn","scope":"Request","type":"Property","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}},"operand":[{"name":"Requests","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationRequest","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MedicationStatementLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Statement","annotation":[],"expression":{"name":"Statements","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Statement","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"Overlaps","annotation":[],"signature":[],"operand":[{"name":"PeriodToInterval","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"effective","scope":"Statement","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]}},"operand":[{"name":"Statements","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationStatement","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MedicationDispenseLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Dispense","annotation":[],"expression":{"name":"Dispenses","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"whenHandedOver","scope":"Dispense","type":"Property","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"whenPrepared","scope":"Dispense","type":"Property","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]}},"operand":[{"name":"Dispenses","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}MedicationDispense","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"InProgress","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Encounter","annotation":[],"expression":{"name":"Encounters","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Encounter","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"in-progress","type":"Literal","annotation":[]}]}},"operand":[{"name":"Encounters","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Encounter","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"EncounterLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Encounter","annotation":[],"expression":{"name":"Encounters","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"Overlaps","annotation":[],"signature":[],"operand":[{"name":"ToInterval","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[{"name":"{http://hl7.org/fhir}Period","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"period","scope":"Encounter","type":"Property","annotation":[]}]},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}},"operand":[{"name":"Encounters","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Encounter","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"ActiveOrConfirmedAllergyIntolerance","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Allergy","annotation":[],"expression":{"name":"AllergyIntolerances","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"clinicalStatus","scope":"Allergy","type":"Property","annotation":[]}]},{"name":"AllergyIntolerance Active","type":"ConceptRef","annotation":[]}]},{"type":"Equivalent","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Concept","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"ToConcept","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"path":"verificationStatus","scope":"Allergy","type":"Property","annotation":[]}]},{"name":"AllergyIntolerance Confirmed","type":"ConceptRef","annotation":[]}]}]}},"operand":[{"name":"AllergyIntolerances","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}AllergyIntolerance","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"GoalLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Goal","annotation":[],"expression":{"name":"Goals","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}},{"identifier":"StartDate","annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"start","scope":"Goal","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}date","type":"NamedTypeSpecifier","annotation":[]}}}},{"identifier":"StatusDate","annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"path":"statusDate","scope":"Goal","type":"Property","annotation":[]}}},{"identifier":"TargetDates","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Target","annotation":[],"expression":{"path":"target","scope":"Goal","type":"Property","annotation":[]}}],"let":[],"relationship":[],"return":{"annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"due","scope":"Target","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}date","type":"NamedTypeSpecifier","annotation":[]}}}}}},{"identifier":"TargetQuantities","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Target","annotation":[],"expression":{"path":"target","scope":"Goal","type":"Property","annotation":[]}}],"let":[],"relationship":[],"return":{"annotation":[],"expression":{"name":"ToQuantity","libraryName":"FHIRHelpers","type":"FunctionRef","annotation":[],"signature":[],"operand":[{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"due","scope":"Target","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}Duration","type":"NamedTypeSpecifier","annotation":[]}}]}}}}],"relationship":[],"where":{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"Or","annotation":[],"signature":[],"operand":[{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"type":"ToDateTime","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Date","type":"NamedTypeSpecifier","annotation":[]}],"operand":{"name":"StartDate","type":"QueryLetRef","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]},{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"type":"ToDateTime","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Date","type":"NamedTypeSpecifier","annotation":[]}],"operand":{"name":"StatusDate","type":"QueryLetRef","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}]},{"type":"Exists","annotation":[],"signature":[],"operand":{"type":"Query","annotation":[],"source":[{"alias":"Date","annotation":[],"expression":{"name":"TargetDates","type":"QueryLetRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"type":"ToDateTime","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Date","type":"NamedTypeSpecifier","annotation":[]}],"operand":{"name":"Date","type":"AliasRef","annotation":[]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}}}]},{"type":"Exists","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}],"operand":{"type":"Query","annotation":[],"source":[{"alias":"Quantity","annotation":[],"expression":{"name":"TargetQuantities","type":"QueryLetRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"type":"ToDateTime","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Date","type":"NamedTypeSpecifier","annotation":[]}],"operand":{"type":"Add","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}Date","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"name":"StartDate","type":"QueryLetRef","annotation":[]},{"name":"Quantity","type":"AliasRef","annotation":[]}]}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}}}]}},"operand":[{"name":"Goals","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Goal","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"CompletedImmunization","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Immunization","annotation":[],"expression":{"name":"Immunizations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Immunization","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"completed","type":"Literal","annotation":[]}]}},"operand":[{"name":"Immunizations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ImmunizationLookBack","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Immunization","annotation":[],"expression":{"name":"Immunizations","type":"OperandRef","annotation":[]}}],"let":[{"identifier":"LookBackInterval","annotation":[],"expression":{"lowClosed":true,"highClosed":true,"type":"Interval","annotation":[],"low":{"type":"Subtract","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"type":"Now","annotation":[],"signature":[]},{"name":"LookBack","type":"OperandRef","annotation":[]}]},"high":{"type":"Now","annotation":[],"signature":[]}}}],"relationship":[],"where":{"type":"In","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]},{"type":"IntervalTypeSpecifier","annotation":[],"pointType":{"name":"{urn:hl7-org:elm-types:r1}DateTime","type":"NamedTypeSpecifier","annotation":[]}}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"path":"occurrence","scope":"Immunization","type":"Property","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBackInterval","type":"QueryLetRef","annotation":[]}]}},"operand":[{"name":"Immunizations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}},{"name":"LookBack","annotation":[],"operandTypeSpecifier":{"name":"{urn:hl7-org:elm-types:r1}Quantity","type":"NamedTypeSpecifier","annotation":[]}}]},{"name":"MostRecentImmunization","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Last","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Immunization","annotation":[],"expression":{"name":"Immunizations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"occurrence","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}}}]}}},"operand":[{"name":"Immunizations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"FirstImmunization","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"First","annotation":[],"signature":[{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}],"source":{"type":"Query","annotation":[],"source":[{"alias":"Immunization","annotation":[],"expression":{"name":"Immunizations","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"sort":{"annotation":[],"by":[{"direction":"asc","type":"ByExpression","annotation":[],"expression":{"path":"value","type":"Property","annotation":[],"source":{"strict":false,"type":"As","annotation":[],"signature":[],"operand":{"name":"occurrence","type":"IdentifierRef","annotation":[]},"asTypeSpecifier":{"name":"{http://hl7.org/fhir}dateTime","type":"NamedTypeSpecifier","annotation":[]}}}}]}}},"operand":[{"name":"Immunizations","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Immunization","type":"NamedTypeSpecifier","annotation":[]}}}]},{"name":"ActiveDevice","context":"Unfiltered","accessLevel":"Public","type":"FunctionDef","annotation":[],"expression":{"type":"Query","annotation":[],"source":[{"alias":"Device","annotation":[],"expression":{"name":"Devices","type":"OperandRef","annotation":[]}}],"let":[],"relationship":[],"where":{"type":"Equal","annotation":[],"signature":[{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]},{"name":"{urn:hl7-org:elm-types:r1}String","type":"NamedTypeSpecifier","annotation":[]}],"operand":[{"path":"value","type":"Property","annotation":[],"source":{"path":"status","scope":"Device","type":"Property","annotation":[]}},{"valueType":"{urn:hl7-org:elm-types:r1}String","value":"active","type":"Literal","annotation":[]}]}},"operand":[{"name":"Devices","annotation":[],"operandTypeSpecifier":{"type":"ListTypeSpecifier","annotation":[],"elementType":{"name":"{http://hl7.org/fhir}Device","type":"NamedTypeSpecifier","annotation":[]}}}]}]}}}