Stream: mapping-framework
Topic: where condition on target instance within source content
Alexander Dimitrov (Apr 26 2021 at 17:16):
Hi! Is it possible to have a where condition on a target instance (in my example bundle) within the source content (part before the '->')?
Example:
group GenerateMedicationStatement(source supply : ClinicalDocument, target tgt : MedicationStatement, target patientResource : Patient, target bundle : Bundle) {
supply.author where(bundle.entry.resource.organization.exists()) -> bundle.entry as entry,
...... .......
}
If it is possible, how should I modify the where part from my example, so that the where condition works on the target instance within the source content?
Thanks in advance!
Oliver Egger (Apr 26 2021 at 17:57):
i don't think this is or should be possible, the where applies to the source context.
Alexander Dimitrov (Apr 26 2021 at 18:27):
okay, thanks for the response!
and is it allowed to do this within the target context (part after the '->')? in my tests it unfortunately didnt seem to work
I'm asking because I would want to use such a condition, so that for example the FHIR Mapping Language does not create new Organization resources, if there is already an existing one with the same identifier within my bundle of resources
Oliver Egger (Apr 26 2021 at 18:52):
you don't have a where in the target transform https://www.hl7.org/fhir/mapping-language.html
Alexander Zautke (Apr 26 2021 at 19:12):
At least in the .NET implementation you can use “%tgt” as a variable in your source where statement. Not sure if this works in Java, too.
Last updated: Apr 12 2022 at 19:14 UTC