<?xml version="1.0" encoding="UTF-8"?>
<!--
    The values a report column may carry.

    Included by both report schema families: the shipped definitions in
    ../ReportDefinition/, and the persisted custom reports under
    Application/CustomReport/Shared/XMLSchemas/. Before this file existed each family
    listed these values itself, so the same vocabulary was written down twice and nothing
    kept the two in step.

    There is a third copy that a schema cannot reach: the PHP enums the renderer switches
    on. ReportValueVocabularyParityTest asserts those match what is here, because when they
    drifted apart before, a value that validated on save threw at render time instead.

    Add a value here and to the matching PHP enum in the same change. The parity test will
    tell you if you forget.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

  <xs:simpleType name="codedEntryValueType">
      <xs:restriction base="xs:string">
        <xs:enumeration value="activityDate"/>
        <xs:enumeration value="activity"/>
        <xs:enumeration value="codeDescription"/>
        <xs:enumeration value="activityTime"/>
        <xs:enumeration value="activityEndDate"/>
        <xs:enumeration value="activityStatus"/>
        <xs:enumeration value="value"/>
        <xs:enumeration value="bodySite"/>
        <xs:enumeration value="route"/>
        <xs:enumeration value="batchNumber"/>
        <xs:enumeration value="expiryDate"/>
        <xs:enumeration value="responsiblePractitioner"/>
        <xs:enumeration value="responsiblePractitionerIdentifier"/>
        <xs:enumeration value="responsibleOrganizationOdsCode"/>
        <xs:enumeration value="activityPerformedHere"/>
        <xs:enumeration value="responsibleOrganisation"/>
        <xs:enumeration value="encounterType"/>
        <xs:enumeration value="encounterTypeCode"/>
        <xs:enumeration value="encounterId"/>
        <xs:enumeration value="createdDate"/>
        <xs:enumeration value="createdInOriginalSystemDateTime"/>
        <xs:enumeration value="bodySiteCode"/>
        <xs:enumeration value="routeCode"/>
        <xs:enumeration value="valueUnitCode"/>
      </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="demographicInformationValueType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="patientName"/>
      <xs:enumeration value="patientPrimaryIdentifier"/>
      <xs:enumeration value="patientUuid"/>
      <xs:enumeration value="patientNhsNumber"/>
      <xs:enumeration value="patientDateOfBirth"/>
      <xs:enumeration value="patientAge"/>
      <xs:enumeration value="patientGender"/>
      <xs:enumeration value="patientRegistrationType"/>
      <xs:enumeration value="patientRegistrationDate"/>
      <xs:enumeration value="patientCurrentRegistrationType"/>
      <xs:enumeration value="namedGP"/>
      <xs:enumeration value="homeAddress"/>
      <xs:enumeration value="homePhoneNumber"/>
      <xs:enumeration value="mobilePhoneNumber"/>
      <xs:enumeration value="emailAddress"/>
      <xs:enumeration value="currentRegistrationStartDate"/>
      <xs:enumeration value="dateOfDeath"/>
      <xs:enumeration value="prescriptionsDispensedByPractice"/>
      <xs:enumeration value="careHomeResident"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="prescriptionValueType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="prescriptionType"/>
      <xs:enumeration value="prescriptionStatus"/>
      <xs:enumeration value="prescriptionProductCode"/>
      <xs:enumeration value="prescriptionProductDescription"/>
      <xs:enumeration value="prescriptionStartDate"/>
      <xs:enumeration value="prescriptionExpectedEndDate"/>
      <xs:enumeration value="prescriptionLastIssueDate"/>
      <xs:enumeration value="prescriptionDiscontinuedDate"/>
      <xs:enumeration value="prescriptionAuthorisedDate"/>
      <xs:enumeration value="prescriptionAuthorisedByPractitioner"/>
      <xs:enumeration value="prescriptionDosageInstruction"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="prescriptionIssueValueType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="prescriptionIssueProductCode"/>
      <xs:enumeration value="prescriptionIssueProductDescription"/>
      <xs:enumeration value="prescriptionIssueQuantity"/>
      <xs:enumeration value="prescriptionIssueDate"/>
      <xs:enumeration value="prescriptionIssueMethod"/>
      <xs:enumeration value="prescriptionIssueNumber"/>
      <xs:enumeration value="prescriptionIssueStatus"/>
      <xs:enumeration value="prescriptionIssueSupplyEndDate"/>
      <xs:enumeration value="prescriptionIssueIssuedByPractitioner"/>
      <xs:enumeration value="prescriptionIssueExpectedDaysSupply"/>
      <xs:enumeration value="prescriptionIssueIssuingOrganisation"/>
      <xs:enumeration value="prescriptionIssueEpsPharmacyOdsCode"/>
      <xs:enumeration value="prescriptionIssuePrescriptionStatus"/>
      <xs:enumeration value="prescriptionIssuePrescriptionType"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="appointmentValueType">
      <xs:restriction base="xs:string">
          <xs:enumeration value="appointmentDate"/>
          <xs:enumeration value="appointmentEndDateTime"/>
          <xs:enumeration value="appointmentStatus"/>
          <xs:enumeration value="appointmentTypeName"/>
          <xs:enumeration value="appointmentServiceName"/>
          <xs:enumeration value="appointmentPractitionerName"/>
          <xs:enumeration value="appointmentDeliveryMode"/>
          <xs:enumeration value="appointmentDurationSeconds"/>
          <xs:enumeration value="appointmentBookedDateTime"/>
          <xs:enumeration value="appointmentArrivedDateTime"/>
          <xs:enumeration value="appointmentCancelledDateTime"/>
          <xs:enumeration value="appointmentRescheduledDateTime"/>
          <xs:enumeration value="appointmentNhsSlotType"/>
          <xs:enumeration value="appointmentSiteName"/>
          <xs:enumeration value="appointmentRoomName"/>
      </xs:restriction>
  </xs:simpleType>

</xs:schema>
