FHIR Chat · mapping language -- Tutorial glitch? · implementers

Stream: implementers

Topic: mapping language -- Tutorial glitch?


view this post on Zulip Joe Kesselman (Jan 29 2020 at 14:40):

I've been looking at the description of the FHIR Mapping tool. It's mostly making sense to me, though its selection approach is driven by explicit context iterations. Personally I prefer the recursion/predicate/modes model used in XSLT, but this can be made to work. (And yes, as someone who as worked on an XSLT implementation, I know I'm biased.)

The tutorial is, obviously, incomplete at this time -- but I have a few questions about the last section that has been written (#13), where it's mapping from a set of values, to a set of references to values stored separately.

src.f1 as s_f1 -> create("TRight2") as rr, tgt.ptr = reference(rr) then {
s_f1 -> rr.f2 = srcff;
};

First, the mapping statement is copying s_f1 to rr.f2, but there's no f2 in the target illustration. I presume that's a typo and they meant to say rr.f1 (or TRight2 was supposed to have an f2 child rather than the f1 shown).

Second, the description says "This mapping statement makes use a special known value "null" for the target context to indicate that the created element/object of type "TRight2" doesn't get added to any existing target context." I don't see null in the sample statement. Is that implicit in the create(), or did something get left out?

Third, there's no explanation of the " = srcff" clause. Was that supposed to be "= s_f1", or is there something else going on here?

view this post on Zulip Lloyd McKenzie (Jan 29 2020 at 16:22):

@Grahame Grieve

view this post on Zulip Alexander Zautke (Jan 30 2020 at 06:21):

My interpretation would be that "target context" refers to StructureMap.group.rule.target.context. The context is in many cases the variable / type name to which the rule applies. For example, given "src.f1 as s_f1 -> tgt.example = create('TRight') as rr" the context for the create function would be "tgt". However, I don't see it documented anywhere that in this case the context should be "null". When converting the mapping language to StructureMap you can leave it out as the element is optional.

view this post on Zulip Alexander Zautke (Jan 30 2020 at 06:25):

The last part should be "s_f1 -> rr.f1 = s_f1;". The simple form ("s_f1 -> rr.f1;") can't be used as "s_f1" might be repeating.

view this post on Zulip Alexander Zautke (Jan 30 2020 at 06:38):

And all parameter passed as a string in the the tutorial should be using single instead of double quotes.


Last updated: Apr 12 2022 at 19:14 UTC