Kindly provide opd based cases in medicine with system wise clinical feature,differential diagnosis, which investigation done and opd based treatment with dose and duration
Which system(s) should I cover first in detailed OPD case format?
All
Please All All system provide
Which section should I provide first in full practical case-sheet format? I can continue with the remaining sections one by one.
Create a complete system-wise OPD handbook as a PDF
primary care outpatient management
WHO package essential noncommunicable disease interventions primary care hypertension diabetes asthma guideline
~/
https://www.who.int/publications/i/item/who-package-of-essen…
~/
mkdir -p "/tmp/workspace/opd_medicine_handbook/src" "/tmp/workspace/opd_medicine_handbook/output" && printf '%s' 'workspace prepared'
~/opd_medicine_handbook/src/create_handbook.py
from reportlab.lib import colors
from reportlab.lib.enums import TA_CENTER
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, PageBreak, Table, TableStyle, KeepTogether
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
from reportlab.lib.colors import HexColor
from reportlab.pdfbase.pdfmetrics import stringWidth
from reportlab.pdfgen.canvas import Canvas
from reportlab.platypus.tableofcontents import TableOfContents
import os
OUT = '/tmp/workspace/opd_medicine_handbook/output/Adult_Medicine_OPD_Handbook.pdf'
FONT = '/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf'
BOLD = '/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf'
pdfmetrics.registerFont(TTFont('DV', FONT))
pdfmetrics.registerFont(TTFont('DVB', BOLD))
NAVY=HexColor('#143A52'); BLUE=HexColor('#276A8A'); PALE=HexColor('#EAF3F7'); RED=HexColor('#9B2C2C'); GREY=HexColor('#F5F7F8')
styles=getSampleStyleSheet()
styles.add(ParagraphStyle(name='CoverTitle', fontName='DVB', fontSize=25, leading=31, textColor=NAVY, alignment=TA_CENTER, spaceAfter=16))
styles.add(ParagraphStyle(name='CoverSub', fontName='DV', fontSize=12, leading=17, textColor=NAVY, alignment=TA_CENTER))
styles.add(ParagraphStyle(name='H1x', fontName='DVB', fontSize=17, leading=21, textColor=NAVY, spaceBefore=6, spaceAfter=9, keepWithNext=True))
styles.add(ParagraphStyle(name='H2x', fontName='DVB', fontSize=12.2, leading=15, textColor=BLUE, spaceBefore=9, spaceAfter=5, keepWithNext=True))
styles.add(ParagraphStyle(name='Bodyx', fontName='DV', fontSize=8.35, leading=11.4, spaceAfter=4))
styles.add(ParagraphStyle(name='Small', fontName='DV', fontSize=7.4, leading=9.2, textColor=HexColor('#334155')))
styles.add(ParagraphStyle(name='Red', fontName='DVB', fontSize=8.4, leading=11.2, textColor=RED))
styles.add(ParagraphStyle(name='TOC', fontName='DV', fontSize=9, leading=12, leftIndent=15, firstLineIndent=-15))
cases = [
('1. Cardiovascular medicine', [
('Essential hypertension', 'Often asymptomatic; headache is nonspecific. Confirm with correctly measured repeated clinic BP and preferably home/ambulatory BP. Examine BMI, pulses, fundi when indicated, heart failure signs and secondary causes.', 'White-coat/masked hypertension; pain/anxiety; CKD; primary aldosteronism; thyroid disease; drug-induced hypertension.', 'Urinalysis and urine albumin-creatinine ratio, creatinine/eGFR, Na/K, HbA1c or fasting glucose, lipid profile, ECG. Consider TSH, aldosterone-renin ratio, renal imaging only when clinical clues suggest secondary disease.', 'Lifestyle: salt reduction, weight loss, exercise, tobacco cessation. If drug therapy indicated: amlodipine 5 mg PO once daily, titrate to 10 mg daily; or lisinopril 5-10 mg PO daily, titrate usually to 20-40 mg daily. ACE inhibitor/ARB requires creatinine and K check about 1-2 weeks after starting or titration. Do not combine ACE inhibitor + ARB. Review in 2-4 weeks until controlled, then every 3-6 months.', 'BP >=180/120 with chest pain, dyspnoea, neurologic deficit, confusion, acute kidney injury, retinal symptoms, pregnancy, or suspected aortic dissection.'),
('Dyslipidaemia / cardiovascular prevention', 'Usually asymptomatic. Assess diabetes, smoking, BP, family history of premature ASCVD, renal disease, hypothyroidism, diet and alcohol.', 'Secondary dyslipidaemia: hypothyroidism, diabetes, nephrotic syndrome, cholestasis, alcohol, medicines. Familial hypercholesterolaemia when very high LDL-C or premature family ASCVD.', 'Fasting or nonfasting lipid profile; HbA1c/glucose, ALT, creatinine/eGFR, TSH if indicated. Calculate total cardiovascular risk. CK only if baseline muscle symptoms/high risk.', 'Diet pattern emphasizing vegetables, fibre and unsaturated fats; physical activity. For patients meeting a statin indication: atorvastatin 10-20 mg PO nightly for moderate intensity, or 40-80 mg nightly for high intensity, long term. Check lipids 4-12 weeks after initiation then periodically; assess myalgia and ALT if symptoms.', 'Acute chest pain, neurologic symptoms, triglycerides >=500 mg/dL (>=5.6 mmol/L), jaundice, severe muscle pain or dark urine on statin.'),
('Stable exertional chest discomfort', 'Pressure/tightness precipitated by exertion or emotion, relieved by rest; assess duration, functional limit and risk factors. Record pulse, BP, cardiac and lung exam.', 'Acute coronary syndrome, GERD, musculoskeletal pain, panic, aortic stenosis, hypertrophic cardiomyopathy, pulmonary embolism.', 'ECG. HbA1c, lipids, CBC, creatinine. Refer for stress imaging/CT coronary angiography according to local pathway. Troponin is for acute or ongoing suspected ACS, not routine stable symptoms.', 'Do not label as stable until acute coronary syndrome is excluded. Give urgent cardiology assessment. For known stable CAD: sublingual glyceryl trinitrate 0.4 mg at pain onset, repeat every 5 minutes up to 3 doses while seeking emergency care if pain persists; aspirin 75-100 mg daily only when established ASCVD and bleeding risk assessed; statin long term. Beta-blocker choice/dose is individualized.', 'Pain at rest, new/worsening or prolonged >10 minutes, diaphoresis, syncope, dyspnoea, haemodynamic instability, or abnormal ECG: emergency evaluation.'),
('Chronic heart failure follow-up', 'Exertional dyspnoea, orthopnoea, paroxysmal nocturnal dyspnoea, fatigue, oedema, weight gain. Check BP, pulse/rhythm, JVP, lungs, oedema and daily weight trend.', 'COPD/asthma, anaemia, renal disease, venous insufficiency, obesity/deconditioning, arrhythmia, medication nonadherence.', 'ECG, CBC, Na/K/creatinine/eGFR, liver tests, HbA1c, TSH as indicated, BNP/NT-proBNP when diagnosis uncertain, echocardiogram for new/suspected HF.', 'New suspected HF requires echocardiography and clinician-led phenotype treatment. For fluid overload in a stable known patient: furosemide 20-40 mg PO daily, titrate to euvolaemia with electrolyte/renal monitoring. HFrEF disease-modifying therapy is specialist/experienced-clinician initiated and titrated: ACEi/ARB/ARNI, evidence-based beta blocker, MRA and SGLT2 inhibitor. Daily weight and low-salt advice; review within 1-2 weeks after medication changes.', 'Rest dyspnoea, hypoxia, pulmonary oedema, syncope, chest pain, rapid new oedema/weight gain, hypotension, confusion, or K/renal deterioration.')]),
('2. Respiratory medicine', [
('Asthma', 'Episodic wheeze, cough, chest tightness or breathlessness with variable triggers and variable airflow limitation. Check inhaler technique, adherence, nocturnal symptoms, exacerbations and smoking.', 'COPD, vocal cord dysfunction, heart failure, GERD, bronchiectasis, foreign body, pulmonary embolism.', 'Spirometry with bronchodilator reversibility when feasible; peak-flow diary if uncertain. CBC/eosinophils when phenotype relevant. Chest radiograph only for atypical features.', 'All adults/adolescents should receive inhaled corticosteroid-containing therapy. A common low-dose option: budesonide-formoterol 160/4.5 micrograms, 1 inhalation as needed for symptom relief, maximum according to product label; or budesonide 200 micrograms 1 puff twice daily plus salbutamol 100 micrograms 1-2 puffs as needed. Review technique and control in 4-6 weeks. Step up/down only after checking diagnosis, adherence and triggers.', 'Unable to speak full sentences, drowsiness, silent chest, cyanosis, SpO2 <92%, PEF <50% best/predicted, poor response to reliever, or frequent reliever use.'),
('COPD stable review', 'Persistent progressive dyspnoea, chronic cough/sputum and exposure history. Assess exacerbation history, CAT/mMRC symptoms, weight, oxygen saturation, inhaler technique and smoking.', 'Asthma, heart failure, bronchiectasis, TB, interstitial lung disease, lung cancer, anaemia.', 'Post-bronchodilator spirometry to confirm persistent obstruction; CXR if alternative diagnosis suspected; CBC, eGFR and ECG as indicated. Do not diagnose solely by symptoms.', 'Smoking cessation, vaccination, pulmonary rehabilitation, correct inhaler technique. A common starting bronchodilator is tiotropium 18 micrograms inhaled once daily (capsule device) or a LABA per local formulary. Add ICS only for defined exacerbation/eosinophil/asthma-overlap indications. Review 4-12 weeks after initiation.', 'New severe breathlessness, cyanosis, confusion, SpO2 <90% or below baseline, fever with systemic illness, chest pain, haemoptysis, or suspected exacerbation needing systemic treatment.'),
('Allergic rhinitis', 'Sneezing, itchy/runny or blocked nose, itchy eyes, seasonal/perennial trigger pattern. Look for asthma, sinus symptoms and nasal polyps.', 'Viral rhinitis, nonallergic rhinitis, medication-induced rhinitis, sinusitis, nasal foreign body/mass.', 'Usually clinical. Allergy testing only if persistent/uncertain or considering immunotherapy.', 'Trigger avoidance and saline rinse. Fluticasone propionate nasal spray 50 micrograms: 2 sprays/nostril once daily for 1-2 weeks then 1 spray/nostril daily once controlled. Cetirizine 10 mg PO once daily as needed. Avoid topical decongestant sprays beyond 3 days.', 'Unilateral obstruction/bleeding, orbital symptoms, severe facial pain/fever, recurrent polyps, or poorly controlled asthma.')]),
('3. Gastrointestinal and hepatology', [
('Dyspepsia / GERD', 'Epigastric burning/pain, post-prandial fullness, early satiety or heartburn/regurgitation. Ask NSAID use, alcohol, weight loss, dysphagia, GI bleeding and family cancer history.', 'Peptic ulcer disease, H. pylori infection, biliary disease, pancreatitis, cardiac ischaemia, gastroparesis, malignancy.', 'H. pylori stool antigen or urea breath test in appropriate uninvestigated dyspepsia. CBC if bleeding suspected. Endoscopy for alarm features or guideline-defined age/risk. ECG if pain could be cardiac.', 'Avoid late meals, excess alcohol, tobacco and trigger foods. Omeprazole 20 mg PO once daily 30 minutes before breakfast for 4-8 weeks. For H. pylori, use locally recommended susceptibility-aware eradication regimen and confirm test-of-cure at least 4 weeks after antibiotics and after withholding PPI 2 weeks.', 'GI bleeding, progressive dysphagia, persistent vomiting, unintentional weight loss, iron-deficiency anaemia, palpable mass, severe chest pain, or new symptoms in high-risk patient.'),
('Irritable bowel syndrome', 'Recurrent abdominal pain related to defecation with change in stool frequency/form; classify constipation, diarrhoea or mixed. Screen for diet, stress and red flags.', 'Coeliac disease, IBD, colorectal cancer, infection, lactose intolerance, thyroid disease, medication effect, microscopic colitis.', 'CBC, CRP/ESR and coeliac serology as clinically appropriate; faecal calprotectin when IBD suspected. Colonoscopy only for red flags or abnormal evaluation.', 'Explain gut-brain interaction; regular meals, soluble fibre and dietary trigger trial. For cramping: peppermint oil enteric-coated 180-225 mg PO three times daily before meals for 2-4 weeks if tolerated. IBS-C: polyethylene glycol 17 g PO daily, titrate. IBS-D: loperamide 2 mg after loose stool, max 8 mg/day OTC or per local label. Review in 4-6 weeks.', 'Rectal bleeding, nocturnal symptoms, fever, weight loss, anaemia, family history colorectal cancer/IBD, onset later in life, or persistent severe pain.'),
('Constipation', 'Infrequent hard stools, straining, incomplete evacuation. Ask onset, alarm features, fluids/fibre, activity, medications and neurological/endocrine symptoms.', 'Medication-induced constipation, hypothyroidism, hypercalcaemia, colorectal cancer, obstruction, pelvic floor disorder, Parkinsonism.', 'Usually clinical. Rectal examination when indicated. CBC, TSH, calcium or colon evaluation only when warning signs/clinical suspicion.', 'Increase fibre gradually, fluids and activity. Polyethylene glycol 17 g PO once daily, titrate to response for 1-2 weeks then as needed. Senna 8.6-17.2 mg at bedtime may be short term rescue. Avoid chronic stimulant laxative dependence without reassessment.', 'Obstipation with vomiting/distension, severe pain, rectal bleeding, weight loss, anaemia, new onset in older adult, or neurological deficit.'),
('Metabolic dysfunction-associated steatotic liver disease', 'Often incidental raised ALT or ultrasound steatosis. Assess obesity, diabetes, alcohol, medicines, viral risks and stigmata of chronic liver disease.', 'Alcohol-related liver disease, viral hepatitis, autoimmune hepatitis, haemochromatosis, Wilson disease in young patients, drug-induced injury.', 'Repeat LFTs, CBC/platelets, HbA1c, lipids, hepatitis B/C tests as risk-based, ultrasound. Calculate FIB-4; higher risk requires elastography/hepatology assessment.', 'Weight loss target 7-10% where overweight, Mediterranean-style diet, exercise, diabetes and lipid control, avoid harmful alcohol. No routine liver-specific drug in general OPD. Recheck metabolic parameters and fibrosis risk in 6-12 months.', 'Jaundice, ascites, encephalopathy, GI bleeding, markedly elevated enzymes, falling platelets, or suspected advanced fibrosis/cirrhosis.')]),
('4. Endocrine and metabolic medicine', [
('Type 2 diabetes mellitus', 'Polyuria, polydipsia, weight change, recurrent infections, neuropathic symptoms or asymptomatic screening abnormality. Examine BP, BMI, feet, pulses, skin and injection/medication use.', 'Type 1 diabetes/LADA, pancreatic diabetes, Cushing syndrome, medication-induced hyperglycaemia, diabetes insipidus for polyuria.', 'Confirm with HbA1c or plasma glucose criteria if no unequivocal symptoms. At baseline: eGFR, urine ACR, lipids, ALT, BP, foot examination, retinal screening, B12 if long-term metformin.', 'Nutrition/activity support and weight management. If eGFR >=45: metformin 500 mg PO once daily with food for 1 week, then 500 mg twice daily; titrate every 1-2 weeks to 1 g twice daily if tolerated. Select additional agent based on ASCVD/HF/CKD, weight, hypoglycaemia risk and affordability. Review HbA1c about every 3 months until at individual target; foot/renal/eye surveillance.', 'Ketones, vomiting, dehydration, marked hyperglycaemia with illness, suspected type 1 diabetes, altered sensorium, foot ulcer/infection, acute vision loss, or severe hypoglycaemia.'),
('Primary hypothyroidism', 'Fatigue, cold intolerance, constipation, weight gain, dry skin, menstrual change, bradycardia. Ask neck surgery/radiation, autoimmune disease and pregnancy plans.', 'Depression, anaemia, sleep apnoea, medication effect, chronic disease; central hypothyroidism if low FT4 with non-elevated TSH.', 'TSH and free T4. TPO antibody if aetiology useful. Do not use T3 routinely. Pregnancy requires separate targets and early specialist guidance.', 'Levothyroxine 25-50 micrograms PO once daily fasting, 30-60 minutes before food, with dose individualized by age, cardiac disease and severity. A healthy younger adult may start near 1.6 micrograms/kg/day. Recheck TSH after 6-8 weeks and adjust by 12.5-25 micrograms; once stable, assess 6-12 monthly. Separate from iron/calcium by at least 4 hours.', 'Myxoedema features, severe bradycardia/syncope, chest pain after starting treatment, pregnancy, suspected pituitary disease, or large/compressive goitre.'),
('Obesity / overweight care', 'Measure BMI and waist circumference; assess diet, activity, sleep apnoea, mood, eating disorder, medications, BP, glucose, lipids and complications.', 'Endocrine contributors are uncommon but consider hypothyroidism/Cushing syndrome if features. Consider fluid overload rather than adiposity if rapid weight gain.', 'BMI/waist, BP, HbA1c/glucose, lipids, ALT, eGFR; screen for obstructive sleep apnoea and depression when indicated.', 'Use non-stigmatising, shared goals. Target 5-10% loss over 6 months through calorie deficit, activity and behavioural support. Anti-obesity medicines require eligibility, contraindication and local availability review. Follow monthly initially. Address obesity-related disease rather than prescribing unverified supplements.', 'Rapid unexplained weight change, eating disorder/suicidality, pregnancy, severe sleep-apnoea symptoms, or suspected endocrine cause.')]),
('5. Renal and urinary medicine', [
('Uncomplicated lower UTI in nonpregnant adult woman', 'Dysuria, urgency, frequency and suprapubic discomfort without fever/flank pain. Confirm pregnancy status and assess recurrent infection/STI risk.', 'Vaginitis, urethritis/STI, pyelonephritis, stones, interstitial cystitis, overactive bladder.', 'Urinalysis is supportive. Urine culture for recurrent, complicated, pregnancy, male patients, resistant risk, pyelonephritis or treatment failure. Pregnancy test when relevant.', 'Hydration and analgesia. Nitrofurantoin monohydrate/macrocrystals 100 mg PO twice daily for 5 days when eGFR >=30 and no concern for pyelonephritis, subject to local resistance guidance. Use culture-guided alternative if unsuitable. Symptoms should improve within 48 hours.', 'Fever, flank pain, rigors, vomiting, pregnancy, male patient, immunosuppression, obstruction, sepsis, or no improvement by 48-72 hours.'),
('Chronic kidney disease follow-up', 'Often asymptomatic. Ask diabetes, hypertension, NSAIDs/herbals, urinary symptoms and fluid overload. Check BP, volume status and medication list.', 'Acute kidney injury, obstructive uropathy, glomerulonephritis, diabetic kidney disease, hypertensive nephrosclerosis, polycystic kidney disease.', 'Repeat creatinine/eGFR and urine ACR to establish chronicity; urinalysis, electrolytes, CBC, HbA1c, BP. Renal ultrasound for obstruction, haematuria, rapid decline or structural concern.', 'Avoid NSAIDs and nephrotoxins; adjust all doses to eGFR. BP and albuminuria management often includes ACEi/ARB with K/creatinine monitoring. Diabetes therapy may include an SGLT2 inhibitor where eGFR/indications permit. Follow frequency by eGFR/ACR category. Dietitian/nephrology input for advanced disease.', 'Rapid eGFR fall, refractory hyperkalaemia, pulmonary oedema, uraemic symptoms, active urinary sediment/haematuria, eGFR <30, or suspected obstruction.'),
('Suspected renal colic', 'Sudden severe colicky flank pain radiating to groin, nausea, haematuria. Check temperature, vitals, hydration and single kidney/pregnancy history.', 'Pyelonephritis, appendicitis, biliary colic, ectopic pregnancy, ovarian torsion, aortic aneurysm/dissection, musculoskeletal pain.', 'Urinalysis/culture, pregnancy test, creatinine/electrolytes. Noncontrast CT or ultrasound per local pathway and radiation considerations.', 'If stable, analgesia: ibuprofen 400 mg PO three times daily with food for up to 3 days if no CKD, ulcer, anticoagulation or pregnancy; otherwise paracetamol 1 g PO every 6-8 hours, max 3 g/day in typical adults. Strain urine, hydration to thirst, urology follow-up according to stone size/site. Do not force fluids.', 'Fever/rigors with obstruction, anuria, AKI, uncontrolled pain/vomiting, solitary kidney, pregnancy, or suspected aneurysm.')]),
('6. Neurology', [
('Migraine', 'Recurrent 4-72 hour unilateral/pulsating headache, nausea and photo/phonophobia, worsened by activity; aura may precede. Document frequency, disability, triggers, analgesic use and neurological examination.', 'Tension headache, cluster headache, medication-overuse headache, sinus disease, glaucoma, meningitis, subarachnoid haemorrhage, temporal arteritis, mass lesion.', 'Clinical diagnosis with normal neurological exam. Neuroimaging only for red flags, atypical pattern or abnormal exam. Consider pregnancy test and ESR/CRP when temporal arteritis suspected.', 'Acute: ibuprofen 400 mg PO at onset, repeat every 6-8 hours if needed for up to 2-3 days, with food and only if no NSAID contraindication; add metoclopramide 10 mg PO once for nausea if appropriate. If inadequate and diagnosis clear: sumatriptan 50 mg PO at onset, may repeat after 2 hours, max 200 mg/day; avoid in known CAD, stroke/TIA, uncontrolled hypertension, hemiplegic/basilar migraine. Avoid acute medicines >2 days/week. If >=4 migraine days/month or disabling, discuss preventive therapy such as propranolol 40 mg twice daily, individualized and contraindication-checked; review 6-8 weeks.', 'Thunderclap onset, new focal deficit, fever/neck stiffness, papilloedema, altered consciousness, pregnancy/postpartum severe headache, new onset >50 years, cancer/immunosuppression, head trauma.'),
('Tension-type headache', 'Bilateral pressing/tightening mild-moderate pain without prominent nausea, often linked to stress, posture or sleep. Examine BP, fundus when indicated and full neurological system.', 'Migraine, medication overuse, cervical disease, giant-cell arteritis, intracranial pathology.', 'No tests when typical pattern and normal exam. Investigate only warning signs or changing pattern.', 'Sleep, hydration, ergonomic and stress measures. Paracetamol 500-1000 mg PO every 6-8 hours as needed, maximum 3 g/day for typical adults, for no more than 2-3 days per week. Avoid routine opioids and frequent combination analgesics. Review recurrent cases for chronic daily headache/medication overuse.', 'Same headache red flags as migraine; escalating frequency or analgesic use >10-15 days/month.'),
('Benign positional vertigo (suspected BPPV)', 'Brief triggered spinning with rolling in bed/looking up, no hearing loss or focal neurology. Perform Dix-Hallpike when trained and safe.', 'Posterior circulation stroke, vestibular neuritis, Ménière disease, vestibular migraine, orthostatic hypotension, arrhythmia.', 'Positional testing; check orthostatic BP and neurological exam. MRI/urgent evaluation only if central features.', 'Canalith repositioning manoeuvre (Epley) is first line, repeated as needed. Avoid routine prolonged vestibular suppressants because they hinder compensation. Safety advice for falls; review in 1-2 weeks.', 'New severe headache, inability to walk, focal deficit, diplopia, dysarthria, vertical nystagmus, chest pain/syncope, or continuous acute vestibular syndrome with central concern.')]),
('7. Rheumatology and musculoskeletal medicine', [
('Knee osteoarthritis', 'Activity-related knee pain, brief morning stiffness, crepitus, bony enlargement and reduced function. Assess gait, effusion, hip/spine and red/hot joint.', 'Inflammatory arthritis, crystalline arthritis, meniscal injury, septic arthritis, referred hip pain, fracture, malignancy.', 'Usually clinical. X-ray only if atypical, severe trauma, inflammatory features, or surgery planning. Do not use MRI routinely.', 'Education, weight reduction if indicated, quadriceps strengthening and aerobic exercise. Topical diclofenac gel 1%: apply 2-4 g to affected knee up to four times daily for up to 2 weeks then reassess. Paracetamol 500-1000 mg every 6-8 hours as needed, max 3 g/day. Oral NSAID only after GI/CV/renal risk assessment and usually with gastroprotection. Review 4-6 weeks.', 'Hot swollen joint/fever, inability to bear weight after trauma, night pain/weight loss, rapidly progressive deformity, or suspected inflammatory/septic arthritis.'),
('Mechanical low-back pain', 'Pain localized to back/buttock, related to movement/position, no major neurological symptoms. Screen red flags: cancer, infection, fracture, cauda equina and inflammatory back pain.', 'Radiculopathy, spinal stenosis, vertebral fracture, malignancy, infection, ankylosing spondylitis, renal/aortic/visceral causes.', 'No routine imaging in uncomplicated pain <6 weeks. MRI for severe/progressive neurological deficit, cauda equina or concerning red flags.', 'Stay active, reassurance, heat, exercise/physiotherapy. Ibuprofen 400 mg PO three times daily with food for up to 3 days if safe; or paracetamol 1 g every 6-8 hours as needed, max 3 g/day. Avoid bed rest and routine opioids. Review 2-4 weeks if not improving.', 'Urinary retention/incontinence, saddle anaesthesia, bilateral weakness, fever/IV drug use, cancer history, major trauma, unexplained weight loss, pulsatile abdominal mass.'),
('Acute gout', 'Abrupt severe monoarthritis, classically first MTP, redness and swelling; ask prior attacks, diuretics, alcohol, kidney disease and fever.', 'Septic arthritis, CPPD, trauma, cellulitis, rheumatoid arthritis.', 'Joint aspiration for crystals/Gram stain/culture when first episode, atypical site or sepsis possible. Serum urate may be normal during flare. eGFR/CBC if treatment choices need assessment.', 'If no contraindication: naproxen 500 mg PO twice daily with food until flare resolves, usually 5-7 days, plus PPI if GI risk. Alternative: colchicine 1.2 mg PO once then 0.6 mg 1 hour later, then 0.6 mg once or twice daily for up to 3 days, dose-reduce/avoid in renal/hepatic impairment and interacting drugs. Do not start urate-lowering therapy solely for one uncomplicated flare; discuss long-term allopurinol for recurrent/tophi/CKD with prophylaxis and titration.', 'Fever, systemic toxicity, prosthetic joint, immunosuppression, inability to exclude septic arthritis, or treatment contraindications.')]),
('8. Hematology', [
('Iron-deficiency anaemia', 'Fatigue, exertional dyspnoea, pica, hair loss, pallor; ask menstrual/GI blood loss, diet, NSAID use and malabsorption symptoms.', 'Anaemia of inflammation, thalassaemia trait, B12/folate deficiency, CKD, haemolysis, malignancy.', 'CBC with indices, ferritin, transferrin saturation, reticulocyte count. Evaluate source: menstrual history, coeliac serology and age/risk-appropriate GI evaluation. Do not treat unexplained IDA without investigation.', 'Ferrous sulfate 325 mg tablet (about 65 mg elemental iron) PO once daily or on alternate days, usually for 8-12 weeks and continue about 3 months after Hb correction to replenish stores. Take away from calcium/tea if possible; manage constipation. Recheck Hb in 2-4 weeks and ferritin after repletion. Treat bleeding source.', 'Haemodynamic symptoms, chest pain, syncope, melena/haematochezia, severe Hb reduction, pregnancy, rapid fall, or suspected cancer.'),
('Vitamin B12 deficiency', 'Macrocytosis, fatigue, glossitis, paraesthesia, gait/cognitive changes. Ask vegan diet, metformin/PPI use, gastric surgery and autoimmune history.', 'Folate deficiency, alcohol/liver disease, myelodysplasia, hypothyroidism, medication-related macrocytosis.', 'CBC/MCV, serum B12, folate; methylmalonic acid/homocysteine if indeterminate; intrinsic-factor antibody if pernicious anaemia suspected.', 'If no neurological deficit and dietary deficiency likely: cyanocobalamin 1000 micrograms PO once daily for 8-12 weeks, then maintenance based on cause. If neurological signs, malabsorption or pernicious anaemia: urgent clinician-directed IM replacement protocol. Never give folate alone before excluding B12 deficiency.', 'Progressive neurological symptoms, severe anaemia, pancytopenia, suspected marrow disease, or pregnancy.'),
('Incidental thrombocytopenia', 'Often asymptomatic; ask bruising, petechiae, bleeding, infections, alcohol, drugs/heparin, autoimmune/liver disease and pregnancy.', 'Pseudothrombocytopenia, ITP, drug-induced thrombocytopenia, viral infection, liver/splenic disease, TMA/DIC, marrow disease.', 'Repeat CBC with peripheral smear and citrate tube to exclude clumping; LFT, renal function, viral testing as guided. Assess other cell lines.', 'No empiric OPD treatment before cause/severity assessment. Stop suspected offending nonessential drugs only with prescribing review; avoid NSAIDs and contact sports until evaluated. Stable mild isolated thrombocytopenia may be monitored with planned repeat CBC and hematology advice.', 'Active bleeding, platelets <20 x10^9/L, neurological symptoms, haemolysis/renal impairment, fever/systemic illness, pregnancy, or pancytopenia.')]),
('9. Infectious diseases and common medicine OPD infections', [
('Acute undifferentiated fever', 'Fever duration, travel, exposure, mosquito risk, respiratory/urinary/GI symptoms, rash, bleeding, mental status, hydration and comorbidity. Examine vitals, skin, lungs, abdomen, nodes and neurology.', 'Viral syndrome, dengue, malaria, enteric fever, UTI, pneumonia, TB, COVID/influenza, leptospirosis, sepsis, autoimmune/malignancy causes.', 'Directed by epidemiology and syndrome: CBC, malaria rapid test/smear where relevant, dengue testing by illness day, urinalysis/culture, chest radiograph, blood culture before antibiotics if sepsis/enteric concern. Avoid indiscriminate antibiotic treatment.', 'Oral fluids, rest and paracetamol 500-1000 mg PO every 6-8 hours as needed, max 3 g/day. Avoid NSAIDs until dengue/bleeding risk excluded. Give safety-net review in 24-48 hours or earlier if worsening. Antibiotics only for a defined probable bacterial source and local guideline.', 'Hypotension, confusion, dyspnoea, SpO2 low, bleeding, severe abdominal pain, persistent vomiting, oliguria, rash with toxicity, pregnancy, immunosuppression, or fever >3-5 days without diagnosis.'),
('Cellulitis, nonpurulent uncomplicated', 'Warm tender expanding erythema, swelling and pain, often lower limb. Check portal of entry, abscess, diabetes, venous disease and systemic signs.', 'DVT, stasis dermatitis, contact dermatitis, gout, necrotising infection, abscess.', 'Clinical. CBC/CRP only if systemic/uncertain. Ultrasound if abscess/DVT concern. Culture purulence, not intact skin.', 'Elevation, treat tinea/wound portal, mark borders. Cephalexin 500 mg PO four times daily for 5 days is a common regimen where streptococcal/MSSA coverage appropriate; modify for allergy, MRSA risk and local guideline. Reassess in 48-72 hours.', 'Systemic toxicity, rapidly spreading pain/erythema, bullae/necrosis, pain out of proportion, facial/periorbital infection, immunosuppression, failed oral therapy, or suspected DVT/necrotising infection.'),
('Herpes zoster', 'Unilateral dermatomal pain followed by grouped vesicles, usually not crossing midline. Ask eye/ear involvement, immune status and pregnancy.', 'HSV, contact dermatitis, impetigo, cellulitis, trigeminal neuralgia.', 'Clinical. PCR of lesion only when atypical/uncertain/immunocompromised.', 'Start promptly when within 72 hours of rash or new lesions/high-risk features: valaciclovir 1 g PO three times daily for 7 days, renal dose-adjust. Paracetamol/appropriate analgesia; keep lesions covered and avoid contact with nonimmune pregnant people, neonates and severely immunocompromised persons until crusted.', 'Eye/nose-tip involvement, ear/facial weakness, disseminated rash, immunocompromise, pregnancy, severe pain, or neurologic symptoms.')]),
('10. Mental health, geriatric medicine and prevention', [
('Depression and anxiety symptoms', 'Low mood/anhedonia, sleep/appetite/energy/concentration change, excessive worry, panic, functional impact and substance use. Ask directly about self-harm/suicide, mania/hypomania, psychosis and domestic violence.', 'Hypothyroidism, anaemia, sleep apnoea, substance/medication effect, bipolar disorder, grief, psychosis, dementia.', 'Use validated PHQ-9/GAD-7 to monitor, not to replace clinical assessment. CBC, TSH, B12 etc only if history/exam suggests medical cause.', 'Psychoeducation, exercise, sleep routine and evidence-based psychotherapy are first-line for many mild cases. For moderate-severe depression/anxiety or persistent symptoms, sertraline 25 mg PO once daily for 1 week then 50 mg daily; reassess tolerability and suicide risk within 1-2 weeks, and response at 4-6 weeks. Continue an effective antidepressant at least 6-9 months after remission. Screen for bipolar disorder before antidepressant monotherapy.', 'Suicidal intent/plan, psychosis, mania, severe functional inability, intoxication/withdrawal, violence risk, or inability to care for self.'),
('Insomnia', 'Difficulty initiating/maintaining sleep or early waking with daytime impairment. Ask duration, sleep schedule, caffeine/alcohol, shift work, mood, pain, restless legs and sleep-apnoea symptoms.', 'Depression/anxiety, OSA, substance use, medication effect, hyperthyroidism, restless legs, circadian disorder.', 'Sleep diary. OSA or restless-leg evaluation when symptoms. Avoid routine laboratory testing.', 'Cognitive behavioural therapy for insomnia and sleep scheduling are first line. Avoid long-term benzodiazepines/Z-drugs. Treat contributing depression, pain, OSA or substance use. If short-term medication is considered, use the lowest dose for only a few days with explicit review and fall/dependence precautions.', 'Suicidality, mania, dangerous daytime sleepiness, suspected severe OSA, recurrent falls, or sedative dependence.'),
('Falls and polypharmacy review in older adult', 'Ask fall circumstances, prodrome, footwear, vision, home hazards, cognition, continence and all prescribed/OTC/herbal drugs. Check orthostatic BP, gait/balance, vision, feet, heart and neurology.', 'Syncope/arrhythmia, seizure, stroke/TIA, hypoglycaemia, infection, medication toxicity, Parkinsonism, vestibular disorder.', 'Orthostatic vitals, ECG if syncope/palpitations, CBC/electrolytes/glucose and medication review as guided. Assess bone health after fragility fall.', 'Strength/balance programme, vision and footwear correction, home safety, vitamin D only when deficiency/risk appropriate, and supervised deprescribing of sedatives, anticholinergics, hypotensive agents or hypoglycaemics where risks exceed benefit. Follow within 4-6 weeks after medication change.', 'Syncope, chest pain, focal neurology, head injury/anticoagulant use, recurrent unexplained falls, inability to mobilize, or safeguarding concern.'),
('Tobacco dependence', 'Document product, quantity, time to first use, previous quit attempts, triggers, mental health and pregnancy.', 'No differential diagnosis. Consider coexisting depression, alcohol/substance use and COPD/CVD risk.', 'CO monitoring where available; assess BP/CVD and medicines. Screening for tobacco-related disease based on symptoms and local programmes.', 'Brief advice plus behavioural support. Nicotine patch 21 mg daily for 6 weeks then 14 mg daily for 2 weeks then 7 mg daily for 2 weeks for people smoking >=10 cigarettes/day, with short-acting nicotine gum/lozenge 2-4 mg as needed for cravings. Adjust for lower smoking exposure/pregnancy and follow in 1-2 weeks. Consider varenicline/bupropion only after contraindication and local prescribing review.', 'Acute chest pain, severe dyspnoea, suicidality, pregnancy requiring tailored cessation pathway, or suspected cancer symptoms.')])
]
class NumberedDocTemplate(SimpleDocTemplate):
def afterFlowable(self, flowable):
if isinstance(flowable, Paragraph) and flowable.style.name == 'H1x':
text=flowable.getPlainText()
self.notify('TOCEntry', (0, text, self.page))
def header_footer(canvas, doc):
canvas.saveState(); w,h=A4
if doc.page > 1:
canvas.setStrokeColor(HexColor('#B8CDD7')); canvas.line(1.45*cm,h-1.25*cm,w-1.45*cm,h-1.25*cm)
canvas.setFont('DV',7.4); canvas.setFillColor(NAVY)
canvas.drawString(1.45*cm,h-1.02*cm,'Adult Medicine OPD Handbook | Core adult outpatient reference')
canvas.drawRightString(w-1.45*cm,0.8*cm,f'Page {doc.page}')
canvas.restoreState()
def p(txt, style='Bodyx'):
return Paragraph(txt, styles[style])
def case_block(title, features, diffs, tests, treatment, referral):
data=[
[p(title,'H2x')],
[p('<b>Clinical features and focused assessment:</b> '+features)],
[p('<b>Key differential diagnoses:</b> '+diffs)],
[p('<b>OPD investigations:</b> '+tests)],
[p('<b>OPD treatment, dose and duration:</b> '+treatment)],
[p('<b>Refer urgently / send to emergency care:</b> '+referral,'Red')],
]
t=Table(data,colWidths=[17.4*cm], hAlign='LEFT')
t.setStyle(TableStyle([('BACKGROUND',(0,0),(-1,0),PALE),('BOX',(0,0),(-1,-1),0.45,HexColor('#B8CDD7')),('INNERGRID',(0,1),(-1,-1),0.22,HexColor('#D7E2E8')),('LEFTPADDING',(0,0),(-1,-1),7),('RIGHTPADDING',(0,0),(-1,-1),7),('TOPPADDING',(0,0),(-1,-1),4),('BOTTOMPADDING',(0,0),(-1,-1),4)]))
return [t,Spacer(1,8)]
story=[]
story += [Spacer(1,3.5*cm), p('ADULT MEDICINE<br/>OPD HANDBOOK','CoverTitle'),p('Core system-wise outpatient cases for clinical assessment, investigations, initial treatment, follow-up, and escalation','CoverSub'),Spacer(1,1.2*cm),p('<b>Scope:</b> Adult, nonpregnant outpatient care. This is an educational clinical reference, not a substitute for local protocols, supervision, or patient-specific prescribing.','CoverSub'),Spacer(1,0.5*cm),p('Prepared: 2 September 2026','CoverSub'),PageBreak()]
story += [p('How to use this handbook','H1x'),p('Each case is a practical starting framework. Establish diagnosis, assess severity and red flags, check allergy, pregnancy potential, renal/hepatic function, frailty, interactions and local resistance patterns before prescribing. Drug regimens are common adult examples, not universal orders. Use local formularies and disease guidelines when they differ.'),p('<b>Universal OPD safety screen:</b> Record vital signs, oxygen saturation when relevant, pain score, mental status, pregnancy possibility, allergies, current medicines and renal function where drug selection requires it. Escalate for instability, sepsis, acute coronary syndrome, stroke signs, severe respiratory distress, GI bleeding, acute kidney injury, severe metabolic disturbance or inability to maintain oral intake.','Red'),p('Abbreviations: ASCVD = atherosclerotic cardiovascular disease; ACR = albumin-creatinine ratio; CKD = chronic kidney disease; CBC = complete blood count; eGFR = estimated glomerular filtration rate; HFrEF = heart failure with reduced ejection fraction; ICS = inhaled corticosteroid; NSAID = nonsteroidal anti-inflammatory drug.'),Spacer(1,10)]
story += [p('Contents','H1x')]
toc=TableOfContents(); toc.levelStyles=[ParagraphStyle(name='TOC0',fontName='DV',fontSize=9.2,leading=13,leftIndent=10,firstLineIndent=-10,textColor=NAVY)]
story += [toc,PageBreak()]
for system, cs in cases:
story.append(p(system,'H1x'))
intro='Core OPD presentations. Treat individual risks and arrange planned review even when symptoms improve.'
story.append(p(intro,'Small'))
story.append(Spacer(1,4))
for c in cs: story.extend(case_block(*c))
story.append(PageBreak())
story += [p('Clinical governance and source notes','H1x'),p('This handbook prioritizes safety-netting, diagnosis confirmation, evidence-based non-drug care, and medication monitoring. It is intentionally not a replacement for emergency protocols or specialist treatment pathways. Exact antimicrobial selection must follow local resistance data. Doses require adjustment for renal/hepatic impairment, body size, age/frailty, pregnancy, interactions and product formulation.'),p('<b>Key sources consulted:</b> WHO Package of Essential Noncommunicable Disease Interventions for Primary Health Care (PEN), 2020; WHO primary-care NCD management materials; Textbook of Family Medicine, 9th edition; Harrison\'s Principles of Internal Medicine, 22nd edition; standard product information and established outpatient-care principles. The WHO PEN framework supports integrated primary-care management of cardiovascular disease risk, diabetes and chronic respiratory disease.'),p('<b>Recent-evidence note:</b> A 2025 systematic review on virtual chronic-disease outpatient models (PMID 40323664) addresses care delivery rather than changing the condition-specific medication recommendations in this handbook.'),Spacer(1,10),p('Version 1.0 | Educational reference | Adult outpatient medicine','Small')]
doc=NumberedDocTemplate(OUT,pagesize=A4,rightMargin=1.45*cm,leftMargin=1.45*cm,topMargin=1.55*cm,bottomMargin=1.25*cm,title='Adult Medicine OPD Handbook',author='Orris')
doc.build(story,onFirstPage=header_footer,onLaterPages=header_footer)
print(OUT)
python "/tmp/workspace/opd_medicine_handbook/src/create_handbook.py" && python -c "from pypdf import PdfReader; p='/tmp/workspace/opd_medicine_handbook/output/Adult_Medicine_OPD_Handbook.pdf'; r=PdfReader(p); print('pages=',len(r.pages)); print('first=',r.pages[0].extract_text()[:200]); print('last=',r.pages[-1].extract_text()[:350])"
~/opd_medicine_handbook/src
~/opd_medicine_handbook/src/create_handbook.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/opd_medicine_handbook/src/create_handbook.py'
~/opd_medicine_handbook/src/create_handbook.py
Successfully replaced 1 instance(s) of the string in '/tmp/workspace/opd_medicine_handbook/src/create_handbook.py'
python -c "p='/tmp/workspace/opd_medicine_handbook/src/create_handbook.py'; s=open(p).read(); s=s.replace(\"fontName='DV'\", \"fontName=DV\").replace(\"fontName='DVB'\", \"fontName=DVB\").replace(\"setFont('DV',\", \"setFont(DV,\"); open(p,'w').write(s)" && python "/tmp/workspace/opd_medicine_handbook/src/create_handbook.py" && python -c "from pypdf import PdfReader; p='/tmp/workspace/opd_medicine_handbook/output/Adult_Medicine_OPD_Handbook.pdf'; r=PdfReader(p); print('pages=',len(r.pages)); print('first=',r.pages[0].extract_text()[:160]); print('last=',r.pages[-1].extract_text()[:250])"
~/opd_medicine_handbook/output
Adult Medicine OPD Handbook
PDF Document · PDF