FHIR Chat · lookup section by id · mapping-framework

Stream: mapping-framework

Topic: lookup section by id


view this post on Zulip Roeland Luykx (Oct 29 2021 at 13:43):

Hi
i have a bundle within a composition resource. in this composition with sections and subsections defined. now i need to add a reference to a specific subsection identified by its id somewhere in a rule in my mapper without to reference the specific section as param.
i tried somthing like this:
group MyRule(source item : BackboneElement, source section : Section, target bundle : Bundle ){
section.section as subsec where (id.value = 'subsection-id'), item as it -> bundle.entry as e,
e.resource = create('Observation') as observ,
observ.id = uuid() as uuid,
observ.code as codeable,
codeable.coding as coding,
coding.system = 'http://mycodesysytem.com/cs',
coding.code = 'question',
e.fullUrl = append('urn:uuid:', uuid),
subsec.entry = create('Reference') as reference,
reference.type = 'Observation',
reference.reference = append('urn:uuid:',uuid) then {
it.text as txt -> observ.note as note, note.text = txt;
it.answer as answ then {
answ.value as val -> observ.value = val;
} "value";
} "reference";
}
the transformation to the StructureMap works wihout errors but the transformation gives me
"Failed to call access method: org.hl7.fhir.exceptions.FHIRException: Rule \"reference\": not handled yet"

somebody an idea what to do? or is this not possible?

view this post on Zulip Lloyd McKenzie (Oct 29 2021 at 13:55):

@Grahame Grieve

view this post on Zulip Roeland Luykx (Oct 29 2021 at 14:12):

one of the problems is for sure the section is source and also target.....
in principle i miss a target lookup

view this post on Zulip Oliver Egger (Oct 29 2021 at 14:15):

on which rule is it failing within the rule "reference"?

view this post on Zulip Oliver Egger (Oct 29 2021 at 14:15):

you cannot mix source and target ...


Last updated: Apr 12 2022 at 19:14 UTC