Skip to content

Instantly share code, notes, and snippets.

@martinchapman
Last active July 21, 2026 13:47
Show Gist options
  • Select an option

  • Save martinchapman/66bb1cc449bbd506699b1623da39b404 to your computer and use it in GitHub Desktop.

Select an option

Save martinchapman/66bb1cc449bbd506699b1623da39b404 to your computer and use it in GitHub Desktop.
qwentity_sample_data_input.json
[
{"document_id": "8e469a83-91cf-4e61-a4d2-530ec49fb452", "document_content": "Emergency Department Clerking Note Date: 7th February 2024 Presenting complaint: Fever, rigors and confusion in a 68-year-old man with known COPD. Mr. Derek Hartley was brought in by ambulance at 03:42 with a 2-day history of productive cough with purulent green sputum, high fever (38.9°C), and new-onset confusion. He was found on the floor by his neighbour; a fall cannot be excluded. There is no history of haemoptysis. He denies chest pain and denies any recent travel abroad. On arrival he was tachycardic (HR 118), tachypnoeic (RR 26), hypoxic (SpO2 84% on air, improving to 93% on 4L), and febrile. GCS was 13/15 (E3V4M6). He appeared cachectic and in moderate distress. CXR demonstrates a right lower lobe consolidation consistent with community-acquired pneumonia. Blood cultures taken. Lactate 3.1 mmol/L. WCC 18.4. He meets SIRS criteria; sepsis secondary to CAP is the working diagnosis. We cannot exclude a hospital-acquired component given his recent 5-day inpatient admission for a COPD infective exacerbation discharged 12 days ago. He has a background of COPD (on home nebulisers, no LTOT), type 2 diabetes mellitus (on metformin and gliclazide), and hypertension. He is a current smoker — approximately 30 pack-years. He lives alone in a ground-floor flat. No formal care package in place. His son, who accompanied him, reports that he has become increasingly frail over the past 6 months and has had at least three falls in the past 2 months. There is no family history of relevance. A urinary antigen for Legionella has been sent; Legionnaires' disease is on the differential given the severity of presentation. There is no clinical evidence of meningism and a CNS source is felt unlikely, though we have not yet excluded viral encephalitis entirely. LP is not planned at this stage unless there is clinical deterioration. Intravenous co-amoxiclav and clarithromycin commenced. High-flow oxygen titrated. IV fluids running. Escalation plan discussed; patient not currently for ITU given baseline status and expressed wishes, but HDU review requested. Repeat lactate in 2 hours."},
{"document_id": "34705d45-d729-4c7d-bf8f-4df112b74823", "document_content": "Cardiology Discharge Summary Date: 15th March 2024 Patient: Mrs. Josephine Carruthers, 79 years old Admission: 1st March 2024 | Discharge: 15th March 2024 Primary diagnosis: Non-ST elevation myocardial infarction (NSTEMI) Mrs. Carruthers was admitted via the emergency department with a 6-hour history of central crushing chest pain radiating to the left arm, associated with diaphoresis and nausea. Serial troponins confirmed myocardial injury (peak hsTnI 4,820 ng/L). ECG demonstrated ST depression in leads V4–V6. She underwent urgent coronary angiography on day 2, which demonstrated severe three-vessel disease. Percutaneous coronary intervention (PCI) was performed to the culprit lesion — a tight mid-LAD stenosis — with a drug-eluting stent deployed successfully. She made a good initial post-procedural recovery. Her hospital course was complicated by a paroxysmal atrial fibrillation episode on day 4, which was managed with IV metoprolol and subsequently self-terminated. Rate-controlled and anticoagulated with apixaban. Echocardiogram demonstrated moderate left ventricular impairment (EF 38%), moderate mitral regurgitation, and moderate aortic stenosis (Vmax 3.6 m/s — under surveillance, not yet severe). A diagnosis of heart failure with reduced ejection fraction (HFrEF) was confirmed. Diuresis with furosemide achieved good fluid balance by day 7. She required 2 litres of supplemental oxygen for the first 5 days of admission. Past medical history: Hypertension (well-controlled on amlodipine and ramipril), hyperlipidaemia (on atorvastatin), chronic kidney disease stage 3 (baseline creatinine 138 μmol/L — unchanged on discharge), osteoarthritis of bilateral knees. Appendicectomy in 1987. She has a coronary artery stent in situ from a PCI performed in 2019 for stable angina. She is an ex-smoker (ceased 2001, 15 pack-year history). She lives with her husband. She mobilises with a Zimmer frame at baseline. She is not on a formal care package. Discharge medications: Aspirin 75mg, clopidogrel 75mg, apixaban 5mg BD, bisoprolol 5mg, ramipril 5mg, furosemide 40mg OD, atorvastatin 80mg. Outpatient plans: Cardiology clinic in 6 weeks with repeat echocardiogram. Urgent referral to the structural heart valve team for formal aortic stenosis assessment and consideration of TAVI. Cardiac rehabilitation referral made. Renal function to be rechecked in 2 weeks in light of new diuretic."},
{"document_id": "74775730-c0ea-4285-bdbf-676837e416b2", "document_content": "Psychiatric Liaison Assessment Date: 22nd January 2024 Referral source: Medical ward (gastroenterology), following intentional paracetamol overdose Miss Priya Venkataraman is a 26-year-old woman admitted medically following an intentional self-overdose of paracetamol (estimated 18g) taken 14 hours prior to presentation. She was found by her flatmate. N-acetylcysteine infusion completed; liver function tests are recovering and she is medically fit for psychiatric review. In interview, Miss Venkataraman was initially guarded but became increasingly open. She describes a 3-year history of recurrent depressive episodes with previous community CMHT involvement, though she has been lost to follow-up for approximately 18 months. She endorses low mood, anhedonia, early morning wakening, poor appetite, and significant fatigue over the past 6 weeks. She explicitly endorses active suicidal ideation prior to the overdose and states she intended to die. She currently denies ongoing active suicidal intent but acknowledges persistent passive death wishes. She denies any history of manic or hypomanic episodes. There is no evidence of a psychotic disorder; she denies auditory or visual hallucinations. She has a background diagnosis of emotionally unstable personality disorder (EUPD/borderline type) and a longstanding anxiety disorder, both previously managed in secondary care. She disclosed regular cannabis use (approximately 4-5 times per week) and occasional cocaine use at weekends; she does not meet criteria for opioid use disorder and denies IV drug use. Alcohol intake is approximately 20–25 units per week, above recommended limits; she has not experienced alcohol withdrawal symptoms and this does not currently meet criteria for alcohol use disorder, though she was advised to reduce. Family history: her mother has a diagnosis of bipolar affective disorder and has had multiple inpatient admissions. Her maternal grandfather died by suicide in 1998. No paternal history of note. She lives alone in a privately rented flat. She is currently unemployed, having left her job 2 months ago. She has not disclosed any history of physical or sexual abuse but declined to discuss further. Impression: Recurrent depressive episode (severe, with suicidal act) in the context of EUPD. Cannabis use disorder is a contributing factor. Plan: Inpatient admission to psychiatric unit under informal status agreed. Crisis safety plan formulated. Psychiatry team to review antidepressant therapy. Substance misuse referral to be arranged on discharge."},
{"document_id": "a4ffaa2b-130b-4ccb-bb9d-2a58e004bdfd", "document_content": "Acute Medical Unit Clerking Date: 3rd April 2024 Patient: Mr. Arthur Brennan, 84 years old Presenting complaint: Acute confusion and reduced oral intake Mr. Brennan was brought to the AMU by his daughter after she found him acutely confused at home this morning. He was unable to recognise her and had been incontinent of urine overnight. She reports he has been off his food and drinks for 3 days and has had a \"funny smell\" to his urine for the past week. On examination he is alert but markedly confused and disorientated in time and place (AMTS 3/10). He is febrile (38.2°C), mildly tachycardic (HR 96), and normotensive. He appears dehydrated with dry mucous membranes. Urinalysis is strongly positive for nitrites and leucocytes. Working diagnosis is delirium secondary to urinary tract infection/urosepsis in a patient with background dementia. Blood cultures and urine MC&S sent. IV co-amoxiclav commenced. IV fluid resuscitation initiated. PMHx: Alzheimer's disease (diagnosed 2019, under memory clinic follow-up, on donepezil), Parkinson's disease (on co-careldopa), hypertension, type 2 diabetes mellitus (diet-controlled), COPD (GOLD stage 2, on tiotropium), osteoporosis (on alendronate and calcium/vitamin D supplementation). He had a right neck of femur fracture repaired with a hemiarthroplasty in November 2022 following a mechanical fall. He is a non-smoker and does not drink alcohol. He lives with his daughter and son-in-law following the hip fracture and has a twice-daily social care package. He mobilises with a Zimmer frame. Baseline AMTS prior to this admission was documented as 6/10 at his last memory clinic appointment. His daughter reports he has had at least 4 falls in the last 3 months. She has noticed progressive cognitive decline over the past year, beyond his established Alzheimer's trajectory. A Lewy body component is possible and had been queried at his last neurology review, though this has not been formally confirmed. On review of medications, his co-careldopa dose was increased 6 weeks ago; secondary Parkinsonism from his antiemetic (metoclopramide, prescribed by his GP for nausea) cannot be excluded and this has been stopped. Plans: Continue IV antibiotics pending cultures. Assess swallowing given aspiration risk in context of Parkinson's disease — SALT referral made. Consider formal Lewy body dementia workup as outpatient once acute illness resolved. Physiotherapy review for falls and mobility. Occupational therapy to assess home safety and consider whether care package requires uplifting. Safeguarding awareness note added given frailty and falls frequency."},
{"document_id": "d69b1bf8-b352-4f46-b7f2-931e4ac302d7", "document_content": "Obstetric High Dependency Unit Note Date: 11th June 2024 Patient: Mrs. Fatima Al-Rashidi, 32 years old, G2P1 Gestation: 35+4 weeks Mrs. Al-Rashidi was transferred to the HDU from the antenatal ward following rapid deterioration in blood pressure readings and new-onset headache. She was previously being monitored for gestational hypertension diagnosed at 32 weeks. This afternoon her BP was recorded at 168/112 mmHg on three successive readings 10 minutes apart. She has developed new 2+ proteinuria on dipstick. Diagnosis of pre-eclampsia confirmed. She is currently 35+4 weeks gestation with a single, cephalic fetus. CTG is reassuring. Fetal growth scan last week demonstrated the fetus to be on the 12th centile with normal Dopplers — no fetal growth restriction formally diagnosed at that point. A fetal wellbeing scan has been arranged urgently today. The fetus has not been noted to have any structural abnormality on prior anomaly scan. She has a severe headache (9/10) and photophobia. She denies visual disturbance and denies epigastric pain. She is not currently seizing. Blood results: platelets 128 (falling from 198 last week), ALT 87 (elevated), urate elevated at 0.48 mmol/L. Haemolysis screen is pending. HELLP syndrome is a concern and cannot be excluded at this time. Immediate management: IV labetalol commenced for acute blood pressure control with target <150/100 mmHg. IV magnesium sulphate initiated for seizure prophylaxis (eclampsia prevention). Urinary catheter inserted; fluid balance on strict hourly monitoring. Corticosteroids (betamethasone) given for fetal lung maturity. Anaesthetics team reviewed; epidural sited in anticipation of delivery. Past obstetric history: Previous pregnancy complicated by gestational diabetes (managed with diet alone), uncomplicated vaginal delivery at term in 2021, healthy male infant. No history of pre-eclampsia in previous pregnancy. Medical history: Hypothyroidism (on levothyroxine 100mcg, TFTs stable in pregnancy). Iron deficiency anaemia identified at booking, on ferrous sulphate. BMI at booking was 32 (overweight/obese range). She is a lifelong non-smoker and denies alcohol use in pregnancy. She lives with her husband and young son. No family history of pre-eclampsia, though her mother has essential hypertension. Plan: Senior obstetric review in 30 minutes. Multidisciplinary discussion with neonatology regarding delivery timing — planned caesarean section at 36 weeks at the latest, or immediate delivery if maternal or fetal condition deteriorates. Neonatal team on standby. ICU bed on reserve should cardiovascular status deteriorate."}
]
{"document_id":"74775730-c0ea-4285-bdbf-676837e416b2","document_source":"{}","document_inference":"{\"is_clinical_document\":true,\"extraction_reasoning\":\"(1) AMBIGUITIES/EDGE CASES: Paracetamol overdose is 'intentional' and 'completed', so relevance is 'recent' (part of this episode). Suicidal ideation is 'active' (persistent passive death wishes) and 'recent' (prior to overdose). EUPD and anxiety are chronic, thus 'active'. Mother's bipolar is 'family_history'. (2) EXACT/UMBRELLA MATCHING: 'intentional self-overdose of paracetamol' -> acute_toxicity_from_paracetamol + intentional_self_overdose. 'depressive episodes' -> depression. 'emotional unstable personality disorder' -> personality_disorder. 'anxiety disorder' -> anxiety_disorder. 'suicidal ideation' -> suicidal_ideation. 'cannabis use' -> cannabis_use_disorder. 'cocaine use' -> cocaine_use_disorder. 'bipolar affective disorder' -> bipolar_affective_disorder. 'lives alone' -> living_alone_at_home. 'unemployed' -> unemployed. (3) OMISSIONS: 'low mood', 'anhedonia', 'early morning wakening', 'poor appetite', 'fatigue' are symptoms of depression but not distinct entities in the schema (except fatigue). 'Alcohol intake 20-25 units' does not meet 'alcohol_use_disorder' criteria per text. 'N-acetylcysteine' is a treatment, not an entity. 'Crisis safety plan' is not an entity. Primary entities: acute_toxicity_from_paracetamol and intentional_self_overdose.\",\"document_content\":{\"doc_type\":\"Psychiatric Liaison Assessment\",\"doc_summary\":\"26F admitted following intentional paracetamol overdose (18g). Background of EUPD, anxiety, and substance use (cannabis, cocaine). Currently experiencing severe depression with suicidal ideation. Medically fit for psychiatric review.\",\"has_active_malignancy\":false},\"entities\":[{\"entity\":\"acute_toxicity_from_paracetamol\",\"entity_source_text\":\"intentional paracetamol overdose\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"completed\",\"14 hours prior\"],\"characterisation\":{\"summary\":\"18g, medically fit\",\"source_text\":[\"estimated 18g\",\"medically fit\"]},\"year\":null,\"month\":null},{\"entity\":\"intentional_self_overdose\",\"entity_source_text\":\"intentional self-overdose\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"intentional\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"depression\",\"entity_source_text\":\"depressive episodes\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"3-year history\",\"severe\"],\"characterisation\":{\"summary\":\"severe, recurrent\",\"source_text\":[\"severe\",\"recurrent\"]},\"year\":null,\"month\":null},{\"entity\":\"personality_disorder\",\"entity_source_text\":\"emotional unstable personality disorder\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"background diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"anxiety_disorder\",\"entity_source_text\":\"anxiety disorder\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"longstanding\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"suicidal_ideation\",\"entity_source_text\":\"suicidal ideation\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"persistent passive death wishes\"],\"characterisation\":{\"summary\":\"active prior to overdose, now passive\",\"source_text\":[\"active\",\"prior to overdose\",\"passive\"]},\"year\":null,\"month\":null},{\"entity\":\"cannabis_use_disorder\",\"entity_source_text\":\"cannabis use\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"regular\",\"4-5 times per week\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"cocaine_use_disorder\",\"entity_source_text\":\"cocaine use\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"occasional\",\"at weekends\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"opioid_use_disorder\",\"entity_source_text\":\"opioid use disorder\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"does not meet criteria\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"bipolar_affective_disorder\",\"entity_source_text\":\"bipolar affective disorder\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"family_history\",\"relevance\":\"historical\",\"status_source_text\":[\"mother\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"living_alone_at_home\",\"entity_source_text\":\"lives alone\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"privately rented flat\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"unemployed\",\"entity_source_text\":\"unemployed\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"currently\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"auditory_hallucinations\",\"entity_source_text\":\"auditory... hallucinations\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"denies\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"visual_hallucinations\",\"entity_source_text\":\"visual hallucinations\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"denies\"],\"characterisation\":null,\"year\":null,\"month\":null}]}","metadata":"{\"inference\": {\"failed_output\": null, \"inference_error\": null, \"schema_package_name\": \"londonaicentre-entityschema\", \"schema_package_version\": \"1.2.0\", \"inference_metadata\": \"2026-07-21 13:27:25.764676\"}, \"model\": {\"model_name\": \"qwentity_1_0_0\", \"model_version\": \"1.0\", \"trained_schema_name\": \"londonaicentre-entityschema\", \"trained_schema_version\": \"1.2.0\"}}","is_valid":true}
{"document_id":"d69b1bf8-b352-4f46-b7f2-931e4ac302d7","document_source":"{}","document_inference":"{\"is_clinical_document\":true,\"extraction_reasoning\":\"(1) AMBIGUITIES/EDGE CASES: Pre-eclampsia is the primary diagnosis. HELLP syndrome is explicitly 'a concern and cannot be excluded', so assertion=hypothetical. Gestational hypertension is historical (diagnosed at 32 weeks) but the current presentation is pre-eclampsia. Fetal growth restriction was 'not formally diagnosed', so assertion=negated. (2) EXACT/UMBRELLA MATCHING: Pre-eclampsia matches pre_eclampsia. Gestational hypertension matches gestational_hypertension. HELLP syndrome matches hellp_syndrome. Hypothyroidism matches hypothyroidism. Iron deficiency anaemia matches iron_deficiency_anaemia + anaemia. Overweight/obese BMI matches obesity. Epigastric pain matches upper_abdominal_pain. Seizure prophylaxis for eclampsia prevention matches eclampsia (negated/hypothetical). (3) OMISSIONS: BP values (168/112) and lab results (ALT 87, platelets 128) are not extracted as entities. 'Photophobia' and 'proteinuria' have no exact matches. 'Fetal wellbeing scan' and 'anomaly scan' are investigations, not entities. 'Epidural' is a procedure but not in the schema. 'Corticosteroids' is a medication. Primary entities: pre_eclampsia, headache, and gestational_hypertension (as the background condition).\",\"document_content\":{\"doc_type\":\"Obstetric High Dependency Unit Note\",\"doc_summary\":\"32F at 35+4 weeks gestation admitted with pre-eclampsia (BP 168/112, proteinuria, headache). Background of gestational hypertension and previous gestational diabetes. HELLP syndrome suspected. Management includes IV labetalol, magnesium sulphate, and planned caesarean section.\",\"has_active_malignancy\":false},\"entities\":[{\"entity\":\"pre_eclampsia\",\"entity_source_text\":\"pre-eclampsia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Diagnosis of\",\"confirmed\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"headache\",\"entity_source_text\":\"headache\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"new-onset\",\"severe\"],\"characterisation\":{\"summary\":\"severe (9/10)\",\"source_text\":[\"severe headache\",\"9/10\"]},\"year\":null,\"month\":null},{\"entity\":\"gestational_hypertension\",\"entity_source_text\":\"gestational hypertension\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"diagnosed at 32 weeks\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"visual_disturbance\",\"entity_source_text\":\"visual disturbance\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"denies\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"upper_abdominal_pain\",\"entity_source_text\":\"epigastric pain\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"denies\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"seizure\",\"entity_source_text\":\"seizure\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"not currently\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"eclampsia\",\"entity_source_text\":\"eclampsia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"prevention\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"hypothyroidism\",\"entity_source_text\":\"Hypothyroidism\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"on levothyroxine\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"iron_deficiency_anaemia\",\"entity_source_text\":\"Iron deficiency anaemia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"identified at booking\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"anaemia\",\"entity_source_text\":\"Iron deficiency anaemia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"identified at booking\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"obesity\",\"entity_source_text\":\"obese\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"BMI at booking was 32\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"never_smoked\",\"entity_source_text\":\"lifelong non-smoker\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"lifelong\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"essential_hypertension\",\"entity_source_text\":\"essential hypertension\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"family_history\",\"relevance\":\"historical\",\"status_source_text\":[\"mother has\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"gestational_diabetes\",\"entity_source_text\":\"gestational diabetes\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"historical\",\"status_source_text\":[\"Previous pregnancy\",\"2021\"],\"characterisation\":null,\"year\":2021,\"month\":null},{\"entity\":\"hellp_syndrome\",\"entity_source_text\":\"HELLP syndrome\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"cannot be excluded at this time\"],\"characterisation\":null,\"year\":null,\"month\":null}]}","metadata":"{\"inference\": {\"failed_output\": null, \"inference_error\": null, \"schema_package_name\": \"londonaicentre-entityschema\", \"schema_package_version\": \"1.2.0\", \"inference_metadata\": \"2026-07-21 13:27:26.215850\"}, \"model\": {\"model_name\": \"qwentity_1_0_0\", \"model_version\": \"1.0\", \"trained_schema_name\": \"londonaicentre-entityschema\", \"trained_schema_version\": \"1.2.0\"}}","is_valid":true}
{"document_id":"a4ffaa2b-130b-4ccb-bb9d-2a58e004bdfd","document_source":"{}","document_inference":"{\"is_clinical_document\":true,\"extraction_reasoning\":\"(1) AMBIGUITIES/EDGE CASES: 'Delirium' is the primary reason for admission, currently active. 'Urosepsis' is the working diagnosis (active). 'Dementia' is a background chronic condition (active). 'Secondary Parkinsonism' is queried ('cannot be excluded') so marked as hypothetical. 'Lewy body dementia' is queried ('possible', 'workup') so marked as hypothetical. 'Reduced oral intake' and 'incontinent of urine' are active symptoms. (2) EXACT/UMBRELLA MATCHING: Alzheimer's -> alzheimers_disease + dementia. Parkinson's -> parkinsons_disease + secondary_parkinsonism. T2DM -> type_2_diabetes_mellitus + diabetes_mellitus. COPD -> copd. Neck of femur fracture -> fracture_of_hip_or_neck_of_femur. Zimmer frame -> zimmer_or_walker_dependency. (3) OMISSIONS: 'Acute confusion' is captured by delirium. 'Dehydrated' is not an exact match for volume_depletion (though close, omitted for precision). 'Dry mucous membranes' and 'febrile' are clinical findings but 'pyrexia' is the entity. 'Funny smell' (smell of urine) has no entity. 'Aspiration risk' is not aspiration_pneumonia. 'Safeguarding' is not neglect. Primary entities: delirium, urosepsis, and urinary_tract_infection.\",\"document_content\":{\"doc_type\":\"Acute Medical Unit Clerking\",\"doc_summary\":\"84M admitted with acute delirium and urosepsis. Background of Alzheimer's, Parkinson's, T2DM, COPD, and osteoporosis. Recent hip fracture (2022). Currently managed with IV antibiotics and fluids. Falls and cognitive decline noted.\",\"has_active_malignancy\":false},\"entities\":[{\"entity\":\"delirium\",\"entity_source_text\":\"Acute confusion\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Presenting complaint\",\"Working diagnosis\"],\"characterisation\":{\"summary\":\"markedly confused, disorientated\",\"source_text\":[\"markedly confused\",\"disorientated\"]},\"year\":null,\"month\":null},{\"entity\":\"urinary_tract_infection\",\"entity_source_text\":\"urinary tract infection\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Working diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"urosepsis\",\"entity_source_text\":\"urosepsis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Working diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"poor_oral_intake\",\"entity_source_text\":\"reduced oral intake\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"off his food and drinks\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"urinary_incontinence\",\"entity_source_text\":\"incontinent of urine\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"overnight\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"pyrexia\",\"entity_source_text\":\"febrile\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"38.2°C\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"tachycardia\",\"entity_source_text\":\"mildly tachycardic\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"HR 96\"],\"characterisation\":{\"summary\":\"mild\",\"source_text\":[\"mildly\"]},\"year\":null,\"month\":null},{\"entity\":\"alzheimers_disease\",\"entity_source_text\":\"Alzheimer's disease\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"diagnosed 2019\"],\"characterisation\":null,\"year\":2019,\"month\":null},{\"entity\":\"dementia\",\"entity_source_text\":\"dementia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"background\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"parkinsons_disease\",\"entity_source_text\":\"Parkinson's disease\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"PMHx\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"secondary_parkinsonism\",\"entity_source_text\":\"secondary Parkinsonism\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"cannot be excluded\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"essential_hypertension\",\"entity_source_text\":\"hypertension\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"PMHx\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"type_2_diabetes_mellitus\",\"entity_source_text\":\"type 2 diabetes mellitus\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"diet-controlled\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"diabetes_mellitus\",\"entity_source_text\":\"type 2 diabetes mellitus\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"PMHx\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"copd\",\"entity_source_text\":\"COPD\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"GOLD stage 2\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"osteoporosis\",\"entity_source_text\":\"osteoporosis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"PMHx\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"fracture_of_hip_or_neck_of_femur\",\"entity_source_text\":\"neck of femur fracture\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"historical\",\"status_source_text\":[\"November 2022\"],\"characterisation\":null,\"year\":2022,\"month\":11},{\"entity\":\"never_smoked\",\"entity_source_text\":\"non-smoker\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"non-smoker\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"social_care_package\",\"entity_source_text\":\"social care package\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"twice-daily\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"zimmer_or_walker_dependency\",\"entity_source_text\":\"Zimmer frame\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"mobilises with\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"lewy_body_dementia\",\"entity_source_text\":\"Lewy body dementia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"possible\",\"workup\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"recurrent_falls\",\"entity_source_text\":\"4 falls in the last 3 months\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"last 3 months\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"cognitive_decline\",\"entity_source_text\":\"progressive cognitive decline\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"past year\"],\"characterisation\":{\"summary\":\"progressive\",\"source_text\":[\"progressive\"]},\"year\":null,\"month\":null}]}","metadata":"{\"inference\": {\"failed_output\": null, \"inference_error\": null, \"schema_package_name\": \"londonaicentre-entityschema\", \"schema_package_version\": \"1.2.0\", \"inference_metadata\": \"2026-07-21 13:27:45.090589\"}, \"model\": {\"model_name\": \"qwentity_1_0_0\", \"model_version\": \"1.0\", \"trained_schema_name\": \"londonaicentre-entityschema\", \"trained_schema_version\": \"1.2.0\"}}","is_valid":true}
{"document_id":"8e469a83-91cf-4e61-a4d2-530ec49fb452","document_source":"{}","document_inference":"{\"is_clinical_document\":true,\"extraction_reasoning\":\"(1) AMBIGUITIES/EDGE CASES: 'Sepsis secondary to CAP' is the working diagnosis (positive assertion). 'Hospital-acquired component' is hypothetical. 'Legionnaires' disease' is on the differential (hypothetical). 'Viral encephalitis' is 'not yet excluded' (hypothetical). 'Fall cannot be excluded' (hypothetical). 'Cachectic' matches cachexia. 'Frail' matches frailty. 'Three falls in the past 2 months' matches recurrent_falls. (2) EXACT/UMBRELLA MATCHING: CAP matches community_acquired_pneumonia + pneumonia. COPD infective exacerbation matches copd_infective_exacerbation + copd. T2DM matches type_2_diabetes_mellitus + diabetes_mellitus. Hypertension matches essential_hypertension. SIRS matches systemic_inflammatory_response_syndrome. (3) OMISSIONS: 'SpO2 84%' and 'hypoxic' - hypoxia is extracted, but 'SpO2 84%' is a value. 'WCC 18.4' and 'Lactate 3.1' are lab values (no inference). 'Metformin' and 'gliclazide' are medications (no inference). 'No haemoptysis' and 'no chest pain' are negated. 'No meningism' is negated. 'Lives alone' matches living_alone_at_home. 'Current smoker' matches active_smoker. Primary entities: community_acquired_pneumonia, sepsis, and confusion_or_disorientation.\",\"document_content\":{\"doc_type\":\"Emergency Department Clerking Note\",\"doc_summary\":\"68M with COPD and T2DM presenting with fever, rigors, and confusion. Diagnosed with sepsis secondary to community-acquired pneumonia (CAP). Background of recurrent falls and frailty. Legionnaires' disease and viral encephalitis are differentials.\",\"has_active_malignancy\":false},\"entities\":[{\"entity\":\"community_acquired_pneumonia\",\"entity_source_text\":\"community-acquired pneumonia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"working diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"pneumonia\",\"entity_source_text\":\"community-acquired pneumonia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"working diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"sepsis\",\"entity_source_text\":\"sepsis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"working diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"confusion_or_disorientation\",\"entity_source_text\":\"confusion\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"new-onset\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"copd_infective_exacerbation\",\"entity_source_text\":\"COPD infective exacerbation\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"discharged 12 days ago\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"copd\",\"entity_source_text\":\"COPD\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"known\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"type_2_diabetes_mellitus\",\"entity_source_text\":\"type 2 diabetes mellitus\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"background\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"diabetes_mellitus\",\"entity_source_text\":\"type 2 diabetes mellitus\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"background\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"essential_hypertension\",\"entity_source_text\":\"hypertension\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"background\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"active_smoker\",\"entity_source_text\":\"current smoker\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"current\"],\"characterisation\":{\"summary\":\"30 pack-years\",\"source_text\":[\"30 pack-years\"]},\"year\":null,\"month\":null},{\"entity\":\"living_alone_at_home\",\"entity_source_text\":\"lives alone\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"lives alone\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"frailty\",\"entity_source_text\":\"frail\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"increasingly frail\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"recurrent_falls\",\"entity_source_text\":\"three falls\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"past 2 months\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"acute_fall\",\"entity_source_text\":\"fall\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"cannot be excluded\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"legionnaires_disease\",\"entity_source_text\":\"Legionnaires' disease\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"on the differential\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"viral_encephalitis\",\"entity_source_text\":\"viral encephalitis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"not yet excluded\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"encephalitis\",\"entity_source_text\":\"viral encephalitis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"hypothetical\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"not yet excluded\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"haemoptysis\",\"entity_source_text\":\"haemoptysis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"no history of\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"chest_pain\",\"entity_source_text\":\"chest pain\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"negated\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"denies\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"tachycardia\",\"entity_source_text\":\"tachycardic\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"HR 118\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"tachypnoea\",\"entity_source_text\":\"tachypnoeic\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"RR 26\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"hypoxia\",\"entity_source_text\":\"hypoxic\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"SpO2 84%\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"cachexia\",\"entity_source_text\":\"cachectic\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"appeared\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"systemic_inflammatory_response_syndrome\",\"entity_source_text\":\"SIRS criteria\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"meets\"],\"characterisation\":null,\"year\":null,\"month\":null}]}","metadata":"{\"inference\": {\"failed_output\": null, \"inference_error\": null, \"schema_package_name\": \"londonaicentre-entityschema\", \"schema_package_version\": \"1.2.0\", \"inference_metadata\": \"2026-07-21 13:27:45.781433\"}, \"model\": {\"model_name\": \"qwentity_1_0_0\", \"model_version\": \"1.0\", \"trained_schema_name\": \"londonaicentre-entityschema\", \"trained_schema_version\": \"1.2.0\"}}","is_valid":true}
{"document_id":"34705d45-d729-4c7d-bf8f-4df112b74823","document_source":"{}","document_inference":"{\"is_clinical_document\":true,\"extraction_reasoning\":\"(1) AMBIGUITIES/EDGE CASES: NSTEMI is the primary diagnosis. Paroxysmal AF occurred during admission (recent). HFrEF is confirmed (active). CKD stage 3 is active. Zimmer frame use is noted as baseline (active). (2) EXACT/UMBRELLA MATCHING: NSTEMI -> non_st_elevation_myocardial_infarction + acute_myocardial_infarction. PCI -> percutaneous_coronary_intervention. LAD stenosis -> atherosclerosis. Mitral regurgitation -> mitral_regurgitation. Aortic stenosis -> aortic_stenosis. HFrEF -> heart_failure. CKD stage 3 -> ckd_stage_3 + chronic_kidney_disease. Stable angina -> stable_angina + angina_pectoris. Appendicectomy -> OMIT (no exact match for appendicectomy, only acute_appendicitis). (3) OMISSIONS: 'ST depression' and 'troponin' are findings/lab results (omit). 'EF 38%' is a value (omit). 'Supplemental oxygen' is oxygen_therapy. 'Zimmer frame' -> zimmer_or_walker_dependency. 'Ex-smoker' -> ex_smoker. 'Living with husband' -> living_with_others_at_home. 'No formal care package' -> OMIT. Primary entities: NSTEMI and heart_failure.\",\"document_content\":{\"doc_type\":\"Cardiology Discharge Summary\",\"doc_summary\":\"79F admitted with NSTEMI and severe three-vessel disease. Treated with PCI to LAD. Complicated by paroxysmal AF and HFrEF. Background of CKD3, hypertension, hyperlipidaemia, and osteoarthritis. Discharged on dual antiplatelets, anticoagulation, and diuretics.\",\"has_active_malignancy\":false},\"entities\":[{\"entity\":\"non_st_elevation_myocardial_infarction\",\"entity_source_text\":\"Non-ST elevation myocardial infarction\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Primary diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"acute_myocardial_infarction\",\"entity_source_text\":\"NSTEMI\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"Primary diagnosis\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"chest_pain\",\"entity_source_text\":\"central crushing chest pain\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"6-hour history\"],\"characterisation\":{\"summary\":\"central crushing, radiating to left arm\",\"source_text\":[\"central crushing\",\"radiating to left arm\"]},\"year\":null,\"month\":null},{\"entity\":\"diaphoresis\",\"entity_source_text\":\"diaphoresis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"associated with\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"nausea\",\"entity_source_text\":\"nausea\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"associated with\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"percutaneous_coronary_intervention\",\"entity_source_text\":\"Percutaneous coronary intervention\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"performed\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"coronary_artery_stent_in_situ\",\"entity_source_text\":\"coronary artery stent in situ\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"in situ\"],\"characterisation\":null,\"year\":2019,\"month\":null},{\"entity\":\"paroxysmal_atrial_fibrillation\",\"entity_source_text\":\"paroxysmal atrial fibrillation\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"episode on day 4\",\"self-terminated\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"atrial_fibrillation\",\"entity_source_text\":\"atrial fibrillation\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"episode\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"heart_failure\",\"entity_source_text\":\"heart failure with reduced ejection fraction\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":true,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"confirmed\"],\"characterisation\":{\"summary\":\"reduced ejection fraction\",\"source_text\":[\"reduced ejection fraction\"]},\"year\":null,\"month\":null},{\"entity\":\"mitral_regurgitation\",\"entity_source_text\":\"mitral regurgitation\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"demonstrated\"],\"characterisation\":{\"summary\":\"moderate\",\"source_text\":[\"moderate\"]},\"year\":null,\"month\":null},{\"entity\":\"aortic_stenosis\",\"entity_source_text\":\"aortic stenosis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"demonstrated\"],\"characterisation\":{\"summary\":\"moderate, under surveillance\",\"source_text\":[\"moderate\",\"under surveillance\"]},\"year\":null,\"month\":null},{\"entity\":\"essential_hypertension\",\"entity_source_text\":\"Hypertension\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"well-controlled\"],\"characterisation\":{\"summary\":\"well-controlled\",\"source_text\":[\"well-controlled\"]},\"year\":null,\"month\":null},{\"entity\":\"hyperlipidaemia\",\"entity_source_text\":\"hyperlipidaemia\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"on atorvastatin\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"ckd_stage_3\",\"entity_source_text\":\"chronic kidney disease stage 3\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"baseline\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"chronic_kidney_disease\",\"entity_source_text\":\"chronic kidney disease\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"baseline\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"osteoarthritis\",\"entity_source_text\":\"osteoarthritis\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"bilateral knees\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"stable_angina\",\"entity_source_text\":\"stable angina\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"historical\",\"status_source_text\":[\"2019\"],\"characterisation\":null,\"year\":2019,\"month\":null},{\"entity\":\"angina_pectoris\",\"entity_source_text\":\"stable angina\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"historical\",\"status_source_text\":[\"2019\"],\"characterisation\":null,\"year\":2019,\"month\":null},{\"entity\":\"ex_smoker\",\"entity_source_text\":\"ex-smoker\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"ceased 2001\"],\"characterisation\":null,\"year\":2001,\"month\":null},{\"entity\":\"living_with_others_at_home\",\"entity_source_text\":\"lives with her husband\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"lives with\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"zimmer_or_walker_dependency\",\"entity_source_text\":\"mobilises with a Zimmer frame\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"active\",\"status_source_text\":[\"at baseline\"],\"characterisation\":null,\"year\":null,\"month\":null},{\"entity\":\"oxygen_therapy\",\"entity_source_text\":\"supplemental oxygen\",\"is_exact_or_umbrella_match\":true,\"is_primary_entity\":false,\"assertion\":\"positive\",\"subject\":\"patient\",\"relevance\":\"recent\",\"status_source_text\":[\"first 5 days\"],\"characterisation\":null,\"year\":null,\"month\":null}]}","metadata":"{\"inference\": {\"failed_output\": null, \"inference_error\": null, \"schema_package_name\": \"londonaicentre-entityschema\", \"schema_package_version\": \"1.2.0\", \"inference_metadata\": \"2026-07-21 13:27:46.206938\"}, \"model\": {\"model_name\": \"qwentity_1_0_0\", \"model_version\": \"1.0\", \"trained_schema_name\": \"londonaicentre-entityschema\", \"trained_schema_version\": \"1.2.0\"}}","is_valid":true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment