text: /*
   * SQL to create Attendances table.
   * Stores attendance details associated with maternity records.
   * Assumes table does not already exist.
   * Based on Maternity Data Model Version 0.6
   *
   * MAK 04-01-2018: First version
   */
  
  /* Create table
   */
  CREATE TABLE Attendances (
   AttendanceID INTEGER NOT NULL,
   MaternityRecordID INTEGER NOT NULL,
   
   DateAttended DATE NOT NULL,
   LocationAttended TEXT NOT NULL,
   PerformerID VARCHAR(10),
   PerformerName TEXT NOT NULL,
   PerformerJobRole VARCHAR(10) NOT NULL, -- Coded (100, '*', 'JobRole')
   Indication TEXT;
   ContactType VARCHAR(2),                -- Coded (6, 'Attendances', 'ContactType')
   ConsultationMethod VARCHAR(2),         -- Coded (7, 'Attendances', 'ConsultationMethod')
   Speciality VARCHAR(3),                 -- Coded (8, '*', 'Speciality')
   Service VARCHAR(2),                    -- Coded (9, 'Attendances', 'Service')
   -- Care professionals present 0..*
   PersonAccompanyingPatient VARCHAR(10), -- Coded (10, 'Attendances', 'PersonAccompanyingPatient') ??? 0..*
   Outcome VARCHAR(5),                    -- Coded (11, 'Attendances', 'Outcome')
   
   UStamp VARCHAR(20) NOT NULL,
   DTStamp TIMESTAMP NOT NULL,
   
   CONSTRAINT PK_Attendances PRIMARY KEY (AttendanceID),
   CONSTRAINT FK_Attendances_MaternityRecords FOREIGN KEY (MaternityRecordID) REFERENCES MaternityRecords(MaternityRecordID)
  );
  
  /* Insert Attendances related codelists
   */
  INSERT INTO CodeLists VALUES (6, 'Attendances', 'ContactType', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO CodeLists VALUES (7, 'Attendances', 'ConsultationMethod', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO CodeLists VALUES (8, '*', 'Speciality', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO CodeLists VALUES (9, 'Attendances', 'Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO CodeLists VALUES (10, 'Attendances', 'PersonAccompanyingPatient', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO CodeLists VALUES (11, 'Attendances', 'Outcome', 'SYSTEM', '2018-01-01 01:00:00');
  
  /* Insert Attendances related codes
   */
  INSERT INTO Codes VALUES (6, '1', 'Accident and Emergency Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '4', 'Cancer Clinical Status Assessment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '5', 'Care Programme Approach Review', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '6', 'Clinic Attendance Consultant', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '8', 'Clinic Attendance Midwife', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '9', 'Clinic Attendance Non-Consultant', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '10', 'Clinic Attendance Nurse', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '14', 'Domiciliary Consultation', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '22', 'Sexual and Reproductive Health Domiciliary Visit', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '23', 'Genitourinary Consultant Clinic Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '27', 'Maternity Domiciliary Visit', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '29', 'Nurse or Midwife Contact', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '30', 'Out-Patient Attendance Consultant', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '38', 'Theatre Case', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '39', 'Ward Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '41', 'Improving Access to Psychological Therapies Contact', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '42', 'NHS Health Check Assessment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '43', 'Antenatal Booking Appointment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '44', 'Pregnancy First Contact', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '45', 'Nutritional Assessment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '46', 'HIV Clinic Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '47', 'Multi-Disciplinary Consultation (National Tariff Payment System)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '48', 'Multi-Professional Consultation (National Tariff Payment System)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '49', 'Two Year Neonatal Outcomes Assessment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '50', 'Radiotherapy Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '51', 'Holistic Needs Assessment', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (6, '52', 'Emergency Care Attendance', 'SYSTEM', '2018-01-01 01:00:00');
  
  INSERT INTO Codes VALUES (7, '1', 'Face to face communication', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '2', 'Telephone', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '3', 'Telemedicine web camera', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '4', 'Talk type for a PERSON unable to speak', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '5', 'Email **', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '6', 'Short Message Service (SMS) - Text Messaging **', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (7, '98', 'Other *', 'SYSTEM', '2018-01-01 01:00:00');
  
  -- Surgical Specialties 	
  INSERT INTO Codes VALUES (8, '100', 'GENERAL SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '101', 'UROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '110', 'TRAUMA & ORTHOPAEDICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '120', 'ENT', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '130', 'OPHTHALMOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '140', 'ORAL SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '141', 'RESTORATIVE DENTISTRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '142', 'PAEDIATRIC DENTISTRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '143', 'ORTHODONTICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '145', 'ORAL & MAXILLO FACIAL SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '146', 'ENDODONTICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '147', 'PERIODONTICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '148', 'PROSTHODONTICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '149', 'SURGICAL DENTISTRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '150', 'NEUROSURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '160', 'PLASTIC SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '170', 'CARDIOTHORACIC SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '171', 'PAEDIATRIC SURGERY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '180', 'ACCIDENT & EMERGENCY', 'SYSTEM', '2018-01-01 01:00:00');
  -- Medical Specialties 	
  INSERT INTO Codes VALUES (8, '190', 'ANAESTHETICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '192', 'CRITICAL CARE MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '300', 'GENERAL MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '301', 'GASTROENTEROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '302', 'ENDOCRINOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '303', 'CLINICAL HAEMATOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '304', 'CLINICAL PHYSIOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '305', 'CLINICAL PHARMACOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '310', 'AUDIOLOGICAL MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '311', 'CLINICAL GENETICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '313', 'CLINICAL IMMUNOLOGY and ALLERGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '314', 'REHABILITATION', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '315', 'PALLIATIVE MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '320', 'CARDIOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '321', 'PAEDIATRIC CARDIOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '325', 'SPORT AND EXERCISE MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '326', 'ACUTE INTERNAL MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '330', 'DERMATOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '340', 'RESPIRATORY MEDICINE (also known as thoracic medicine)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '350', 'INFECTIOUS DISEASES', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '352', 'TROPICAL MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '360', 'GENITOURINARY MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '361', 'NEPHROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '370', 'MEDICAL ONCOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '371', 'NUCLEAR MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '400', 'NEUROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '401', 'CLINICAL NEURO-PHYSIOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '410', 'RHEUMATOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '420', 'PAEDIATRICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '421', 'PAEDIATRIC NEUROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '430', 'GERIATRIC MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '450', 'DENTAL MEDICINE SPECIALTIES', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '451', 'SPECIAL CARE DENTISTRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '460', 'MEDICAL OPHTHALMOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '500', 'OBSTETRICS and GYNAECOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '501', 'OBSTETRICS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '502', 'GYNAECOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '504', 'COMMUNITY SEXUAL AND REPRODUCTIVE HEALTH', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '560', 'MIDWIFE EPISODE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '600', 'GENERAL MEDICAL PRACTICE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '601', 'GENERAL DENTAL PRACTICE', 'SYSTEM', '2018-01-01 01:00:00');
  -- Psychiatry 	
  INSERT INTO Codes VALUES (8, '700', 'LEARNING DISABILITY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '710', 'ADULT MENTAL ILLNESS', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '711', 'CHILD and ADOLESCENT PSYCHIATRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '712', 'FORENSIC PSYCHIATRY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '713', 'PSYCHOTHERAPY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '715', 'OLD AGE PSYCHIATRY', 'SYSTEM', '2018-01-01 01:00:00');
  -- Radiology 	
  INSERT INTO Codes VALUES (8, '800', 'CLINICAL ONCOLOGY (previously RADIOTHERAPY)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '810', 'RADIOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  -- Pathology 	
  INSERT INTO Codes VALUES (8, '820', 'GENERAL PATHOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '821', 'BLOOD TRANSFUSION', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '822', 'CHEMICAL PATHOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '823', 'HAEMATOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '824', 'HISTOPATHOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '830', 'IMMUNOPATHOLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '831', 'MEDICAL MICROBIOLOGY AND VIROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '833', '	MEDICAL MICROBIOLOGY (also known as MICROBIOLOGY AND BACTERIOLOGY)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '834', 'MEDICAL VIROLOGY', 'SYSTEM', '2018-01-01 01:00:00');
  -- Other 	
  INSERT INTO Codes VALUES (8, '900', 'COMMUNITY MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '901', 'OCCUPATIONAL MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '902', 'COMMUNITY HEALTH SERVICES DENTAL', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '903', 'PUBLIC HEALTH MEDICINE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '904', 'PUBLIC HEALTH DENTAL', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '950', 'NURSING EPISODE', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (8, '960', 'ALLIED HEALTH PROFESSIONAL EPISODE', 'SYSTEM', '2018-01-01 01:00:00');
  
  INSERT INTO Codes VALUES (9, '01', 'Appliances Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '02', 'Arts Therapy Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '03', 'Cancer Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '04', 'Cardiac Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '05', 'Community Dental Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '06', 'Community Paediatrics Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '07', 'Continence Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '09', 'Counselling Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '10', 'Dermatology Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '11', 'Diabetes Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '12', 'District Nursing Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '13', 'Ear Nose and Throat Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '14', 'End of Life Care Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '15', 'Gastrointestinal Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '16', 'Health Visiting Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '17', 'Hearing Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '18', 'Intermediate Care Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '19', 'Long Term Conditions Case Management Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '20', 'Musculoskeletal Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '21', 'Neurology Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '22', 'Nutrition and Dietetics Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '23', 'Occupational Therapy Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '24', 'Orthoptist Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '25', 'Pain Management Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '26', 'Physiotherapy Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '27', 'Podiatry Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '28', 'Public Health and Lifestyle Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '29', 'Rehabilitation Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '30', 'Respiratory Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '31', 'Rheumatology Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '32', 'School Nursing Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '33', 'Speech and Language Therapy Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '34', 'Vulnerable Children''s Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '35', 'Vulnerable Adult''s Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '36', 'Respite Care Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '37', 'Clinical Psychology Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '38', 'Children''s Community Nursing Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '39', 'Diagnostic Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '40', 'Treatment Room Nursing Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '41', 'Haematology Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '42', 'Phlebotomy Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '43', 'Tissue Viability Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '44', 'Family Support Service', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (9, '45', 'Integrated Multi-Disciplinary Team (jointly commissioned)', 'SYSTEM', '2018-01-01 01:00:00');
  -- Safeguarding Team (for example FGM, Domestic Abuse)
  -- Social Services (e.g. CAF Form commenced)
  
  INSERT INTO Codes VALUES (10, 'EXT', 'Extended family member', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'AUNT', 'Aunt', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'COUSN', 'Cousin', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GGRPRN', 'Great grandparent', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GGRFTH', 'Great grandfather', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GGRMTH', 'Great grandmother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GRPRN', 'Grandparent', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GRFTH', 'Grandfather', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GRMTH', 'Grandmother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NEPHEW', 'Nephew', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NIECE', 'Niece', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'UNCLE', 'Uncle', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'PRN', 'Parent', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'ADOPTF', 'Adoptive father', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'ADOPTM', 'Adoptive mother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'FTH', 'Father', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'FTHFOST', 'Foster father', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NFTH', 'Natural father', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'STPFTH', 'Stepfather', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'MTH', 'Mother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'MTHFOST', 'Foster mother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NMTH', 'Natural mother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'STPMTH', 'Stepmother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'SIB', 'Sibling', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'BRO', 'Brother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'HBRO', 'Half-brother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'STPBRO', 'Stepbrother', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'HSIS', 'Half-sister', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NSIS', 'Natural sister', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'SIS', 'Sister', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'STPSIS', 'Stepsister', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'SIGOTHR', 'Significant other', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'FRND', 'Unrelated friend', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'NBOR', 'Neighbour', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'ONESELF', 'Self', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'ROOM', 'Roommate', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'GUARDIAN', 'Guardian', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'FRIEND', 'Friend', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'PARTNER', 'Partner', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (10, 'CAREGIVER', 'Caregiver', 'SYSTEM', '2018-01-01 01:00:00');
  
  INSERT INTO Codes VALUES (11, '1', 'Discharged from CONSULTANT''s care (last attendance)', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (11, '2', 'Another APPOINTMENT given', 'SYSTEM', '2018-01-01 01:00:00');
  INSERT INTO Codes VALUES (11, '3', 'APPOINTMENT to be made at a later date', 'SYSTEM', '2018-01-01 01:00:00');
  