Stream: implementers
Topic: Using FHIR Path in FHIR Mapping
Ivan Dubrov (Sep 17 2018 at 20:04):
FHIR Mapping (StructureMap) allows executing FHIR Paths against values.
I have few questions:
1. Is it allowed for FHIR Path to return a complex object? For example, what if I have mapping like "for src.XYZ as xyz make tgt.name = ($xyz.name)", can "$xyz.name" return the whole HumanName? It feels weird because the result is extracted from the "source" universe and is directly assigned to the "target" universe (which could be separate universes: like STU3 vs DSTU2).
2. What if it is just assigned to a variable? Would that be ok? Like "for src.XYZ as xyz make ($xyz.name) as tmpname then { for tmpname make tgt.name }"
3. Or maybe FHIR Path in this case should only be limited to returning "primitive" values?
Lloyd McKenzie (Sep 17 2018 at 21:29):
@Grahame Grieve ?
Grahame Grieve (Sep 17 2018 at 23:33):
I do not know. I think that the type must match. I guess it could be subject to implicit type based conversion, but I don't think I've implemented that or that we describe it
Grahame Grieve (Sep 17 2018 at 23:33):
2 could be a variable? I'm not sure
Ivan Dubrov (Sep 17 2018 at 23:59):
From EpisodeOfCare.map:
"EpisodeOfCare-careTeam" : for src.team as vs where reference.resolve().exists() make (src.team.reference.resolve()) as ct then epiCareTeam(ct, tgt)
So it seems like at least there are cases (taken from FHIR SVN repository) where it is assigned to a variable...
Grahame Grieve (Sep 18 2018 at 00:00):
indeed. that must work then as well. Is it documented?
Last updated: Apr 12 2022 at 19:14 UTC