-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slicing on non-array elements #5644
Comments
Hi @albertsaradin — great find! This is an interesting mismatch between the FHIR spec indicating that slicing is applicable to "an element that may occur more than once (e.g. in a list)" and the Smoking Status profile using a slice on an element with maximum cardinality of 1. We'll look into what it would take to support this nonstandard case |
Quick follow up: I was able to step through our code and it looked to me like the Separately, I think that the current version of the Smoking Status profile (STU7) is not well-defined. The relevant bits of the profile {
"id" : "Observation.value[x]",
"path" : "Observation.value[x]",
"slicing" : {
"discriminator" : [{
"type" : "type",
"path" : "$this"
}],
"ordered" : false,
"rules" : "open"
},
"min" : 1,
"max" : "1",
"base" : {
"path" : "Observation.value[x]",
"min" : 0,
"max" : "1"
},
"type" : [
{ "code" : "Quantity" },
{ "code" : "CodeableConcept" },
{ "code" : "string" },
{ "code" : "boolean" },
{ "code" : "integer" },
{ "code" : "Range" },
{ "code" : "Ratio" },
{ "code" : "SampledData" },
{ "code" : "time" },
{ "code" : "dateTime" },
{ "code" : "Period" }
]
}
{
"id" : "Observation.value[x]:valueQuantity",
"path" : "Observation.value[x]",
"sliceName" : "valueQuantity",
"min" : 0,
"max" : "1",
"base" : {
"path" : "Observation.value[x]",
"min" : 0,
"max" : "1"
},
"type" : [{ "code" : "Quantity" }],
"binding" : {
"strength" : "required",
"valueSet" : "http://terminology.hl7.org/ValueSet/v3-UnitsOfMeasureCaseSensitive"
}
}
{
"id" : "Observation.value[x]:valueCodeableConcept",
"path" : "Observation.value[x]",
"sliceName" : "valueCodeableConcept",
"min" : 0,
"max" : "1",
"base" : {
"path" : "Observation.value[x]",
"min" : 0,
"max" : "1"
},
"type" : [{ "code" : "CodeableConcept" }],
"binding" : {
"strength" : "extensible",
"valueSet" : "http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1267.3"
}
} While this looks like it should restrict the field to two specific types, I don't believe it will work as intended. The use of optional (minimum cardinality 0) slices without restricting |
Hi @mattwiller , Thank you for following up! It throws error and doesn't validates when I try. I attempted to debug the issue (though I'm not very experienced). The error I encountered is
I used the latest medplum from the github. |
Hi @mattwiller, Thank you! You're fast man! I tried the code, and it works great. However, there's a small UI problem. I'm not sure if we should create a separate issue or mention it here. FYI, please go to the app: The Value [CodeableConcept] should show the binding valueset, but unfortunately, it doesn't. I hope that is also as easy to fix as this one! |
Hi team, Great work!
I was trying to use the US Core Smoking Status profile and encountered an issue with Medplum: Slicing can only happen on arrays.
The Smoking Status profile defines slices on value[x], which is not an array. Is there an issue there?
The text was updated successfully, but these errors were encountered: