In the query mentioned in https://github.com/bzkf/orwdp/issues/8, the expression C.stage.assessment.reference evaluates to a list. If that list actually contains more than one element, the evaluation fails. The solution would be to use contains instead of =.
library Test
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
codesystem icd10: 'http://fhir.de/CodeSystem/bfarm/icd-10-gm'
codesystem loinc: 'http://loinc.org'
context Patient
define "TNMp 21902-2":
[Observation: Code '21902-2' from loinc]
define Criterion:
exists (from [Condition: Code 'C50.0' from icd10] C
with "TNMp 21902-2" O
such that C.stage.assessment.reference = 'Observation/' + O.id)
define InInitialPopulation:
Criterion
In the query mentioned in https://github.com/bzkf/orwdp/issues/8, the expression
C.stage.assessment.reference
evaluates to a list. If that list actually contains more than one element, the evaluation fails. The solution would be to usecontains
instead of=
.