Stream: implementers
Topic: Make a CodeSystem
Brian Reinhold (Sep 18 2018 at 13:34):
I need to make a CodeSystem for a PHD IG. I am not sure exactly how to do it and how I should reference it in profiled resources. I suppose the latter depends upon where it will be located.
In any case I have started a CodeSystem structure definition for medical device BITs measurements. I would like to ask any experts whether my structure definition seems correct. The Code System contains a code which represents a binary value (set or cleared). The code is either an event or a state. A defined event only occurs when the item is set.
If the Structure definition below looks good, then I know I can start the tedious chore of adding about 100 more concepts. When that is all done, I need to figure out how to reference it from a ValueSet, a coding.system element, and a Binding.
<?xml version="1.0" encoding="UTF-8"?> <CodeSystem xmlns="http://hl7.org/fhir"> <id value="example"/> <meta> <profile value="http://hl7.org/fhir/StructureDefinition/shareablecodesystem"/> </meta> <text> </text> <version value="20160128"/> <name value="ASN1ToHL7"/> <status value="draft"/> <experimental value="true"/> <date value="2018-09-18"/> <publisher value="Health Level Seven International (Health Care Devices Work Group)"/> <description value="Maps IEEE 11073 ASN1 BITS measurements to codes. All these codes have two possible values, set or cleared. The code may either represent an event or a state. When an event, the defined event has occured when set. If a state, the described item is either set or cleared. Sometimes the states may be defined in unexpected manners. For example, the regulation state when set is unregulated and when cleared it is regulated. In addition the code may derive from an IEEE 11073 attribute or from a measurement."/> <!-- The codes are strings but consist of only digits and a decimal point. They do not represent decimal numbers --> <caseSensitive value="true"/> <content value="complete"/> <!-- The following code concepts are derived from the MDC_ATTR_POWER_STAT MDS attribute --> <concept> <code value="67925.0"/> <display value="Mains power state"/> <definition value="Indicates whether the PHD is on or off mains power"/> <property> <code value="parent" /> <valueString value="state" /> </property> <property> <code value="parent" /> <valueString value="attribute" /> </property> </concept> </CodeSystem>
I thank the experts for any guidance here!
Lloyd McKenzie (Sep 18 2018 at 14:53):
What you're creating here isn't a StructureDefinition, it's just a CodeSystem. If it's for production use, don't mark it as experimental. What's the purpose of the "parent" property?
Brian Reinhold (Sep 18 2018 at 19:54):
What you're creating here isn't a StructureDefinition, it's just a CodeSystem. If it's for production use, don't mark it as experimental. What's the purpose of the "parent" property?
@Lloyd McKenzie I am not sure. I could not understand what was meant by that code in the docs. The only example I found which had a property element in it used 'parent'. I assumed it meant it was a property of the code being defined in the <concept> element. All I am trying to do is to state whether the code represents an item that is an event or a state. It would seem that it would be some type of property. The property.code is required so I had to put something in there. It was a best-guess attempt. Its actually a very simple code system.
Lloyd McKenzie (Sep 18 2018 at 19:56):
Normally subsumption is shown by the code system hierarchy. property.code is required but property isn't - why are you adding properties at all?
Brian Reinhold (Sep 18 2018 at 19:56):
Normally subsumption is shown by the code system hierarchy. property.code is required but property isn't - why are you adding properties at all?
I am trying to specify if the code represents an event or a state
Do I make a CodeSystem.property defining a 'state' and one defining an 'event' and reference that from the concept?
Grahame Grieve (Sep 18 2018 at 20:09):
one property for type, and use values 'state' and 'event'
Brian Reinhold (Sep 18 2018 at 20:50):
one property for type, and use values 'state' and 'event'
@Grahame Grieve I am quite confused. Is this the correct track?
Set of properties that describe something about the code:
<property> <code value="event" /> <description value="Indicates that the code represents an event" /> <type value="code" /> </property> <property> <code value="state" /> <description value="Indicates that the code represents a state" /> <type value="code" /> </property> <property> <code value="measurement" /> <description value="Indicates that the code is a measurement" /> <type value="code" /> </property> <property> <code value="attribute" /> <description value="Indicates that the code comes from a 11073 attribute that further describes something about the device or a measurement" /> <type value="code" /> </property> <property> <code value="event" /> <description value="Indicates that the code represents an event" /> <type value="code" /> </property> <property> <code value="state" /> <description value="Indicates that the code represents a state" /> <type value="code" /> </property> <property> <code value="measurement" /> <description value="Indicates that the code is a measurement" /> <type value="code" /> </property> <property> <code value="attribute" /> <description value="Indicates that the code comes from a 11073 attribute that further describes something about the device or a measurement" /> <type value="code" /> </property>
Now how would I reference these properties in my code definitions?
<concept> <code value="67925.0"/> <display value="Mains power state"/> <definition value="Indicates whether the PHD is on or off mains power"/> <property> <code value="state?" /> <valueString value="?" /> <!-- What goes here? --> </property> <property> <code value="attribute?" /> <valueString value="?" /> </property> </concept>
Grahame Grieve (Sep 18 2018 at 20:54):
on the code system:
<property> <code value="type"/> <description value="Indicates that type of thing the code represents: event, measurement, or state" /> <type value="code"/> </property>
Grahame Grieve (Sep 18 2018 at 20:54):
and then on a concept:
Grahame Grieve (Sep 18 2018 at 20:55):
<concept> <code value="67925.0"/> <display value="Mains power state"/> <definition value="Indicates whether the PHD is on or off mains power"/> <property> <code value="type" /> <valueCode value="state"/> </property> </concept>
Brian Reinhold (Sep 18 2018 at 20:55):
THANKS! So now I go with this
<!-- These properties indicate the type and source of the code --> <property> <code value="type" /> <description value="Indicates that the code type is an event or state" /> <type value="code" /> </property> <property> <code value="source" /> <description value="Indicates that the code originates from a measurement or an attribute that further describes a measurement or the sensor device." /> <type value="code" /> </property> <!-- The following code concepts are derived from the MDC_ATTR_POWER_STAT MDS attribute --> <concept> <code value="67925.0"/> <display value="Mains power state"/> <definition value="Indicates whether the PHD is on or off mains power"/> <property> <code value="type" /> <valueString value="state" /> </property> <property> <code value="source" /> <valueString value="attribute" /> </property> </concept>
Last updated: Apr 12 2022 at 19:14 UTC