<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="PatientMERT" />
  <url value="https://intrahealth.com/fhir/mert/StructureDefinition/PatientMERT" />
  <name value="PatientMERT" />
  <title value="Patient (MERT)" />
  <status value="draft" />
  <description value="This profile describes the Patient for demographics and administrative information constraints for MERT." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Patient" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Patient" />
  <derivation value="constraint" />
  <differential>
    <element id="Patient">
      <path value="Patient" />
    </element>
    <element id="Patient.identifier">
      <path value="Patient.identifier" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.active">
      <path value="Patient.active" />
      <definition value="Whether this patient record is in active use." />
      <min value="1" />
      <mustSupport value="true" />
      <isModifierReason value="Status element that may indicate a record should not be treated as valid." />
    </element>
    <element id="Patient.name">
      <path value="Patient.name" />
      <min value="1" />
      <max value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.telecom">
      <path value="Patient.telecom" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.gender">
      <path value="Patient.gender" />
      <comment value="gender is optional (0..1). If populated, values SHALL conform to AdministrativeGender. Free-text values are not permitted." />
      <mustSupport value="true" />
      <binding>
        <strength value="required" />
        <valueSet value="http://hl7.org/fhir/ValueSet/administrative-gender" />
      </binding>
    </element>
    <element id="Patient.birthDate">
      <path value="Patient.birthDate" />
      <min value="1" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.deceased[x]">
      <path value="Patient.deceased[x]" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.address">
      <path value="Patient.address" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication">
      <path value="Patient.communication" />
      <mustSupport value="true" />
    </element>
    <element id="Patient.communication.language">
      <path value="Patient.communication.language" />
      <definition value="The language used to communicate with the patient. Senders SHOULD populate communication.language.coding with a BCP-47 language tag (coding.system = 'urn:ietf:bcp:47') where available." />
      <comment value="If no coding is available, the sender SHALL populate communication.language.text. Receivers MUST accept and persist coded or text-only language values." />
      <constraint>
        <key value="PatientCommunicationLanguageHasCodingOrText" />
        <severity value="error" />
        <human value="Each communication.language SHALL have either a coding entry or a text value." />
        <expression value="coding.exists() or text.exists()" />
        <source value="https://intrahealth.com/fhir/mert/StructureDefinition/PatientMERT" />
      </constraint>
      <binding>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
          <valueCanonical value="http://hl7.org/fhir/ValueSet/all-languages" />
        </extension>
        <strength value="preferred" />
        <valueSet value="http://hl7.org/fhir/ValueSet/common-languages" />
      </binding>
    </element>
    <element id="Patient.generalPractitioner">
      <path value="Patient.generalPractitioner" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://intrahealth.com/fhir/mert/StructureDefinition/PractitionerMERT" />
      </type>
      <mustSupport value="true" />
    </element>
  </differential>
</StructureDefinition>