{
  "resourceType": "StructureDefinition",
  "id": "health-card-eligibility",
  "url": "https://fhir.apps.health/StructureDefinition/health-card-eligibility",
  "name": "HealthCardEligibility",
  "title": "Health Card Eligibility Extension",
  "status": "draft",
  "date": "2026-09-04",
  "publisher": "WELLSTAR Technologies Corp.",
  "description": "The payer's settled answer about one provincial health card, carried on the card's own\n`Identifier`, together with a marker for a check that could not reach the payer.\n\n**It belongs to one exact card.** A card is a province, a number and a version code together, and\nan answer given for one card says nothing about a card that has since changed. Carried here, the\nanswer is discarded with the card it was about rather than outliving it on the patient.\n\n**It belongs on the health card and on nothing else.** `Patient.identifier` also carries the medical\nrecord number, the legacy paper chart number and whatever identifiers a source system contributed,\nand a payer eligibility answer means nothing on any of them. The extension's `contextInvariant`\nrequires the identifier it rides to carry the HL7 v2-0203 type `JHN` (jurisdictional health number),\nwhich is the same discriminator the Patient profile uses to recognise a provincial health number. An\neligibility answer stamped on an MRN or a chart number is not merely unhelpful; it is invalid.\n\n**`answeredAt` is when the payer gave THIS answer, not when the patient was last checked.** The\nanswer is rewritten only when it changes, so a check that confirms an existing answer leaves the\nmoment alone. Nothing may infer freshness from it: an answer dated months ago may have been\nreconfirmed this morning.\n\n**A failed attempt is not an answer.** `attemptFailedAt` records that a check could not reach the\npayer. It never touches the answer children, so the last real answer survives an outage, and it\ndates the failure rather than the answer, so freshness cannot be inferred from it either. It is\ncleared by the next check that reaches the payer. An extension carrying only `attemptFailedAt`\ncarries no answer at all.\n\n**Read the answer whole or not at all.** `eligible` and `answeredAt` are both required, and a\nmalformed `coverageExpiry` invalidates the whole answer rather than being dropped -- dropping it\nwould hand back an answer that reads as covered indefinitely. An unreadable `attemptFailedAt` is\nthe one child held to a softer rule: it reads as no marker, because a corrupt display-only child\nmust not be able to hide a real answer.\n\n**Absence of `coverageExpiry` is not an unlimited entitlement.** It means the payer delivered no\nexpiry with this answer.\n\n**`coverageExpiry` is DEPRECATED. Write the expiry to `Identifier.period.end` instead.** R4 defines\n`Identifier.period` as the time period during which the identifier is or was valid for use, which is\nexactly what a card's coverage expiry is, and this guide already records the Indian status card's\nexpiry there on the same resource. A child duplicating a base element gives a reader two places to\nlook and no rule for which wins when they disagree. The child stays defined because answers already\nstored carry it and must keep reading back; a producer that has not moved yet is not thereby\nnonconformant. Readers SHOULD read `Identifier.period.end` first and fall back to `coverageExpiry`,\nand SHOULD NOT treat a disagreement between them as an error -- prefer `Identifier.period.end`.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`http://services.well.com/fhir/identifier/eligibility` (FHIR-381): that address is live in stored\npatient records and in code, and is under migration to the canonical declared here. Write the\ncanonical; when reading, match both addresses exactly. The final segments differ (`eligibility`\nagainst `health-card-eligibility`), so a suffix rule does not reach the pre-migration one and a\nreader built on it misses every answer stored before the writer moves.",
  "jurisdiction": [
    {
      "coding": [
        {
          "code": "CA",
          "system": "urn:iso:std:iso:3166",
          "display": "Canada"
        }
      ]
    }
  ],
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "context": [
    {
      "type": "element",
      "expression": "Patient.identifier"
    }
  ],
  "contextInvariant": [
    "type.coding.where(system = 'http://terminology.hl7.org/CodeSystem/v2-0203' and code = 'JHN').exists()"
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "Settled payer eligibility answer for this health card",
        "definition": "The payer's settled answer about one provincial health card, carried on the card's own\n`Identifier`, together with a marker for a check that could not reach the payer.\n\n**It belongs to one exact card.** A card is a province, a number and a version code together, and\nan answer given for one card says nothing about a card that has since changed. Carried here, the\nanswer is discarded with the card it was about rather than outliving it on the patient.\n\n**It belongs on the health card and on nothing else.** `Patient.identifier` also carries the medical\nrecord number, the legacy paper chart number and whatever identifiers a source system contributed,\nand a payer eligibility answer means nothing on any of them. The extension's `contextInvariant`\nrequires the identifier it rides to carry the HL7 v2-0203 type `JHN` (jurisdictional health number),\nwhich is the same discriminator the Patient profile uses to recognise a provincial health number. An\neligibility answer stamped on an MRN or a chart number is not merely unhelpful; it is invalid.\n\n**`answeredAt` is when the payer gave THIS answer, not when the patient was last checked.** The\nanswer is rewritten only when it changes, so a check that confirms an existing answer leaves the\nmoment alone. Nothing may infer freshness from it: an answer dated months ago may have been\nreconfirmed this morning.\n\n**A failed attempt is not an answer.** `attemptFailedAt` records that a check could not reach the\npayer. It never touches the answer children, so the last real answer survives an outage, and it\ndates the failure rather than the answer, so freshness cannot be inferred from it either. It is\ncleared by the next check that reaches the payer. An extension carrying only `attemptFailedAt`\ncarries no answer at all.\n\n**Read the answer whole or not at all.** `eligible` and `answeredAt` are both required, and a\nmalformed `coverageExpiry` invalidates the whole answer rather than being dropped -- dropping it\nwould hand back an answer that reads as covered indefinitely. An unreadable `attemptFailedAt` is\nthe one child held to a softer rule: it reads as no marker, because a corrupt display-only child\nmust not be able to hide a real answer.\n\n**Absence of `coverageExpiry` is not an unlimited entitlement.** It means the payer delivered no\nexpiry with this answer.\n\n**`coverageExpiry` is DEPRECATED. Write the expiry to `Identifier.period.end` instead.** R4 defines\n`Identifier.period` as the time period during which the identifier is or was valid for use, which is\nexactly what a card's coverage expiry is, and this guide already records the Indian status card's\nexpiry there on the same resource. A child duplicating a base element gives a reader two places to\nlook and no rule for which wins when they disagree. The child stays defined because answers already\nstored carry it and must keep reading back; a producer that has not moved yet is not thereby\nnonconformant. Readers SHOULD read `Identifier.period.end` first and fall back to `coverageExpiry`,\nand SHOULD NOT treat a disagreement between them as an error -- prefer `Identifier.period.end`.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`http://services.well.com/fhir/identifier/eligibility` (FHIR-381): that address is live in stored\npatient records and in code, and is under migration to the canonical declared here. Write the\ncanonical; when reading, match both addresses exactly. The final segments differ (`eligibility`\nagainst `health-card-eligibility`), so a suffix rule does not reach the pre-migration one and a\nreader built on it misses every answer stored before the writer moves.",
        "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": "*",
        "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.extension:eligible",
        "path": "Extension.extension",
        "sliceName": "eligible",
        "short": "The payer's answer; required for the answer to be readable",
        "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": "1",
        "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"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.extension:eligible.id",
        "path": "Extension.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:eligible.extension",
        "path": "Extension.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.extension:eligible.url",
        "path": "Extension.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": "eligible",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.extension:eligible.value[x]",
        "path": "Extension.extension.value[x]",
        "short": "Value of extension",
        "definition": "The payer's settled answer for this card. Present with `answeredAt` or the extension carries no readable answer.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "boolean"
          }
        ],
        "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"
          }
        ]
      },
      {
        "id": "Extension.extension:answeredAt",
        "path": "Extension.extension",
        "sliceName": "answeredAt",
        "short": "When the payer gave THIS answer; required for the answer to be readable",
        "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": "1",
        "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"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.extension:answeredAt.id",
        "path": "Extension.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:answeredAt.extension",
        "path": "Extension.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.extension:answeredAt.url",
        "path": "Extension.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": "answeredAt",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.extension:answeredAt.value[x]",
        "path": "Extension.extension.value[x]",
        "short": "Value of extension",
        "definition": "When the payer gave the answer stored here -- NOT when the patient was last checked. The answer is rewritten only on change, so a re-check that agrees leaves this moment untouched and no freshness may be inferred from it.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "instant"
          }
        ],
        "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"
          }
        ]
      },
      {
        "id": "Extension.extension:coverageExpiry",
        "path": "Extension.extension",
        "sliceName": "coverageExpiry",
        "short": "DEPRECATED -- write Identifier.period.end instead",
        "definition": "**Deprecated. Write the coverage expiry to `Identifier.period.end` and not here.** R4 defines `Identifier.period` as the time period during which the identifier is or was valid for use, which is what a card's coverage expiry is, and this guide already records the Indian status card's expiry there on the same resource; a child duplicating a base element leaves a reader with two places to look and no rule for which wins. This child remains defined, and must keep reading back, because answers stored before the move carry it. Readers SHOULD prefer `Identifier.period.end` and fall back to this.",
        "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": "1",
        "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"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.extension:coverageExpiry.id",
        "path": "Extension.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:coverageExpiry.extension",
        "path": "Extension.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.extension:coverageExpiry.url",
        "path": "Extension.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": "coverageExpiry",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.extension:coverageExpiry.value[x]",
        "path": "Extension.extension.value[x]",
        "short": "Value of extension",
        "definition": "The coverage expiry the payer delivered alongside the answer. Absent means the payer delivered none, NOT that coverage is unlimited. **Deprecated: `Identifier.period.end` is the element to write.** Still must-support, because stored answers carry it and a reader has to be able to read one back.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "date"
          }
        ],
        "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"
          }
        ]
      },
      {
        "id": "Extension.extension:attemptFailedAt",
        "path": "Extension.extension",
        "sliceName": "attemptFailedAt",
        "short": "When a check last failed to reach the payer; not part of the answer",
        "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": "1",
        "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"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Extension.extension:attemptFailedAt.id",
        "path": "Extension.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:attemptFailedAt.extension",
        "path": "Extension.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.extension:attemptFailedAt.url",
        "path": "Extension.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": "attemptFailedAt",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.extension:attemptFailedAt.value[x]",
        "path": "Extension.extension.value[x]",
        "short": "Value of extension",
        "definition": "When a check last failed to reach the payer. It carries no answer, gates nothing, and dates the failure rather than the answer. Written once for a run of failures -- it names when the failures began -- and cleared by the next check that reaches the payer.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "instant"
          }
        ],
        "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"
          }
        ]
      },
      {
        "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/health-card-eligibility",
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "Value of extension",
        "definition": "Value of extension - must be one of a constrained set of the data types (see [Extensibility](extensibility.html) for a list).",
        "min": 0,
        "max": "0",
        "base": {
          "path": "Extension.value[x]",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "base64Binary"
          },
          {
            "code": "boolean"
          },
          {
            "code": "canonical"
          },
          {
            "code": "code"
          },
          {
            "code": "date"
          },
          {
            "code": "dateTime"
          },
          {
            "code": "decimal"
          },
          {
            "code": "id"
          },
          {
            "code": "instant"
          },
          {
            "code": "integer"
          },
          {
            "code": "markdown"
          },
          {
            "code": "oid"
          },
          {
            "code": "positiveInt"
          },
          {
            "code": "string"
          },
          {
            "code": "time"
          },
          {
            "code": "unsignedInt"
          },
          {
            "code": "uri"
          },
          {
            "code": "url"
          },
          {
            "code": "uuid"
          },
          {
            "code": "Address"
          },
          {
            "code": "Age"
          },
          {
            "code": "Annotation"
          },
          {
            "code": "Attachment"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "Coding"
          },
          {
            "code": "ContactPoint"
          },
          {
            "code": "Count"
          },
          {
            "code": "Distance"
          },
          {
            "code": "Duration"
          },
          {
            "code": "HumanName"
          },
          {
            "code": "Identifier"
          },
          {
            "code": "Money"
          },
          {
            "code": "Period"
          },
          {
            "code": "Quantity"
          },
          {
            "code": "Range"
          },
          {
            "code": "Ratio"
          },
          {
            "code": "Reference"
          },
          {
            "code": "SampledData"
          },
          {
            "code": "Signature"
          },
          {
            "code": "Timing"
          },
          {
            "code": "ContactDetail"
          },
          {
            "code": "Contributor"
          },
          {
            "code": "DataRequirement"
          },
          {
            "code": "Expression"
          },
          {
            "code": "ParameterDefinition"
          },
          {
            "code": "RelatedArtifact"
          },
          {
            "code": "TriggerDefinition"
          },
          {
            "code": "UsageContext"
          },
          {
            "code": "Dosage"
          },
          {
            "code": "Meta"
          }
        ],
        "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"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "short": "Settled payer eligibility answer for this health card",
        "definition": "The payer's settled answer about one provincial health card, carried on the card's own\n`Identifier`, together with a marker for a check that could not reach the payer.\n\n**It belongs to one exact card.** A card is a province, a number and a version code together, and\nan answer given for one card says nothing about a card that has since changed. Carried here, the\nanswer is discarded with the card it was about rather than outliving it on the patient.\n\n**It belongs on the health card and on nothing else.** `Patient.identifier` also carries the medical\nrecord number, the legacy paper chart number and whatever identifiers a source system contributed,\nand a payer eligibility answer means nothing on any of them. The extension's `contextInvariant`\nrequires the identifier it rides to carry the HL7 v2-0203 type `JHN` (jurisdictional health number),\nwhich is the same discriminator the Patient profile uses to recognise a provincial health number. An\neligibility answer stamped on an MRN or a chart number is not merely unhelpful; it is invalid.\n\n**`answeredAt` is when the payer gave THIS answer, not when the patient was last checked.** The\nanswer is rewritten only when it changes, so a check that confirms an existing answer leaves the\nmoment alone. Nothing may infer freshness from it: an answer dated months ago may have been\nreconfirmed this morning.\n\n**A failed attempt is not an answer.** `attemptFailedAt` records that a check could not reach the\npayer. It never touches the answer children, so the last real answer survives an outage, and it\ndates the failure rather than the answer, so freshness cannot be inferred from it either. It is\ncleared by the next check that reaches the payer. An extension carrying only `attemptFailedAt`\ncarries no answer at all.\n\n**Read the answer whole or not at all.** `eligible` and `answeredAt` are both required, and a\nmalformed `coverageExpiry` invalidates the whole answer rather than being dropped -- dropping it\nwould hand back an answer that reads as covered indefinitely. An unreadable `attemptFailedAt` is\nthe one child held to a softer rule: it reads as no marker, because a corrupt display-only child\nmust not be able to hide a real answer.\n\n**Absence of `coverageExpiry` is not an unlimited entitlement.** It means the payer delivered no\nexpiry with this answer.\n\n**`coverageExpiry` is DEPRECATED. Write the expiry to `Identifier.period.end` instead.** R4 defines\n`Identifier.period` as the time period during which the identifier is or was valid for use, which is\nexactly what a card's coverage expiry is, and this guide already records the Indian status card's\nexpiry there on the same resource. A child duplicating a base element gives a reader two places to\nlook and no rule for which wins when they disagree. The child stays defined because answers already\nstored carry it and must keep reading back; a producer that has not moved yet is not thereby\nnonconformant. Readers SHOULD read `Identifier.period.end` first and fall back to `coverageExpiry`,\nand SHOULD NOT treat a disagreement between them as an error -- prefer `Identifier.period.end`.\n\n**MIGRATION.** Nexus EMR writes this extension today at\n`http://services.well.com/fhir/identifier/eligibility` (FHIR-381): that address is live in stored\npatient records and in code, and is under migration to the canonical declared here. Write the\ncanonical; when reading, match both addresses exactly. The final segments differ (`eligibility`\nagainst `health-card-eligibility`), so a suffix rule does not reach the pre-migration one and a\nreader built on it misses every answer stored before the writer moves."
      },
      {
        "id": "Extension.extension:eligible",
        "path": "Extension.extension",
        "sliceName": "eligible",
        "short": "The payer's answer; required for the answer to be readable",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:eligible.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:eligible.url",
        "path": "Extension.extension.url",
        "fixedUri": "eligible"
      },
      {
        "id": "Extension.extension:eligible.value[x]",
        "path": "Extension.extension.value[x]",
        "definition": "The payer's settled answer for this card. Present with `answeredAt` or the extension carries no readable answer.",
        "min": 1,
        "type": [
          {
            "code": "boolean"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.extension:answeredAt",
        "path": "Extension.extension",
        "sliceName": "answeredAt",
        "short": "When the payer gave THIS answer; required for the answer to be readable",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:answeredAt.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:answeredAt.url",
        "path": "Extension.extension.url",
        "fixedUri": "answeredAt"
      },
      {
        "id": "Extension.extension:answeredAt.value[x]",
        "path": "Extension.extension.value[x]",
        "definition": "When the payer gave the answer stored here -- NOT when the patient was last checked. The answer is rewritten only on change, so a re-check that agrees leaves this moment untouched and no freshness may be inferred from it.",
        "min": 1,
        "type": [
          {
            "code": "instant"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.extension:coverageExpiry",
        "path": "Extension.extension",
        "sliceName": "coverageExpiry",
        "short": "DEPRECATED -- write Identifier.period.end instead",
        "definition": "**Deprecated. Write the coverage expiry to `Identifier.period.end` and not here.** R4 defines `Identifier.period` as the time period during which the identifier is or was valid for use, which is what a card's coverage expiry is, and this guide already records the Indian status card's expiry there on the same resource; a child duplicating a base element leaves a reader with two places to look and no rule for which wins. This child remains defined, and must keep reading back, because answers stored before the move carry it. Readers SHOULD prefer `Identifier.period.end` and fall back to this.",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:coverageExpiry.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:coverageExpiry.url",
        "path": "Extension.extension.url",
        "fixedUri": "coverageExpiry"
      },
      {
        "id": "Extension.extension:coverageExpiry.value[x]",
        "path": "Extension.extension.value[x]",
        "definition": "The coverage expiry the payer delivered alongside the answer. Absent means the payer delivered none, NOT that coverage is unlimited. **Deprecated: `Identifier.period.end` is the element to write.** Still must-support, because stored answers carry it and a reader has to be able to read one back.",
        "min": 1,
        "type": [
          {
            "code": "date"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.extension:attemptFailedAt",
        "path": "Extension.extension",
        "sliceName": "attemptFailedAt",
        "short": "When a check last failed to reach the payer; not part of the answer",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Extension.extension:attemptFailedAt.extension",
        "path": "Extension.extension.extension",
        "max": "0"
      },
      {
        "id": "Extension.extension:attemptFailedAt.url",
        "path": "Extension.extension.url",
        "fixedUri": "attemptFailedAt"
      },
      {
        "id": "Extension.extension:attemptFailedAt.value[x]",
        "path": "Extension.extension.value[x]",
        "definition": "When a check last failed to reach the payer. It carries no answer, gates nothing, and dates the failure rather than the answer. Written once for a run of failures -- it names when the failures began -- and cleared by the next check that reaches the payer.",
        "min": 1,
        "type": [
          {
            "code": "instant"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "https://fhir.apps.health/StructureDefinition/health-card-eligibility"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "max": "0"
      }
    ]
  }
}
