<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="profile-coverage" />
  <url value="http://pharmacyeclaims.ca/FHIR/v1.0/StructureDefinition/profile-coverage" />
  <name value="Coverage" />
  <title value="Coverage" />
  <status value="active" />
  <description value="Coverage details" />
  <purpose value="Coverage Details" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Coverage" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Coverage" />
  <derivation value="constraint" />
  <differential>
    <element id="Coverage.id">
      <path value="Coverage.id" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.status">
      <path value="Coverage.status" />
      <comment value="CPHA Map:  N/A - new mandatory data element&#xD;&#xA;&#xD;&#xA;This element is labeled as a modifier because the status contains the code entered-in-error that marks the coverage as not currently valid." />
      <fixedCode value="active" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber">
      <path value="Coverage.subscriber" />
      <comment value="CPHA:  C.32.03 Client ID # or Code and CPHA:  C.35.03  Cardholder Identity  A/N 5&#xD;&#xA;&#xD;&#xA;May be self or a parent in the case of dependants." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.reference">
      <path value="Coverage.subscriber.reference" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier">
      <path value="Coverage.subscriber.identifier" />
      <comment value="Usage:  this may be used to refer to the patient in place of a reference to the resource.   &#xD;&#xA;&#xD;&#xA;if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. &#xA;&#xA;When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.&#xA;&#xA;Reference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference.  For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport).  One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any)." />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.type">
      <path value="Coverage.subscriber.identifier.type" />
      <comment value="Usage Note:   Where known, this should be identified, eg a value of &quot;JHN&quot; should be used for jurisdictional healthcare numbers.&#xD;&#xA;&#xD;&#xA;This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.   Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type." />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.type.coding">
      <path value="Coverage.subscriber.identifier.type.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.type.coding.system">
      <path value="Coverage.subscriber.identifier.type.coding.system" />
      <comment value="Usage note:  For Jurisdictional identifiers, &#xD;&#xA;&#xD;&#xA;The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously." />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.type.coding.code">
      <path value="Coverage.subscriber.identifier.type.coding.code" />
      <comment value="Usage Note:   For jurisdictional identifiers, set value = JHN&#xD;&#xA;&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.system">
      <path value="Coverage.subscriber.identifier.system" />
      <comment value="Usage Note:   This should be provided when known, eg for jurisdictional health number where the assigning authority has an established namespace..  Refer to the terminology, Jurisdictional Healthcare Identifier Type for these values.   &#xD;&#xA;&#xD;&#xA;Identifier.system is always case sensitive." />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.identifier.value">
      <path value="Coverage.subscriber.identifier.value" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriber.display">
      <path value="Coverage.subscriber.display" />
      <comment value="Usage:  This field confirms the identity of the cardholder,  This contains the full surname of the individual to whom the benefit eligibility card was issued.&#xD;&#xA;CPHA:  C.35.03  Cardholder Identity  A/N 5, first five letters only of the surname&#xD;&#xA;&#xD;&#xA;This is generally not the same as the Resource.text of the referenced resource.  The purpose is to identify what's being referenced, not to fully describe it." />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.subscriberId">
      <path value="Coverage.subscriberId" />
      <comment value="CPHA:  C.32.03 Client ID # or Code   A/N15&#xD;&#xA;CPHA:   C.39.03 - Provincial Healthcare ID Code --- Note:  this is not in patient resource;  do not want duplication&#xD;&#xA;Usage Note:   A system will be provided if known.   The context is fully understood by sending and receiving applications; that being that it is unique within the group identifier (contract.identifier) which is unique within the payor.identifier.&#xD;&#xA;&#xD;&#xA;When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference &#xD;&#xA;Usage:  Cardholder identification number assigned by the benefit card issuer.  The cardholder may be an individual (e.g. Ontario MOH health number), who is covered by a unique ID code, or the responsible party in a family or other similar unit where dependants are covered under the same client ID # as the cardholder&#xD;&#xA;Note that FHIR strings SHALL NOT exceed 1MB in size" />
      <min value="1" />
    </element>
    <element id="Coverage.beneficiary">
      <path value="Coverage.beneficiary" />
      <type>
        <code value="Reference" />
        <targetProfile value="http://pharmacyeclaims.ca/FHIR/v1.0/StructureDefinition/profile-patient" />
        <aggregation value="bundled" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Coverage.beneficiary.reference">
      <path value="Coverage.beneficiary.reference" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.relationship">
      <path value="Coverage.relationship" />
      <comment value="Usage:  Code to show relationship of patient to cardholder&#xD;&#xA;CPHA:  C.36.03 Relationship, mapping between codes is required&#xD;&#xD;&#xA;Typically, an individual uses policies which are theirs (relationship='self') before policies owned by others." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.relationship.coding">
      <path value="Coverage.relationship.coding" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.relationship.coding.system">
      <path value="Coverage.relationship.coding.system" />
      <min value="1" />
      <fixedUri value="http://terminology.hl7.org/CodeSystem/subscriber-relationship" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.relationship.coding.code">
      <path value="Coverage.relationship.coding.code" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.payor">
      <path value="Coverage.payor" />
      <comment value="Usage:   Identifies the plan type or benefit program.  Only an identifier is required&#xD;&#xA;CPHA Mapping: Carrier ID C.30.03 A/N2&#xD;&#xA;&#xD;&#xA;May provide multiple identifiers such as insurance company identifier or business identifier (BIN number).&#xA;For selfpay it may provide multiple paying persons and/or organizations." />
      <type>
        <code value="Reference" />
        <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
      </type>
      <mustSupport value="true" />
    </element>
    <element id="Coverage.payor.identifier">
      <path value="Coverage.payor.identifier" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.payor.identifier.system">
      <path value="Coverage.payor.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.payor.identifier.value">
      <path value="Coverage.payor.identifier.value" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.contract">
      <path value="Coverage.contract" />
      <comment value="Conformance Rule:   This must be populated when known.&#xD;&#xA;CPHA Map:  C.31.03 Group Number or Code&#xD;&#xA;&#xD;&#xA;References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.contract.identifier">
      <path value="Coverage.contract.identifier" />
      <comment value="Usage:  This is a number or code, assigned by the plan administrator, payor, processor or benefit card issuer to identify a specific group of benefit &#xD;&#xA;recipients within a carrier (Field C.30.03) designation.  The issuer of the group number may include this number or code on a benefit card or other &#xD;&#xA;format to be used universally or (as is the case with ODB) assign it for use by a specific provider to a group of residents in a specific facility&#xD;&#xA;CPHA Map:  C.31.03 Group Number or Code -&gt; value&#xD;&#xA;&#xD;&#xA;When an identifier is provided in place of a reference, any system processing the reference will only be able to resolve the identifier to a reference if it understands the business context in which the identifier is used. Sometimes this is global (e.g. a national identifier) but often it is not. For this reason, none of the useful mechanisms described for working with references (e.g. chaining, includes) are possible, nor should servers be expected to be able resolve the reference. Servers may accept an identifier based reference untouched, resolve it, and/or reject it - see CapabilityStatement.rest.resource.referencePolicy. &#xA;&#xA;When both an identifier and a literal reference are provided, the literal reference is preferred. Applications processing the resource are allowed - but not required - to check that the identifier matches the literal reference&#xA;&#xA;Applications converting a logical reference to a literal reference may choose to leave the logical reference present, or remove it.&#xA;&#xA;Reference is intended to point to a structure that can potentially be expressed as a FHIR resource, though there is no need for it to exist as an actual FHIR resource instance - except in as much as an application wishes to actual find the target of the reference. The content referred to be the identifier must meet the logical constraints implied by any limitations on what resource types are permitted for the reference.  For example, it would not be legitimate to send the identifier for a drug prescription if the type were Reference(Observation|DiagnosticReport).  One of the use-cases for Reference.identifier is the situation where no FHIR representation exists (where the type is Reference (Any)." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.contract.identifier.system">
      <path value="Coverage.contract.identifier.system" />
      <mustSupport value="true" />
    </element>
    <element id="Coverage.contract.identifier.value">
      <path value="Coverage.contract.identifier.value" />
      <comment value="CPHA Map:  C.31.03 Group Number or Code&#xD;&#xA;&#xD;&#xA;If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe." />
      <min value="1" />
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>