Stream: shorthand
Topic: Duplicate codes in Sushi generated example
Nathan Davis (Jan 19 2022 at 22:36):
I have a profile in which I set the Observation.code to a LOINC code (patternCodeableConcept by default). Code snippet...
Profile: BodyMassIndex
Parent: BMI
...
* code = LNC#39156-5
I have an example of this profile that gives instance data for it.....
Instance: bmi-example
InstanceOf: BodyMassIndex
Description: "Body Mass Index example"
...
* code = LNC#39156-5 "Body mass index (BMI) [Ratio]"
Sushi then generates the example with both codes in it.
"code": {
"coding": [
{
"code": "39156-5",
"system": "http://loinc.org",
"display": "Body mass index (BMI) [Ratio]"
},
{
"system": "http://loinc.org",
"code": "39156-5"
}
]
},
I appropriately get an error when running the publisher that there are too many Observation.code instances. What am I doing wrong?
Chris Moesel (Jan 19 2022 at 23:10):
Hi @Nathan Davis. I think you stumbled upon a recently discovered bug in SUSHI (see SUSHI#1008). Basically, in some cases, if a profile fixes a value to an element, but the parent profile has also already fixed the same values, then SUSHI will output both values in instances of the child profile. Now, ideally SUSHI should handle this, but currently it does not.
The best way to avoid this bug is by not re-specifying fixed values for elements that are already properly fixed to a value. In your case, you're setting code
to the LOINC code for BMI, but this is probably not necessary, because I think your parent profile (BMI
) has already done that. So... if you remove the line that fixes code
to LNC#39156-5
, then this problem goes away (and your profile still requires it - but it just inherits it from the parent instead). If that is an acceptable solution, then I recommend it.
Last updated: Apr 12 2022 at 19:14 UTC