Stream: mapping-framework
Topic: Extension on effective with FHIR Mapping Language
Alexander Dimitrov (Apr 03 2021 at 18:00):
Hello, I'm trying to map the data-absent-reason extension on the effective Element from the IPS profile with the FHIR mapping language:
Bildschirmfoto-2021-04-03-um-19.50.14.png
I'm not really sure how exactly to do this, but here is how I tried:
src -> tgt.effective = create('extension') as dataAbsentReason
Unfortunately, I am getting the following error:
<diagnostics value="Failed to call access method: org.hl7.fhir.exceptions.FHIRException: Exception executing transform tgt.effective = create('extension') as dataAbsentReason on Rule "effectiveTime-width": null"></diagnostics>
Does anyone know how to fill the data-absent-reason extension on effective with the FHIR Mapping Language? Thanks in advance!
Oliver Egger (Apr 03 2021 at 19:25):
can you provide the map somewhere? I think you are a level to high, maybe try:
src -> tgt.effective = create('Period') as effective, effective.extension as dataAbsenReson, ...
Alexander Dimitrov (Apr 04 2021 at 07:41):
thanks for the help @Oliver Egger, I changed the rule to the following and it seems to be generating it correctly now:
substanceAdministration.effectiveTime as effectiveTime where (width.where(value.exists())) -> tgt.effective = create('Period') as effective then {
effectiveTime.width as width -> effective.extension as dataabsentReason, dataabsentReason.url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason', dataabsentReason.value = create('code') as code then {
width -> code.value = 'unknown' "code-value";
}"coding";
}"effectiveTime-width";
Snippet of the generated resource:
Bildschirmfoto-2021-04-04-um-09.40.21.png
Oliver Egger (Apr 04 2021 at 08:59):
@Alexander Dimitrov now you only have to decide if you want to have an effectivePeriod or an effectiveDateTime which is unknown :grinning:
Last updated: Apr 12 2022 at 19:14 UTC