FHIR Chat · disciminator not discriminating · IG creation

Stream: IG creation

Topic: disciminator not discriminating


view this post on Zulip Brian Reinhold (Nov 26 2018 at 14:02):

I am trying to slice on the Device.identifier. One slice represents the IEEE system id. The other slice the transport address. To do so the discriminator slices on value with the path pointing to the identifier.type. In the system id slice, the type is bound to a value set that only contains the single code "SYSID" from an IG-defined code system called ContinuaDeviceIdenfiers. The transport slice binds to a value set that contains 3 codes all representing different types of transports. These value sets and code system look correct in the Artifacts page of the rendered guide.

Yet the validator does not discriminate between the slices and I don't know why. It gives me this error

Device/phd-711000FEFF5F49B0.B0495F001071: Device.identifier[1]  error   Profile http://hl7.org/fhir/uv/phd/StructureDefinition/PhdDevice, Element matches more than one slice - systemIdIdentifier, transportAddressIdentifier
Device/phd-711000FEFF5F49B0.B0495F001071: Device.identifier[2]  error   Profile http://hl7.org/fhir/uv/phd/StructureDefinition/PhdDevice, Element matches more than one slice - systemIdIdentifier, transportAddressIdentifier

It does not seem to be able to tell that there are two slices distinguished by identifier.type.coding.code="SYSID" and identifier.type.coding.code="BTMAC"
Here is my slicing: (I wish they weren't so BIG!!!)

    <!-- IDENTIFIER -->
    <!-- The identifier is used for the system id and transport addresses. There can be many such identifiers. The Contina slices shall be identified by the system element value -->
    <element id="Device.identifier">
      <path value="Device.identifier" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="type" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <short value="Information that uniquely describes the personal health device" />
      <definition value="The assigned unique identification of the device that is semantically meaningful outside of the FHIR resource context. An example would be the IEEE EUI-64 System-Id or transport address. For PHDs the systemIdentifier is required and the transportAddressIdentifier is highly recommended as this is what most end users see and can obtain from the device itself or device packaging." />
      <alias value="11073-20601 System id, transport address, etc." />
      <min value="1" />
    </element>

    <!-- Give the Continua system id slice a name. This slice shall exist -->
    <element id="Device.identifier:systemIdIdentifier">
      <path value="Device.identifier" />
      <sliceName value="systemIdIdentifier" />
      <short value="System Id identifier" />
      <definition value="This entry contains the IEEE EUI-64. If absent (bad device) set to all zeros." />
      <alias value="11073-20601 System id" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Device.identifier:systemIdIdentifier.type">
      <path value="Device.identifier.type" />
      <min value="1" />
      <binding>
        <strength value="required"/>
        <valueSet value="http://hl7.org/fhir/uv/phd/ValueSet/DeviceSystemIdIdentifier"/>
      </binding>
    </element>
    <element id="Device.identifier:systemIdIdentifier.type.coding">
      <path value="Device.identifier.type.coding" />
      <short value="Indicates this is the IEEE 11073 System Id identifier" />
      <min value="1" />
    </element>
    <element id="Device.identifier:systemIdIdentifier.type.coding.system">
      <path value="Device.identifier.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers" />
    </element>
    <element id="Device.identifier:systemIdIdentifier.type.coding.code">
      <path value="Device.identifier.type.coding.code" />
      <min value="1" />
      <fixedCode value="SYSID" />
    </element>
    <!-- The system element of the systemIdentifier slice shall indicate the EUI  -->
    <element id="Device.identifier:systemIdIdentifier.system">
      <path value="Device.identifier.system" />
      <short value="EUI-64 system identifier" />
      <definition value="Identifies the system as an IEEE EUI." />
      <min value="1" />
      <fixedUri value="urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680" />
    </element>
    <!-- The value element of the systemIdentifier slice shall have the system id attribute value  -->
    <element id="Device.identifier:systemIdIdentifier.value">
      <path value="Device.identifier.value" />
      <short value="System id value from System-Id attribute" />
      <definition value="The System id from the System-Id attribute as an 8-byte HEX string where each byte is separated by dashes, for example FE-ED-AB-EE-DE-AD-77-C3. " />
      <comment value="The formatting is specified in the IEEE document Guidelines for 64-bit Global Identifier.&#xD;&#xA;&#xD;&#xA;To allow the mapping of non-compliant proprietary devices that do not provide a system id, the value is set to all zeros in the same format, 00-00-00-00-00-00-00-00" />
      <min value="1" />
    </element>

    <element id="Device.identifier:transportAddressIdentifier">
      <path value="Device.identifier" />
      <sliceName value="transportAddressIdentifier" />
      <short value="Transport address identifier" />
      <definition value="This entry contains the transport address, for example the Bluetooth, ZigBee, USB, or mac address." />
      <comment value="USB does not have an 'address' as it is a point to point wired protocol. However, it does have a Vendor identification and Production identification number which together uniquely define the unit. For USB transports, the VID.PID in HEX is used as the transport identifier." />
      <alias value="Transport address" />
    </element>
    <element id="Device.identifier:transportAddressIdentifier.type">
      <path value="Device.identifier.type" />
      <binding>
        <strength value="required"/>
        <valueSet value="http://hl7.org/fhir/uv/phd/ValueSet/DeviceTransportIdentifiers"/>
      </binding>
    </element>
    <element id="Device.identifier:transportAddressIdentifier.type.coding">
      <path value="Device.identifier.type.coding" />
      <short value="Indicates this is the IEEE 11073 System Id identifier" />
    </element>
    <element id="Device.identifier:transportAddressIdentifier.type.coding.system">
      <path value="Device.identifier.type.coding.system" />
      <min value="1" />
      <fixedUri value="http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers" />
    </element>
    <element id="Device.identifier:transportAddressIdentifier.type.coding.code">
      <path value="Device.identifier.type.coding.code" />
      <min value="1" />
    </element>
    <element id="Device.identifier:transportAddressIdentifier.system">
      <path value="Device.identifier.system" />
    </element>
    <element id="Device.identifier:transportAddressIdentifier.value">
      <path value="Device.identifier.value" />
      <definition value="The transport address. If Bluetooth, use an EUI-48 such as 00-E5-DE-AD-77-C3. If a USB device use the VID.PID as HEX such as 0043.F90D. If a ZigBee address use an EUI-64 as with the system id." />
      <comment value="Transport addresses are supposed to be unique for a given device." />
      <min value="1" />
    </element>

view this post on Zulip Lloyd McKenzie (Nov 26 2018 at 15:07):

You shouldn't be setting fixed values for the code and system. What does your instance look like? What do your value sets look like?

view this post on Zulip Brian Reinhold (Nov 26 2018 at 15:14):

You shouldn't be setting fixed values for the code and system. What does your instance look like? What do your value sets look like?

@Lloyd McKenzie The value set for the SystemIdIdentifier binding looks like this

  <compose>
    <include>
      <system value="http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers"/>
      <concept>
        <code value="SYSID"/>
      </concept>
    </include>
  </compose>

The value set for the TransportIdentifier looks like this

  <compose>
    <include>
      <system value="http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers"/>
      <concept>
        <code value="BTMAC"/>
      </concept>
      <concept>
        <code value="USB"/>
      </concept>
      <concept>
        <code value="ZIGBEE"/>
      </concept>
    </include>
  </compose>

In the systemId case the system is a fixed value. In the transport case, I don't know what the system value is. Are you saying I need to drop the system element in the systemId case? I not sure how the system effects the discriminators as that is done on the type element. Isn't that all the parsers need to consider?

view this post on Zulip Lloyd McKenzie (Nov 26 2018 at 15:38):

If you want to match on identifiers, you need system + value. "type" is irrelevant and is only intended for humans. What does your instance look like?

view this post on Zulip Brian Reinhold (Nov 26 2018 at 15:46):

If you want to match on identifiers, you need system + value. "type" is irrelevant and is only intended for humans. What does your instance look like?

@Lloyd McKenzie Well that (you cant bind on type) is unexpected given it is a CodeableConcept! Isn't a CodeableConcept designed for machine reading?

The problem is that I do not have system values for the different cases or I would use that (I started with that). I only know of a system value for the systemId case. I have no 'system' value for the various transport cases.

I changed my instance to use the type so it looks like this

"identifier": [
    {
        "type": {
            "coding": [
                {
                    "system": "http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers",
                    "code": "SYSID"
                }
            ],
            "text": "System Identifier"
        },
        "system": "urn:oid:1.2.840.10004.1.1.1.0.0.1.0.0.1.2680",
        "value": "00-09-1F-FF-FE-80-07-3A"
    },
    {
        "type": {
            "coding": [
                {
                    "system": "http://hl7.org/fhir/uv/phd/CodeSystem/ContinuaDeviceIdentifiers",
                    "code": "BTMAC"
                }
            ],
            "text": "Bluetooth Address"
        },
        "value": "00-09-1F-80-07-3A"
    }
],

view this post on Zulip Lloyd McKenzie (Nov 26 2018 at 16:29):

I didn't say you couldn't bind on type. I just said that it's not used for identifier matching. And I'm suggesting that you'd be better off defining "system" values for each identifier system rather than defining custom identifier types.


Last updated: Apr 12 2022 at 19:14 UTC