{
  "resourceType": "StructureDefinition",
  "id": "valueset-secondary-coding",
  "url": "https://fhir.apps.health/StructureDefinition/valueset-secondary-coding",
  "name": "ValueSetSecondaryCoding",
  "title": "ValueSet Secondary Coding Extension",
  "status": "draft",
  "description": "A second coding for one member of a pre-expanded `ValueSet`, carried on that member beside its own\n`system` and `code`. Repeats: a member with two secondary codings carries two.\n\n**SUPERSEDED BY A PUBLISHED EXTENSION. Write\n`http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property`\ninstead.** R4's `ValueSet.expansion.contains` has no element for a per-member property, which is why\nthis extension was minted. R5 adds `expansion.contains.property` -- and HL7 publishes that element\nback to R4 as an extension, ACTIVE, `fhirVersion 4.0.1`, contexted on\n`ValueSet.expansion.contains`, in `hl7.fhir.uv.xver-r5.r4`. It was already available when this one\nwas written.\n\n**It is a strict superset, and the difference is the part that matters.** The published extension\ncarries a `code` child naming WHAT THE PROPERTY IS, beside a `value` child that admits `code`,\n`Coding`, `string`, `integer` or `boolean` -- and a `subProperty` for nested pairs. This extension\nhas only a value, so what the value MEANS has to be inferred from `valueCoding.system`.\n\nThat inference fails on a case this guide already has. The allergen picker's list annotates each\nmember with an allergen class, and the problem picker's list annotates each member with a\nclassification edition. Both are axes over expansion members; the moment two axes are drawn from ONE\nvocabulary, `system` no longer tells them apart and there is nowhere to say which is which. The\npublished extension names the axis explicitly and does not have that failure mode.\n\n**ADOPTING IT NEEDS A DEPENDENCY.** `hl7.fhir.uv.xver-r5.r4` is not currently pinned by this guide,\nand it must be declared before a validator can resolve the canonical. That declaration belongs with\nthe change that moves the writer, not ahead of it -- the package carries over 1,400\nStructureDefinitions and pinning it for an extension nothing yet writes would add weight for no\nreader.\n\n**What it buys.** These lists ship pre-expanded and are filtered in the client, so the second code\ntravels with the member the user picks. The picker can then emit a complete `CodeableConcept` --\nthe member's own coding, followed by each secondary coding -- rather than resolving a map after the\nfact. The [allergen class](CodeSystem-nexus-allergen-class.md) rides this way on the allergen\npicker's list, so an entry knows what kind of allergen it is at the moment it is recorded; the\nproblem picker carries a classification coding the same way, the edition named by that coding's own\n`system`.\n\n**Read it by the value's `system` -- and this is the limitation that supersedes it.** The extension\nURL says only that a second code is present; what the code IS comes from `valueCoding.system`.\nRepeats are in no guaranteed order and a member may carry more than one, so infer nothing from\nposition either. Two axes drawn from one vocabulary are indistinguishable under this rule, which is\nexactly what the published extension's `code` child exists to state.\n\n**It annotates a member; it does not decide membership.** A concept is in the set because\n`compose` includes it. This adds a code to a member and never adds or removes one.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-coding` (FHIR-374): it is live in\nseeded expansions and in code, and is under migration to the canonical declared here. That address\nshares the final segment `valueset-secondary-coding` with the canonical, so matching that segment\nreads both -- but it does NOT read the second address below.\n\n**A SECOND PRE-MIGRATION ADDRESS, which no suffix rule reaches.** The earliest form of this\nextension was spelled for one classification and is written at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-icd10` (FHIR-374). It is the same\nextension under a narrower name -- the same value, the same reading rule, and the classification it\ncarries is named by `valueCoding.system` rather than by the URL -- so this guide declares one\ncanonical for both rather than a second artifact for the special case. It is the address the seeded\nproblem picker's classification codings are filed under today. It has no segment in common\nwith the canonical and must be matched exactly; a reader built on the suffix alone misses every\nmember filed under it. Write the canonical, and neither of these.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "ValueSet.expansion.contains"
    }
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "ValueSet Secondary Coding Extension",
        "definition": "A second coding for one member of a pre-expanded `ValueSet`, carried on that member beside its own\n`system` and `code`. Repeats: a member with two secondary codings carries two.\n\n**SUPERSEDED BY A PUBLISHED EXTENSION. Write\n`http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property`\ninstead.** R4's `ValueSet.expansion.contains` has no element for a per-member property, which is why\nthis extension was minted. R5 adds `expansion.contains.property` -- and HL7 publishes that element\nback to R4 as an extension, ACTIVE, `fhirVersion 4.0.1`, contexted on\n`ValueSet.expansion.contains`, in `hl7.fhir.uv.xver-r5.r4`. It was already available when this one\nwas written.\n\n**It is a strict superset, and the difference is the part that matters.** The published extension\ncarries a `code` child naming WHAT THE PROPERTY IS, beside a `value` child that admits `code`,\n`Coding`, `string`, `integer` or `boolean` -- and a `subProperty` for nested pairs. This extension\nhas only a value, so what the value MEANS has to be inferred from `valueCoding.system`.\n\nThat inference fails on a case this guide already has. The allergen picker's list annotates each\nmember with an allergen class, and the problem picker's list annotates each member with a\nclassification edition. Both are axes over expansion members; the moment two axes are drawn from ONE\nvocabulary, `system` no longer tells them apart and there is nowhere to say which is which. The\npublished extension names the axis explicitly and does not have that failure mode.\n\n**ADOPTING IT NEEDS A DEPENDENCY.** `hl7.fhir.uv.xver-r5.r4` is not currently pinned by this guide,\nand it must be declared before a validator can resolve the canonical. That declaration belongs with\nthe change that moves the writer, not ahead of it -- the package carries over 1,400\nStructureDefinitions and pinning it for an extension nothing yet writes would add weight for no\nreader.\n\n**What it buys.** These lists ship pre-expanded and are filtered in the client, so the second code\ntravels with the member the user picks. The picker can then emit a complete `CodeableConcept` --\nthe member's own coding, followed by each secondary coding -- rather than resolving a map after the\nfact. The [allergen class](CodeSystem-nexus-allergen-class.md) rides this way on the allergen\npicker's list, so an entry knows what kind of allergen it is at the moment it is recorded; the\nproblem picker carries a classification coding the same way, the edition named by that coding's own\n`system`.\n\n**Read it by the value's `system` -- and this is the limitation that supersedes it.** The extension\nURL says only that a second code is present; what the code IS comes from `valueCoding.system`.\nRepeats are in no guaranteed order and a member may carry more than one, so infer nothing from\nposition either. Two axes drawn from one vocabulary are indistinguishable under this rule, which is\nexactly what the published extension's `code` child exists to state.\n\n**It annotates a member; it does not decide membership.** A concept is in the set because\n`compose` includes it. This adds a code to a member and never adds or removes one.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-coding` (FHIR-374): it is live in\nseeded expansions and in code, and is under migration to the canonical declared here. That address\nshares the final segment `valueset-secondary-coding` with the canonical, so matching that segment\nreads both -- but it does NOT read the second address below.\n\n**A SECOND PRE-MIGRATION ADDRESS, which no suffix rule reaches.** The earliest form of this\nextension was spelled for one classification and is written at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-icd10` (FHIR-374). It is the same\nextension under a narrower name -- the same value, the same reading rule, and the classification it\ncarries is named by `valueCoding.system` rather than by the URL -- so this guide declares one\ncanonical for both rather than a second artifact for the special case. It is the address the seeded\nproblem picker's classification codings are filed under today. It has no segment in common\nwith the canonical and must be matched exactly; a reader built on the suffix alone misses every\nmember filed under it. Write the canonical, and neither of these.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "Extension",
          "min": 0,
          "max": "*"
        },
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])"
          }
        ],
        "isModifier": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.id",
        "path": "Extension.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "open"
        },
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "0",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "representation": [
          "xmlAttr"
        ],
        "short": "identifies the meaning of the extension",
        "definition": "Source of the definition for the extension code - a logical name or a URL.",
        "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.url",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "uri"
              }
            ]
          }
        ],
        "fixedUri": "https://fhir.apps.health/StructureDefinition/valueset-secondary-coding",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "The second code for this expansion member",
        "definition": "A second coding for this expansion member. `system` states which vocabulary the code is drawn from and is the only thing that identifies what the code means; it is not constrained here, because a curated list chooses the vocabulary its members are annotated with.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Coding"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "ValueSet Secondary Coding Extension",
        "definition": "A second coding for one member of a pre-expanded `ValueSet`, carried on that member beside its own\n`system` and `code`. Repeats: a member with two secondary codings carries two.\n\n**SUPERSEDED BY A PUBLISHED EXTENSION. Write\n`http://hl7.org/fhir/5.0/StructureDefinition/extension-ValueSet.expansion.contains.property`\ninstead.** R4's `ValueSet.expansion.contains` has no element for a per-member property, which is why\nthis extension was minted. R5 adds `expansion.contains.property` -- and HL7 publishes that element\nback to R4 as an extension, ACTIVE, `fhirVersion 4.0.1`, contexted on\n`ValueSet.expansion.contains`, in `hl7.fhir.uv.xver-r5.r4`. It was already available when this one\nwas written.\n\n**It is a strict superset, and the difference is the part that matters.** The published extension\ncarries a `code` child naming WHAT THE PROPERTY IS, beside a `value` child that admits `code`,\n`Coding`, `string`, `integer` or `boolean` -- and a `subProperty` for nested pairs. This extension\nhas only a value, so what the value MEANS has to be inferred from `valueCoding.system`.\n\nThat inference fails on a case this guide already has. The allergen picker's list annotates each\nmember with an allergen class, and the problem picker's list annotates each member with a\nclassification edition. Both are axes over expansion members; the moment two axes are drawn from ONE\nvocabulary, `system` no longer tells them apart and there is nowhere to say which is which. The\npublished extension names the axis explicitly and does not have that failure mode.\n\n**ADOPTING IT NEEDS A DEPENDENCY.** `hl7.fhir.uv.xver-r5.r4` is not currently pinned by this guide,\nand it must be declared before a validator can resolve the canonical. That declaration belongs with\nthe change that moves the writer, not ahead of it -- the package carries over 1,400\nStructureDefinitions and pinning it for an extension nothing yet writes would add weight for no\nreader.\n\n**What it buys.** These lists ship pre-expanded and are filtered in the client, so the second code\ntravels with the member the user picks. The picker can then emit a complete `CodeableConcept` --\nthe member's own coding, followed by each secondary coding -- rather than resolving a map after the\nfact. The [allergen class](CodeSystem-nexus-allergen-class.md) rides this way on the allergen\npicker's list, so an entry knows what kind of allergen it is at the moment it is recorded; the\nproblem picker carries a classification coding the same way, the edition named by that coding's own\n`system`.\n\n**Read it by the value's `system` -- and this is the limitation that supersedes it.** The extension\nURL says only that a second code is present; what the code IS comes from `valueCoding.system`.\nRepeats are in no guaranteed order and a member may carry more than one, so infer nothing from\nposition either. Two axes drawn from one vocabulary are indistinguishable under this rule, which is\nexactly what the published extension's `code` child exists to state.\n\n**It annotates a member; it does not decide membership.** A concept is in the set because\n`compose` includes it. This adds a code to a member and never adds or removes one.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-coding` (FHIR-374): it is live in\nseeded expansions and in code, and is under migration to the canonical declared here. That address\nshares the final segment `valueset-secondary-coding` with the canonical, so matching that segment\nreads both -- but it does NOT read the second address below.\n\n**A SECOND PRE-MIGRATION ADDRESS, which no suffix rule reaches.** The earliest form of this\nextension was spelled for one classification and is written at\n`https://fhir.nexus.health/StructureDefinition/valueset-secondary-icd10` (FHIR-374). It is the same\nextension under a narrower name -- the same value, the same reading rule, and the classification it\ncarries is named by `valueCoding.system` rather than by the URL -- so this guide declares one\ncanonical for both rather than a second artifact for the special case. It is the address the seeded\nproblem picker's classification codings are filed under today. It has no segment in common\nwith the canonical and must be matched exactly; a reader built on the suffix alone misses every\nmember filed under it. Write the canonical, and neither of these."
      },
      {
        "id": "Extension.extension",
        "path": "Extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "https://fhir.apps.health/StructureDefinition/valueset-secondary-coding"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "The second code for this expansion member",
        "definition": "A second coding for this expansion member. `system` states which vocabulary the code is drawn from and is the only thing that identifies what the code means; it is not constrained here, because a curated list chooses the vocabulary its members are annotated with.",
        "min": 1,
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}
