Stream: mapping-framework
Topic: StructureMap "as produced"
Alexander Zautke (Feb 11 2021 at 14:23):
Resulting from the discussion about local let statements (see https://chat.fhir.org/#narrow/stream/181579-mapping-framework/topic/FHIR.20Mapping.20language.20in.20real.20world.20applications), we reached the conclusion for the .NET implementation that it makes more sense to declare target variables in a group which can act like a local let statement.
For example: group LocalLetTest(source src: MySrc, target tgt: MyTgt, target myLet : <type>)
. In this case a mapping rule could use "myLet" as a local variable and store some result within the scope of the group.
Looking at https://www.hl7.org/fhir/mapping-language.html#typing, we would also have the option to use "as produced", which is exactly what would be needed here. However, "produced" is currently only used in StructureMap.structure.mode and not in StructureMap.group.input.mode. Would it make sense to extend this and use "produced" like optional parameters which can occur at the end of a group? The engine could then create the instances of the defined type on-demand but you wouldn't need to provide when calling the group.
Last updated: Apr 12 2022 at 19:14 UTC