From 2c6ef7e24af24e25c6f83d16661dc29cf2ea4feb Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Mon, 18 Nov 2024 17:27:17 +0000 Subject: [PATCH 01/14] NRL-519 add practice setting codes from nrl2.8 to FHIR resources --- .../fhir/NRLF-PracticeSetting-ValueSet.json | 1889 +++++++++++++++++ 1 file changed, 1889 insertions(+) create mode 100644 resources/fhir/NRLF-PracticeSetting-ValueSet.json diff --git a/resources/fhir/NRLF-PracticeSetting-ValueSet.json b/resources/fhir/NRLF-PracticeSetting-ValueSet.json new file mode 100644 index 000000000..e81312fe7 --- /dev/null +++ b/resources/fhir/NRLF-PracticeSetting-ValueSet.json @@ -0,0 +1,1889 @@ +{ + "resourceType": "ValueSet", + "id": "NRLF-PracticeSetting", + "url": "https://fhir.nhs.uk/England/CodeSystem/England-NRLPracticeSetting", + "version": "1.1.2", + "name": "NRLF Record Practice Setting", + "status": "draft", + "date": "2024-11-18T00:00:00+00:00", + "publisher": "NHS Digital", + "contact": { + "name": "NRL Team at NHS Digital", + "telecom": { + "system": "email", + "value": "nrls@nhs.net", + "use": "work" + } + }, + "description": "A code from the SNOMED Clinical Terminology UK coding system to represent the NRL clinical practice setting.", + "copyright": "Copyright 2024 NHS Digital. This value set includes content from SNOMED CT, which is copyright 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement.", + "compose": { + "include": [ + { + "system": "http://snomed.info/sct", + "concept": [ + { + "code": "2471000175109", + "display": "Employee health service" + }, + { + "code": "828331000000102", + "display": "Homeopathy service" + }, + { + "code": "893041000000108", + "display": "Transient ischaemic attack service" + }, + { + "code": "893391000000101", + "display": "Adult cystic fibrosis service" + }, + { + "code": "828811000000104", + "display": "Child psychiatry service" + }, + { + "code": "741073001", + "display": "Neonatal intensive care service" + }, + { + "code": "3801000175108", + "display": "Pediatric pulmonology service" + }, + { + "code": "893521000000108", + "display": "Respiratory physiology service" + }, + { + "code": "892801000000107", + "display": "Audiological medicine service" + }, + { + "code": "892571000000101", + "display": "Medical oncology service" + }, + { + "code": "893421000000107", + "display": "Tropical medicine service" + }, + { + "code": "1060971000000108", + "display": "General practice service" + }, + { + "code": "907271000000106", + "display": "Genetics laboratory service" + }, + { + "code": "224891009", + "display": "Healthcare services" + }, + { + "code": "893771000000104", + "display": "Paediatric respiratory medicine service" + }, + { + "code": "893591000000106", + "display": "Paediatric metabolic disease service" + }, + { + "code": "892771000000109", + "display": "Cardiothoracic transplantation service" + }, + { + "code": "92151000000102", + "display": "Mental health crisis resolution team" + }, + { + "code": "893141000000109", + "display": "Nephrology service" + }, + { + "code": "829981000000108", + "display": "Community child health service" + }, + { + "code": "733459009", + "display": "Cardiac rehabilitation service" + }, + { + "code": "893971000000101", + "display": "Paediatric burns care service" + }, + { + "code": "931851000000100", + "display": "Oral pathology service" + }, + { + "code": "3771000175106", + "display": "Pediatric gastroenterology service" + }, + { + "code": "893621000000109", + "display": "Paediatric ear nose and throat service" + }, + { + "code": "828281000000107", + "display": "Eating disorders service" + }, + { + "code": "893121000000102", + "display": "Spinal surgery service" + }, + { + "code": "892751000000100", + "display": "Clinical immunology and allergy service" + }, + { + "code": "893601000000100", + "display": "Paediatric medical oncology service" + }, + { + "code": "3751000175100", + "display": "Pediatric emergency medical service" + }, + { + "code": "893951000000105", + "display": "Paediatric cardiology service" + }, + { + "code": "931831000000107", + "display": "Oral medicine service" + }, + { + "code": "829961000000104", + "display": "Out of hours service" + }, + { + "code": "911381000000108", + "display": "Telehealthcare service" + }, + { + "code": "828181000000101", + "display": "Community sexual and reproductive health" + }, + { + "code": "2451000175103", + "display": "Perinatology service" + }, + { + "code": "893851000000100", + "display": "Paediatric neurosurgery service" + }, + { + "code": "109201000000109", + "display": "Substance misuse team" + }, + { + "code": "893671000000108", + "display": "Paediatric urology service" + }, + { + "code": "932271000000104", + "display": "Oral and maxillofacial surgery service" + }, + { + "code": "444933003", + "display": "Home hospice service" + }, + { + "code": "444913002", + "display": "Diabetes mellitus service" + }, + { + "code": "892601000000108", + "display": "Intermediate care service" + }, + { + "code": "893801000000101", + "display": "Paediatric ophthalmology service" + }, + { + "code": "911231000000103", + "display": "Remote health monitoring service" + }, + { + "code": "893091000000103", + "display": "Infectious diseases service" + }, + { + "code": "893221000000106", + "display": "Specialist rehabilitation service" + }, + { + "code": "828381000000103", + "display": "Well woman service" + }, + { + "code": "907301000000109", + "display": "National Health Service 111 service" + }, + { + "code": "828511000000102", + "display": "National Health Service 24" + }, + { + "code": "893701000000107", + "display": "Paediatric thoracic surgery service" + }, + { + "code": "828861000000102", + "display": "Programmed pulmonary rehabilitation service" + }, + { + "code": "931781000000102", + "display": "Acute medicine service" + }, + { + "code": "827641000000101", + "display": "Anticoagulant service" + }, + { + "code": "893201000000102", + "display": "Sport and exercise medicine service" + }, + { + "code": "278032008", + "display": "Preventive service" + }, + { + "code": "892731000000107", + "display": "Dental medicine service" + }, + { + "code": "893451000000102", + "display": "Respite care service" + }, + { + "code": "2351000175106", + "display": "Sports medicine service" + }, + { + "code": "893271000000105", + "display": "Medical virology service" + }, + { + "code": "708168004", + "display": "Mental health service" + }, + { + "code": "708169007", + "display": "Respiratory therapy service" + }, + { + "code": "708171007", + "display": "Vascular ultrasound service" + }, + { + "code": "708170008", + "display": "Nursing service" + }, + { + "code": "708173005", + "display": "Obstetric ultrasound service" + }, + { + "code": "708172000", + "display": "Cardiac ultrasound service" + }, + { + "code": "708175003", + "display": "Diagnostic imaging service" + }, + { + "code": "708178001", + "display": "Cytogenetics service" + }, + { + "code": "708174004", + "display": "Interventional radiology service" + }, + { + "code": "708179009", + "display": "Molecular pathology service" + }, + { + "code": "708183009", + "display": "Anatomic pathology service" + }, + { + "code": "708182004", + "display": "Histology service" + }, + { + "code": "708180007", + "display": "Dermatopathology service" + }, + { + "code": "708187005", + "display": "Surgical pathology service" + }, + { + "code": "708185002", + "display": "Virology service" + }, + { + "code": "708184003", + "display": "Clinical pathology service" + }, + { + "code": "708188000", + "display": "Serology service" + }, + { + "code": "708194008", + "display": "Blood bank service" + }, + { + "code": "708196005", + "display": "Hematology service" + }, + { + "code": "708191000", + "display": "Toxicology service" + }, + { + "code": "708190004", + "display": "Immunology service" + }, + { + "code": "708193002", + "display": "Coagulation service" + }, + { + "code": "89301000000108", + "display": "Community mental health team" + }, + { + "code": "893301000000108", + "display": "Local specialist rehabilitation service" + }, + { + "code": "893651000000104", + "display": "Paediatric clinical immunology and allergy service" + }, + { + "code": "893171000000103", + "display": "Clinical neurophysiology service" + }, + { + "code": "711332004", + "display": "Allergy service" + }, + { + "code": "893151000000107", + "display": "Nuclear medicine service" + }, + { + "code": "894001000000107", + "display": "Paediatric audiological medicine service" + }, + { + "code": "892781000000106", + "display": "Burns care service" + }, + { + "code": "3781000175109", + "display": "Pediatric infectious disease service" + }, + { + "code": "893631000000106", + "display": "Paediatric diabetic medicine service" + }, + { + "code": "827621000000108", + "display": "Addiction service" + }, + { + "code": "893531000000105", + "display": "Psychiatric intensive care service" + }, + { + "code": "893881000000106", + "display": "Paediatric maxillofacial surgery service" + }, + { + "code": "893051000000106", + "display": "Clinical allergy service" + }, + { + "code": "893351000000109", + "display": "Complex specialised rehabilitation service" + }, + { + "code": "893001000000105", + "display": "Clinical genetics service" + }, + { + "code": "908981000000101", + "display": "Remote triage and advice service" + }, + { + "code": "931811000000104", + "display": "Histopathology service" + }, + { + "code": "1079481000000104", + "display": "Perinatal psychiatry service" + }, + { + "code": "893251000000101", + "display": "Mental health recovery and rehabilitation service" + }, + { + "code": "3531000175102", + "display": "Geriatric service" + }, + { + "code": "736622005", + "display": "Aboriginal health service" + }, + { + "code": "983641000000106", + "display": "Fracture liaison service" + }, + { + "code": "893711000000109", + "display": "Neonatal critical care service" + }, + { + "code": "828521000000108", + "display": "National Health Service Direct" + }, + { + "code": "892761000000102", + "display": "Clinical haematology service" + }, + { + "code": "901221000000102", + "display": "Perinatal mental health service" + }, + { + "code": "706902008", + "display": "Mycology service" + }, + { + "code": "706901001", + "display": "Bacteriology service" + }, + { + "code": "706903003", + "display": "Mycobacteriology service" + }, + { + "code": "706900000", + "display": "Parasitology service" + }, + { + "code": "893131000000100", + "display": "Genitourinary medicine service" + }, + { + "code": "413294000", + "display": "Community health services" + }, + { + "code": "413299005", + "display": "Early years services" + }, + { + "code": "828291000000109", + "display": "Dispensing optometry service" + }, + { + "code": "413331009", + "display": "Voluntary services" + }, + { + "code": "61831000000105", + "display": "Periodontics service" + }, + { + "code": "893231000000108", + "display": "Podiatric surgery service" + }, + { + "code": "893581000000109", + "display": "Well baby service" + }, + { + "code": "893911000000106", + "display": "Paediatric gastrointestinal surgery service" + }, + { + "code": "395104009", + "display": "Cancer primary healthcare multidisciplinary team" + }, + { + "code": "892711000000104", + "display": "Gynaecological oncology service" + }, + { + "code": "893331000000102", + "display": "Dementia assessment service" + }, + { + "code": "892611000000105", + "display": "Hepatology service" + }, + { + "code": "893681000000105", + "display": "Paediatric trauma and orthopaedics service" + }, + { + "code": "395086005", + "display": "Community specialist palliative care" + }, + { + "code": "395092004", + "display": "Specialist palliative care" + }, + { + "code": "710028007", + "display": "Maxillofacial surgery service" + }, + { + "code": "892811000000109", + "display": "Adult mental health service" + }, + { + "code": "828821000000105", + "display": "Adolescent psychiatry service" + }, + { + "code": "983341000000102", + "display": "Pharmacy First service" + }, + { + "code": "893431000000109", + "display": "Trauma and orthopaedics service" + }, + { + "code": "893781000000102", + "display": "Paediatric plastic surgery service" + }, + { + "code": "892581000000104", + "display": "Learning disability service" + }, + { + "code": "893661000000101", + "display": "Paediatric clinical haematology service" + }, + { + "code": "893311000000105", + "display": "Haemophilia service" + }, + { + "code": "373654008", + "display": "Medical referral service" + }, + { + "code": "893081000000100", + "display": "Respiratory medicine service" + }, + { + "code": "911221000000100", + "display": "Remote care environment monitoring service" + }, + { + "code": "409971007", + "display": "Emergency medical services" + }, + { + "code": "828371000000100", + "display": "Well man service" + }, + { + "code": "963151000000104", + "display": "Diabetic medicine service" + }, + { + "code": "893761000000106", + "display": "Paediatric rheumatology service" + }, + { + "code": "932841000000106", + "display": "Public health dentistry service" + }, + { + "code": "893861000000102", + "display": "Paediatric neurodisability service" + }, + { + "code": "92191000000105", + "display": "Early intervention in psychosis team" + }, + { + "code": "722424008", + "display": "Physical medicine and rehabilitation service" + }, + { + "code": "89311000000105", + "display": "Crisis prevention assessment and treatment team" + }, + { + "code": "722393008", + "display": "Legal medicine service" + }, + { + "code": "722352000", + "display": "Vascular medicine service" + }, + { + "code": "722170006", + "display": "Chiropractic service" + }, + { + "code": "722174002", + "display": "Pulmonary medicine service" + }, + { + "code": "722175001", + "display": "Psychosomatic medicine service" + }, + { + "code": "722176000", + "display": "Dentistry service" + }, + { + "code": "722140001", + "display": "Physiotherapy service" + }, + { + "code": "892561000000108", + "display": "Medical ophthalmology service" + }, + { + "code": "714088003", + "display": "Midwifery service" + }, + { + "code": "714089006", + "display": "Community midwifery service" + }, + { + "code": "3761000175103", + "display": "Pediatric endocrinology service" + }, + { + "code": "893611000000103", + "display": "Paediatric epilepsy service" + }, + { + "code": "893961000000108", + "display": "Paediatric cardiac surgery service" + }, + { + "code": "931841000000103", + "display": "Oral microbiology service" + }, + { + "code": "91901000000109", + "display": "Assertive outreach team" + }, + { + "code": "828191000000104", + "display": "Dental hygiene service" + }, + { + "code": "893031000000104", + "display": "Clinical immunology service" + }, + { + "code": "893381000000103", + "display": "Clinical psychology service" + }, + { + "code": "2461000175101", + "display": "Pulmonary rehabilitation service" + }, + { + "code": "893161000000105", + "display": "Neurology service" + }, + { + "code": "828201000000102", + "display": "Dental surgery assistance service" + }, + { + "code": "1079491000000102", + "display": "Paediatric diabetes service" + }, + { + "code": "893261000000103", + "display": "Mental health dual diagnosis service" + }, + { + "code": "310031001", + "display": "Family planning service" + }, + { + "code": "310032008", + "display": "Intensive care service" + }, + { + "code": "310030000", + "display": "Endoscopy service" + }, + { + "code": "310034009", + "display": "Pediatric intensive care service" + }, + { + "code": "310033003", + "display": "Adult intensive care service" + }, + { + "code": "310025004", + "display": "Complementary therapy service" + }, + { + "code": "310024000", + "display": "Colposcopy service" + }, + { + "code": "310027007", + "display": "Mental health counseling service" + }, + { + "code": "310026003", + "display": "Counseling service" + }, + { + "code": "310029005", + "display": "Domiciliary visit service" + }, + { + "code": "310028002", + "display": "Diagnostic investigation service" + }, + { + "code": "310020009", + "display": "Hearing therapy service" + }, + { + "code": "310022001", + "display": "Clinical oncology service" + }, + { + "code": "310021008", + "display": "Assistive listening device service" + }, + { + "code": "310023006", + "display": "Radiotherapy service" + }, + { + "code": "310017001", + "display": "Pediatric hearing aid service" + }, + { + "code": "310016005", + "display": "Adult hearing aid service" + }, + { + "code": "310015009", + "display": "Hearing aid service" + }, + { + "code": "310014008", + "display": "Pediatric cochlear implant service" + }, + { + "code": "310013002", + "display": "Adult cochlear implant service" + }, + { + "code": "310012007", + "display": "Cochlear implant service" + }, + { + "code": "310011000", + "display": "Aural rehabilitation service" + }, + { + "code": "310010004", + "display": "Distraction test audiological screening service" + }, + { + "code": "310019003", + "display": "Tinnitus management service" + }, + { + "code": "310018006", + "display": "Speech-reading training service" + }, + { + "code": "310001007", + "display": "Anesthetic service" + }, + { + "code": "310000008", + "display": "Accident and Emergency service" + }, + { + "code": "310003005", + "display": "Child assessment service" + }, + { + "code": "310002000", + "display": "Assessment service" + }, + { + "code": "310008001", + "display": "Audiological screening service" + }, + { + "code": "310009009", + "display": "Neonatal audiological screening service" + }, + { + "code": "310005003", + "display": "Diagnostic audiology service" + }, + { + "code": "310004004", + "display": "Audiological service" + }, + { + "code": "310007006", + "display": "Pediatric diagnostic audiology service" + }, + { + "code": "310006002", + "display": "Adult diagnostic audiology service" + }, + { + "code": "310085001", + "display": "Drama therapy service" + }, + { + "code": "310086000", + "display": "Music therapy service" + }, + { + "code": "310083008", + "display": "Art therapy service" + }, + { + "code": "310082003", + "display": "Arts therapy services" + }, + { + "code": "310084002", + "display": "Dance therapy service" + }, + { + "code": "310089007", + "display": "Hospital-based podiatry service" + }, + { + "code": "310087009", + "display": "Podiatry service" + }, + { + "code": "310088004", + "display": "Community-based podiatry service" + }, + { + "code": "310080006", + "display": "Pharmacy service" + }, + { + "code": "310081005", + "display": "Professional allied to medicine service" + }, + { + "code": "310079008", + "display": "Neuropathology service" + }, + { + "code": "310078000", + "display": "Medical microbiology service" + }, + { + "code": "310071006", + "display": "Pain management service" + }, + { + "code": "310070007", + "display": "Special care baby service" + }, + { + "code": "310072004", + "display": "Acute pain service" + }, + { + "code": "310073009", + "display": "Palliative care service" + }, + { + "code": "310076001", + "display": "Clinical biochemistry service" + }, + { + "code": "310074003", + "display": "Pathology service" + }, + { + "code": "310064001", + "display": "Occupational health service" + }, + { + "code": "310063007", + "display": "Obstetrics service" + }, + { + "code": "310066004", + "display": "Pediatric service" + }, + { + "code": "310065000", + "display": "Open access service" + }, + { + "code": "310068003", + "display": "Pediatric neurology service" + }, + { + "code": "310067008", + "display": "Community pediatric service" + }, + { + "code": "310069006", + "display": "Pediatric oncology service" + }, + { + "code": "310061009", + "display": "Gynecology service" + }, + { + "code": "310062002", + "display": "Pregnancy termination service" + }, + { + "code": "310060005", + "display": "Obstetrics and gynecology service" + }, + { + "code": "310099002", + "display": "Child physiotherapy service" + }, + { + "code": "310098005", + "display": "Hospital-based physiotherapy service" + }, + { + "code": "310091004", + "display": "Community-based dietetics service" + }, + { + "code": "310090003", + "display": "Dietetics service" + }, + { + "code": "310096009", + "display": "Hospital-based occupational therapy service" + }, + { + "code": "310094007", + "display": "Community-based occupational therapy service" + }, + { + "code": "310095008", + "display": "Social services occupational therapy service" + }, + { + "code": "310093001", + "display": "Occupational therapy service" + }, + { + "code": "310092006", + "display": "Hospital-based dietetics service" + }, + { + "code": "310120006", + "display": "Mental handicap psychiatry service" + }, + { + "code": "310121005", + "display": "Psychogeriatric service" + }, + { + "code": "310126000", + "display": "Breast screening service" + }, + { + "code": "310128004", + "display": "Computerized tomography service" + }, + { + "code": "310127009", + "display": "Magnetic resonance imaging service" + }, + { + "code": "310129007", + "display": "Rehabilitation service" + }, + { + "code": "310122003", + "display": "Rehabilitation psychiatry service" + }, + { + "code": "310123008", + "display": "Psychology service" + }, + { + "code": "310124002", + "display": "Psychotherapy service" + }, + { + "code": "310125001", + "display": "Radiology service" + }, + { + "code": "310117003", + "display": "Child and adolescent psychiatry service" + }, + { + "code": "310116007", + "display": "Psychiatry service" + }, + { + "code": "310119000", + "display": "Liaison psychiatry service" + }, + { + "code": "310118008", + "display": "Forensic psychiatry service" + }, + { + "code": "310114005", + "display": "Community surgical fitting service" + }, + { + "code": "310112009", + "display": "Surgical fitting service" + }, + { + "code": "310115006", + "display": "Public health service" + }, + { + "code": "310113004", + "display": "Hospital surgical fitting service" + }, + { + "code": "310110001", + "display": "Hospital orthotics service" + }, + { + "code": "310111002", + "display": "Community orthotics service" + }, + { + "code": "310109006", + "display": "Orthotics service" + }, + { + "code": "310108003", + "display": "Community orthoptics service" + }, + { + "code": "310105000", + "display": "Optometry service" + }, + { + "code": "310107008", + "display": "Hospital orthoptics service" + }, + { + "code": "310106004", + "display": "Orthoptics service" + }, + { + "code": "310104001", + "display": "Child speech and language therapy service" + }, + { + "code": "310103007", + "display": "Hospital-based speech and language therapy service" + }, + { + "code": "310102002", + "display": "Community-based speech and language therapy service" + }, + { + "code": "310141000", + "display": "Thoracic surgery service" + }, + { + "code": "310143002", + "display": "Dental surgery service" + }, + { + "code": "310142007", + "display": "Cardiac surgery service" + }, + { + "code": "310144008", + "display": "General dental surgery service" + }, + { + "code": "310145009", + "display": "Oral surgery service" + }, + { + "code": "310146005", + "display": "Orthodontics service" + }, + { + "code": "310147001", + "display": "Pediatric dentistry service" + }, + { + "code": "310148006", + "display": "Restorative dentistry service" + }, + { + "code": "310149003", + "display": "Ear, nose and throat service" + }, + { + "code": "310140004", + "display": "Cardiothoracic surgery service" + }, + { + "code": "310131003", + "display": "Community rehabilitation service" + }, + { + "code": "310130002", + "display": "Head injury rehabilitation service" + }, + { + "code": "310134006", + "display": "Social services" + }, + { + "code": "310135007", + "display": "Social services department customer services" + }, + { + "code": "310132005", + "display": "Young disabled service" + }, + { + "code": "310133000", + "display": "Swallow clinic" + }, + { + "code": "310139001", + "display": "Breast surgery service" + }, + { + "code": "310138009", + "display": "Surgical service" + }, + { + "code": "310136008", + "display": "Social services department duty team" + }, + { + "code": "310137004", + "display": "Stroke service" + }, + { + "code": "310101009", + "display": "Speech and language therapy service" + }, + { + "code": "310100005", + "display": "Play therapy service" + }, + { + "code": "734862008", + "display": "Endodontic service" + }, + { + "code": "734863003", + "display": "Prosthodontic service" + }, + { + "code": "310168000", + "display": "Vascular surgery service" + }, + { + "code": "310169008", + "display": "Ultrasonography service" + }, + { + "code": "310165002", + "display": "Transplant surgery service" + }, + { + "code": "310167005", + "display": "Urology service" + }, + { + "code": "310166001", + "display": "Trauma surgery service" + }, + { + "code": "310163009", + "display": "Pediatric surgical service" + }, + { + "code": "310164003", + "display": "Plastic surgery service" + }, + { + "code": "310161006", + "display": "Orthopedic service" + }, + { + "code": "310162004", + "display": "Pancreatic surgery service" + }, + { + "code": "310160007", + "display": "Ophthalmology service" + }, + { + "code": "310151004", + "display": "Gastrointestinal surgery service" + }, + { + "code": "310152006", + "display": "General gastrointestinal surgery service" + }, + { + "code": "310153001", + "display": "Upper gastrointestinal surgery service" + }, + { + "code": "310155008", + "display": "Colorectal surgery service" + }, + { + "code": "310150003", + "display": "Endocrine surgery service" + }, + { + "code": "310157000", + "display": "Hand surgery service" + }, + { + "code": "310156009", + "display": "General surgical service" + }, + { + "code": "310159002", + "display": "Neurosurgical service" + }, + { + "code": "310158005", + "display": "Hepatobiliary surgical service" + }, + { + "code": "828301000000108", + "display": "Electrocardiography service" + }, + { + "code": "310200001", + "display": "Cytology service" + }, + { + "code": "734920002", + "display": "Diabetes mellitus education service" + }, + { + "code": "829951000000102", + "display": "Industrial therapy service" + }, + { + "code": "931821000000105", + "display": "School nursing service" + }, + { + "code": "893941000000107", + "display": "Paediatric dermatology service" + }, + { + "code": "892741000000103", + "display": "Clinical microbiology service" + }, + { + "code": "893211000000100", + "display": "Spinal injuries service" + }, + { + "code": "92221000000103", + "display": "Mental health home treatment team" + }, + { + "code": "3621000175101", + "display": "Rheumatology service" + }, + { + "code": "408451000", + "display": "Community learning disabilities team" + }, + { + "code": "408452007", + "display": "Behavioral intervention team" + }, + { + "code": "408458006", + "display": "Specialist multidisciplinary team" + }, + { + "code": "893341000000106", + "display": "Congenital heart disease service" + }, + { + "code": "445449000", + "display": "Acute care hospice service" + }, + { + "code": "1078501000000104", + "display": "Health visiting service" + }, + { + "code": "893691000000107", + "display": "Paediatric transplantation surgery service" + }, + { + "code": "892621000000104", + "display": "Hepatobiliary and pancreatic surgery service" + }, + { + "code": "2421000175108", + "display": "Acute care inpatient service" + }, + { + "code": "931801000000101", + "display": "Community nursing service" + }, + { + "code": "699478002", + "display": "Surgical oncology service" + }, + { + "code": "893791000000100", + "display": "Paediatric pain management service" + }, + { + "code": "893541000000101", + "display": "Prosthetics service" + }, + { + "code": "699650006", + "display": "Community based physiotherapy service" + }, + { + "code": "893891000000108", + "display": "Paediatric interventional radiology service" + }, + { + "code": "827631000000105", + "display": "Emergency ambulance service" + }, + { + "code": "827981000000103", + "display": "Paediatric cystic fibrosis service" + }, + { + "code": "892821000000103", + "display": "Critical care medicine service" + }, + { + "code": "700435004", + "display": "Clinical physiology service" + }, + { + "code": "700436003", + "display": "Clinical pharmacology service" + }, + { + "code": "700434000", + "display": "Endocrinology service" + }, + { + "code": "700221004", + "display": "Care of elderly service" + }, + { + "code": "700433006", + "display": "Gastroenterology service" + }, + { + "code": "700231006", + "display": "Critical care physician service" + }, + { + "code": "700232004", + "display": "General medical service" + }, + { + "code": "700241009", + "display": "Dermatology service" + }, + { + "code": "893061000000109", + "display": "Cardiology service" + }, + { + "code": "705150003", + "display": "Domiciliary physiotherapy service" + }, + { + "code": "932241000000105", + "display": "Blood banking and transfusion service" + }, + { + "code": "3791000175107", + "display": "Pediatric nephrology service" + }, + { + "code": "892791000000108", + "display": "Blood and marrow transplantation service" + }, + { + "code": "893641000000102", + "display": "Palliative medicine service" + }, + { + "code": "431051000124102", + "display": "Dialysis service" + }, + { + "code": "23951000087100", + "display": "Opioid dependence service" + }, + { + "code": "1323651000000109", + "display": "Cardiac physiology service" + }, + { + "code": "788126001", + "display": "Prosthetic service" + }, + { + "code": "788124003", + "display": "Histopathology service" + }, + { + "code": "788125002", + "display": "Addiction service" + }, + { + "code": "788123009", + "display": "Radiation oncology service" + }, + { + "code": "788122004", + "display": "Sexual health service" + }, + { + "code": "788128000", + "display": "Critical care medicine service" + }, + { + "code": "788127005", + "display": "Child health service" + }, + { + "code": "788121006", + "display": "Clinical immunology and allergy service" + }, + { + "code": "733921009", + "display": "Transplant medicine service" + }, + { + "code": "788001008", + "display": "Infectious disease service" + }, + { + "code": "788002001", + "display": "Adult mental health service" + }, + { + "code": "788003006", + "display": "Nephrology service" + }, + { + "code": "788009005", + "display": "Nuclear medicine service" + }, + { + "code": "788006003", + "display": "Genetic laboratory service" + }, + { + "code": "788004000", + "display": "Clinical genetics service" + }, + { + "code": "788005004", + "display": "Neurology service" + }, + { + "code": "788008002", + "display": "Oral and maxillofacial surgery service" + }, + { + "code": "788007007", + "display": "General practice service" + }, + { + "code": "1326391000000100", + "display": "FNP (Family Nurse Partnership) service" + }, + { + "code": "1186717003", + "display": "Intellectual disability psychiatry service" + }, + { + "code": "830149003", + "display": "Clinical neurophysiology service" + }, + { + "code": "224930009", + "display": "Services" + }, + { + "code": "830039004", + "display": "Genitourinary medicine service" + }, + { + "code": "830038007", + "display": "Clinical allergy service" + }, + { + "code": "830037002", + "display": "Clinical immunology service" + }, + { + "code": "1326421000000106", + "display": "Safeguarding children team" + }, + { + "code": "1323551000000105", + "display": "Inherited metabolic medicine service" + }, + { + "code": "28541000087101", + "display": "Musculoskeletal service" + }, + { + "code": "24271000087103", + "display": "Adult chronic pain management service" + }, + { + "code": "1240241000000109", + "display": "Community sexual and reproductive health service" + }, + { + "code": "897188002", + "display": "Pediatric hematology service" + }, + { + "code": "1323631000000102", + "display": "Aviation and space medicine service" + }, + { + "code": "1325831000000100", + "display": "Post-COVID-19 syndrome service" + }, + { + "code": "1323431000000104", + "display": "Fetal medicine service" + }, + { + "code": "24001000087103", + "display": "Paediatric plastic surgery service" + }, + { + "code": "24351000087104", + "display": "Paediatric chronic pain management service" + }, + { + "code": "1323881000000102", + "display": "Stroke medicine service" + }, + { + "code": "1323531000000103", + "display": "Urological physiology service" + }, + { + "code": "148621000000100", + "display": "School aged immunisation service" + }, + { + "code": "24101000087102", + "display": "HIV (human immunodeficiency virus) social work service" + }, + { + "code": "23911000087104", + "display": "Medication review service" + }, + { + "code": "1148679005", + "display": "Specialist palliative care service" + }, + { + "code": "773558007", + "display": "Physical medicine service" + }, + { + "code": "24051000087102", + "display": "Breast surgical oncology service" + }, + { + "code": "896974005", + "display": "Transgender health service" + }, + { + "code": "1323611000000105", + "display": "Paediatric inherited metabolic medicine service" + }, + { + "code": "1323661000000107", + "display": "Paediatric audiovestibular medicine service" + }, + { + "code": "24331000087108", + "display": "Narcotic addiction service with chronic pain management" + }, + { + "code": "1323561000000108", + "display": "Gastrointestinal physiology service" + }, + { + "code": "34911000087100", + "display": "Amputation care service" + }, + { + "code": "1231786003", + "display": "Refugee healthcare service" + }, + { + "code": "1163002007", + "display": "Electrocardiography service" + }, + { + "code": "1163004008", + "display": "Hyperbaric medicine service" + }, + { + "code": "1163003002", + "display": "Colorectal cancer screening service" + }, + { + "code": "1323841000000105", + "display": "Paediatric palliative medicine service" + }, + { + "code": "1163054002", + "display": "Gastroscopy service" + }, + { + "code": "1231392007", + "display": "Paediatric orthopaedic service" + }, + { + "code": "1231391000", + "display": "Colonoscopy service" + }, + { + "code": "1231393002", + "display": "Spirometry service" + }, + { + "code": "1231390004", + "display": "Hand therapy service" + }, + { + "code": "1231394008", + "display": "Paediatric urology service" + }, + { + "code": "24081000087105", + "display": "HIV (human immunodeficiency virus) nurse practitioner service" + }, + { + "code": "23941000087103", + "display": "Narcotic addiction service" + }, + { + "code": "1323641000000106", + "display": "Audiovestibular medicine service" + }, + { + "code": "840587001", + "display": "Aerospace medical service" + }, + { + "code": "840586005", + "display": "Neonatal service" + }, + { + "code": "840585009", + "display": "Postnatal service" + }, + { + "code": "816075004", + "display": "Prosthetic and orthotic service" + }, + { + "code": "1323921000000108", + "display": "Neuropsychiatry service" + }, + { + "code": "24011000087101", + "display": "Vascular imaging service" + }, + { + "code": "1323691000000101", + "display": "General internal medical service" + }, + { + "code": "23891000087102", + "display": "Adult hematology service" + }, + { + "code": "1323821000000103", + "display": "Paediatric clinical pharmacology service" + }, + { + "code": "789718008", + "display": "Cardiology service" + }, + { + "code": "789714005", + "display": "Pediatric rheumatology service" + }, + { + "code": "789715006", + "display": "Paediatric respiratory therapy service" + }, + { + "code": "789716007", + "display": "Pediatric otolaryngology service" + }, + { + "code": "789717003", + "display": "Paediatric cardiology service" + }, + { + "code": "148581000000100", + "display": "Personal health record provider service" + }, + { + "code": "792849008", + "display": "Pediatric clinical genetics service" + }, + { + "code": "792847005", + "display": "Emergency ambulance service" + }, + { + "code": "792848000", + "display": "Internal medicine service" + }, + { + "code": "1323621000000104", + "display": "Medical psychotherapy service" + }, + { + "code": "1323871000000104", + "display": "Rehabilitation medicine service" + }, + { + "code": "1230046007", + "display": "Cervical cancer screening service" + }, + { + "code": "1230045006", + "display": "Cardiac diagnostic service" + }, + { + "code": "1230044005", + "display": "Cardiac specialist nursing service" + }, + { + "code": "1362761000000103", + "display": "Adult safeguarding team" + }, + { + "code": "1323901000000104", + "display": "Rare disease service" + }, + { + "code": "1136421000168109", + "display": "Sleep medicine service" + }, + { + "code": "1323701000000101", + "display": "Vascular physiology service" + }, + { + "code": "24141000087104", + "display": "Spine orthopedic surgery service" + }, + { + "code": "1323571000000101", + "display": "Orthogeriatric medicine service" + }, + { + "code": "1323801000000107", + "display": "Paediatric oral and maxillofacial surgery service" + }, + { + "code": "23871000087101", + "display": "Adult dermatology service" + }, + { + "code": "1323601000000108", + "display": "Ophthalmic and vision science service" + }, + { + "code": "1234796008", + "display": "Community nursing service" + }, + { + "code": "23901000087101", + "display": "Hepatology service" + }, + { + "code": "1324191000000107", + "display": "Intensive care medicine service" + }, + { + "code": "2391000175104", + "display": "Bariatric surgery service" + }, + { + "code": "1323851000000108", + "display": "Paediatric hepatology service" + }, + { + "code": "24291000087104", + "display": "Geriatric chronic pain management service" + }, + { + "code": "1323501000000109", + "display": "Special care dentistry service" + }, + { + "code": "1423561000000102", + "display": "Acute oncology service" + } + ] + } + ] + } +} From 8de586c0d161bc6f3c7fb2dddc0f2fffb93a1db3 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Tue, 26 Nov 2024 02:29:07 +0000 Subject: [PATCH 02/14] NRL-519 add practice setting validator --- layer/nrlf/core/constants.py | 472 ++++++++++++++++++++++++ layer/nrlf/core/validators.py | 73 +++- terraform/infrastructure/consumer.tftpl | 4 +- terraform/infrastructure/producer.tftpl | 10 +- 4 files changed, 554 insertions(+), 5 deletions(-) diff --git a/layer/nrlf/core/constants.py b/layer/nrlf/core/constants.py index 650547fb9..9ba8e1ffe 100644 --- a/layer/nrlf/core/constants.py +++ b/layer/nrlf/core/constants.py @@ -25,6 +25,7 @@ class Source(Enum): KEY_SEPARATOR = "#" ODS_SYSTEM = "https://fhir.nhs.uk/Id/ods-organization-code" NHS_NUMBER_SYSTEM_URL = "https://fhir.nhs.uk/Id/nhs-number" +SNOMED_SYSTEM_URL = "http://snomed.info/sct" RELATES_TO_REPLACES = "replaces" ALLOWED_RELATES_TO_CODES = { RELATES_TO_REPLACES, @@ -138,5 +139,476 @@ def coding_value(self): PointerTypes.MRI_AXILLA_BOTH.value: Categories.DIAGNOSTIC_PROCEDURE.value, } +PRACTICE_SETTING_VALUE_SET_URL = ( + "https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting" +) +SNOMED_PRACTICE_SETTINGS = { + "2471000175109": "Employee health service", + "828331000000102": "Homeopathy service", + "893041000000108": "Transient ischaemic attack service", + "893391000000101": "Adult cystic fibrosis service", + "828811000000104": "Child psychiatry service", + "741073001": "Neonatal intensive care service", + "3801000175108": "Pediatric pulmonology service", + "893521000000108": "Respiratory physiology service", + "892801000000107": "Audiological medicine service", + "892571000000101": "Medical oncology service", + "893421000000107": "Tropical medicine service", + "1060971000000108": "General practice service", + "907271000000106": "Genetics laboratory service", + "224891009": "Healthcare services", + "893771000000104": "Paediatric respiratory medicine service", + "893591000000106": "Paediatric metabolic disease service", + "892771000000109": "Cardiothoracic transplantation service", + "92151000000102": "Mental health crisis resolution team", + "893141000000109": "Nephrology service", + "829981000000108": "Community child health service", + "733459009": "Cardiac rehabilitation service", + "893971000000101": "Paediatric burns care service", + "931851000000100": "Oral pathology service", + "3771000175106": "Pediatric gastroenterology service", + "893621000000109": "Paediatric ear nose and throat service", + "828281000000107": "Eating disorders service", + "893121000000102": "Spinal surgery service", + "892751000000100": "Clinical immunology and allergy service", + "893601000000100": "Paediatric medical oncology service", + "3751000175100": "Pediatric emergency medical service", + "893951000000105": "Paediatric cardiology service", + "931831000000107": "Oral medicine service", + "829961000000104": "Out of hours service", + "911381000000108": "Telehealthcare service", + "828181000000101": "Community sexual and reproductive health", + "2451000175103": "Perinatology service", + "893851000000100": "Paediatric neurosurgery service", + "109201000000109": "Substance misuse team", + "893671000000108": "Paediatric urology service", + "932271000000104": "Oral and maxillofacial surgery service", + "444933003": "Home hospice service", + "444913002": "Diabetes mellitus service", + "892601000000108": "Intermediate care service", + "893801000000101": "Paediatric ophthalmology service", + "911231000000103": "Remote health monitoring service", + "893091000000103": "Infectious diseases service", + "893221000000106": "Specialist rehabilitation service", + "828381000000103": "Well woman service", + "907301000000109": "National Health Service 111 service", + "828511000000102": "National Health Service 24", + "893701000000107": "Paediatric thoracic surgery service", + "828861000000102": "Programmed pulmonary rehabilitation service", + "931781000000102": "Acute medicine service", + "827641000000101": "Anticoagulant service", + "893201000000102": "Sport and exercise medicine service", + "278032008": "Preventive service", + "892731000000107": "Dental medicine service", + "893451000000102": "Respite care service", + "2351000175106": "Sports medicine service", + "893271000000105": "Medical virology service", + "708168004": "Mental health service", + "708169007": "Respiratory therapy service", + "708171007": "Vascular ultrasound service", + "708170008": "Nursing service", + "708173005": "Obstetric ultrasound service", + "708172000": "Cardiac ultrasound service", + "708175003": "Diagnostic imaging service", + "708178001": "Cytogenetics service", + "708174004": "Interventional radiology service", + "708179009": "Molecular pathology service", + "708183009": "Anatomic pathology service", + "708182004": "Histology service", + "708180007": "Dermatopathology service", + "708187005": "Surgical pathology service", + "708185002": "Virology service", + "708184003": "Clinical pathology service", + "708188000": "Serology service", + "708194008": "Blood bank service", + "708196005": "Hematology service", + "708191000": "Toxicology service", + "708190004": "Immunology service", + "708193002": "Coagulation service", + "89301000000108": "Community mental health team", + "893301000000108": "Local specialist rehabilitation service", + "893651000000104": "Paediatric clinical immunology and allergy service", + "893171000000103": "Clinical neurophysiology service", + "711332004": "Allergy service", + "893151000000107": "Nuclear medicine service", + "894001000000107": "Paediatric audiological medicine service", + "892781000000106": "Burns care service", + "3781000175109": "Pediatric infectious disease service", + "893631000000106": "Paediatric diabetic medicine service", + "827621000000108": "Addiction service", + "893531000000105": "Psychiatric intensive care service", + "893881000000106": "Paediatric maxillofacial surgery service", + "893051000000106": "Clinical allergy service", + "893351000000109": "Complex specialised rehabilitation service", + "893001000000105": "Clinical genetics service", + "908981000000101": "Remote triage and advice service", + "931811000000104": "Histopathology service", + "1079481000000104": "Perinatal psychiatry service", + "893251000000101": "Mental health recovery and rehabilitation service", + "3531000175102": "Geriatric service", + "736622005": "Aboriginal health service", + "983641000000106": "Fracture liaison service", + "893711000000109": "Neonatal critical care service", + "828521000000108": "National Health Service Direct", + "892761000000102": "Clinical haematology service", + "901221000000102": "Perinatal mental health service", + "706902008": "Mycology service", + "706901001": "Bacteriology service", + "706903003": "Mycobacteriology service", + "706900000": "Parasitology service", + "893131000000100": "Genitourinary medicine service", + "413294000": "Community health services", + "413299005": "Early years services", + "828291000000109": "Dispensing optometry service", + "413331009": "Voluntary services", + "61831000000105": "Periodontics service", + "893231000000108": "Podiatric surgery service", + "893581000000109": "Well baby service", + "893911000000106": "Paediatric gastrointestinal surgery service", + "395104009": "Cancer primary healthcare multidisciplinary team", + "892711000000104": "Gynaecological oncology service", + "893331000000102": "Dementia assessment service", + "892611000000105": "Hepatology service", + "893681000000105": "Paediatric trauma and orthopaedics service", + "395086005": "Community specialist palliative care", + "395092004": "Specialist palliative care", + "710028007": "Maxillofacial surgery service", + "892811000000109": "Adult mental health service", + "828821000000105": "Adolescent psychiatry service", + "983341000000102": "Pharmacy First service", + "893431000000109": "Trauma and orthopaedics service", + "893781000000102": "Paediatric plastic surgery service", + "892581000000104": "Learning disability service", + "893661000000101": "Paediatric clinical haematology service", + "893311000000105": "Haemophilia service", + "373654008": "Medical referral service", + "893081000000100": "Respiratory medicine service", + "911221000000100": "Remote care environment monitoring service", + "409971007": "Emergency medical services", + "828371000000100": "Well man service", + "963151000000104": "Diabetic medicine service", + "893761000000106": "Paediatric rheumatology service", + "932841000000106": "Public health dentistry service", + "893861000000102": "Paediatric neurodisability service", + "92191000000105": "Early intervention in psychosis team", + "722424008": "Physical medicine and rehabilitation service", + "89311000000105": "Crisis prevention assessment and treatment team", + "722393008": "Legal medicine service", + "722352000": "Vascular medicine service", + "722170006": "Chiropractic service", + "722174002": "Pulmonary medicine service", + "722175001": "Psychosomatic medicine service", + "722176000": "Dentistry service", + "722140001": "Physiotherapy service", + "892561000000108": "Medical ophthalmology service", + "714088003": "Midwifery service", + "714089006": "Community midwifery service", + "3761000175103": "Pediatric endocrinology service", + "893611000000103": "Paediatric epilepsy service", + "893961000000108": "Paediatric cardiac surgery service", + "931841000000103": "Oral microbiology service", + "91901000000109": "Assertive outreach team", + "828191000000104": "Dental hygiene service", + "893031000000104": "Clinical immunology service", + "893381000000103": "Clinical psychology service", + "2461000175101": "Pulmonary rehabilitation service", + "893161000000105": "Neurology service", + "828201000000102": "Dental surgery assistance service", + "1079491000000102": "Paediatric diabetes service", + "893261000000103": "Mental health dual diagnosis service", + "310031001": "Family planning service", + "310032008": "Intensive care service", + "310030000": "Endoscopy service", + "310034009": "Pediatric intensive care service", + "310033003": "Adult intensive care service", + "310025004": "Complementary therapy service", + "310024000": "Colposcopy service", + "310027007": "Mental health counseling service", + "310026003": "Counseling service", + "310029005": "Domiciliary visit service", + "310028002": "Diagnostic investigation service", + "310020009": "Hearing therapy service", + "310022001": "Clinical oncology service", + "310021008": "Assistive listening device service", + "310023006": "Radiotherapy service", + "310017001": "Pediatric hearing aid service", + "310016005": "Adult hearing aid service", + "310015009": "Hearing aid service", + "310014008": "Pediatric cochlear implant service", + "310013002": "Adult cochlear implant service", + "310012007": "Cochlear implant service", + "310011000": "Aural rehabilitation service", + "310010004": "Distraction test audiological screening service", + "310019003": "Tinnitus management service", + "310018006": "Speech-reading training service", + "310001007": "Anesthetic service", + "310000008": "Accident and Emergency service", + "310003005": "Child assessment service", + "310002000": "Assessment service", + "310008001": "Audiological screening service", + "310009009": "Neonatal audiological screening service", + "310005003": "Diagnostic audiology service", + "310004004": "Audiological service", + "310007006": "Pediatric diagnostic audiology service", + "310006002": "Adult diagnostic audiology service", + "310085001": "Drama therapy service", + "310086000": "Music therapy service", + "310083008": "Art therapy service", + "310082003": "Arts therapy services", + "310084002": "Dance therapy service", + "310089007": "Hospital-based podiatry service", + "310087009": "Podiatry service", + "310088004": "Community-based podiatry service", + "310080006": "Pharmacy service", + "310081005": "Professional allied to medicine service", + "310079008": "Neuropathology service", + "310078000": "Medical microbiology service", + "310071006": "Pain management service", + "310070007": "Special care baby service", + "310072004": "Acute pain service", + "310073009": "Palliative care service", + "310076001": "Clinical biochemistry service", + "310074003": "Pathology service", + "310064001": "Occupational health service", + "310063007": "Obstetrics service", + "310066004": "Pediatric service", + "310065000": "Open access service", + "310068003": "Pediatric neurology service", + "310067008": "Community pediatric service", + "310069006": "Pediatric oncology service", + "310061009": "Gynecology service", + "310062002": "Pregnancy termination service", + "310060005": "Obstetrics and gynecology service", + "310099002": "Child physiotherapy service", + "310098005": "Hospital-based physiotherapy service", + "310091004": "Community-based dietetics service", + "310090003": "Dietetics service", + "310096009": "Hospital-based occupational therapy service", + "310094007": "Community-based occupational therapy service", + "310095008": "Social services occupational therapy service", + "310093001": "Occupational therapy service", + "310092006": "Hospital-based dietetics service", + "310120006": "Mental handicap psychiatry service", + "310121005": "Psychogeriatric service", + "310126000": "Breast screening service", + "310128004": "Computerized tomography service", + "310127009": "Magnetic resonance imaging service", + "310129007": "Rehabilitation service", + "310122003": "Rehabilitation psychiatry service", + "310123008": "Psychology service", + "310124002": "Psychotherapy service", + "310125001": "Radiology service", + "310117003": "Child and adolescent psychiatry service", + "310116007": "Psychiatry service", + "310119000": "Liaison psychiatry service", + "310118008": "Forensic psychiatry service", + "310114005": "Community surgical fitting service", + "310112009": "Surgical fitting service", + "310115006": "Public health service", + "310113004": "Hospital surgical fitting service", + "310110001": "Hospital orthotics service", + "310111002": "Community orthotics service", + "310109006": "Orthotics service", + "310108003": "Community orthoptics service", + "310105000": "Optometry service", + "310107008": "Hospital orthoptics service", + "310106004": "Orthoptics service", + "310104001": "Child speech and language therapy service", + "310103007": "Hospital-based speech and language therapy service", + "310102002": "Community-based speech and language therapy service", + "310141000": "Thoracic surgery service", + "310143002": "Dental surgery service", + "310142007": "Cardiac surgery service", + "310144008": "General dental surgery service", + "310145009": "Oral surgery service", + "310146005": "Orthodontics service", + "310147001": "Pediatric dentistry service", + "310148006": "Restorative dentistry service", + "310149003": "Ear, nose and throat service", + "310140004": "Cardiothoracic surgery service", + "310131003": "Community rehabilitation service", + "310130002": "Head injury rehabilitation service", + "310134006": "Social services", + "310135007": "Social services department customer services", + "310132005": "Young disabled service", + "310133000": "Swallow clinic", + "310139001": "Breast surgery service", + "310138009": "Surgical service", + "310136008": "Social services department duty team", + "310137004": "Stroke service", + "310101009": "Speech and language therapy service", + "310100005": "Play therapy service", + "734862008": "Endodontic service", + "734863003": "Prosthodontic service", + "310168000": "Vascular surgery service", + "310169008": "Ultrasonography service", + "310165002": "Transplant surgery service", + "310167005": "Urology service", + "310166001": "Trauma surgery service", + "310163009": "Pediatric surgical service", + "310164003": "Plastic surgery service", + "310161006": "Orthopedic service", + "310162004": "Pancreatic surgery service", + "310160007": "Ophthalmology service", + "310151004": "Gastrointestinal surgery service", + "310152006": "General gastrointestinal surgery service", + "310153001": "Upper gastrointestinal surgery service", + "310155008": "Colorectal surgery service", + "310150003": "Endocrine surgery service", + "310157000": "Hand surgery service", + "310156009": "General surgical service", + "310159002": "Neurosurgical service", + "310158005": "Hepatobiliary surgical service", + "828301000000108": "Electrocardiography service", + "310200001": "Cytology service", + "734920002": "Diabetes mellitus education service", + "829951000000102": "Industrial therapy service", + "931821000000105": "School nursing service", + "893941000000107": "Paediatric dermatology service", + "892741000000103": "Clinical microbiology service", + "893211000000100": "Spinal injuries service", + "92221000000103": "Mental health home treatment team", + "3621000175101": "Rheumatology service", + "408451000": "Community learning disabilities team", + "408452007": "Behavioral intervention team", + "408458006": "Specialist multidisciplinary team", + "893341000000106": "Congenital heart disease service", + "445449000": "Acute care hospice service", + "1078501000000104": "Health visiting service", + "893691000000107": "Paediatric transplantation surgery service", + "892621000000104": "Hepatobiliary and pancreatic surgery service", + "2421000175108": "Acute care inpatient service", + "931801000000101": "Community nursing service", + "699478002": "Surgical oncology service", + "893791000000100": "Paediatric pain management service", + "893541000000101": "Prosthetics service", + "699650006": "Community based physiotherapy service", + "893891000000108": "Paediatric interventional radiology service", + "827631000000105": "Emergency ambulance service", + "827981000000103": "Paediatric cystic fibrosis service", + "892821000000103": "Critical care medicine service", + "700435004": "Clinical physiology service", + "700436003": "Clinical pharmacology service", + "700434000": "Endocrinology service", + "700221004": "Care of elderly service", + "700433006": "Gastroenterology service", + "700231006": "Critical care physician service", + "700232004": "General medical service", + "700241009": "Dermatology service", + "893061000000109": "Cardiology service", + "705150003": "Domiciliary physiotherapy service", + "932241000000105": "Blood banking and transfusion service", + "3791000175107": "Pediatric nephrology service", + "892791000000108": "Blood and marrow transplantation service", + "893641000000102": "Palliative medicine service", + "431051000124102": "Dialysis service", + "23951000087100": "Opioid dependence service", + "1323651000000109": "Cardiac physiology service", + "788126001": "Prosthetic service", + "788124003": "Histopathology service", + "788125002": "Addiction service", + "788123009": "Radiation oncology service", + "788122004": "Sexual health service", + "788128000": "Critical care medicine service", + "788127005": "Child health service", + "788121006": "Clinical immunology and allergy service", + "733921009": "Transplant medicine service", + "788001008": "Infectious disease service", + "788002001": "Adult mental health service", + "788003006": "Nephrology service", + "788009005": "Nuclear medicine service", + "788006003": "Genetic laboratory service", + "788004000": "Clinical genetics service", + "788005004": "Neurology service", + "788008002": "Oral and maxillofacial surgery service", + "788007007": "General practice service", + "1326391000000100": "FNP (Family Nurse Partnership) service", + "1186717003": "Intellectual disability psychiatry service", + "830149003": "Clinical neurophysiology service", + "224930009": "Services", + "830039004": "Genitourinary medicine service", + "830038007": "Clinical allergy service", + "830037002": "Clinical immunology service", + "1326421000000106": "Safeguarding children team", + "1323551000000105": "Inherited metabolic medicine service", + "28541000087101": "Musculoskeletal service", + "24271000087103": "Adult chronic pain management service", + "1240241000000109": "Community sexual and reproductive health service", + "897188002": "Pediatric hematology service", + "1323631000000102": "Aviation and space medicine service", + "1325831000000100": "Post-COVID-19 syndrome service", + "1323431000000104": "Fetal medicine service", + "24001000087103": "Paediatric plastic surgery service", + "24351000087104": "Paediatric chronic pain management service", + "1323881000000102": "Stroke medicine service", + "1323531000000103": "Urological physiology service", + "148621000000100": "School aged immunisation service", + "24101000087102": "HIV (human immunodeficiency virus) social work service", + "23911000087104": "Medication review service", + "1148679005": "Specialist palliative care service", + "773558007": "Physical medicine service", + "24051000087102": "Breast surgical oncology service", + "896974005": "Transgender health service", + "1323611000000105": "Paediatric inherited metabolic medicine service", + "1323661000000107": "Paediatric audiovestibular medicine service", + "24331000087108": "Narcotic addiction service with chronic pain management", + "1323561000000108": "Gastrointestinal physiology service", + "34911000087100": "Amputation care service", + "1231786003": "Refugee healthcare service", + "1163002007": "Electrocardiography service", + "1163004008": "Hyperbaric medicine service", + "1163003002": "Colorectal cancer screening service", + "1323841000000105": "Paediatric palliative medicine service", + "1163054002": "Gastroscopy service", + "1231392007": "Paediatric orthopaedic service", + "1231391000": "Colonoscopy service", + "1231393002": "Spirometry service", + "1231390004": "Hand therapy service", + "1231394008": "Paediatric urology service", + "24081000087105": "HIV (human immunodeficiency virus) nurse practitioner service", + "23941000087103": "Narcotic addiction service", + "1323641000000106": "Audiovestibular medicine service", + "840587001": "Aerospace medical service", + "840586005": "Neonatal service", + "840585009": "Postnatal service", + "816075004": "Prosthetic and orthotic service", + "1323921000000108": "Neuropsychiatry service", + "24011000087101": "Vascular imaging service", + "1323691000000101": "General internal medical service", + "23891000087102": "Adult hematology service", + "1323821000000103": "Paediatric clinical pharmacology service", + "789718008": "Cardiology service", + "789714005": "Pediatric rheumatology service", + "789715006": "Paediatric respiratory therapy service", + "789716007": "Pediatric otolaryngology service", + "789717003": "Paediatric cardiology service", + "148581000000100": "Personal health record provider service", + "792849008": "Pediatric clinical genetics service", + "792847005": "Emergency ambulance service", + "792848000": "Internal medicine service", + "1323621000000104": "Medical psychotherapy service", + "1323871000000104": "Rehabilitation medicine service", + "1230046007": "Cervical cancer screening service", + "1230045006": "Cardiac diagnostic service", + "1230044005": "Cardiac specialist nursing service", + "1362761000000103": "Adult safeguarding team", + "1323901000000104": "Rare disease service", + "1136421000168109": "Sleep medicine service", + "1323701000000101": "Vascular physiology service", + "24141000087104": "Spine orthopedic surgery service", + "1323571000000101": "Orthogeriatric medicine service", + "1323801000000107": "Paediatric oral and maxillofacial surgery service", + "23871000087101": "Adult dermatology service", + "1323601000000108": "Ophthalmic and vision science service", + "1234796008": "Community nursing service", + "23901000087101": "Hepatology service", + "1324191000000107": "Intensive care medicine service", + "2391000175104": "Bariatric surgery service", + "1323851000000108": "Paediatric hepatology service", + "24291000087104": "Geriatric chronic pain management service", + "1323501000000109": "Special care dentistry service", + "1423561000000102": "Acute oncology service", +} + SYSTEM_SHORT_IDS = {"http://snomed.info/sct": "SCT", "https://nicip.nhs.uk": "NICIP"} diff --git a/layer/nrlf/core/validators.py b/layer/nrlf/core/validators.py index 0974e403e..b31c72599 100644 --- a/layer/nrlf/core/validators.py +++ b/layer/nrlf/core/validators.py @@ -5,7 +5,14 @@ from pydantic import ValidationError from nrlf.core.codes import SpineErrorConcept -from nrlf.core.constants import CATEGORY_ATTRIBUTES, ODS_SYSTEM, REQUIRED_CREATE_FIELDS +from nrlf.core.constants import ( + CATEGORY_ATTRIBUTES, + ODS_SYSTEM, + PRACTICE_SETTING_VALUE_SET_URL, + REQUIRED_CREATE_FIELDS, + SNOMED_PRACTICE_SETTINGS, + SNOMED_SYSTEM_URL, +) from nrlf.core.errors import ParseError from nrlf.core.logger import LogReference, logger from nrlf.core.types import DocumentReference, OperationOutcomeIssue, RequestQueryType @@ -510,3 +517,67 @@ def _validate_author(self, model: DocumentReference): field=f"author[0].identifier.value", ) return + + def _validate_practiceSetting(self, model: DocumentReference): + """ + Validate the practice setting field contains an appropriate coding system and code. + """ + + if not ( + practice_setting_coding := getattr( + model.context.practiceSetting, "coding", [] + ) + ): + self.result.add_error( + issue_code="invalid", + error_code="INVALID_RESOURCE", + diagnostics=f"Invalid practice setting: must contain a Coding", + field=f"context.practiceSetting.coding", + ) + return + + if len(practice_setting_coding) != 1: + self.result.add_error( + issue_code="invalid", + error_code="INVALID_RESOURCE", + diagnostics=f"Invalid practice setting coding length: {len(model.context.practiceSetting.coding)} Practice Setting Coding must only contain a single value", + field=f"context.practiceSetting.coding", + ) + return + + if ( + practice_setting_system := getattr( + practice_setting_coding[0], "system", None + ) + != SNOMED_SYSTEM_URL + ): + self.result.add_error( + issue_code="invalid", + error_code="INVALID_VALIDATION", + diagnostics=f"Invalid practice setting system: {practice_setting_system} Practice Setting system must be {SNOMED_SYSTEM_URL}", + field=f"context.practiceSetting.coding[0].system", + ) + return + + if ( + practice_setting_value := getattr(practice_setting_coding[0], "value", None) + not in SNOMED_PRACTICE_SETTINGS.keys() + ): + self.result.add_error( + issue_code="invalid", + error_code="INVALID_VALIDATION", + diagnostics=f"Invalid practice setting code: {practice_setting_value} Practice Setting coding must be a member of value set {PRACTICE_SETTING_VALUE_SET_URL}", + field=f"context.practiceSetting.coding[0].value", + ) + return + + if practice_setting_display := getattr( + practice_setting_coding[0], "display", None + ) != SNOMED_PRACTICE_SETTINGS.get(practice_setting_value): + self.result.add_error( + issue_code="invalid", + error_code="INVALID_VALIDATION", + diagnostics=f"Invalid practice setting coding: display {practice_setting_display} does not match the expected display for {practice_setting_value} Practice Setting coding is bound to value set {PRACTICE_SETTING_VALUE_SET_URL}", + field=f"context.practiceSetting.coding[0]", + ) + return diff --git a/terraform/infrastructure/consumer.tftpl b/terraform/infrastructure/consumer.tftpl index 15ee86292..363ead22f 100644 --- a/terraform/infrastructure/consumer.tftpl +++ b/terraform/infrastructure/consumer.tftpl @@ -4,7 +4,7 @@ "url": "https://${domain}/record-locator/consumer/FHIR/R4/metadata", "name": "NRLConsumerAPICapabilityStatement", "status": "active", - "version": "1.0.0", + "version": "1.0.1", "experimental": false, "date": "2024-03-13", "publisher": "NHS England", @@ -99,7 +99,7 @@ "name": "type", "definition": "http://hl7.org/fhir/SearchParameter/DocumentReference-type", "type": "token", - "documentation": "Allows DocumentReference search results to be filtered by pointer type (SNOMED code)." + "documentation": "Allows DocumentReference search results to be filtered by pointer type (SNOMED or NICIP code)." }, { "name": "subject", diff --git a/terraform/infrastructure/producer.tftpl b/terraform/infrastructure/producer.tftpl index d52749ebd..fafe92700 100644 --- a/terraform/infrastructure/producer.tftpl +++ b/terraform/infrastructure/producer.tftpl @@ -4,7 +4,7 @@ "url": "https://${domain}/record-locator/producer/FHIR/R4/metadata", "name": "NRLProducerAPICapabilityStatement", "status": "active", - "version": "1.0.0", + "version": "1.0.1", "experimental": false, "date": "2024-03-13", "publisher": "NHS England", @@ -98,7 +98,13 @@ "name": "type", "definition": "http://hl7.org/fhir/SearchParameter/DocumentReference-type", "type": "token", - "documentation": "Allows DocumentReference search results to be filtered by pointer type (SNOMED code)." + "documentation": "Allows DocumentReference search results to be filtered by pointer type (SNOMED or NICIP code)." + }, + { + "name": "category", + "definition": "http://hl7.org/fhir/SearchParameter/DocumentReference-category", + "type": "token", + "documentation": "Allows DocumentReference search results to be filtered by pointer category (SNOMED code)." }, { "name": "subject", From aed5ca615954881a2846f98ad0cfcf45eb3f5c61 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Fri, 29 Nov 2024 09:23:26 +0000 Subject: [PATCH 03/14] NRL-519 add unit tests --- layer/nrlf/core/tests/test_validators.py | 202 +++++++++++++++++++++++ layer/nrlf/core/validators.py | 38 ++--- tests/features/utils/constants.py | 4 +- 3 files changed, 223 insertions(+), 21 deletions(-) diff --git a/layer/nrlf/core/tests/test_validators.py b/layer/nrlf/core/tests/test_validators.py index fd02deb20..169e4af2c 100644 --- a/layer/nrlf/core/tests/test_validators.py +++ b/layer/nrlf/core/tests/test_validators.py @@ -1522,3 +1522,205 @@ def test_validate_ssp_content_with_multiple_asids(): "diagnostics": "Multiple ASID identifiers provided. Only a single valid ASID identifier can be provided in the context.related.", "expression": ["context.related"], } + + +def test_validate_practiceSetting_no_coding(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "text": "Description of the clinic" + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting: must contain a Coding", + "expression": ["context.practiceSetting.coding"], + } + + +def test_validate_practiceSetting_coding_invalid_system(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "coding": [ + { + "system": "http://snoooooomed/sctfffffg", + "code": "788002001", + "display": "Adult mental health service", + } + ] + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting system: http://snoooooomed/sctfffffg Practice Setting system must be 'http://snomed.info/sct'", + "expression": ["context.practiceSetting.coding[0].system"], + } + + +def test_validate_practiceSetting_coding_invalid_code(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "123", + "display": "Adult mental health service", + } + ] + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting code: 123 Practice Setting coding must be a member of value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": ["context.practiceSetting.coding[0].code"], + } + + +def test_validate_practiceSetting_coding_missing_code(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "coding": [ + { + "system": "http://snomed.info/sct", + "display": "Adult mental health service", + } + ] + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting code: None Practice Setting coding must be a member of value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": ["context.practiceSetting.coding[0].code"], + } + + +def test_validate_practiceSetting_coding_missing_display(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "788002001", + } + ] + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting coding: display None does not match the expected display for 788002001 Practice Setting coding is bound to value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": ["context.practiceSetting.coding[0]"], + } + + +def test_validate_practiceSetting_coding_mismatch_code_and_display(): + validator = DocumentReferenceValidator() + document_ref_data = load_document_reference_json("Y05868-736253002-Valid") + + document_ref_data["context"]["practiceSetting"] = { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "788002001", + "display": "Nephrology service", + } + ] + } + + result = validator.validate(document_ref_data) + + assert result.is_valid is False + assert len(result.issues) == 1 + assert result.issues[0].model_dump(exclude_none=True) == { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource", + } + ] + }, + "diagnostics": "Invalid practice setting coding: display Nephrology service does not match the expected display for 788002001 Practice Setting coding is bound to value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": ["context.practiceSetting.coding[0]"], + } diff --git a/layer/nrlf/core/validators.py b/layer/nrlf/core/validators.py index ae8346ee6..ca5f5f894 100644 --- a/layer/nrlf/core/validators.py +++ b/layer/nrlf/core/validators.py @@ -13,11 +13,10 @@ REQUIRED_CREATE_FIELDS, SNOMED_PRACTICE_SETTINGS, SNOMED_SYSTEM_URL, - REQUIRED_CREATE_FIELDS, TYPE_ATTRIBUTES, TYPE_CATEGORIES, Categories, - PointerTypes + PointerTypes, ) from nrlf.core.errors import ParseError from nrlf.core.logger import LogReference, logger @@ -145,6 +144,7 @@ def validate(self, data: Dict[str, Any] | DocumentReference): self._validate_category(resource) self._validate_author(resource) self._validate_type_category_mapping(resource) + self._validate_practiceSetting(resource) if resource.content[0].extension: self._validate_content_extension(resource) @@ -615,7 +615,7 @@ def _validate_practiceSetting(self, model: DocumentReference): ) ): self.result.add_error( - issue_code="invalid", + issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting: must contain a Coding", field=f"context.practiceSetting.coding", @@ -624,7 +624,7 @@ def _validate_practiceSetting(self, model: DocumentReference): if len(practice_setting_coding) != 1: self.result.add_error( - issue_code="invalid", + issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting coding length: {len(model.context.practiceSetting.coding)} Practice Setting Coding must only contain a single value", field=f"context.practiceSetting.coding", @@ -635,34 +635,34 @@ def _validate_practiceSetting(self, model: DocumentReference): practice_setting_system := getattr( practice_setting_coding[0], "system", None ) - != SNOMED_SYSTEM_URL - ): + ) != SNOMED_SYSTEM_URL: self.result.add_error( - issue_code="invalid", - error_code="INVALID_VALIDATION", - diagnostics=f"Invalid practice setting system: {practice_setting_system} Practice Setting system must be {SNOMED_SYSTEM_URL}", + issue_code="value", + error_code="INVALID_RESOURCE", + diagnostics=f"Invalid practice setting system: {practice_setting_system} Practice Setting system must be '{SNOMED_SYSTEM_URL}'", field=f"context.practiceSetting.coding[0].system", ) return if ( - practice_setting_value := getattr(practice_setting_coding[0], "value", None) - not in SNOMED_PRACTICE_SETTINGS.keys() - ): + practice_setting_value := getattr(practice_setting_coding[0], "code", None) + ) not in SNOMED_PRACTICE_SETTINGS: self.result.add_error( - issue_code="invalid", - error_code="INVALID_VALIDATION", + issue_code="value", + error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting code: {practice_setting_value} Practice Setting coding must be a member of value set {PRACTICE_SETTING_VALUE_SET_URL}", - field=f"context.practiceSetting.coding[0].value", + field=f"context.practiceSetting.coding[0].code", ) return - if practice_setting_display := getattr( - practice_setting_coding[0], "display", None + if ( + practice_setting_display := getattr( + practice_setting_coding[0], "display", None + ) ) != SNOMED_PRACTICE_SETTINGS.get(practice_setting_value): self.result.add_error( - issue_code="invalid", - error_code="INVALID_VALIDATION", + issue_code="value", + error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting coding: display {practice_setting_display} does not match the expected display for {practice_setting_value} Practice Setting coding is bound to value set {PRACTICE_SETTING_VALUE_SET_URL}", field=f"context.practiceSetting.coding[0]", ) diff --git a/tests/features/utils/constants.py b/tests/features/utils/constants.py index 48228a74d..7c656824e 100644 --- a/tests/features/utils/constants.py +++ b/tests/features/utils/constants.py @@ -64,8 +64,8 @@ "coding": [ { "system": "http://snomed.info/sct", - "code": "390826005", - "display": "Mental health caregiver support" + "code": "788002001", + "display": "Adult mental health service" } ] }, From 9f44e028a1b8f52994d6d620fbf604a09f7d82c6 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Wed, 4 Dec 2024 17:50:17 +0000 Subject: [PATCH 04/14] NRL-519 include practice setting in integration tests --- .../createDocumentReference-success.feature | 165 +++++++++--------- tests/features/utils/data.py | 40 +++-- 2 files changed, 112 insertions(+), 93 deletions(-) diff --git a/tests/features/producer/createDocumentReference-success.feature b/tests/features/producer/createDocumentReference-success.feature index 929e2a037..202595190 100644 --- a/tests/features/producer/createDocumentReference-success.feature +++ b/tests/features/producer/createDocumentReference-success.feature @@ -6,14 +6,15 @@ Feature: Producer - createDocumentReference - Success Scenarios | system | value | | http://snomed.info/sct | 736253002 | When producer 'ANGY1' creates a DocumentReference with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | 736253002 | - | category | 734163000 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | 736253002 | + | category | 734163000 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | Then the response status code is 201 And the response is an OperationOutcome with 1 issue And the OperationOutcome contains the issue: @@ -36,14 +37,15 @@ Feature: Producer - createDocumentReference - Success Scenarios And the response has a Location header And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-' And the resource in the Location header exists with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | 736253002 | - | category | 734163000 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | 736253002 | + | category | 734163000 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | # # NRL-766 Resolve custodian suffix issues # Scenario: Successfully create a Document Pointer (care plan) with custodian suffix @@ -97,26 +99,28 @@ Feature: Producer - createDocumentReference - Success Scenarios | system | value | | http://snomed.info/sct | 736253002 | And a DocumentReference resource exists with values: - | property | value | - | id | ANGY1-111-SupercedeDocRefTest1 | - | subject | 9278693472 | - | status | current | - | type | 736253002 | - | category | 734163000 | - | contentType | application/pdf | - | url | https://example.org/my-doc.pdf | - | custodian | ANGY1 | - | author | HAR1 | + | property | value | + | id | ANGY1-111-SupercedeDocRefTest1 | + | subject | 9278693472 | + | status | current | + | type | 736253002 | + | category | 734163000 | + | contentType | application/pdf | + | url | https://example.org/my-doc.pdf | + | custodian | ANGY1 | + | author | HAR1 | + | practiceSetting | 788002001 | When producer 'ANGY1' creates a DocumentReference with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | 736253002 | - | category | 734163000 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/newdoc.pdf | - | supercedes | ANGY1-111-SupercedeDocRefTest1 | + | property | value | + | subject | 9278693472 | + | status | current | + | type | 736253002 | + | category | 734163000 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/newdoc.pdf | + | supercedes | ANGY1-111-SupercedeDocRefTest1 | + | practiceSetting | 788002001 | Then the response status code is 201 And the response is an OperationOutcome with 1 issue And the OperationOutcome contains the issue: @@ -139,14 +143,15 @@ Feature: Producer - createDocumentReference - Success Scenarios And the response has a Location header And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-' And the resource in the Location header exists with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | 736253002 | - | category | 734163000 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/newdoc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | 736253002 | + | category | 734163000 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/newdoc.pdf | + | practiceSetting | 788002001 | And the resource with id 'ANGY1-111-SupercedeDocRefTest1' does not exist # Create document reference with relatesTo - not code='replaces' @@ -157,14 +162,15 @@ Feature: Producer - createDocumentReference - Success Scenarios | system | value | | http://snomed.info/sct | | When producer 'ANGY1' creates a DocumentReference with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | | - | category | | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | | + | category | | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | Then the response status code is 201 And the response is an OperationOutcome with 1 issue And the OperationOutcome contains the issue: @@ -229,15 +235,16 @@ Feature: Producer - createDocumentReference - Success Scenarios | https://nicip.nhs.uk | MAULR | | https://nicip.nhs.uk | MAXIB | When producer 'ANGY1' creates a DocumentReference with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | MAULR | - | type_system | https://nicip.nhs.uk | - | category | 721981007 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | MAULR | + | type_system | https://nicip.nhs.uk | + | category | 721981007 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | Then the response status code is 201 And the response is an OperationOutcome with 1 issue And the OperationOutcome contains the issue: @@ -260,25 +267,27 @@ Feature: Producer - createDocumentReference - Success Scenarios And the response has a Location header And the Location header starts with '/producer/FHIR/R4/DocumentReference/ANGY1-' And the resource in the Location header exists with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | MAULR | - | type_system | https://nicip.nhs.uk | - | category | 721981007 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | MAULR | + | type_system | https://nicip.nhs.uk | + | category | 721981007 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | When producer 'ANGY1' creates a DocumentReference with values: - | property | value | - | subject | 9278693472 | - | status | current | - | type | MAXIB | - | type_system | https://nicip.nhs.uk | - | category | 103693007 | - | custodian | ANGY1 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | + | property | value | + | subject | 9278693472 | + | status | current | + | type | MAXIB | + | type_system | https://nicip.nhs.uk | + | category | 103693007 | + | custodian | ANGY1 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 788002001 | Then the response status code is 201 And the response is an OperationOutcome with 1 issue And the OperationOutcome contains the issue: diff --git a/tests/features/utils/data.py b/tests/features/utils/data.py index 11288945a..da40a9424 100644 --- a/tests/features/utils/data.py +++ b/tests/features/utils/data.py @@ -1,4 +1,9 @@ -from layer.nrlf.core.constants import CATEGORY_ATTRIBUTES, TYPE_ATTRIBUTES +from layer.nrlf.core.constants import ( + CATEGORY_ATTRIBUTES, + SNOMED_PRACTICE_SETTINGS, + SNOMED_SYSTEM_URL, + TYPE_ATTRIBUTES, +) from nrlf.producer.fhir.r4.model import ( Attachment, CodeableConcept, @@ -36,24 +41,13 @@ def create_test_document_reference(items: dict) -> DocumentReference: ) ) ], - context=DocumentReferenceContext( - practiceSetting=CodeableConcept( - coding=[ - Coding( - system="http://snomed.info/sct", - code="390826005", - display="Mental health caregiver support", - ) - ] - ) - ), ) if items.get("id"): base_doc_ref.id = items["id"] if type_code := items.get("type"): - type_system = items.get("type_system", "http://snomed.info/sct") + type_system = items.get("type_system", SNOMED_SYSTEM_URL) type_str = f"{type_system}|{type_code}" type_display = items.get( "type_display", TYPE_ATTRIBUTES.get(type_str, {}).get("display") @@ -90,13 +84,13 @@ def create_test_document_reference(items: dict) -> DocumentReference: if items.get("category"): category_display = CATEGORY_ATTRIBUTES.get( - f"http://snomed.info/sct|{items['category']}", {} + f"SNOMED_SYSTEM_URL|{items['category']}", {} ).get("display") base_doc_ref.category = [ CodeableConcept( coding=[ Coding( - system="http://snomed.info/sct", + system=SNOMED_SYSTEM_URL, code=items["category"], display=category_display, ) @@ -118,6 +112,22 @@ def create_test_document_reference(items: dict) -> DocumentReference: ) ] + if practice_setting_code := items.get("practiceSetting"): + practice_setting_display = SNOMED_PRACTICE_SETTINGS.get( + str(practice_setting_code), "Unknown practice setting" + ) + base_doc_ref.context = DocumentReferenceContext( + practiceSetting=CodeableConcept( + coding=[ + Coding( + system=SNOMED_SYSTEM_URL, + code=str(practice_setting_code), + display=practice_setting_display, + ) + ] + ) + ) + return base_doc_ref From ef966237a58a0de17a79c6ab42aec4d212d34eca Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Wed, 4 Dec 2024 19:09:49 +0000 Subject: [PATCH 05/14] NRL-519 include practice setting in integration tests --- tests/features/utils/data.py | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/features/utils/data.py b/tests/features/utils/data.py index da40a9424..a4a23ea17 100644 --- a/tests/features/utils/data.py +++ b/tests/features/utils/data.py @@ -30,6 +30,23 @@ def create_test_document_reference(items: dict) -> DocumentReference: + + if practice_setting_code := items.get("practiceSetting"): + practice_setting_display = SNOMED_PRACTICE_SETTINGS.get( + str(practice_setting_code), "Unknown practice setting" + ) + context = DocumentReferenceContext( + practiceSetting=CodeableConcept( + coding=[ + Coding( + system=SNOMED_SYSTEM_URL, + code=str(practice_setting_code), + display=practice_setting_display, + ) + ] + ) + ) + base_doc_ref = DocumentReference.model_construct( resourceType="DocumentReference", status=items.get("status", "current"), @@ -41,6 +58,7 @@ def create_test_document_reference(items: dict) -> DocumentReference: ) ) ], + context=context, ) if items.get("id"): @@ -112,22 +130,6 @@ def create_test_document_reference(items: dict) -> DocumentReference: ) ] - if practice_setting_code := items.get("practiceSetting"): - practice_setting_display = SNOMED_PRACTICE_SETTINGS.get( - str(practice_setting_code), "Unknown practice setting" - ) - base_doc_ref.context = DocumentReferenceContext( - practiceSetting=CodeableConcept( - coding=[ - Coding( - system=SNOMED_SYSTEM_URL, - code=str(practice_setting_code), - display=practice_setting_display, - ) - ] - ) - ) - return base_doc_ref From dbde35db3a933ea97abaf95141e691f809592c33 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Wed, 4 Dec 2024 19:59:07 +0000 Subject: [PATCH 06/14] NRL-519 include practice setting in integration tests --- tests/features/utils/data.py | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/tests/features/utils/data.py b/tests/features/utils/data.py index a4a23ea17..053a42e76 100644 --- a/tests/features/utils/data.py +++ b/tests/features/utils/data.py @@ -31,21 +31,10 @@ def create_test_document_reference(items: dict) -> DocumentReference: - if practice_setting_code := items.get("practiceSetting"): - practice_setting_display = SNOMED_PRACTICE_SETTINGS.get( - str(practice_setting_code), "Unknown practice setting" - ) - context = DocumentReferenceContext( - practiceSetting=CodeableConcept( - coding=[ - Coding( - system=SNOMED_SYSTEM_URL, - code=str(practice_setting_code), - display=practice_setting_display, - ) - ] - ) - ) + practice_setting_code = items.get("practiceSetting", "788007007") + practice_setting_display = SNOMED_PRACTICE_SETTINGS.get( + str(practice_setting_code), "General practice service" + ) base_doc_ref = DocumentReference.model_construct( resourceType="DocumentReference", @@ -58,7 +47,17 @@ def create_test_document_reference(items: dict) -> DocumentReference: ) ) ], - context=context, + context=DocumentReferenceContext( + practiceSetting=CodeableConcept( + coding=[ + Coding( + system=SNOMED_SYSTEM_URL, + code=str(practice_setting_code), + display=practice_setting_display, + ) + ] + ) + ), ) if items.get("id"): From 4b3ab850a254e478274d96cd6d45ca527bb76697 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Wed, 4 Dec 2024 20:33:25 +0000 Subject: [PATCH 07/14] NRL-519 include practice setting in integration tests --- tests/features/producer/readDocumentReference-success.feature | 4 ++-- tests/features/utils/data.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/features/producer/readDocumentReference-success.feature b/tests/features/producer/readDocumentReference-success.feature index bf0e340b1..2eb19448b 100644 --- a/tests/features/producer/readDocumentReference-success.feature +++ b/tests/features/producer/readDocumentReference-success.feature @@ -79,8 +79,8 @@ Feature: Producer - readDocumentReference - Success Scenarios "coding": [ { "system": "http://snomed.info/sct", - "code": "390826005", - "display": "Mental health caregiver support" + "code": "788007007", + "display": "General practice service" } ] } diff --git a/tests/features/utils/data.py b/tests/features/utils/data.py index 053a42e76..5bc300585 100644 --- a/tests/features/utils/data.py +++ b/tests/features/utils/data.py @@ -101,7 +101,7 @@ def create_test_document_reference(items: dict) -> DocumentReference: if items.get("category"): category_display = CATEGORY_ATTRIBUTES.get( - f"SNOMED_SYSTEM_URL|{items['category']}", {} + f"{SNOMED_SYSTEM_URL}|{items['category']}", {} ).get("display") base_doc_ref.category = [ CodeableConcept( From 04b2c9ddc8aa19d01d2058c9f7ce8130ae07df17 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Wed, 4 Dec 2024 20:50:08 +0000 Subject: [PATCH 08/14] NRL-519 include practice setting in integration tests --- .../consumer/readDocumentReference-success.feature | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/features/consumer/readDocumentReference-success.feature b/tests/features/consumer/readDocumentReference-success.feature index b1e1add80..f0854af16 100644 --- a/tests/features/consumer/readDocumentReference-success.feature +++ b/tests/features/consumer/readDocumentReference-success.feature @@ -77,8 +77,8 @@ Feature: Consumer - readDocumentReference - Success Scenarios "coding": [ { "system": "http://snomed.info/sct", - "code": "390826005", - "display": "Mental health caregiver support" + "code": "788007007", + "display": "General practice service" } ] } @@ -163,8 +163,8 @@ Feature: Consumer - readDocumentReference - Success Scenarios "coding": [ { "system": "http://snomed.info/sct", - "code": "390826005", - "display": "Mental health caregiver support" + "code": "788007007", + "display": "General practice service" } ] } From 2aef83dd6026a5e9b343c935d0fb05c5fec4eb33 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 08:44:26 +0000 Subject: [PATCH 09/14] NRL-519 add create failure scenarios for invalid practice settings --- .../createDocumentReference-failure.feature | 202 +++++++----------- 1 file changed, 81 insertions(+), 121 deletions(-) diff --git a/tests/features/producer/createDocumentReference-failure.feature b/tests/features/producer/createDocumentReference-failure.feature index c1d09f483..9f6efda40 100644 --- a/tests/features/producer/createDocumentReference-failure.feature +++ b/tests/features/producer/createDocumentReference-failure.feature @@ -194,7 +194,6 @@ Feature: Producer - createDocumentReference - Failure Scenarios } """ - # Invalid document reference - invalid custodian ID # Invalid document reference - invalid relatesTo target # Invalid document reference - invalid producer ID in relatesTo target Scenario: Unauthorised supersede - target belongs to a different custodian @@ -331,7 +330,6 @@ Feature: Producer - createDocumentReference - Failure Scenarios } """ - # Credentials - missing pointer type for create Scenario: Producer lacks the permission for the pointer type requested Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API And the organisation 'ANGY1' is authorised to access pointer types: @@ -407,93 +405,93 @@ Feature: Producer - createDocumentReference - Failure Scenarios } """ - # Invalid document reference - invalid Type - # NRL-769 Known issue: Type display is not validated - # Scenario: Invalid type (valid code but wrong display value) - # Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API - # And the organisation 'TSTCUS' is authorised to access pointer types: - # | system | value | - # | http://snomed.info/sct | 1363501000000100 | - # | http://snomed.info/sct | 736253002 | - # When producer 'TSTCUS' requests creation of a DocumentReference with default test values except 'type' is: - # """ - # "type": { - # "coding": [ - # { - # "system": "http://snomed.info/sct", - # "code": "736253002", - # "display": "Emergency Healthcare Plan" - # } - # ] - # } - # """ - # Then the response status code is 400 - # And the response is an OperationOutcome with 1 issue - # And the OperationOutcome contains the issue: - # """ - # { - # "severity": "error", - # "code": "invalid", - # "details": { - # "coding": [ - # { - # "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", - # "code": "BAD_REQUEST", - # "display": "Bad request" - # } - # ] - # }, - # "diagnostics": "The display does not match the expected value for this type", - # "expression": [ - # "type.coding.display" - # ] - # } - # """ + Scenario: Invalid practice setting (not in value set) + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API + And the organisation 'X26' is authorised to access pointer types: + | system | value | + | http://snomed.info/sct | 1363501000000100 | + | http://snomed.info/sct | 736253002 | + When producer 'X26' creates a DocumentReference with values: + | property | value | + | subject | 9999999999 | + | status | current | + | type | 736253002 | + | category | 1102421000000108 | + | custodian | X26 | + | author | HAR1 | + | url | https://example.org/my-doc.pdf | + | practiceSetting | 12345 | + Then the response status code is 400 + And the response is an OperationOutcome with 1 issue + And the OperationOutcome contains the issue: + """ + { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource" + } + ] + }, + "diagnostics": "Invalid practice setting code: 12345 Practice Setting coding must be a member of value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": ["context.practiceSetting.coding[0].code"], + + } + """ + + Scenario: Invalid practice setting (valid code but wrong display value) + Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API + And the organisation 'TSTCUS' is authorised to access pointer types: + | system | value | + | http://snomed.info/sct | 1363501000000100 | + | http://snomed.info/sct | 736253002 | + When producer 'TSTCUS' requests creation of a DocumentReference with default test values except 'context' is: + """ + "context": { + "practiceSetting": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "788002001", + "display": "Ophthalmology service" + } + ] + } + } + """ + Then the response status code is 400 + And the response is an OperationOutcome with 1 issue + And the OperationOutcome contains the issue: + """ + { + "severity": "error", + "code": "value", + "details": { + "coding": [ + { + "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", + "code": "INVALID_RESOURCE", + "display": "Invalid validation of resource" + } + ] + }, + "diagnostics": "Invalid practice setting coding: display Ophthalmology service does not match the expected display for 788002001 Practice Setting coding is bound to value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", + "expression": [ + "context.practiceSetting.coding[0]" + ] + } + """ + # Invalid document reference - empty content[0].attachment.url # Invalid document reference - create another producers document # Invalid document reference - bad JSON - # Invalid document reference - invalid status (NRL-476 to ensure only 'current' is accepted) - # Scenario: Invalid document reference - invalid status - # Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API - # And the organisation 'ANGY1' is authorised to access pointer types: - # | system | value | - # | http://snomed.info/sct | 736253002 | - # When producer 'ANGY1' creates a DocumentReference with values: - # | property | value | - # | subject | 9999999999 | - # | status | notarealStatus | - # | type | 736253002 | - # | category | 734163000 | - # | custodian | ANGY1 | - # | author | HAR1 | - # | url | https://example.org/my-doc.pdf | - # Then the response status code is 400 - # And the response is an OperationOutcome with 1 issue - # And the OperationOutcome contains the issue: - # """ - # { - # "severity": "error", - # "code": "forbidden", - # "details": { - # "coding": [ - # { - # "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", - # "code": "AUTHOR_CREDENTIALS_ERROR", - # "display": "Author credentials error" - # } - # ] - # }, - # "diagnostics": "The type of the provided DocumentReference is not in the list of allowed types for this organisation", - # "expression": [ - # "type.coding[0].code" - # ] - # } - # """ - # Invalid document reference - invalid author (NRL-474) # Invalid document reference - invalid content (NRL-518) # Invalid document reference - invalid context.related for an SSP url # Invalid document reference - missing context.related for an SSP url - # Invalid document reference - invalid context.practiceSetting (NRL-519) # Invalid document reference - invalid docStatus (NRL-477) # Invalid document reference - duplicate keys # Invalid document reference - duplicate relatesTo targets in URL @@ -573,44 +571,6 @@ Feature: Producer - createDocumentReference - Failure Scenarios } """ - Scenario: Mismatched Category Code for Document Reference Type - Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API - And the organisation 'X26' is authorised to access pointer types: - | system | value | - | http://snomed.info/sct | 1363501000000100 | - | http://snomed.info/sct | 736253002 | - When producer 'X26' creates a DocumentReference with values: - | property | value | - | subject | 9999999999 | - | status | current | - | type | 736253002 | - | category | 1102421000000108 | - | custodian | X26 | - | author | HAR1 | - | url | https://example.org/my-doc.pdf | - Then the response status code is 400 - And the response is an OperationOutcome with 1 issue - And the OperationOutcome contains the issue: - """ - { - "severity": "error", - "code": "value", - "details": { - "coding": [ - { - "system": "https://fhir.nhs.uk/ValueSet/Spine-ErrorOrWarningCode-1", - "code": "INVALID_RESOURCE", - "display": "Invalid validation of resource" - } - ] - }, - "diagnostics": "The Category code of the provided document 'http://snomed.info/sct|1102421000000108' must match the allowed category for pointer type 'http://snomed.info/sct|736253002' with a category value of 'http://snomed.info/sct|734163000'", - "expression": [ - "category.coding[0].code" - ] - } - """ - Scenario Outline: Invalid display value for type or category (imaging) Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API And the organisation 'ANGY1' is authorised to access pointer types: From 4f6469475d50429c1b7c8d191d63c3433808d364 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 08:50:08 +0000 Subject: [PATCH 10/14] NRL-519 update smoketest to use a valid practiceSetting --- tests/smoke/setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/smoke/setup.py b/tests/smoke/setup.py index a44ebe9bb..69e1f6358 100644 --- a/tests/smoke/setup.py +++ b/tests/smoke/setup.py @@ -81,8 +81,8 @@ def build_document_reference( coding=[ Coding( system="http://snomed.info/sct", - code="390826005", - display="Mental health caregiver support", + code="224891009", + display="Healthcare services", ) ] ) From 8e4aa3e4eda079a1a7ae23cb2aa8c5f55516a715 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 09:04:30 +0000 Subject: [PATCH 11/14] NRL-519 fix confounding issue in create integration test --- tests/features/producer/createDocumentReference-failure.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/features/producer/createDocumentReference-failure.feature b/tests/features/producer/createDocumentReference-failure.feature index 9f6efda40..2aeac74c4 100644 --- a/tests/features/producer/createDocumentReference-failure.feature +++ b/tests/features/producer/createDocumentReference-failure.feature @@ -416,7 +416,7 @@ Feature: Producer - createDocumentReference - Failure Scenarios | subject | 9999999999 | | status | current | | type | 736253002 | - | category | 1102421000000108 | + | category | 734163000 | | custodian | X26 | | author | HAR1 | | url | https://example.org/my-doc.pdf | From c52fc09480985987be52b295daae2e1f9316d74e Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 09:16:00 +0000 Subject: [PATCH 12/14] NRL-519 fix formatting error --- .../features/producer/createDocumentReference-failure.feature | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/features/producer/createDocumentReference-failure.feature b/tests/features/producer/createDocumentReference-failure.feature index 2aeac74c4..d407845b7 100644 --- a/tests/features/producer/createDocumentReference-failure.feature +++ b/tests/features/producer/createDocumentReference-failure.feature @@ -438,8 +438,7 @@ Feature: Producer - createDocumentReference - Failure Scenarios ] }, "diagnostics": "Invalid practice setting code: 12345 Practice Setting coding must be a member of value set https://fhir.nhs.uk/England/ValueSet/England-PracticeSetting", - "expression": ["context.practiceSetting.coding[0].code"], - + "expression": ["context.practiceSetting.coding[0].code"] } """ From b9f7d40122c5d4f73df3321b80edb77ab2229b23 Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 13:16:29 +0000 Subject: [PATCH 13/14] NRL-519 implement sonarcloud suggestions --- layer/nrlf/core/validators.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/layer/nrlf/core/validators.py b/layer/nrlf/core/validators.py index 654827202..707ca5294 100644 --- a/layer/nrlf/core/validators.py +++ b/layer/nrlf/core/validators.py @@ -570,7 +570,7 @@ def _validate_author(self, model: DocumentReference): issue_code="invalid", error_code="INVALID_RESOURCE", diagnostics=f"Invalid author length: {len(model.author)} Author must only contain a single value", - field=f"author", + field="author", ) return @@ -582,7 +582,7 @@ def _validate_author(self, model: DocumentReference): issue_code="invalid", error_code="INVALID_IDENTIFIER_SYSTEM", diagnostics=f"Invalid author system: '{identifier.system}' Author system must be '{ODS_SYSTEM}'", - field=f"author[0].identifier.system", + field="author[0].identifier.system", ) return @@ -591,7 +591,7 @@ def _validate_author(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid author value: '{identifier.value}' Author value must be alphanumeric", - field=f"author[0].identifier.value", + field="author[0].identifier.value", ) return @@ -600,7 +600,7 @@ def _validate_author(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid author value: '{identifier.value}' Author value must be less than 13 characters", - field=f"author[0].identifier.value", + field="author[0].identifier.value", ) return @@ -617,8 +617,8 @@ def _validate_practiceSetting(self, model: DocumentReference): self.result.add_error( issue_code="value", error_code="INVALID_RESOURCE", - diagnostics=f"Invalid practice setting: must contain a Coding", - field=f"context.practiceSetting.coding", + diagnostics="Invalid practice setting: must contain a Coding", + field="context.practiceSetting.coding", ) return @@ -627,7 +627,7 @@ def _validate_practiceSetting(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting coding length: {len(model.context.practiceSetting.coding)} Practice Setting Coding must only contain a single value", - field=f"context.practiceSetting.coding", + field="context.practiceSetting.coding", ) return @@ -651,7 +651,7 @@ def _validate_practiceSetting(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting code: {practice_setting_value} Practice Setting coding must be a member of value set {PRACTICE_SETTING_VALUE_SET_URL}", - field=f"context.practiceSetting.coding[0].code", + field="context.practiceSetting.coding[0].code", ) return @@ -664,6 +664,6 @@ def _validate_practiceSetting(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting coding: display {practice_setting_display} does not match the expected display for {practice_setting_value} Practice Setting coding is bound to value set {PRACTICE_SETTING_VALUE_SET_URL}", - field=f"context.practiceSetting.coding[0]", + field="context.practiceSetting.coding[0]", ) return From bfc1850a3c60e8c3c61e09f121ee903e290d3c7e Mon Sep 17 00:00:00 2001 From: Kate Bobyn Date: Thu, 5 Dec 2024 13:17:34 +0000 Subject: [PATCH 14/14] NRL-519 implement sonarcloud suggestions --- layer/nrlf/core/validators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layer/nrlf/core/validators.py b/layer/nrlf/core/validators.py index 707ca5294..fa1743013 100644 --- a/layer/nrlf/core/validators.py +++ b/layer/nrlf/core/validators.py @@ -640,7 +640,7 @@ def _validate_practiceSetting(self, model: DocumentReference): issue_code="value", error_code="INVALID_RESOURCE", diagnostics=f"Invalid practice setting system: {practice_setting_system} Practice Setting system must be '{SNOMED_SYSTEM_URL}'", - field=f"context.practiceSetting.coding[0].system", + field="context.practiceSetting.coding[0].system", ) return