FHIR Chat · How can populate the property for a codesystem ? · shorthand

Stream: shorthand

Topic: How can populate the property for a codesystem ?


view this post on Zulip Anup Rai (Mar 17 2021 at 11:47):

I am trying to populate the CodeSystem.property field.

  • ^property[0].code = #ErsterTagMitAbschlag
  • ^property[0].type = http://hl7.org/fhir/concept-property-type#integer
    runs without error however does not populate the Codesystem resource. Am I using a wrong syntax ? Is filling property in CodeSystem supported at all ?

Thanks in advance.
Anup

view this post on Zulip Chris Moesel (Mar 17 2021 at 12:48):

Hi @Anup Rai. It should be possible to populate the top-level property in a CodeSystem -- and the way you are doing it is correct if you are using the FSH CodeSystem grammar. That said, the FSH CodeSystem grammar does not support setting property values on each specific concept (although we hope to support that in FSH STU2). So... if you also need to set concept.property then you must define your CodeSystem using the Instance grammar.

This link brings you to FSH Online w/ working examples of setting the top-level property using the CodeSystem grammar and doing the same, plus concept.property, using the Instance grammar: https://fshschool.org/FSHOnline/#/share/30Oe1GU

view this post on Zulip Anup Rai (Mar 17 2021 at 16:56):

Hi @Chris Moesel thanks a lot for a quick response. I am now resorting to the InstanceOf syntax. Thanks a lot for looking into and a quick solution for the problem.

view this post on Zulip Martin Höcker (Apr 15 2021 at 10:51):

Hi @Chris Moesel , we ran into a small issue when trying to use the CodeSystem that was created with InstanceOf (https://fshschool.org/FSHOnline/#/share/2Ry70sl):

// Authoring a CodeSystem using Instance to allow for concept.property
Instance: AdvancedMarriageForms
InstanceOf: CodeSystem
Usage: #definition
* name = "AdvancedMarriageForms"
* title = "Advanced Marriage Forms"
* url = AdvancedMarriageForms
* status = #active
* content = #complete
* property.code = #AmicableSplit
* property.type = #boolean
* concept[+].code = #its-complicated
* concept[=].display = "it's complicated"
* concept[=].property.code = #AmicableSplit
* concept[=].property.valueBoolean = false

Instance: PatientTest
InstanceOf: Patient
* maritalStatus = AdvancedMarriageForms#half-married

This leads to the error: Resolved value "AdvancedMarriageForms" is not a valid URI.. As a workaround, we introduced

Alias: AdvancedMarriageForms = http://codesystem.com/test

This works, but now we have the name AdvancedMarriageForms occuring twice in our FSH project: Once for the CodeSystem, and another time for the Alias. Is this legal and "safe", or is there maybe a better workaround?

view this post on Zulip Martin Höcker (Apr 15 2021 at 11:26):

Ahh, I found an issue with our workaround: Often, CodeSystem and ValueSet share the same .name. When we introduce a ValueSet with the name AdvancedMarriageForms and use it in a profile, then SUSHI picks up the alias (that points to the CodeSystem) instead of the ValueSet: https://fshschool.org/FSHOnline/#/share/3tn51VZ

view this post on Zulip Chris Moesel (Apr 15 2021 at 12:43):

Hi @Martin Höcker. Once you have an Alias, a CodeSystem, and a ValueSet all with the same name, then things can get a bit tricky and confusing when referring to things by that name. Sometimes SUSHI can figure it out and sometimes it can't. I think there are probably things we can do to make SUSHI smarter here, and maybe it would solve this problem, but for now, I'd suggest just giving the alias a different name (e.g., AdvancedMarriageFormsCS).

One thing we will be implementing soon is that when you create #definition instances for items that can hold a canonical URL (like CodeSystem), SUSHI will autopopulate the url based on the canonical of the IG. I'm not sure if that will 100% help you in this case, but it might. I think that we also need to update SUSHI to look in Instances when resolving the system part of System#Code.


Last updated: Apr 12 2022 at 19:14 UTC