{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "Indicates the type/structure of the JSON record."
    },
    "action": {
      "type": "string",
      "description": "Indicates the action represented by the JSON record."
    },
    "system": {
      "$ref": "#/definitions/System"
    },
    "referral": {
      "$ref": "#/definitions/Referral"
    },
    "patient": {
      "$ref": "#/definitions/Patient"
    },
    "attendance": {
      "$ref": "#/definitions/Attendance"
    },
    "clinical": {
      "$ref": "#/definitions/Clinical"
    },
    "commissioning": {
      "$ref": "#/definitions/Commissioning"
    },
    "data_quality": {
      "$ref": "#/definitions/DataQuality"
    }
  },
  "definitions": {
    "AccessibleInformationProfessionalRequired": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACCESSIBLE INFORMATION PROFESSIONAL REQUIRED CODE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accessible_information_professional_required_code (snomed_ct)_de.asp"
          },
          "description": "ACCESSIBLE INFORMATION PROFESSIONAL REQUIRED CODE (SNOMED CT) is the SNOMED CT concept ID which is used to identify that the PATIENT requires support from a communication professional."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Accessible Information professional Required Code is approved on the activity_date"
        }
      }
    },
    "AccommodationStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACCOMMODATION STATUS (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accommodation_status_(snomed_ct)_de.asp"
          },
          "description": "ACCOMMODATION STATUS (SNOMED CT) is the SNOMED CT concept ID which is used to identify the details of the ACCOMMODATION of the PERSON."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Accommodation Status Code is approved on the activity_date"
        }
      }
    },
    "Acuity": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE ACUITY (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_acuity_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE ACUITY (SNOMED CT) is the SNOMED CT concept ID which is used to indicate the acuity of the PATIENT's condition on the Emergency Care Initial Assessment Date and Emergency Care Initial Assessment Time."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Acuity Code is approved on the activity_date"
        }
      }
    },
    "Arrival": {
      "type": "object",
      "properties": {
        "attendance_identifier": {
          "type": "string",
          "data_dictionary": {
            "name": "A and E ATTENDANCE NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/a_and_e_attendance_number_de.asp"
          },
          "description": "A number allocated by an Accident and Emergency Department to provide a unique identifier for each Accident and Emergency Attendance."
        },
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ARRIVAL DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/ap/arrival_date_de.asp"
          },
          "description": "The date on which the patient arrived in Accident and Emergency."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "ARRIVAL TIME AT ACCIDENT AND EMERGENCY DEPARTMENT",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/ap/arrival_time_at_accident_and_emergency_department_de.asp"
          },
          "description": "The time (HH:MM:SS) at which the patient arrived in A&E."
        },
        "month": {
          "type": "number",
          "description": "The month on which the activity occurred."
        },
        "arrival_mode": {
          "$ref": "#/definitions/ArrivalMode"
        },
        "attendance_category": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE ATTENDANCE CATEGORY",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_attendance_category_de.asp"
          },
          "description": "The category of Emergency Care Attendance.The national codes for Attendance Category are:"
        },
        "planned": {
          "type": "boolean",
          "description": "Indicates whether attendance was planned or unplanned, derived by checking if Attendance Category is 2."
        },
        "ambulance_incident_number": {
          "type": "string",
          "data_dictionary": {
            "name": "AMBULANCE INCIDENT NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/ag/ambulance_incident_number_de.asp"
          },
          "description": "An identifier for the patient transport journey when the patient arrived at hospital by Ambulance."
        },
        "conveying_ambulance_trust": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (CONVEYING AMBULANCE TRUST)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(conveying_ambulance_trust)_de.asp"
          },
          "description": "The organisation code of the conveying ambulance trust, if specified."
        },
        "ambulance_care_contact_identifier": {
          "type": "string",
          "description": "Care Contact Identifier (Ambulance Service) is the activity identifier for a care contact allocated by the ambulance service. Care Contact Identifier (Ambulance Service) is an identifier allocated to each ambulance incident for each patient."
        },
        "attendance_source": {
          "$ref": "#/definitions/AttendanceSource"
        },
        "attendance_source_organisation": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE ATTENDANCE SOURCE FOR ORGANISTION SITE IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_attendance_source_de.asp"
          },
          "description": "ORGANISATION SITE IDENTIFIER (EMERGENCY CARE ATTENDANCE SOURCE) is the ORGANISATION IDENTIFIER of the Organisation Site from which a PATIENT arrived at an Emergency Care Department."
        }
      }
    },
    "ArrivalMode": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE ARRIVAL MODE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_arrival_mode_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE ARRIVAL MODE (SNOMED CT) is the SNOMED CT concept ID which is used to identify the transport mode by which the PATIENT arrived at the Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Arrival Mode Code is approved on the activity_date"
        }
      }
    },
    "Attendance": {
      "type": "object",
      "properties": {
        "unique_identifier": {
          "type": "string",
          "description": "System generated identifier which uniquely identifies an attendance."
        },
        "location": {
          "$ref": "#/definitions/Location"
        },
        "expected_treatment_times": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ExpectedTreatmentTime"
          }
        },
        "arrival": {
          "$ref": "#/definitions/Arrival"
        },
        "initial_assessment": {
          "$ref": "#/definitions/InitialAssessment"
        },
        "seen_for_treatment": {
          "$ref": "#/definitions/SeenForTreatment"
        },
        "conclusion": {
          "$ref": "#/definitions/Conclusion"
        },
        "clinically_ready_to_proceed": {
          "$ref": "#/definitions/ClinicallyReadyToProceed"
        },
        "departure": {
          "$ref": "#/definitions/Departure"
        },
        "decision_to_admit": {
          "$ref": "#/definitions/DecisionToAdmit"
        },
        "referred_to": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ReferredTo"
          }
        },
        "discharge": {
          "$ref": "#/definitions/Discharge"
        }
      }
    },
    "AttendanceSource": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE ATTENDANCE SOURCE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_attendance_source_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE ATTENDANCE SOURCE (SNOMED CT) is the SNOMED CT concept ID which is used to indicate the source of an Emergency Care Attendance."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Attendance Source Code is approved on the activity_date"
        }
      }
    },
    "ChiefComplaint": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE CHIEF COMPLAINT (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_chief_complaint_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE CHIEF COMPLAINT (SNOMED CT) is the SNOMED CT concept ID which is used to indicate the nature of the PATIENT's chief complaint as assessed by the CARE PROFESSIONAL first assessing the PATIENT."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Chief Complaint Code is approved on the activity_date"
        },
        "is_injury_related": {
          "type": "boolean",
          "description": "Indicates if the Chief Complaint is injury related"
        },
        "extended_code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE CHIEF COMPLAINT (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_chief_complaint_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE CHIEF COMPLAINT (Extended) is the Lorenzo concept ID which is used to indicate the nature of the PATIENT's chief complaint as assessed by the CARE PROFESSIONAL first assessing the PATIENT. This will only appear where code is different from EMERGENCY CARE CHIEF COMPLAINT (SNOMED CT) Group: ATTENDANCE OCCURRENCE ACTIVITY CHARACTERISTICS"
        }
      }
    },
    "Clinical": {
      "type": "object",
      "properties": {
        "chief_complaint": {
          "$ref": "#/definitions/ChiefComplaint"
        },
        "acuity": {
          "$ref": "#/definitions/Acuity"
        },
        "comorbidities": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Comorbidity"
          }
        },
        "coded_scored_assessments": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CodedScoredAssessment"
          }
        },
        "coded_observations": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CodedObservation"
          }
        },
        "coded_findings": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/CodedFinding"
          }
        },
        "injury": {
          "$ref": "#/definitions/Injury"
        },
        "diagnoses": {
          "$ref": "#/definitions/Diagnoses"
        },
        "investigations": {
          "$ref": "#/definitions/Investigations"
        },
        "treatments": {
          "$ref": "#/definitions/Treatments"
        },
        "participants": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/Participant"
          }
        },
        "trial_code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE CLINICAL TRIAL IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_clinical_trial_identifier_de.asp"
          },
          "description": "The ClinicalTrialIdentifier ."
        },
        "disease_notification": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE CLINICAL TRIAL IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_clinical_trial_identifier_de.asp"
          },
          "description": "The DiseaseOutbreakNotification ."
        },
        "disease_notification_code": {
          "type": "string",
          "data_dictionary": {
            "name": "DISEASE OUTBREAK NOTIFICATION (SNOMED CT)",
            "href": "https://datadictionary.nhs.uk/data_elements/disease_outbreak_notification__snomed_ct_.html"
          },
          "description": "RESTRICTED USE  Disease Outbreak Notification (SNOMED CT) is the SNOMED CT concept ID describing nationally notifiable outbreaks of disease."
        },
        "disease_notification_description": {
          "type": "string",
          "data_dictionary": {
            "name": "DISEASE OUTBREAK NOTIFICATION DESCRIPTION",
            "href": "https://datadictionary.nhs.uk/data_elements/disease_outbreak_notification_description.html"
          },
          "description": "RESTRICTED USE  The DiseaseOutbreakNotification description (if code is not available)."
        }
      }
    },
    "ClinicallyReadyToProceed": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "EMERGENCY CARE CLINICALLY READY TO PROCEED TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/emergency_care_clinically_ready_to_proceed_timestamp.html"
          }
        },
        "time_since_arrival": {
          "type": "number"
        }
      }
    },
    "CodedFinding": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "CODED FINDING (SNOMED CT)",
            "href": "https://datadictionary.nhs.uk/data_elements/coded_finding__snomed_ct_.html"
          },
          "description": "Coded Finding (SNOMED CT) is the SNOMED CT concept ID which is used to identify a Finding."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Indicates if the finding code is approved on the activity date of the record."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "CODED FINDING TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/coded_finding_timestamp.html"
          },
          "description": "Coded Finding Timestamp is the date and time that the Coded Finding (SNOMED CT) was recorded by a Care Professional."
        }
      }
    },
    "CodedObservation": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "CODED OBSERVATION (SNOMED CT)",
            "href": "https://datadictionary.nhs.uk/data_elements/coded_observation__snomed_ct_.html"
          },
          "description": "Coded Observation (SNOMED CT) is the SNOMED CT concept ID which is used to identify an Observable Entity."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Indicates if the observation code is approved on the activity date of the record."
        },
        "value": {
          "type": "string",
          "data_dictionary": {
            "name": "OBSERVATION VALUE",
            "href": "https://datadictionary.nhs.uk/data_elements/observation_value.html"
          },
          "description": "The value of a Clinical Investigation Result Item."
        },
        "ucum_unit_of_measurement": {
          "type": "string",
          "data_dictionary": {
            "name": "UCUM UNIT OF MEASUREMENT",
            "href": "https://datadictionary.nhs.uk/data_elements/ucum_unit_of_measurement.html"
          },
          "description": "The Unit of Measurement using the Unified Code for Units of Measure (UCUM) code system."
        },
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "CODED OBSERVATION TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/coded_observation_timestamp.html"
          },
          "description": "Coded Observation Timestamp is the date and  time that the Coded Observation (SNOMED CT) was recorded by a Care Professional."
        }
      }
    },
    "CodedScoredAssessment": {
      "type": "object",
      "properties": {
        "tool_type": {
          "$ref": "#/definitions/ToolType"
        },
        "person_score": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON SCORE",
            "href": "https://datadictionary.nhs.uk/data_elements/person_score.html"
          },
          "description": "The score taken from an Assessment Tool. This could be for an individual element of, or question within, an Assessment Tool, a subtotal or total score. The purpose of the Person Score is to measure changes in health and wellbeing."
        },
        "validation_timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "ASSESSMENT TOOL VALIDATION TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/assessment_tool_validation_timestamp.html"
          },
          "description": "The Assessment Tool Validation Timestamp is the date, time and time zone that the Coded Assessment Tool Type (SNOMED CT) was validated by the Care Professional"
        }
      }
    },
    "Commissioning": {
      "type": "object",
      "properties": {
        "service_agreement": {
          "$ref": "#/definitions/ServiceAgreement"
        },
        "grouping": {
          "$ref": "#/definitions/Grouping"
        },
        "national_pricing": {
          "$ref": "#/definitions/NationalPricing"
        }
      }
    },
    "Comorbidity": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "COMORBIDITY (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/co/comorbidity_(snomed_ct)_de.asp"
          },
          "description": "A record of whether a person has any of the NHS list of medical co-morbidities."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Comorbidity Code is approved on the activity_date"
        }
      }
    },
    "Conclusion": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY ATTENDANCE CONCLUSION DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accident_and_emergency_attendance_conclusion_date_de.asp"
          },
          "description": "An Accident and Emergency Attendance Conclusion Date is the date that a PATIENT's Accident and Emergency Attendance concludes or when treatment in the Accident and Emergency Department is completed, whichever is the later For those PATIENTS admitted into hospital, the ACCIDENT AND EMERGENCY ATTENDANCE CONCLUSION DATE is recorded as the date when the DECISION TO ADMIT was made."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "A and E ATTENDANCE CONCLUSION TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/a_and_e_attendance_conclusion_time_de.asp"
          },
          "description": "The time (HH:MM:SS) at which the attendance was concluded."
        },
        "time_since_arrival": {
          "type": "number",
          "description": "Indicates waiting time in minutes between from arrival to seen for treatment or attendance conclusion, whichever is greater. If arrival datetime missing, or if neither seen_for_treatment or attendance_conclusion exists, or if the longest calculated duration is less than 0 then derivation result is Null"
        }
      }
    },
    "CquinRule": {
      "type": "object",
      "properties": {
        "expected": {
          "type": "boolean",
          "description": "Indicates if a value is expected in the field associated with the CQUIN rule."
        },
        "completed": {
          "type": "boolean",
          "description": "Indicates if a value was expected and was present in the field associated with the CQUIN rule."
        },
        "valid": {
          "type": "boolean",
          "description": "Indicates if a value was expected and a valid value was present in the field associated with the CQUIN rule."
        }
      }
    },
    "DataQuality": {
      "type": "object",
      "properties": {
        "chief_complaint": {
          "$ref": "#/definitions/CquinRule"
        },
        "primary_diagnosis": {
          "$ref": "#/definitions/CquinRule"
        }
      }
    },
    "DecisionToAdmit": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "DECIDED TO ADMIT DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/d/dea/decided_to_admit_date_de.asp"
          },
          "description": "DECIDED TO ADMIT DATE is the same as attribute DECIDED TO ADMIT DATE. DECIDED TO ADMIT DATE may be the same as the date of admission (e.g. most emergency admissions). Alternatively, a decision can be made to admit at a future date. This decision denotes that the PATIENT is intended to be admitted to a Hospital Bed, either immediately or subsequently in the future. It records the event that a clinical DECISION TO ADMIT a PATIENT to a Hospital Bed has been made by or on behalf of someone, who has the right of admission to a Hospital Provider."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "DECIDED TO ADMIT TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/d/dea/decided_to_admit_time_de.asp"
          },
          "description": "The time a decision to admit was made."
        },
        "time_since_arrival": {
          "type": "number",
          "description": "Indicates waiting time in minutes from arrival to the time the decision was made to admit the patient."
        },
        "treatment_function_code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACTIVITY TREATMENT FUNCTION CODE (DECISION TO ADMIT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/act/activity_treatment_function_code_(decision_to_admit)_de.asp"
          },
          "description": "ACTIVITY TREATMENT FUNCTION CODE (DECISION TO ADMIT) is the TREATMENT FUNCTION CODE of the SERVICE to which a PATIENT is to be admitted."
        },
        "receiving_site": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION SITE IDENTIFIER (DISCHARGE FROM EMERGENCY CARE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_site_identifier_(discharge_from_emergency_care)_de.asp"
          },
          "description": "ORGANISATION SITE IDENTIFIER (DISCHARGE FROM EMERGENCY CARE) is the ORGANISATION IDENTIFIER of the Organisation Site to which a PATIENT is discharged following an Emergency Care Attendance."
        }
      }
    },
    "Departure": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY DEPARTURE DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accident_and_emergency_departure_date_de.asp"
          },
          "description": "An Accident and Emergency Departure Date is the date that a PATIENT leaves an Accident and Emergency Department after an Accident and Emergency Attendance has concluded."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "A and E DEPARTURE TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/a_and_e_departure_time_de.asp"
          },
          "description": "The time (HH:MM:SS) at which the patient departed A&E."
        },
        "time_since_arrival": {
          "type": "number",
          "description": "Indicates waiting time in minutes between from arrival to Departure Derived Column - Use Time difference between Arrival_date, Arrival_Time and departure_date , departure_time Return - Number in int format (Only the Minutes part ignore the seconds or fraction If either of the submitted element is missing then derivation result is Null"
        }
      }
    },
    "Diagnoses": {
      "type": "object",
      "properties": {
        "snomed": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SnomedDiagnosis"
          }
        }
      }
    },
    "Discharge": {
      "type": "object",
      "properties": {
        "status": {
          "$ref": "#/definitions/DischargeStatus"
        },
        "destination": {
          "$ref": "#/definitions/DischargeDestination"
        },
        "follow_up": {
          "$ref": "#/definitions/DischargeFollowUp"
        },
        "information_given": {
          "$ref": "#/definitions/DischargeInformationGiven"
        },
        "safeguarding_concerns": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SafeguardingConcern"
          }
        }
      }
    },
    "DischargeDestination": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DISCHARGE DESTINATION (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_discharge_destination_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE DISCHARGE DESTINATION (SNOMED CT) is the SNOMED CT concept ID which is used to identify the intended destination of the PATIENT following discharge from the Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Discharge Destination Code is approved on the activity_date"
        }
      }
    },
    "DischargeFollowUp": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DISCHARGE FOLLOW UP (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_discharge_follow_up_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE DISCHARGE FOLLOW UP (SNOMED CT) is the SNOMED CT concept ID which is used to identify the SERVICE to which a PATIENT was referred for continuing care following an Emergency Care Attendance."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Discharge FollowUp Code is approved on the activity_date"
        }
      }
    },
    "DischargeInformationGiven": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DISCHARGE INFORMATION GIVEN (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_discharge_information_given_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE DISCHARGE INFORMATION GIVEN (SNOMED CT) is the SNOMED CT concept ID which is used to identify whether a copy of a letter to their GENERAL PRACTITIONER has been printed and given to the PATIENT on discharge from an Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Discharge Information Given Code is approved on the activity_date"
        }
      }
    },
    "DischargeStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DISCHARGE STATUS (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_discharge_status_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE DISCHARGE STATUS (SNOMED CT) is the SNOMED CT concept ID which is used indicate the status of the PATIENT on discharge from an Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Discharge Status Code is approved on the activity_date"
        }
      }
    },
    "ExpectedTreatmentTime": {
      "type": "object",
      "properties": {
        "timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "EMERGENCY CARE EXPECTED DATE AND TIMESTAMP OF TREATMENT",
            "href": "https://datadictionary.nhs.uk/data_elements/emergency_care_expected_date_and_timestamp_of_treatment.html"
          },
          "description": "An Emergency Care Expected Date and Timestamp of Treatment is the date, time and time zone a patient should expect to receive treatment at the Emergency Care Department."
        },
        "allocation_timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "EMERGENCY CARE TREATMENT ALLOCATION TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/emergency_care_treatment_allocation_timestamp.html"
          },
          "description": "Emergency Care Treatment Allocation Timestamp is the date, time and time zone that an Emergency Care Expected Date and Timestamp of Treatment was allocated to the Patient."
        }
      }
    },
    "GPRegistration": {
      "type": "object",
      "properties": {
        "general_practitioner": {
          "type": "string",
          "data_dictionary": {
            "name": "GENERAL MEDICAL PRACTITIONER (SPECIFIED)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/g/general_medical_practitioner_(specified)_de.asp"
          },
          "description": "This is the submitted value of General Medical Practitioner (Specified) which is the PPD (NHS Prescription Services) code for the General Medical Practitioner specified by the patient."
        },
        "general_practice": {
          "type": "string",
          "data_dictionary": {
            "name": "GENERAL MEDICAL PRACTICE CODE (PATIENT REGISTRATION)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/g/general_medical_practice_code_(patient_registration)_de.asp"
          },
          "description": "The organisation code of the GP Practice that the patient is registered with. The code before testing against reference files. In the event that an organisation code cannot be given, the ODS default codes must be used. The ODS default codes used are:"
        },
        "pds_general_practice": {
          "type": "string",
          "description": "This is the patient's GP Practice Code as registered in the Personal Demographic Service (PDS) found by using the submitted value of NHS Number"
        },
        "responsible_ccg_from_general_practice": {
          "type": "string",
          "description": "This is the Clinical Commissioning Group (CCG) code found in Organisation Data Service (ODS) reference data associated with the practice code for the patient as registered in the Personal Demographic Service (PDS). If no entry is found on PDS then the submitted value for GP Practice is used."
        },
        "hes_ccg_from_general_practice": {
          "type": "string",
          "description": "The derived CCG using the GP Practice in the CDS record ONLY USED IN 011 (Emergency Care) Records"
        },
        "hes_responsible_ccg": {
          "$ref": "#/definitions/HESCCGResponsible"
        }
      }
    },
    "Grouping": {
      "type": "object",
      "properties": {
        "grouper_version": {
          "type": "string",
          "description": "This shows which version of the Healthcare Resource Group (HRG) algorithm was used to assign an HRG to the activity.  It will typically show the type of grouper and the year it was in use, eg P1617 refers to the Local Payment grouper used in financial year 2016-1017.  Other types of grouper include the Engagement grouper and the Consultation grouper - these are not currently used by SUS."
        },
        "code_cleaning_applied": {
          "type": "boolean",
          "description": "Signifies whether relevant clinical codes in the record have been cleaned before submission to grouping."
        },
        "health_resource_group": {
          "type": "string",
          "description": "The core HRG derived by SUS - as a result of HRG grouping - and used for tariff application."
        }
      }
    },
    "HESCCGFromTreatmentSite": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "The derived CCG using the Treatment Site, or failing that, the Provider Code in the CDS record."
        },
        "origin": {
          "type": "string",
          "description": "The HES origin code which indicates the origin of the HESCCGFromTreatmentSiteValue"
        }
      }
    },
    "HESCCGResponsible": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "The derived CCG using the first available valid CCG derivation from input values from the CDS record. GP Practice, Patient Postcode, Treatment Site, Provider Code, in that order."
        },
        "origin": {
          "type": "string",
          "description": "The HES origin code which indicates the origin of the HESCCGResponsibleValue"
        }
      }
    },
    "IndexOfMultipleDeprivation": {
      "type": "object",
      "properties": {
        "decile": {
          "type": "string",
          "description": "The deciles are calculated by ranking the 32,844 LSOAs in England from most deprived to least deprived and dividing them into 10 equal groups. LSOAs in decile 1 fall within the most deprived 10% of LSOAs nationally and LSOAs in decile 10 fall within the least deprived 10% of LSOAs nationally."
        },
        "decile_description": {
          "type": "string",
          "description": "Description for Index of Multiple Decile Deprivation"
        }
      }
    },
    "InitialAssessment": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY INITIAL ASSESSMENT DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accident_and_emergency_initial_assessment_date_de.asp"
          },
          "description": "This records the date when the PATIENT is first assessed in the Accident and Emergency Department."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "A and E INITIAL ASSESSMENT TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/a_and_e_initial_assessment_time_de.asp"
          },
          "description": "The time (HH:MM:SS) at which the A&E Initial Assessment was made."
        },
        "time_since_arrival": {
          "type": "number",
          "description": "Indicates waiting time in minutes from arrival to initial assessment Derived Column - Use Time difference between Arrival_date, Arrival_Time and initial_assessment_date , initial_assessment_time Return - Number in int format (Only the Minutes part ignore the seconds or fraction If either of the submitted element is missing then derivation result is Null"
        }
      }
    },
    "Injury": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_date_de.asp"
          },
          "description": "An Injury Date is an ACTIVITY DATE TIME."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_time_de.asp"
          },
          "description": "An Injury Time is an ACTIVITY DATE TIME."
        },
        "activity_status": {
          "$ref": "#/definitions/InjuryActivityStatus"
        },
        "activity_type": {
          "$ref": "#/definitions/InjuryActivityType"
        },
        "alcohol_drug_involvements": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/InjuryAlcDrugInvolvement"
          }
        },
        "intent": {
          "$ref": "#/definitions/InjuryIntent"
        },
        "mechanism": {
          "$ref": "#/definitions/InjuryMechanism"
        },
        "place": {
          "$ref": "#/definitions/PlaceOfInjury"
        }
      }
    },
    "InjuryActivityStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY ACTIVITY STATUS (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_activity_status_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE INJURY ACTIVITY STATUS (SNOMED CT) is the SNOMED CT concept ID which is used to identify the status of activity being undertaken by the PATIENT when the injury occurred."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Injury Activity Status Code is approved on the activity_date"
        }
      }
    },
    "InjuryActivityType": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY ACTIVITY TYPE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_activity_type_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE INJURY ACTIVITY TYPE (SNOMED CT) is the SNOMED CT concept ID which is used to identify the type of activity being undertaken by the PERSON at the moment the injury occurred."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Injury Activity Type is approved on the activity_date"
        }
      }
    },
    "InjuryAlcDrugInvolvement": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY ALCOHOL DRUG INVOLVEMENT",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_alcohol_or_drug_involvement_de.asp"
          },
          "description": "EMERGENCY CARE INJURY ALCOHOL OR DRUG INVOLVEMENT (SNOMED CT) is the SNOMED CT concept ID which is used to identify any drugs or alcohol used by the PATIENT, which are thought likely to have contributed to the need to attend the Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Alcohol Drug Involvement Code is approved on the activity_date"
        }
      }
    },
    "InjuryIntent": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY INTENT (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_intent_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE INJURY INTENT (SNOMED CT) is the SNOMED CT concept ID which is used to identify the most likely human intent in the occurrence of the injury or poisoning as assessed by the CARE PROFESSIONAL."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Injury Intent Code is approved on the activity_date"
        }
      }
    },
    "InjuryMechanism": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE INJURY MECHANISM (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_injury_mechanism_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE INJURY MECHANISM (SNOMED CT) is the SNOMED CT concept ID which is used to identify how an injury was caused."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Injury Mechanism is approved on the activity_date"
        }
      }
    },
    "Interchange": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "Generated interchange identifier"
        },
        "received_date": {
          "type": "string",
          "format": "date",
          "description": "The date the interchange was received by SUS+"
        },
        "schema_version": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS MESSAGE VERSION NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_message_version_number_de.asp"
          },
          "description": "This item represents the CDS Schema Version used to submit the interchange the data was carried in."
        }
      }
    },
    "InterpreterLanguage": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "INTERPRETER LANGUAGE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/i/in/interpreter_language_(snomed_ct)_de.asp"
          },
          "description": "INTERPRETER LANGUAGE (SNOMED CT) is the SNOMED CT concept ID which is used to record the LANGUAGE of the interpreter required by the PERSON."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Interpreter Language Code is approved on the activity_date"
        }
      }
    },
    "Investigations": {
      "type": "object",
      "properties": {
        "snomed": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SnomedInvestigation"
          }
        }
      }
    },
    "LSOAProviderDistance": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "The distance between the LSOA centroid of the patient's submitted postcode and the LSOA centroid of the provider."
        },
        "origin": {
          "type": "string",
          "description": "The HES origin code which indicates the origin of the LSOA Provider Distance"
        }
      }
    },
    "LSOASiteOfTreatmentDistance": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "description": "The distance between the LSOA centroid of the patient's submitted postcode and the LSOA centroid of the site of treatment."
        },
        "origin": {
          "type": "string",
          "description": "The HES origin code which indicates the origin of the LSOA site of treatment Distance"
        }
      }
    },
    "LocalPatientIdentifier": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "data_dictionary": {
            "name": "LOCAL PATIENT IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/l/lo/local_patient_identifier_de.asp"
          },
          "description": "This is a person unique identifier from the sender. In the hospital it may relate to the notes number on a physical patient record or an identifier within the patient administration system."
        },
        "issuer": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (LOCAL PATIENT IDENTIFIER)"
          },
          "description": "The organisation code of the organisation that assigned the Local Patient Identifier."
        }
      }
    },
    "Location": {
      "type": "object",
      "properties": {
        "site": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION SITE IDENTIFIER (OF TREATMENT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_site_identifier_(of_treatment)_de.asp"
          },
          "description": "The Organisation Site within the Organisation on which the PATIENT was treated, since facilities may vary on different hospital sites."
        },
        "hes_provider_3": {
          "type": "string",
          "description": "The first 3 characters of the provider code."
        },
        "hes_provider_5": {
          "type": "string",
          "description": "The first 5 characters of the provider code."
        },
        "postcode_district": {
          "type": "string",
          "description": "This is effectively the outward (leading) part of the postcode of the submitted Provider Code as found in Organisation Services Data. It is formed by removing the last three characters from the postcode value which has first been trimmed to remove non-alphanumeric characters such as spaces."
        },
        "government_office_region": {
          "type": "string",
          "description": "Derived hospital provider code for treatment. This will find the postcode of the provider code, along with the country code."
        },
        "sha_provider": {
          "type": "string",
          "description": "This represents Either the historical parent SHA of  Provider or the current LAT (Local Area Team) of  provider. It is found in Organisation Data Service (ODS) data using the submitted Provider Code."
        },
        "hes_ccg_from_treatment_site": {
          "$ref": "#/definitions/HESCCGFromTreatmentSite"
        },
        "department_type": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION SITE IDENTIFIER (OF TREATMENT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_department_type_de.asp"
          },
          "description": "The department type in which the PATIENT was treated"
        },
        "lsoa_provider_distance": {
          "$ref": "#/definitions/LSOAProviderDistance"
        },
        "lsoa_site_of_treatment_distance": {
          "$ref": "#/definitions/LSOASiteOfTreatmentDistance"
        }
      }
    },
    "MentalHealthActLegalStatus": {
      "type": "object",
      "properties": {
        "classification": {
          "type": "string",
          "data_dictionary": {
            "name": "MENTAL HEALTH ACT LEGAL STATUS CLASSIFICATION CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/m/men/mental_health_act_legal_status_classification_code_de.asp"
          },
          "description": "A code which identifies the MHA Legal Status Classification."
        },
        "start_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "START DATE (MENTAL HEALTH ACT LEGAL STATUS CLASSIFICATION ASSIGNMENT PERIOD)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/s/star/start_date_(mental_health_act_legal_status_classification_assignment_period)_de.asp"
          },
          "description": "The start date of the MHA Legal Status Classification Assignment Period."
        },
        "start_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "START TIME (MENTAL HEALTH ACT LEGAL STATUS CLASSIFICATION ASSIGNMENT PERIOD)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/s/star/start_time_(mental_health_act_legal_status_classification_assignment_period)_de.asp"
          },
          "description": "The start time of the MHA Legal Status Classification Assignment Period."
        },
        "expiry_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "EXPIRY DATE (MENTAL HEALTH ACT LEGAL STATUS CLASSIFICATION)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/ex/expiry_date_(mental_health_act_legal_status_classification)_de.asp"
          },
          "description": "The date when a MHA Legal Status Classification for a patient expires."
        },
        "expiry_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "EXPIRY TIME (MENTAL HEALTH ACT LEGAL STATUS CLASSIFICATION)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/ex/expiry_time_(mental_health_act_legal_status_classification)_de.asp"
          },
          "description": "The time when a MHA Legal Status Classification for a patient expires."
        }
      }
    },
    "NationalPricing": {
      "type": "object",
      "properties": {
        "costing_period": {
          "type": "string",
          "description": "This returns a formatted costing period, e.g. \"M01 - Apr 2016\". It is derived from the date of the activity and is the calendar month when payment falls due: For Admitted Patient Care records the date used is the Hospital Discharge Date for the completed spell; for Other Deliveries it is the Delivery Date for Outpatients it is the Appointment Date for Emergency Medicine it is the Arrival Date"
        },
        "excluded": {
          "type": "boolean",
          "description": "Signifies whether the record is nationally priced or not. Normally, a record is excluded from national pricing for defined reasons - see the Exclusion Reason field of the record for those reasons."
        },
        "exclusion_reasons": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "This field contains one of the reasons as to why the record/spell is excluded from national pricing."
        },
        "tariff": {
          "type": "string",
          "format": "-?[0-9]+(\\.[0-9]+)?",
          "description": "The national tariff appropriate for either the spell (APC), the appointment (OP) or the attendance (EM). The primary driver is the spell core HRG but this could be modified by:"
        },
        "tariff_description": {
          "type": "string",
          "description": "This field will be populated with a string that details which of the possible tariffs has been applied as PbR Final Tariff. It also deals with identifying Best Practice tariffs."
        },
        "market_forces_factor": {
          "type": "string",
          "format": "-?[0-9]+(\\.[0-9]+)?",
          "description": "The MFF adjustment factor applied to the price calculation."
        },
        "market_forces_adjustment": {
          "type": "string",
          "format": "-?[0-9]+(\\.[0-9]+)?",
          "description": "The increment to the overall price attributable to application of the Market Forces Factor adjustment."
        },
        "final_price": {
          "type": "string",
          "format": "-?[0-9]+(\\.[0-9]+)?",
          "description": "This field contains the final calculated national price. The derivation calculations are as follows:"
        }
      }
    },
    "NhsNumber": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "data_dictionary": {
            "name": "NHS NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/n/nhs/nhs_number_de.asp"
          },
          "description": "The NHS Number of the patient the record refers to."
        },
        "status": {
          "type": "string",
          "data_dictionary": {
            "name": "NHS NUMBER STATUS INDICATOR CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/n/nhs/nhs_number_status_indicator_code_de.asp"
          },
          "description": "This is a flag that indicates if the NHS Number of the patient has been traced by the sender against the tracing service e.g."
        },
        "is_valid": {
          "type": "boolean",
          "description": "This is a flag that indicates if the NHS Number meets validity criteria:"
        }
      }
    },
    "Participant": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "data_dictionary": {
            "name": "PROFESSIONAL REGISTRATION ENTRY IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/prod/professional_registration_entry_identifier_de.asp"
          },
          "description": "The registration identifier allocated by the professional body."
        },
        "issuer": {
          "type": "string",
          "data_dictionary": {
            "name": "PROFESSIONAL REGISTRATION ISSUER CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/prod/professional_registration_issuer_code_de.asp"
          },
          "description": "Code identifying the Professional Registration Body."
        },
        "tier": {
          "type": "string",
          "data_dictionary": {
            "name": "CARE PROFESSIONAL TIER (EMERGENCY CARE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/care/care_professional_tier_(emergency_care)_de.asp"
          },
          "description": "The tier of care professional treating the patient during an Emergency Care Attendance. The care professional tiers for emergency care are defined in the Royal College of Emergency Medicine Guidelines for Medical and Practitioner Staffing in Emergency Departments. See the Royal College of Emergency Medicine website."
        },
        "has_discharge_responsibility": {
          "type": "string",
          "data_dictionary": {
            "name": "CARE PROFESSIONAL DISCHARGE RESPONSIBILITY INDICATOR (EMERGENCY CARE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/care/care_professional_discharge_responsibility_indicator_(emergency_care)_de.asp"
          },
          "description": "An indication of whether a care professional is responsible for discharge of the patient from an emergency care attendance."
        },
        "clinical_responsibility_timestamp": {
          "type": "string",
          "format": "date-time",
          "data_dictionary": {
            "name": "CARE PROFESSIONAL CLINICAL RESPONSIBILITY TIMESTAMP",
            "href": "https://datadictionary.nhs.uk/data_elements/care_professional_clinical_responsibility_timestamp.html"
          },
          "description": "A Care Professional Clinical Responsibility Timestamp is the date, time when the Care Professional first became clinically responsible for the patient."
        }
      }
    },
    "Patient": {
      "type": "object",
      "properties": {
        "nhs_number": {
          "$ref": "#/definitions/NhsNumber"
        },
        "local_patient_identifier": {
          "$ref": "#/definitions/LocalPatientIdentifier"
        },
        "withheld_identity_reason": {
          "type": "string",
          "data_dictionary": {
            "name": "WITHHELD IDENTITY REASON",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/w/we/withheld_identity_reason_de.asp"
          },
          "description": "This field allows suppliers of Commissioning Data Set records to indicate to recipients of the record (for example, the Commissioner of the activity) that the record has been purposely anonymised for a valid reason. Values can be:"
        },
        "birth_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "PERSON BIRTH DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/p/person/person_birth_date_de.asp"
          },
          "description": "The date of birth of the patient the record refers to."
        },
        "birth_month": {
          "type": "number",
          "data_dictionary": {
            "name": "PERSON BIRTH DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_birth_date_de.asp"
          },
          "description": "The month component of the person's date of birth e.g \"07\" meaning July."
        },
        "birth_year": {
          "type": "number",
          "data_dictionary": {
            "name": "PERSON BIRTH DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_birth_date_de.asp"
          },
          "description": "The year component of the person's date of birth."
        },
        "patient_type": {
          "type": "string",
          "description": "Could also be interpreted as Age Band."
        },
        "age_range": {
          "type": "number",
          "description": "The age range of the patient derived from either the A&E Arrival Date, the OP Appointment Date, the Episode Start Date or the Delivery Date. The values are representative of age ranges in 5 year increments:"
        },
        "age_at_cds_activity_date": {
          "type": "number",
          "data_dictionary": {
            "name": "AGE AT CDS ACTIVITY DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/ag/age_at_cds_activity_date_de.asp"
          },
          "description": "The age in years of the patient derived by the sender as at the relevant CDS activity date of the CDS type."
        },
        "age_at_arrival": {
          "type": "number",
          "description": "Age at Start of Episode derived from submitted date of birth and episode start date (defaults to age at CDS activity date if no DOB submitted)."
        },
        "fractional_age_at_arrival": {
          "type": "number",
          "description": "The age of the patient on the record start date. The maximum value output is 120. If the patient is older than 1 year, a calculation is made by dividing the number of days from the Date of Birth by 365.25 to determine the age in years, otherwise the age is returned as an age in fraction:"
        },
        "hes_age_at_arrival": {
          "type": "number",
          "description": "The age of the patient on the record start date. The maximum value output is 120. If the patient is older than 1 year, a calculation is made by dividing the number of days from the Date of Birth by 365.25 to determine the age in years, otherwise the age is returned as an age range code between 7001 and 7007:"
        },
        "hes_age_at_departure": {
          "type": "number",
          "description": "The age of the patient on the record end date. The maximum value output is 120. If the patient is older than 1 year, a calculation is made by dividing the number of days from the Date of Birth by 365.25 to determine the age in years, otherwise the age is returned as an age range code between 7001 and 7007:"
        },
        "name": {
          "$ref": "#/definitions/PatientName"
        },
        "usual_address": {
          "$ref": "#/definitions/PatientUsualAddress"
        },
        "residence_ccg": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (RESIDENCE RESPONSIBILITY)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(residence_responsibility)_de.asp"
          },
          "description": "Organisation Code (Residence Responsibility) is the Organisation Code derived from the patient's postcode of usual address, where they reside  within the boundary of a:"
        },
        "residence_ccg_from_patient_postcode": {
          "type": "string",
          "description": "The CCG (formerly PCT) of residence looked up in Organisation Data Service (ODS) reference data either from the postcode found in Personal Demographics Service (PDS) data against the submitted NHS Number or directly from the postcode value submitted as no PDS value was found."
        },
        "hes_ccg_from_patient_postcode": {
          "type": "string",
          "description": "The derived CCG using the patient postcode in the CDS record"
        },
        "stated_gender": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON STATED GENDER CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_stated_gender_code_de.asp"
          },
          "description": "The stated gender of the patient. The codes to be submitted are as follows:"
        },
        "ethnic_category": {
          "type": "string",
          "data_dictionary": {
            "name": "ETHNIC CATEGORY CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/e/end/ethnic_category_code_de.asp"
          },
          "description": "A code that indicates the ethnicity of the patient, this is a value that the patients themselves specify. This field will be populated with an alphabetic value from A to Z; consult the NHS data dictionary link below for further details."
        },
        "ethnic_category_2021": {
          "type": "string",
          "description": "NOT CONFIRMED. It is likely that ethnic categories will be updated to reflect the 2021 census categories, which may result in a new data item. This will be communicated as part of a formal national update to the data set."
        },
        "accommodation_status": {
          "$ref": "#/definitions/AccommodationStatus"
        },
        "preferred_spoken_language": {
          "$ref": "#/definitions/PreferredSpokenLanguage"
        },
        "accessible_information_professional_required": {
          "$ref": "#/definitions/AccessibleInformationProfessionalRequired"
        },
        "interpreter_language": {
          "$ref": "#/definitions/InterpreterLanguage"
        },
        "overseas_visitor_charging_category": {
          "type": "string",
          "data_dictionary": {
            "name": "OVERSEAS VISITOR CHARGING CATEGORY AT CDS ACTIVITY DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/ov/overseas_visitor_charging_category_at_cds_activity_date_de.asp"
          },
          "description": "The charging category relating to an overseas visitor at the time of the activity."
        },
        "gp_registration": {
          "$ref": "#/definitions/GPRegistration"
        },
        "mental_health_act_legal_status": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/MentalHealthActLegalStatus"
          }
        }
      }
    },
    "PatientName": {
      "type": "object",
      "properties": {
        "full_name": {
          "type": "string",
          "data_dictionary": {
            "name": "PATIENT NAME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pat/patient_name_de.asp"
          },
          "description": "The name of the patient. The patient name should only be included where the NHS Number is not present or is present and not traced. Structured and unstructured name fields are presented as a single entity in the extract."
        },
        "title": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON TITLE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_title_de.asp"
          },
          "description": "PERSON TITLE is the standard form of address used to precede a PERSON's name. The Person Title should only be included where the NHS Number is not present or is present and not traced."
        },
        "given_name": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON GIVEN NAME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_given_name_de.asp"
          },
          "description": "The forename or given name of a person. The patient name should only be included where the NHS Number is not present or is present and not traced."
        },
        "family_name": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON FAMILY NAME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_family_name_de.asp"
          },
          "description": "The part of a person's name which is used to describe family, clan, tribal group, or marital association. The patient name should only be included where the NHS Number is not present or is present and not traced."
        },
        "suffix": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON NAME SUFFIX",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_name_suffix_de.asp"
          },
          "description": "A textual suffix that may be added to the end of a person's name. The patient name should only be included where the NHS Number is not present or is present and not traced."
        },
        "initials": {
          "type": "string",
          "data_dictionary": {
            "name": "PERSON INITIALS",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pers/person_initials_de.asp"
          },
          "description": "This field is used to record a person's initials. The patient name should only be included where the NHS Number is not present or is present and not traced."
        }
      }
    },
    "PatientPathwayIdentifier": {
      "type": "object",
      "properties": {
        "value": {
          "type": "string",
          "data_dictionary": {
            "name": "PATIENT PATHWAY IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pat/patient_pathway_identifier_de.asp"
          },
          "description": "This is the unique identifier that may be used to tie all treatments within the single care pathway together. It may be absent when Unique Booking Reference Number is present or it may be the same as the Unique Booking Reference Number."
        },
        "issuer": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (PATIENT PATHWAY IDENTIFIER ISSUER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(patient_pathway_identifier_issuer)_de.asp"
          },
          "description": "This is the code of the organisation that assigned the Patient Pathway Identifier. Patient Pathway Identifiers are not necessarily unique across hospitals, the addition of the organisation code ensures uniqueness."
        }
      }
    },
    "PatientUsualAddress": {
      "type": "object",
      "properties": {
        "full_address": {
          "type": "string",
          "data_dictionary": {
            "name": "PATIENT USUAL ADDRESS",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pat/patient_usual_address_de.asp"
          },
          "description": "The usual address of the patient. The address should only be included where the NHS Number is not present or is present and not traced. All address fields other than postcode are presented as a single entity in the extract."
        },
        "address_lines": {
          "type": "array",
          "items": {
            "type": "string",
            "data_dictionary": {
              "name": "PATIENT USUAL ADDRESS",
              "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pat/patient_usual_address_de.asp"
            }
          },
          "description": "The usual address lines of the patient. The address should only be included where the NHS Number is not present or is present and not traced."
        },
        "postcode": {
          "type": "string",
          "data_dictionary": {
            "name": "POSTCODE OF USUAL ADDRESS",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/po/postcode_of_usual_address_de.asp"
          },
          "description": "The postcode of the address nominated by the patient."
        },
        "is_postcode_valid": {
          "type": "boolean",
          "description": "This is a flag to indicate if the postcode is valid."
        },
        "postcode_district": {
          "type": "string",
          "description": "This is effectively the outward (leading) part of the submitted postcode. It is formed by removing the last three characters from the postcode value which has first been trimmed to remove non-alphanumeric characters such as spaces."
        },
        "oa_11": {
          "type": "string",
          "description": "The 2011 Census Output Areas in GB and SAs in Northern Ireland were based on 2001 Census OAs, and they form the building bricks for defining higher level geographies."
        },
        "msoa_11": {
          "type": "string",
          "description": "The 2011 Census MSOA code for England and Wales and IZ code for Scotland. Pseudo codes are included for Northern Ireland, Channel Islands and Isle of Man."
        },
        "lsoa_11": {
          "type": "string",
          "description": "A Lower Layer Super Output Area (LSOA) is a GEOGRAPHIC AREA. Lower Layer Super Output Areas are a geographic hierarchy designed to improve the reporting of small area statistics in England and Wales. Lower Layer Super Output Areas are built from groups of contiguous Output Areas and have been automatically generated to be as consistent in population size as possible, and typically contain from four to six Output Areas. The Minimum population is 1000 and the mean is 1500. There are 32,844 Lower-layer Super Output Areas (LSOAs) in England. They were produced by the Office for National Statistics for the reporting of small area statistics."
        },
        "country": {
          "type": "string",
          "description": "Derived from the Office of National Statistics NHS Postcode Directory"
        },
        "government_office_region": {
          "type": "string",
          "description": "Derived code for the Residence Government Office Region."
        },
        "residence_county": {
          "type": "string",
          "description": "Derived code for the Residence County."
        },
        "local_authority_district": {
          "type": "string",
          "description": "Derived code for the Residence Local Authority District."
        },
        "parliamentary_constituency": {
          "type": "string",
          "description": "Derived code for the Parliamentary Constituency."
        },
        "ed_county_code": {
          "type": "string",
          "description": "Report field 1991 Census ED"
        },
        "ed_district_code": {
          "type": "string",
          "description": "Report field ED District Code"
        },
        "electoral_ward_1998": {
          "type": "string",
          "description": "Report field 1998 Electoral Area"
        },
        "index_of_multiple_deprivation": {
          "$ref": "#/definitions/IndexOfMultipleDeprivation"
        },
        "rural_urban_indicator": {
          "type": "string",
          "description": "The 2001 Census urban and rural classification of output areas for England and Wales, Scotland and Northern Ireland."
        },
        "cancer_registry": {
          "type": "string",
          "description": "The cancer registry that each postcode falls within. A pseudo code is included for Scotland, Northern Ireland, Channel Islands and Isle of Man."
        },
        "grid_link_reference": {
          "type": "string",
          "description": "The grid link reference of the postcode. If postcode is valid, then postcode grid link reference is Ordnance Survey east concatenated with Ordnance Survey North separated by space."
        },
        "commissioning_region": {
          "type": "string",
          "description": "The responsible commissioning region derived from the patient postcode."
        }
      }
    },
    "PlaceOfInjury": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE PLACE OF INJURY (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_place_of_injury_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE PLACE OF INJURY (SNOMED CT) is the SNOMED CT concept ID which is used to identify the type of LOCATION at which the PATIENT was present when the injury occurred."
        },
        "is_type_approved": {
          "type": "boolean",
          "description": "Tests if the Place Of Injury Code is approved on the activity_date"
        },
        "latitude": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE PLACE OF INJURY - LATITUDE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_place_of_injury_latitude_de.asp"
          },
          "description": "EMERGENCY CARE PLACE OF INJURY (LATITUDE) is the latitude of the EMERGENCY CARE PLACE OF INJURY (SNOMED CT), expressed in decimal degrees."
        },
        "longitude": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE PLACE OF INJURY - LONGITUDE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_place_of_injury_longitude_de.asp"
          },
          "description": "EMERGENCY CARE PLACE OF INJURY (LONGITUDE) is the longitude of the EMERGENCY CARE PLACE OF INJURY (SNOMED CT), expressed in decimal degrees."
        }
      }
    },
    "PreferredSpokenLanguage": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "PREFERRED SPOKEN LANGUAGE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/pot/preferred_spoken_language_(snomed_ct)_de.asp"
          },
          "description": "PREFERRED SPOKEN LANGUAGE (SNOMED CT) is the SNOMED CT concept ID which is used to capture the preferred spoken LANGUAGE of the PERSON."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Preferred Spoken Language Code is approved on the activity_date"
        }
      }
    },
    "Record": {
      "type": "object",
      "properties": {
        "identifier": {
          "type": "string",
          "description": "The generated unique identifier for the episode."
        },
        "version": {
          "type": "string",
          "description": "The timestamp for when the record was added to the database Presented as CCYYMMDDHHMMSSmmm, for example 20170518101226415"
        },
        "confidentiality_category": {
          "type": "number",
          "description": "In most cases, this field will be blank. When populated, it can contain the following values based on the description given:"
        },
        "reasons_access_provided": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Also known as Reason For Access (RFA)."
        },
        "cds_record_identifier": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS RECORD IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_record_identifier_de.asp"
          },
          "description": "(May also be referred to as CDS RID)"
        },
        "cds_record_type": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS TYPE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_type_code_de.asp"
          },
          "description": "A code to identify the Commissioning Data Set type of the submitted record."
        },
        "cds_group_indicator": {
          "type": "number",
          "description": "Identifies the Commissioning Data Set group type used in Payments by Results processing"
        },
        "finished_indicator": {
          "type": "number",
          "description": "An indicator to show whether an event is finished or unfinished. The values are:"
        },
        "cds_activity_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "CDS ACTIVITY DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_activity_date_de.asp"
          },
          "description": "This is a mandatory item for ALL CDS Types and is carried in the Transaction Header to be used as part of the update protocol. It is the CDS Originating Date; the link below provides further detail about which date is used for each CDS type."
        },
        "sender": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS INTERCHANGE SENDER IDENTITY",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_interchange_sender_identity_de.asp"
          },
          "description": "The assigned EDI Address of the physical Organisation or site responsible for sending Commissioning data."
        },
        "prime_recipient": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS PRIME RECIPIENT IDENTITY",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_prime_recipient_identity_de.asp"
          },
          "description": "The mandatory NHS Organisation Code (or valid Organisation Data Service Default Code) representing the Organisation determined to be the Commissioning Data Set Prime Recipient of the Commissioning Data Set Message as indicated in the Commissioning Data Set Addressing Grid. Where appropriate, the following ODS Default code may be used:"
        },
        "provider": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (CODE OF PROVIDER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(code_of_provider)_de.asp"
          },
          "description": "The Organisation Code of the Organisation acting as a Health Care Provider as issued by the Organisation Data Service (ODS). This field represents the organisation receiving payment for the associated activity. The value is the Provider Code reason for access to data held on user smart cards and is used for item 'Reason Access Provided'."
        },
        "commissioner": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (CODE OF COMMISSIONER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(code_of_commissioner)_de.asp"
          },
          "description": "The Organisation Code of the Organisation commissioning health care as issued by the Organisation Data Service (ODS) and validated against reference data. The value is the Commissioner Code reason for access to data held on user smart cards and is used for item 'Reason Access Provided'. This value is submitted by the provider organisation and is subject to change on a given record as data is updated at source and resubmitted."
        },
        "copy_recipients": {
          "type": "array",
          "items": {
            "type": "string",
            "data_dictionary": {
              "name": "CDS TYPE",
              "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_copy_recipient_identity_de.asp"
            }
          },
          "description": "CDS COPY RECIPIENT IDENTITY is the same as attribute ORGANISATION CODE. A Recipient may be an agency or service provider that carries out the receiving (and perhaps other) processes on behalf of the NHS Organisation that ultimately uses the data. There may be multiple recipients for Commissioning data."
        }
      }
    },
    "ReferenceData": {
      "type": "object",
      "properties": {
        "snomed_version": {
          "type": "string",
          "description": "Indicates the Snomed CT reference data version number"
        }
      }
    },
    "Referral": {
      "type": "object",
      "properties": {
        "ubrn": {
          "$ref": "#/definitions/UBRN"
        },
        "patient_pathway_identifier": {
          "$ref": "#/definitions/PatientPathwayIdentifier"
        },
        "period_status": {
          "type": "string",
          "data_dictionary": {
            "name": "REFERRAL TO TREATMENT PERIOD STATUS",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referral_to_treatment_period_status_de.asp?"
          },
          "description": "One of a set of defined codes that indicates this treatment's position within a referral to treatment period or the fact that this treatment is not part of a referral to treatment measured pathway."
        },
        "waiting_time_measurement_type": {
          "type": "string",
          "data_dictionary": {
            "name": "WAITING TIME MEASUREMENT TYPE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/w/waiting_time_measurement_type_de.asp"
          },
          "description": "The type of waiting time measurement methodology which may be applied during a patient pathway."
        },
        "period_start_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "REFERRAL TO TREATMENT PERIOD START DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referral_to_treatment_period_start_date_de.asp"
          },
          "description": "This is that date of one of a variety of events that starts the referral to treatment clock calculation, for example the initial referral date or the failed to attend clinic date."
        },
        "period_end_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "REFERRRAL TO TREATMENT PERIOD END DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referral_to_treatment_period_end_date_de.asp"
          },
          "description": "This should indicate the end date of a referral to treatment clock calculation; it may be when the first definite treatment started or when another relevant stopping event occurred."
        },
        "period_length": {
          "type": "number",
          "description": "The total time of the subject referral to treatment period calculated by subtracting the Referral To Treatment Period Start Date from the Referral To Treatment Period End Date (in whole days). Both fields are submitted data."
        }
      }
    },
    "ReferredTo": {
      "type": "object",
      "properties": {
        "service": {
          "type": "string",
          "data_dictionary": {
            "name": "REFERRED TO SERVICE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referred_to_service_(snomed_ct)_de.asp"
          },
          "description": "An inpatient service to which the patient was referred for admission or opinion by the treating clinician."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Referred To Service Code is approved on the activity_date"
        },
        "request_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ACTIVITY SERVICE REQUEST DATE (EMERGENCY CARE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/act/activity_service_request_date_(emergency_care)_de.asp"
          },
          "description": "The date the patient was referred to another service during an emergency care attendance."
        },
        "request_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "ACTIVITY SERVICE REQUEST TIME (EMERGENCY CARE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/act/activity_service_request_time_(emergency_care)_de.asp"
          },
          "description": "The time the patient was referred to another service during an emergency care attendance."
        },
        "assessment_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "REFERRED TO SERVICE ASSESSMENT DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referred_to_service_assessment_date_de.asp"
          },
          "description": "The date that a care professional from the referred to service assesses the patient."
        },
        "assessment_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "REFERRED TO SERVICE ASSESSMENT TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/r/ref/referred_to_service_assessment_time_de.asp"
          },
          "description": "The time that a care professional from the referred to service assesses the patient."
        }
      }
    },
    "Report": {
      "type": "object",
      "properties": {
        "query_identifier": {
          "type": "string",
          "description": "The system generated query ID appended to an extract. This data item is not displayed for user selection but is always included with each row."
        },
        "query_date": {
          "type": "string",
          "format": "date",
          "description": "The system generated date (YYYY-MM-DD) showing when the extract query was run. This data item is not displayed for user selection but is always included with each row."
        },
        "query_time": {
          "type": "string",
          "format": "time",
          "description": "The system generated date (hh:mm:ss) showing when the extract query was run. This data item is not displayed for user selection but is always included with each row."
        }
      }
    },
    "SafeguardingConcern": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "SAFEGUARDING CONCERN (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/s/safeguarding_concern_(snomed_ct)_de.asp"
          },
          "description": "Used to identify an unresolved issue or concern regarding adult and child safeguarding that requires communication to another organisation or care agency."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Safeguarding Concern Code is approved on the activity_date"
        }
      }
    },
    "SeenForTreatment": {
      "type": "object",
      "properties": {
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY DATE SEEN FOR TREATMENT",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/accident_and_emergency_date_seen_for_treatment_de.asp"
          },
          "description": "Accident and Emergency Date Seen For Treatment is the date, that the PATIENT is seen by a clinical decision maker (someone who can define the management plan and discharge the PATIENT) to diagnose the problem and arrange or start definite treatment as necessary."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "A and E TIME SEEN FOR TREATMENT",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/a/a_and_e_time_seen_for_treatment_de.asp"
          },
          "description": "The time (HH:MM:SS) at which the patient was seen for treatment."
        },
        "time_since_arrival": {
          "type": "number",
          "description": "Indicates waiting time in minutes between from arrival to seen for treatment Derived Column - Use Time difference between Arrival_date, Arrival_Time and date_seen_for_treatment , time_seen_for_treatment Return - Number in int format (Only the Minutes part ignore the seconds or fraction If either of the submitted element is missing then derivation result is Null"
        }
      }
    },
    "ServiceAgreement": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (CODE OF PROVIDER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(code_of_provider)_de.asp"
          },
          "description": "The Organisation Code of the Organisation acting as a Health Care Provider as issued by the Organisation Data Service (ODS). This field represents the organisation receiving payment for the associated activity. The value of this field is unaltered and is exactly as it was received in the CDS interchange."
        },
        "commissioner": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (CODE OF COMMISSIONER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(code_of_commissioner)_de.asp"
          },
          "description": "The Organisation Code of the Organisation commissioning health care as issued by the Organisation Data Service (ODS) and validated against reference data. The value is the Commissioner Code reason for access to data held on user smart cards and is used for item 'Reason Access Provided'. This value is submitted by the provider organisation and is subject to change on a given record as data is updated at source and resubmitted."
        },
        "commissioning_serial_number": {
          "type": "string",
          "data_dictionary": {
            "name": "COMMISSIONING SERIAL NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/n/nhs/nhs_service_agreement_number_de.asp"
          },
          "description": "A code agreed between the provider and the commissioner that indicates the commissioning contract line or other local commissioning granularity to aid commissioning discussion. If it begins with an \"=\" sign, this indicates that the record is excluded from the national tariff and a local agreement for the activity is in place, this activity will not be given a PbR price."
        },
        "line_number": {
          "type": "string",
          "data_dictionary": {
            "name": "NHS SERVICE AGREEMENT LINE NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/n/nhs/nhs_service_agreement_line_number_de.asp"
          },
          "description": "An optional locally defined identifier that may contain letters, numbers or other keyboard symbols that is used to specify the specific line of a contract or service agreement that the record belongs to."
        },
        "commissioner_reference_number": {
          "type": "string",
          "data_dictionary": {
            "name": "COMMISSIONER REFERENCE NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/c/com/commissioner_reference_number_de.asp"
          },
          "description": "This is locally defined between the provider and the Commissioner. it is a free text alphanumeric field for use within a Commissioning Data Set."
        },
        "provider_reference_number": {
          "type": "string",
          "data_dictionary": {
            "name": "PROVIDER REFERENCE NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/prod/provider_reference_number_de.asp"
          },
          "description": "This is locally defined between the provider and the Commissioner. it is a free text field that may contain letters, numbers or other keyboard symbols for use within a Commissioning Data Set."
        },
        "sha_commissioner": {
          "type": "string",
          "description": "This represents the current NHS England Region code or Non-English Commissioner organisation. It is found in Organisation Data Service (ODS) data using the Clinical Commissioning Group (CCG) code associated with the patient's GP practice code registered in the Personal Demographic Service (PDS)."
        },
        "is_commissioner_recognised": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is a notifiable disease"
        },
        "provider_type": {
          "type": "string",
          "description": "Derived code for the Provider Type."
        }
      }
    },
    "SnomedDiagnosis": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DIAGNOSIS (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_diagnosis_(snomed_ct)_de.asp"
          },
          "description": "Recorded A&E diagnosis in SNOMED CT format."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Diagnosis Code is approved on the activity_date"
        },
        "is_injury_related": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is injury related"
        },
        "equivalent_ae_code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY DIAGNOSIS",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/a/acc/accident_and_emergency_diagnosis_de.asp"
          },
          "description": "The diagnosis code translated from SNOMED CT to the legacy A&E classification."
        },
        "is_primary": {
          "type": "boolean",
          "description": "Indicates if this Diagnosis is the primary diagnosis as indicated by the provider."
        },
        "qualifier": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE DIAGNOSIS QUALIFIER (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_diagnosis_qualifier_(snomed_ct)_de.asp"
          },
          "description": "The EC Diagnosis qualifier pertaining to the recorded diagnosis in SNOMED CT format."
        },
        "is_qualifier_approved": {
          "type": "boolean",
          "description": "Indicates if Diagnosis Qualifier SNOMED CT code is approved by the Royal College of Emergency Medicine for use in the Emergency Care Data Set. 'True' indicates approval 'False' indicates a code was submitted but cannot be provided in the extract and the corresponding code column on that line will be blank."
        },
        "sequence_number": {
          "type": "number",
          "data_dictionary": {
            "name": "CODED CLINICAL ENTRY SEQUENCE NUMBER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/co/coded_clinical_entry_sequence_number_de.asp"
          },
          "description": "The sequence of the diagnosis in order of relevance to the emergency department attendance."
        },
        "is_aec_related": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is AEC related"
        },
        "is_allergy_related": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is allergy related"
        },
        "is_applicable_to_females": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is applicable to females"
        },
        "is_applicable_to_males": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is applicable to males"
        },
        "is_notifiable_disease": {
          "type": "boolean",
          "description": "Indicates if the diagnosis is a notifiable disease"
        }
      }
    },
    "SnomedInvestigation": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE CLINICAL INVESTIGATION (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_clinical_investigation_(snomed_ct)_de.asp"
          },
          "description": "The recorded investigation in SNOMED CT format."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Investigation Code is approved on the activity_date"
        },
        "equivalent_ae_code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY INVESTIGATION",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/a/acc/accident_and_emergency_investigation_de.asp"
          },
          "description": "The investigation code translated from SNOMED CT to the legacy A&E classification."
        },
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "PROCEDURE DATE (EMERGENCY CARE CLINICAL INVESTIGATION)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/proc/procedure_date_(emergency_care_clinical_investigation)_de.asp"
          },
          "description": "The date on which investigations were performed while the person was under the care of the emergency care facility."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "PROCEDURE TIME (EMERGENCY CARE CLINICAL INVESTIGATION)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/proc/procedure_time_(emergency_care_clinical_investigation)_de.asp"
          },
          "description": "The time at which investigations were performed while the person was under the care of the emergency care facility."
        }
      }
    },
    "SnomedTreatment": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "EMERGENCY CARE PROCEDURE (SNOMED CT)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/e/eme/emergency_care_procedure_(snomed_ct)_de.asp"
          },
          "description": "EMERGENCY CARE PROCEDURE (SNOMED CT) is the SNOMED CT concept ID which is used to identify a Patient Procedure performed while a PATIENT is under the care of an Emergency Care Department."
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Tests if the Treatment Code is approved on the activity_date"
        },
        "equivalent_ae_code": {
          "type": "string",
          "data_dictionary": {
            "name": "ACCIDENT AND EMERGENCY TREATMENT",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/attributes/a/acc/accident_and_emergency_treatment_de.asp"
          },
          "description": "The treatment code translated from SNOMED CT to the legacy A&E classification."
        },
        "date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "PROCEDURE DATE (EMERGENCY CARE PROCEDURE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/proc/procedure_date_(emergency_care_procedure)_de.asp"
          },
          "description": "The date on which treatments were performed while the person was under the care of the Emergency Care facility."
        },
        "time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "PROCEDURE TIME (EMERGENCY CARE PROCEDURE)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/p/proc/procedure_time_(emergency_care_procedure)_de.asp"
          },
          "description": "The time at which treatments were performed while the person was under the care of the Emergency Care facility."
        }
      }
    },
    "System": {
      "type": "object",
      "properties": {
        "interchange": {
          "$ref": "#/definitions/Interchange"
        },
        "transaction": {
          "$ref": "#/definitions/Transaction"
        },
        "record": {
          "$ref": "#/definitions/Record"
        },
        "report": {
          "$ref": "#/definitions/Report"
        },
        "reference_data": {
          "$ref": "#/definitions/ReferenceData"
        }
      }
    },
    "ToolType": {
      "type": "object",
      "properties": {
        "code": {
          "type": "string",
          "data_dictionary": {
            "name": "CODED ASSESSMENT TOOL TYPE (SNOMED CT)",
            "href": "https://datadictionary.nhs.uk/data_elements/coded_assessment_tool_type__snomed_ct_.html"
          },
          "description": "The SNOMED CT concept ID which is used to identify an Assessment in SNOMED CT"
        },
        "is_code_approved": {
          "type": "boolean",
          "description": "Indicates if the tool type code is approved on the activity date of the record"
        }
      }
    },
    "Transaction": {
      "type": "object",
      "properties": {
        "cds_protocol_identifier": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS PROTOCOL IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_protocol_identifier_code_de.asp"
          },
          "description": "A code to identify the Commissioning Data Set Submission Protocol (NET/BULK) associated with the transaction. The values are:"
        },
        "cds_unique_identifier": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS UNIQUE IDENTIFIER",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_unique_identifier_de.asp"
          },
          "description": "A Commissioning Data Set data element providing a unique identity for the life-time of an episode carried in a Commissioning Data Set message."
        },
        "cds_bulk_replacement_group": {
          "type": "string",
          "data_dictionary": {
            "name": "CDS BULK REPLACEMENT GROUP CODE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_bulk_replacement_group_code_de.asp"
          },
          "description": "The Commissioning Data Set Group into which CDS Types must be grouped when using the Commissioning Data Set Bulk Replacement Update Mechanism. It is not required when the Net Change Update Mechanism is used."
        },
        "cds_extract_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "CDS EXTRACT DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_extract_date_de.asp"
          },
          "description": "The date (with an associated CDS Extract Time) of the update event (or the nearest equivalent) that resulted in the need to exchange this Commissioning Data Set."
        },
        "cds_extract_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "CDS EXTRACT TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_extract_time_de.asp"
          },
          "description": "The time (with an associated CDS Extract Date) of the update event (or the nearest equivalent) that resulted in the need to exchange this Commissioning Data Set."
        },
        "cds_report_period_start_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "CDS REPORT PERIOD START DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_report_period_start_date_de.asp"
          },
          "description": "Defines the Start Date (for the date range of the data being exchanged) for the Bulk Replacement Update time period."
        },
        "cds_report_period_end_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "CDS REPORT PERIOD END DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_report_period_end_date_de.asp"
          },
          "description": "Defines the End Date (for the date range of the data being exchanged) for the Commissioning Data Set Bulk Replacement Update time period."
        },
        "cds_update_type": {
          "type": "number",
          "data_dictionary": {
            "name": "CDS UPDATE TYPE ",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cds/cds_update_type_de.asp"
          },
          "description": "A code to indicate the required database update process for the submitted CDS Message."
        },
        "cds_applicable_date": {
          "type": "string",
          "format": "date",
          "data_dictionary": {
            "name": "CDS APPLICABLE DATE",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_applicable_date_de.asp"
          },
          "description": "The date (with an associated CDS Applicable Time) of the update event (or the nearest equivalent) that resulted in the need to exchange this Commissioning Data Set."
        },
        "cds_applicable_time": {
          "type": "string",
          "format": "time",
          "data_dictionary": {
            "name": "CDS APPLICABLE TIME",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/c/cd/cds_applicable_time_de.asp"
          },
          "description": "The time (with an associated CDS Applicable Date) of the update event (or the nearest equivalent) that resulted in the need to exchange this Commissioning Data Set."
        }
      }
    },
    "Treatments": {
      "type": "object",
      "properties": {
        "snomed": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/SnomedTreatment"
          }
        }
      }
    },
    "UBRN": {
      "type": "object",
      "properties": {
        "value": {
          "type": "number",
          "data_dictionary": {
            "name": "UNIQUE BOOKING REFERENCE NUMBER (CONVERTED)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/u/un/unique_booking_reference_number_(converted)_de.asp"
          },
          "description": "The unique booking reference number is assigned by the choose and book system and where recorded can be used to tie together all of the treatments and visits associated with a single referral."
        },
        "issuer": {
          "type": "string",
          "data_dictionary": {
            "name": "ORGANISATION CODE (PATIENT PATHWAY IDENTIFIER ISSUER)",
            "href": "http://www.datadictionary.nhs.uk/data_dictionary/data_field_notes/o/org/organisation_code_(patient_pathway_identifier_issuer)_de.asp"
          },
          "description": "This is the code of the organisation that assigned the Patient Pathway Identifier. Patient Pathway Identifiers are not necessarily unique across hospitals, the addition of the organisation code ensures uniqueness."
        }
      }
    }
  }
}