FHIR Chat · (no topic) · cimpl

Stream: cimpl

Topic: (no topic)


view this post on Zulip Kurt Allen (Sep 25 2019 at 19:42):

This is kinda a follow on to my previous sliceing question.
I get the following error when I try to slice Observation.hasMember
ERROR 13046: 'Mapping to undefined parameter 's hasMember (slice # = 1): slice could not be found.'

My code is as follows.

Observation:
Entry: Observation
Property: HasMemberSlices 0..1

Group: HasMemberSlices
Property: HasMemberSlice 0..*
// ConvertFhirClass.cs:340
Group: HasMemberSlice
Property: HasMember 1..1
// ConvertFhirClass.cs:343
Element: HasMember
Value: fhir.observation.Observation
or fhir.questionnaireresponse.QuestionnaireResponse
or fhir.molecularsequence.MolecularSequence

Entry: BreastRadiologyObservation
Parent: Observation
HasMemberSlices.HasMemberSlice
includes PatientHistory 0..1

Group: PatientHistory
Parent: HasMemberSlice
HasMember only BreastRadiologyObservationPatientHistory

Entry: BreastRadiologyObservationPatientHistory
Parent: Observation

and my mapping file is

BreastRadiologyObservation maps to Observation:
HasMemberSlices.PatientHistory.HasMember maps to hasMember (slice # = 1)

What am I doing wrong??
Thanks in advance!
Kurt A.

Observation.txt Observation_map_r4.txt
BreastRadiologyObservation.txt BreastRadiologyObservation_map.r4.txt BreastRadiologyObservationPatientHistory.txt

view this post on Zulip Chris Moesel (Sep 25 2019 at 21:01):

So the basic error is that the slice # construct is only used to map something to an existing slice in an existing profile. For example, if your class mapped to the official FHIR BP file, you could map your elements to the existing SystolicBP and DiastolicBP slices by their numbers (the order in which they show up in the profile).

In your case, there is no existing profile w/ slices, so the slice # construct doesn't apply. You would need to use one of the other constructs. There is slicing documentation here: http://standardhealthrecord.org/cimpl-doc/#cimpl6LanguageReference/#slicing (but beware, it's complicated!).

That said, I'm not sure if the current structure you've laid out will work well with how we slice anyway. I think the the target being a choice of Observation, QuestionnaireResponse, or MolecularSequence makes things trickier. @Mark Kramer -- any ideas for how to model this? Because of the choice, I don't think we can use "includes", although I may be wrong.

view this post on Zulip Kurt Allen (Sep 25 2019 at 22:46):

@Chris Moesel and @Mark Kramer I can constrain the choice to be just observation (the base code was auto generated from the fhir structure def's), so I could derive from the base class and constrain that field.
It is kinda a problem that hasMember is not a backbone element with a Code associated with each instance. @Mark Kramer Is this worthy of a request to the Fhir Gods?


Last updated: Apr 12 2022 at 19:14 UTC