Handicapped children from spm in detail and prevention in flow charts
| Term | Definition | Level |
|---|---|---|
| Impairment | Any loss or abnormality of psychological, physiological, or anatomical structure or function | Organ level |
| Disability | Restriction or lack of ability to perform an activity in a manner considered normal for a human being | Person level |
| Handicap | Disadvantage for a given individual, resulting from impairment or disability, that limits fulfilment of a normal role | Society level |

HANDICAPPED CHILDREN
|
______|________
| | |
v v v
Physically Mentally Socially
Handicapped Handicapped Handicapped
PHYSICAL HANDICAP - CAUSES
|
______|_______
| | |
v v v
Birth Infections Accidents
Defects
| Category | IQ Range |
|---|---|
| Mild (educable) | 50-70 |
| Moderate (trainable) | 35-49 |
| Severe | 20-34 |
| Profound | Below 20 |
CAUSES OF MENTAL HANDICAP
|
__________|______________
| | | |
v v v v
Genetic Antenatal Perinatal Postnatal
Causes Factors Factors Factors
| | | |
v v v v
Down's Neural Birth Head
syndrome tube injuries injuries
Klinefelter defects Hypoxia Accidents
PKU Rh incom- Cerebral Encephalitis
Tay-Sachs patibility palsy Lead/mercury
Galact- Rubella, poisoning
osaemia CMV, toxo-
Micro- plasmosis,
cephaly syphilis,
Congen- drugs,
ital irradiation
hypothyroidism
+ Miscellaneous: Maternal malnutrition, PEM, iodine deficiency, consanguineous marriages, pregnancy >40 years
Note: A child who is physically or mentally handicapped also meets social handicaps to the extent they face social rejection or misunderstanding.
PRIMARY PREVENTION OF HANDICAP IN CHILDREN
(Prevent the handicap from occurring)
|
_____________|_____________
| |
v v
PRECONCEPTUAL PERINATAL &
& PRENATAL POSTNATAL
PERIOD PERIOD
| |
v v
1. GENETIC COUNSELLING 1. CARE OF HIGH-RISK
- Optimal maternal age WOMEN during labour
(20-30 years) 2. ACCIDENT PREVENTION
- Discourage 3. NUTRITION:
consanguineous - Breastfeeding
marriages - Balanced diet
- Identify at-risk 4. AVOIDANCE OF:
individuals - Teratogenic drugs
- X-rays
- Smoking
- Alcohol
2. IMMUNIZATION
- Polio vaccine (OPV/IPV) - KEY intervention
- Rubella vaccine
- All EPI vaccines
3. PRENATAL NUTRITION
- Proper nutrition of
expectant mother
- Reduces prematurity
(associated with
mental handicap)
4. ANTENATAL CARE
- Screening for Rh
incompatibility
- Screening for infections
(rubella, CMV, syphilis,
toxoplasmosis)
- MTP Act 1971: allows
abortion of seriously
handicapped foetus
5. SAFE DELIVERY
- Prevent birth injuries
- Prevent hypoxia
- Skilled birth attendant
SECONDARY PREVENTION
(Early diagnosis + Treatment + Rehabilitation)
|
____________|_______________
| | |
v v v
EARLY TREATMENT TRAINING &
DIAGNOSIS EDUCATION
| | |
v v v
- Parents bring - Physiotherapy - Vocational
child to (polio, CP) guidance
paediatrician - Occupational - "Work with
- Full history therapy what is left"
- Assess degree - Speech - 150+ schools
of handicap therapy and institutions
- MCH + School - Prosthetics: in India
Health artificial - Foster care
Services limbs, hearing - Adoption
- Developmental aids - Observation
milestone - Physical homes
screening Medicine &
Rehabilitation
TERTIARY PREVENTION
(Reduce impact - Rehabilitation)
|
__________|__________
| | |
v v v
MEDICAL SOCIAL VOCATIONAL
REHAB REHAB REHAB
| | |
v v v
- Physical - Integrating - Job
medicine child into placement
- Correct community - Skill
deformity - Removing training
- Prosthetics social - Financial
barriers support
- Foster care by NGOs/
- Legal Govt
protection
CHILD AT RISK OF HANDICAP
|
v
PRECONCEPTUAL STAGE
- Genetic counselling
- Maternal age advice (20-30 yrs)
- Reduce consanguineous marriages
|
v
ANTENATAL STAGE
- Immunization (rubella, polio)
- Good maternal nutrition
- Avoid teratogens, X-rays, smoking
- Screen for infections
- Screen for chromosomal anomalies
- Rh-factor management
|
v
INTRANATAL STAGE
- Skilled birth attendant
- Prevent birth asphyxia
- Prevent birth injuries
|
v
POSTNATAL / INFANCY
- Immunization (EPI schedule)
- Accident prevention
- Nutritional support (PEM, iodine)
- Developmental milestone monitoring
|
______|_______
| |
v v
NO HANDICAP HANDICAP DETECTED
(Primary (Go to secondary
prevention prevention)
achieved) |
v
EARLY DIAGNOSIS
- MCH Services
- School Health
- Developmental
assessment
|
v
TREATMENT
- Physiotherapy
- Occupational therapy
- Speech therapy
- Prosthetics
|
v
REHABILITATION
(Medical + Social
+ Vocational)
|
v
COMMUNITY
INTEGRATION
- Mainstreaming
- Legal protection
- Support services
Pls create this info into pdf
ls /home/daytona/workspace/ 2>/dev/null || echo "workspace empty or not found"
mkdir -p /home/daytona/workspace/handicapped-children-spm
~/handicapped-children-spm/create_pdf.py
from reportlab.lib.pagesizes import A4
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import cm
from reportlab.lib.colors import (
HexColor, white, black, Color
)
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle,
PageBreak, HRFlowable, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
from reportlab.platypus.flowables import Flowable
import reportlab.lib.colors as colors
# ── Color Palette ───────────────────────────────────────────────
DARK_BLUE = HexColor("#1B3A6B")
MED_BLUE = HexColor("#2563EB")
LIGHT_BLUE = HexColor("#DBEAFE")
TEAL = HexColor("#0F766E")
LIGHT_TEAL = HexColor("#CCFBF1")
ORANGE = HexColor("#C2410C")
LIGHT_ORANGE= HexColor("#FED7AA")
PURPLE = HexColor("#6D28D9")
LIGHT_PURPLE= HexColor("#EDE9FE")
GREEN = HexColor("#15803D")
LIGHT_GREEN = HexColor("#DCFCE7")
GREY_BG = HexColor("#F8FAFC")
GREY_BORDER = HexColor("#CBD5E1")
HEADER_BG = HexColor("#1E3A5F")
ACCENT_RED = HexColor("#DC2626")
# ── Flowable: Flowchart Box ──────────────────────────────────────
class FlowchartBox(Flowable):
"""Draws a single rounded box used in flowcharts."""
def __init__(self, text, width=None, height=40, bg=LIGHT_BLUE,
border=MED_BLUE, text_color=DARK_BLUE, font_size=9):
super().__init__()
self.text = text
self.box_width = width or 14*cm
self.box_height = height
self.bg = bg
self.border = border
self.text_color = text_color
self.font_size = font_size
self.width = self.box_width
self.height = self.box_height + 4
def draw(self):
c = self.canv
c.saveState()
c.setFillColor(self.bg)
c.setStrokeColor(self.border)
c.setLineWidth(1.2)
c.roundRect(0, 2, self.box_width, self.box_height, 6, fill=1, stroke=1)
c.setFillColor(self.text_color)
c.setFont("Helvetica-Bold", self.font_size)
lines = self.text.split('\n')
line_h = self.font_size + 3
total_h = len(lines) * line_h
y = self.box_height/2 + total_h/2 - line_h/2 + 4
for line in lines:
c.drawCentredString(self.box_width/2, y, line)
y -= line_h
c.restoreState()
class Arrow(Flowable):
"""Draws a downward arrow."""
def __init__(self, width=14*cm, color=MED_BLUE):
super().__init__()
self.arrow_width = width
self.color = color
self.width = width
self.height = 18
def draw(self):
c = self.canv
c.saveState()
c.setStrokeColor(self.color)
c.setFillColor(self.color)
c.setLineWidth(1.5)
cx = self.arrow_width / 2
c.line(cx, 18, cx, 6)
c.setLineWidth(0)
c.beginPath()
c.moveTo(cx, 2)
c.lineTo(cx-5, 8)
c.lineTo(cx+5, 8)
c.closePath()
c.fill()
c.restoreState()
class SectionDivider(Flowable):
"""Colored section header bar."""
def __init__(self, text, bg=DARK_BLUE, text_color=white, width=None):
super().__init__()
self.text = text
self.bg = bg
self.text_color = text_color
self.div_width = width or 17*cm
self.width = self.div_width
self.height = 28
def draw(self):
c = self.canv
c.saveState()
c.setFillColor(self.bg)
c.roundRect(0, 0, self.div_width, 26, 4, fill=1, stroke=0)
c.setFillColor(self.text_color)
c.setFont("Helvetica-Bold", 11)
c.drawString(10, 8, self.text)
c.restoreState()
# ── Multi-column flowchart helper ────────────────────────────────
def make_cause_table(causes_dict, col_colors):
"""
causes_dict: {header: [list of items], ...}
Returns a Table flowable.
"""
headers = list(causes_dict.keys())
items = list(causes_dict.values())
n = len(headers)
col_w = 16.5*cm / n
# header row
header_cells = []
for i, h in enumerate(headers):
p = Paragraph(h, ParagraphStyle('ch', fontSize=8, fontName='Helvetica-Bold',
textColor=white, alignment=TA_CENTER, leading=10))
header_cells.append(p)
# body rows - zip_longest
from itertools import zip_longest
body_rows = []
for row_items in zip_longest(*items, fillvalue=''):
row = []
for cell in row_items:
row.append(Paragraph(f"• {cell}" if cell else '',
ParagraphStyle('ci', fontSize=7.5, fontName='Helvetica',
textColor=DARK_BLUE, leading=11, leftIndent=4)))
body_rows.append(row)
all_rows = [header_cells] + body_rows
col_widths = [col_w]*n
tbl = Table(all_rows, colWidths=col_widths, repeatRows=1)
style_cmds = [
('BACKGROUND', (0,0), (-1,0), col_colors[0]),
('ROWBACKGROUNDS', (0,1), (-1,-1), [GREY_BG, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (0,0), (-1,-1), 6),
]
for i, bg in enumerate(col_colors[:n]):
style_cmds.append(('BACKGROUND', (i,0), (i,0), bg))
tbl.setStyle(TableStyle(style_cmds))
return tbl
# ── Document Setup ───────────────────────────────────────────────
OUTPUT = "/home/daytona/workspace/handicapped-children-spm/Handicapped_Children_SPM.pdf"
doc = SimpleDocTemplate(
OUTPUT,
pagesize=A4,
leftMargin=1.8*cm, rightMargin=1.8*cm,
topMargin=2*cm, bottomMargin=2*cm,
title="Handicapped Children - Park's SPM",
author="Orris Medical Assistant"
)
styles = getSampleStyleSheet()
# Custom styles
title_style = ParagraphStyle('Title', parent=styles['Title'],
fontSize=20, textColor=white, fontName='Helvetica-Bold',
alignment=TA_CENTER, spaceAfter=4, spaceBefore=0, leading=24)
subtitle_style = ParagraphStyle('Subtitle',
fontSize=11, textColor=LIGHT_BLUE, fontName='Helvetica',
alignment=TA_CENTER, spaceAfter=0, leading=14)
h1 = ParagraphStyle('H1', fontSize=13, fontName='Helvetica-Bold',
textColor=DARK_BLUE, spaceBefore=14, spaceAfter=6, leading=16,
borderPad=4, leftIndent=0)
h2 = ParagraphStyle('H2', fontSize=11, fontName='Helvetica-Bold',
textColor=TEAL, spaceBefore=10, spaceAfter=4, leading=14)
h3 = ParagraphStyle('H3', fontSize=9.5, fontName='Helvetica-Bold',
textColor=DARK_BLUE, spaceBefore=6, spaceAfter=3, leading=12)
body = ParagraphStyle('Body', fontSize=9, fontName='Helvetica',
textColor=HexColor("#1E293B"), spaceBefore=3, spaceAfter=3,
leading=13, alignment=TA_JUSTIFY)
bullet = ParagraphStyle('Bullet', parent=body, leftIndent=14,
bulletIndent=4, spaceBefore=2, spaceAfter=2, leading=12)
note_style = ParagraphStyle('Note', fontSize=8, fontName='Helvetica-Oblique',
textColor=HexColor("#64748B"), leftIndent=10, spaceBefore=4, leading=11)
# ── Cover Page ───────────────────────────────────────────────────
class CoverBackground(Flowable):
def __init__(self):
super().__init__()
self.width = A4[0] - 3.6*cm
self.height = 120
def draw(self):
c = self.canv
c.saveState()
c.setFillColor(HEADER_BG)
c.roundRect(-0.5*cm, -10, self.width+1*cm, self.height+20, 10, fill=1, stroke=0)
c.setFillColor(MED_BLUE)
c.roundRect(-0.5*cm, -10, self.width+1*cm, 8, 0, fill=1, stroke=0)
c.restoreState()
story = []
# Cover header
story.append(CoverBackground())
story.append(Spacer(1, -115))
story.append(Paragraph("HANDICAPPED CHILDREN", title_style))
story.append(Paragraph("Preventive & Social Medicine (Park's SPM)", subtitle_style))
story.append(Paragraph("Complete Notes with Prevention Flowcharts", subtitle_style))
story.append(Spacer(1, 30))
story.append(Paragraph(
'<font color="#64748B" size="8">Source: Park\'s Textbook of Preventive and Social Medicine, pp. 674–677 | '
'International Classification of Functioning, Disability and Health (ICF, WHO 2001)</font>',
ParagraphStyle('src', fontSize=8, alignment=TA_CENTER, textColor=HexColor("#64748B"))))
story.append(HRFlowable(width="100%", thickness=1.5, color=MED_BLUE, spaceAfter=12))
# ── SECTION 1: DEFINITIONS ───────────────────────────────────────
story.append(SectionDivider("1. DEFINITIONS & TERMINOLOGY"))
story.append(Spacer(1, 8))
story.append(Paragraph(
'<b>Handicap</b> (WHO): "Reduction in a person\'s capacity to fulfil a social role as a consequence of an impairment, '
'inadequate training for the role, or other circumstances." In children, the term refers to the presence of an impairment '
'or other circumstances likely to interfere with normal growth and development or with the capacity to learn.', body))
story.append(Spacer(1, 6))
# ICIDH --> ICF table
story.append(Paragraph("WHO Classification Framework:", h3))
fw_data = [
[Paragraph('<b>Classification</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Year</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Focus</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER))],
['ICIDH', '1980', 'Consequences of disease (Impairment → Disability → Handicap)'],
['ICF', '2001', 'Components of health (Body Function, Activities, Participation)'],
]
fw_tbl = Table(fw_data, colWidths=[5*cm, 3*cm, 8.5*cm])
fw_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_BLUE, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 9),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(fw_tbl)
story.append(Spacer(1, 8))
# Key term table
story.append(Paragraph("Key Terms (ICIDH):", h3))
terms_data = [
[Paragraph('<b>Term</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Definition</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Level</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
['Impairment', 'Any loss or abnormality of psychological, physiological, or anatomical structure or function', 'Organ level'],
['Disability', 'Restriction or lack of ability to perform an activity in a manner considered normal for a human being', 'Person level'],
['Handicap', 'Disadvantage resulting from impairment/disability that limits fulfilment of a normal role', 'Society level'],
]
t = Table(terms_data, colWidths=[3.5*cm, 9.5*cm, 3.5*cm])
t.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), TEAL),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_TEAL, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(t)
story.append(Spacer(1, 6))
story.append(Paragraph(
'<b>Types of Handicap:</b> <b>Intrinsic</b> (e.g., blindness) | <b>Extrinsic</b> (e.g., loss of parents) | '
'<b>Primary</b> (direct - e.g., blindness) | <b>Secondary</b> (arises from primary - e.g., poverty due to blindness)', body))
# ── SECTION 2: EXTENT ────────────────────────────────────────────
story.append(Spacer(1, 10))
story.append(SectionDivider("2. EXTENT OF THE PROBLEM"))
story.append(Spacer(1, 8))
extent_data = [
[Paragraph('<b>Condition</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Burden</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Rank</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
['Mental Retardation', '~83 million worldwide; 41 million with long-term/permanent disability', '4th leading cause of disability'],
['Hearing Loss (>41 dB, age >3)', '~42 million worldwide', '3rd leading cause of disability'],
['Poliomyelitis disability', '~10 million worldwide', 'Major cause in India'],
['Mental disability in India', '~2% of population', 'Census data underestimates'],
]
ext_tbl = Table(extent_data, colWidths=[4.5*cm, 8.5*cm, 3.5*cm])
ext_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), PURPLE),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_PURPLE, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(ext_tbl)
# ── SECTION 3: CLASSIFICATION ────────────────────────────────────
story.append(PageBreak())
story.append(SectionDivider("3. CLASSIFICATION OF HANDICAPPED CHILDREN"))
story.append(Spacer(1, 10))
# Flowchart - Classification
story.append(FlowchartBox("HANDICAPPED CHILDREN", bg=HEADER_BG, border=DARK_BLUE,
text_color=white, height=36, font_size=11))
story.append(Arrow())
# Three boxes side by side
class_row = Table(
[[FlowchartBox("1. PHYSICALLY\nHANDICAPPED", width=5*cm, bg=LIGHT_BLUE, border=MED_BLUE, text_color=DARK_BLUE, height=42),
FlowchartBox("2. MENTALLY\nHANDICAPPED", width=5*cm, bg=LIGHT_TEAL, border=TEAL, text_color=HexColor("#134E4A"), height=42),
FlowchartBox("3. SOCIALLY\nHANDICAPPED", width=5*cm, bg=LIGHT_PURPLE, border=PURPLE, text_color=HexColor("#3B0764"), height=42)]],
colWidths=[5.5*cm, 5.5*cm, 5.5*cm]
)
class_row.setStyle(TableStyle([('VALIGN', (0,0), (-1,-1), 'MIDDLE'), ('ALIGN', (0,0), (-1,-1), 'CENTER')]))
story.append(class_row)
story.append(Spacer(1, 16))
# ── 3a. Physically Handicapped ───────────────────────────────────
story.append(HRFlowable(width="100%", thickness=1, color=MED_BLUE, spaceAfter=6))
story.append(Paragraph("3a. Physically Handicapped Children", h1))
story.append(Paragraph(
"Includes children who are <b>blind, deaf and mute</b>; those with <b>hare-lip, cleft palate, talipes</b>; "
"and the <b>'crippled'</b> - e.g., resulting from polio, cerebral palsy, congenital heart disease, road accidents, burns, injuries, etc.", body))
story.append(Spacer(1, 6))
story.append(Paragraph("Three broad causative groups:", h3))
phys_causes = Table(
[[FlowchartBox("(a) BIRTH DEFECTS", width=5*cm, bg=LIGHT_BLUE, border=MED_BLUE, text_color=DARK_BLUE, height=36),
FlowchartBox("(b) INFECTIONS", width=5*cm, bg=LIGHT_TEAL, border=TEAL, text_color=HexColor("#134E4A"), height=36),
FlowchartBox("(c) ACCIDENTS", width=5*cm, bg=LIGHT_ORANGE, border=ORANGE, text_color=HexColor("#7C2D12"), height=36)]],
colWidths=[5.5*cm, 5.5*cm, 5.5*cm]
)
phys_causes.setStyle(TableStyle([('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE')]))
story.append(phys_causes)
story.append(Spacer(1, 4))
story.append(Paragraph(
'<i>All are largely preventable through adequate prenatal, natal, postnatal services, and genetic counselling.</i>',
note_style))
# ── 3b. Mentally Handicapped ─────────────────────────────────────
story.append(Spacer(1, 10))
story.append(HRFlowable(width="100%", thickness=1, color=TEAL, spaceAfter=6))
story.append(Paragraph("3b. Mentally Handicapped Children", h1))
story.append(Paragraph(
"Current preferred term for <b>mental retardation</b>. Defined as sub-average intellectual function combined with "
"deficits in adaptive behaviour. At least <b>2% of India's population</b> is affected. "
"Earliest recognition: look for <b>delayed milestones and development</b>.", body))
story.append(Spacer(1, 6))
story.append(Paragraph("WHO Classification of Mental Retardation (IQ-based):", h3))
iq_data = [
[Paragraph('<b>Category</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>IQ Range</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Description</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
['Mild (Educable)', '50 - 70', 'Can be educated in special schools'],
['Moderate (Trainable)', '35 - 49', 'Can be trained for simple tasks'],
['Severe', '20 - 34', 'Requires supervised care'],
['Profound', 'Below 20', 'Requires full-time nursing care'],
]
iq_tbl = Table(iq_data, colWidths=[5*cm, 3.5*cm, 8*cm])
iq_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), TEAL),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_TEAL, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 9),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(iq_tbl)
# Causes of MH - table
story.append(Spacer(1, 8))
story.append(Paragraph("Causes of Mental Handicap:", h3))
causes_data = [
[Paragraph('<b>Genetic</b>', ParagraphStyle('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Antenatal</b>', ParagraphStyle('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Perinatal</b>', ParagraphStyle('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Postnatal</b>', ParagraphStyle('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER)),
Paragraph('<b>Miscellaneous</b>', ParagraphStyle('th', fontSize=8.5, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER))],
[Paragraph("• Down's syndrome\n• Klinefelter syndrome\n• PKU\n• Tay-Sachs disease\n• Galactosaemia\n• Microcephaly\n• Congenital hypothyroidism",
ParagraphStyle('c1', fontSize=7.5, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=2)),
Paragraph("• Neural tube defects\n• Rh incompatibility\n• Rubella\n• CMV\n• Toxoplasmosis\n• Syphilis\n• Drugs\n• Irradiation",
ParagraphStyle('c2', fontSize=7.5, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=2)),
Paragraph("• Birth injuries\n• Birth asphyxia/hypoxia\n• Cerebral palsy",
ParagraphStyle('c3', fontSize=7.5, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=2)),
Paragraph("• Head injuries\n• Accidents\n• Encephalitis\n• Lead poisoning\n• Mercury poisoning",
ParagraphStyle('c4', fontSize=7.5, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=2)),
Paragraph("• Maternal malnutrition\n• PEM\n• Iodine deficiency\n• Consanguineous marriages\n• Pregnancy >40 years",
ParagraphStyle('c5', fontSize=7.5, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=2))],
]
cw = 16.5*cm / 5
causes_tbl = Table(causes_data, colWidths=[cw]*5)
causes_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (0,0), MED_BLUE),
('BACKGROUND', (1,0), (1,0), TEAL),
('BACKGROUND', (2,0), (2,0), ORANGE),
('BACKGROUND', (3,0), (3,0), PURPLE),
('BACKGROUND', (4,0), (4,0), HexColor("#B45309")),
('ROWBACKGROUNDS', (0,1), (-1,-1), [GREY_BG]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 4),
]))
story.append(causes_tbl)
# ── 3c. Socially Handicapped ─────────────────────────────────────
story.append(Spacer(1, 10))
story.append(HRFlowable(width="100%", thickness=1, color=PURPLE, spaceAfter=6))
story.append(Paragraph("3c. Socially Handicapped Children", h1))
story.append(Paragraph(
"A child whose opportunities for healthy personality development and full unfolding of potentialities are hampered "
"by certain elements in the social environment.", body))
soc_data = [
[Paragraph('<b>Causes (Social Environment)</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Who is Included?</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
[Paragraph("• Parental inadequacy\n• Environmental deprivation (lack of stimulation)\n• Emotional disturbances\n• Social rejection / misunderstanding",
ParagraphStyle('s1', fontSize=8.5, fontName='Helvetica', textColor=DARK_BLUE, leading=12, leftIndent=4)),
Paragraph("• Orphaned children (death/loss of parents)\n• Neglected and destitute children\n• Exploited or victimized children\n• Delinquent children",
ParagraphStyle('s2', fontSize=8.5, fontName='Helvetica', textColor=DARK_BLUE, leading=12, leftIndent=4))],
]
soc_tbl = Table(soc_data, colWidths=[8.25*cm, 8.25*cm])
soc_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), PURPLE),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_PURPLE]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(soc_tbl)
# ── SECTION 4: PREVENTION ────────────────────────────────────────
story.append(PageBreak())
story.append(SectionDivider("4. APPROACHES TO PREVENTION (Flowcharts)"))
story.append(Spacer(1, 10))
story.append(Paragraph(
"One of the objectives of Mother and Child Health (MCH) Services is the prevention of handicapping conditions "
"and the early management of illness to prevent crippling sequelae. Prevention is organized at three levels:", body))
story.append(Spacer(1, 8))
# Primary Prevention flowchart
story.append(Paragraph("PRIMARY PREVENTION", h2))
story.append(Paragraph(
"Objective: Prevent the handicap from occurring through preventive measures during preconceptual, prenatal, intranatal periods "
"and during infancy, childhood and adolescence.", body))
story.append(Spacer(1, 6))
story.append(FlowchartBox("PRIMARY PREVENTION OF HANDICAP IN CHILDREN",
bg=HEADER_BG, border=DARK_BLUE, text_color=white, height=34, font_size=10))
story.append(Arrow())
pp_items = [
("(a) GENETIC COUNSELLING", LIGHT_BLUE, MED_BLUE, DARK_BLUE,
"• Optimal maternal age: 20-30 years\n• After age 30-35: increased risk of Down's syndrome\n"
"• Reduce consanguineous marriages through education\n• Identify at-risk individuals (chromosomal/sex-linked diseases)\n"
"• Provide investigations & competent advice on future risks"),
("(b) IMMUNIZATION", LIGHT_TEAL, TEAL, HexColor("#134E4A"),
"• Polio vaccine (OPV/IPV) - KEY: main cause of disability in India\n"
"• Rubella vaccine\n• All EPI vaccines (prevent infections leading to handicap)"),
("(c) PRENATAL NUTRITION", LIGHT_ORANGE, ORANGE, HexColor("#7C2D12"),
"• Proper nutrition of expectant mother\n• Reduces prematurity (associated with mental handicap)\n"
"• Adequate intake of iodine (prevents cretinism)\n• Protein-energy adequacy"),
("(d) ANTENATAL CARE", LIGHT_PURPLE, PURPLE, HexColor("#3B0764"),
"• Screen for Rh incompatibility\n• Screen for infections (rubella, CMV, syphilis, toxoplasmosis)\n"
"• Avoid teratogenic drugs, X-rays, smoking\n• MTP Act 1971: allows abortion of seriously handicapped foetus"),
("(e) SAFE DELIVERY & POSTNATAL CARE", LIGHT_GREEN, GREEN, HexColor("#14532D"),
"• Skilled birth attendant\n• Prevent birth asphyxia and birth injuries\n"
"• Special care of high-risk women during labour\n• Accident prevention in infancy/childhood\n"
"• Developmental milestone monitoring"),
]
for title, bg, border, tc, content in pp_items:
row = Table(
[[FlowchartBox(title, width=5*cm, bg=bg, border=border, text_color=tc, height=36),
Paragraph(content, ParagraphStyle('fc', fontSize=8, fontName='Helvetica', textColor=DARK_BLUE, leading=12, leftIndent=6))]],
colWidths=[5.2*cm, 11.3*cm]
)
row.setStyle(TableStyle([
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('BACKGROUND', (1,0), (1,0), GREY_BG),
('BOX', (0,0), (-1,-1), 0.5, GREY_BORDER),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (1,0), (1,0), 10),
]))
story.append(row)
story.append(Spacer(1, 4))
# Secondary Prevention
story.append(Spacer(1, 8))
story.append(HRFlowable(width="100%", thickness=1, color=TEAL, spaceAfter=6))
story.append(Paragraph("SECONDARY PREVENTION", h2))
story.append(Paragraph(
"Objective: Bring handicapped children as close to normality as possible - physically, mentally and socially. "
"Involves early diagnosis, treatment and education/training.", body))
story.append(Spacer(1, 6))
story.append(FlowchartBox("SECONDARY PREVENTION — EARLY DIAGNOSIS + TREATMENT + REHABILITATION",
bg=TEAL, border=TEAL, text_color=white, height=34, font_size=10))
story.append(Arrow(color=TEAL))
sp_steps = [
("EARLY DIAGNOSIS", LIGHT_TEAL, TEAL, HexColor("#134E4A"),
"• Parents bring child to paediatrician\n• Full history + assessment of degree of handicap\n"
"• Special investigations; assess natural potentialities\n• Through MCH and School Health Services\n"
"• Look for delayed developmental milestones"),
("TREATMENT (Physical Medicine & Rehabilitation)", LIGHT_BLUE, MED_BLUE, DARK_BLUE,
"• Physiotherapy: correct deformities, exercise weakened muscles (polio, CP); infrared rays, diathermy\n"
"• Occupational therapy: music, painting, weaving, woodwork, pottery, basket making\n"
"• Speech therapy: train child to talk normally\n• Prosthetics: artificial limbs, hearing aids, other equipment"),
("TRAINING & EDUCATION (Vocational Guidance)", LIGHT_GREEN, GREEN, HexColor("#14532D"),
"• 'Work with what is left' - train for independent living\n"
"• 150+ schools and institutions for handicapped in India\n"
"• Key institutions: Occupational Therapy School (Mumbai);\n All India Institute of Physical Medicine & Rehabilitation\n"
"• Foster care, adoption, observation homes for socially handicapped"),
]
for title, bg, border, tc, content in sp_steps:
row = Table(
[[FlowchartBox(title, width=5*cm, bg=bg, border=border, text_color=tc, height=40),
Paragraph(content, ParagraphStyle('fc2', fontSize=8, fontName='Helvetica', textColor=DARK_BLUE, leading=12, leftIndent=6))]],
colWidths=[5.2*cm, 11.3*cm]
)
row.setStyle(TableStyle([
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('BACKGROUND', (1,0), (1,0), GREY_BG),
('BOX', (0,0), (-1,-1), 0.5, GREY_BORDER),
('TOPPADDING', (0,0), (-1,-1), 4),
('BOTTOMPADDING', (0,0), (-1,-1), 4),
('LEFTPADDING', (1,0), (1,0), 10),
]))
story.append(row)
story.append(Spacer(1, 4))
# Tertiary Prevention
story.append(Spacer(1, 8))
story.append(HRFlowable(width="100%", thickness=1, color=ORANGE, spaceAfter=6))
story.append(Paragraph("TERTIARY PREVENTION", h2))
story.append(Paragraph(
"Objective: Reduce the impact of disability and restore maximum possible function. Focuses on rehabilitation.", body))
story.append(Spacer(1, 6))
tert_row = Table(
[[FlowchartBox("MEDICAL\nREHABILITATION", width=5*cm, bg=LIGHT_BLUE, border=MED_BLUE, text_color=DARK_BLUE, height=44),
FlowchartBox("SOCIAL\nREHABILITATION", width=5*cm, bg=LIGHT_TEAL, border=TEAL, text_color=HexColor("#134E4A"), height=44),
FlowchartBox("VOCATIONAL\nREHABILITATION", width=5*cm, bg=LIGHT_GREEN, border=GREEN, text_color=HexColor("#14532D"), height=44)]],
colWidths=[5.5*cm, 5.5*cm, 5.5*cm]
)
tert_row.setStyle(TableStyle([('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE')]))
story.append(tert_row)
story.append(Spacer(1, 4))
tert_desc = Table(
[[Paragraph("• Physical medicine\n• Correct deformity\n• Prosthetics & aids\n• Long-term therapy",
ParagraphStyle('td1', fontSize=8, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=4)),
Paragraph("• Integrate child into community\n• Remove social barriers\n• Foster care / adoption\n• Legal protection",
ParagraphStyle('td2', fontSize=8, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=4)),
Paragraph("• Skill training\n• Job placement\n• NGO / Govt support\n• Financial assistance",
ParagraphStyle('td3', fontSize=8, fontName='Helvetica', textColor=DARK_BLUE, leading=11, leftIndent=4))]],
colWidths=[5.5*cm, 5.5*cm, 5.5*cm]
)
tert_desc.setStyle(TableStyle([
('ROWBACKGROUNDS', (0,0), (-1,-1), [GREY_BG]),
('BOX', (0,0), (-1,-1), 0.5, GREY_BORDER),
('INNERGRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
]))
story.append(tert_desc)
# ── SECTION 5: COMPLETE PREVENTION SUMMARY ───────────────────────
story.append(PageBreak())
story.append(SectionDivider("5. COMPLETE PREVENTION SUMMARY FLOWCHART"))
story.append(Spacer(1, 10))
full_fc_steps = [
("CHILD AT RISK OF HANDICAP", HEADER_BG, DARK_BLUE, white, 32, 10, ""),
("PRECONCEPTUAL STAGE", DARK_BLUE, DARK_BLUE, white, 28, 9,
"• Genetic counselling • Maternal age advice (20-30 yrs) • Reduce consanguineous marriages"),
("ANTENATAL STAGE", MED_BLUE, MED_BLUE, white, 28, 9,
"• Immunization (rubella, polio) • Good maternal nutrition • Avoid teratogens/X-rays/smoking\n"
"• Screen for infections • Screen for chromosomal anomalies • Rh-factor management"),
("INTRANATAL STAGE", TEAL, TEAL, white, 28, 9,
"• Skilled birth attendant • Prevent birth asphyxia • Prevent birth injuries"),
("POSTNATAL / INFANCY & CHILDHOOD", GREEN, GREEN, white, 28, 9,
"• Immunization (EPI schedule) • Accident prevention\n"
"• Nutritional support (PEM, iodine) • Developmental milestone monitoring"),
]
for title, bg, border, tc, h, fs, desc in full_fc_steps:
story.append(FlowchartBox(title, bg=bg, border=border, text_color=tc, height=h, font_size=fs))
if desc:
story.append(Paragraph(desc, ParagraphStyle('fdesc', fontSize=8, fontName='Helvetica',
textColor=HexColor("#334155"), leftIndent=20, leading=12,
spaceBefore=2, spaceAfter=2)))
story.append(Arrow())
# Outcome split
outcome_row = Table(
[[FlowchartBox("NO HANDICAP\n(Primary prevention\nachieved)", width=7cm, bg=LIGHT_GREEN, border=GREEN,
text_color=HexColor("#14532D"), height=50),
FlowchartBox("HANDICAP DETECTED\n(Proceed to secondary\nprevention)", width=7cm, bg=LIGHT_ORANGE, border=ORANGE,
text_color=HexColor("#7C2D12"), height=50)]],
colWidths=[8.25*cm, 8.25*cm]
)
outcome_row.setStyle(TableStyle([('ALIGN', (0,0), (-1,-1), 'CENTER'), ('VALIGN', (0,0), (-1,-1), 'MIDDLE')]))
story.append(outcome_row)
story.append(Spacer(1, 4))
# Arrow only under right box
a2 = Table([[Spacer(1,1), Arrow(width=7*cm, color=ORANGE)]], colWidths=[8.25*cm, 8.25*cm])
story.append(a2)
next_steps = [
("EARLY DIAGNOSIS", LIGHT_BLUE, MED_BLUE, DARK_BLUE, 34,
"MCH Services | School Health Services | Developmental assessment | Full history"),
("TREATMENT", LIGHT_TEAL, TEAL, HexColor("#134E4A"), 34,
"Physiotherapy | Occupational therapy | Speech therapy | Prosthetics"),
("REHABILITATION", LIGHT_GREEN, GREEN, HexColor("#14532D"), 34,
"Medical + Social + Vocational Rehabilitation"),
("COMMUNITY INTEGRATION", HEADER_BG, DARK_BLUE, white, 34,
"Mainstreaming | Legal protection | Support services | Remove barriers"),
]
for title, bg, border, tc, h, desc in next_steps:
a_row = Table([[Spacer(1,1), Arrow(width=7*cm, color=border)]], colWidths=[8.25*cm, 8.25*cm])
story.append(a_row)
b_row = Table([[Spacer(1,1), FlowchartBox(title, width=7*cm, bg=bg, border=border, text_color=tc, height=h)]],
colWidths=[8.25*cm, 8.25*cm])
story.append(b_row)
story.append(Paragraph(desc, ParagraphStyle('ns', fontSize=8, fontName='Helvetica', textColor=HexColor("#475569"),
leftIndent=(8.25+0.5)*cm, leading=12, spaceBefore=2, spaceAfter=2)))
# ── SECTION 6: KEY LEGISLATION ───────────────────────────────────
story.append(PageBreak())
story.append(SectionDivider("6. KEY LEGISLATION & INSTITUTIONS IN INDIA"))
story.append(Spacer(1, 10))
leg_data = [
[Paragraph('<b>Act / Policy</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Key Provision</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
['Medical Termination of Pregnancy Act, 1971',
'Allows abortion of foetus that may be seriously handicapped'],
['Mental Health Act',
'Legal framework for mentally handicapped individuals'],
['National Policy for Persons with Disabilities',
'Addresses rehabilitation, education, and employment of disabled persons'],
['Persons with Disabilities Act, 1995',
'Equal opportunities, protection of rights, full participation'],
['Rehabilitation Council of India Act, 1992',
'Regulates training of rehabilitation professionals'],
]
leg_tbl = Table(leg_data, colWidths=[7*cm, 9.5*cm])
leg_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), DARK_BLUE),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_BLUE, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(leg_tbl)
story.append(Spacer(1, 10))
story.append(Paragraph("Important Institutions for Handicapped in India:", h3))
inst_data = [
[Paragraph('<b>Institution</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white)),
Paragraph('<b>Location</b>', ParagraphStyle('th', fontSize=9, fontName='Helvetica-Bold', textColor=white))],
['Occupational Therapy School', 'Mumbai'],
['All India Institute of Physical Medicine and Rehabilitation', 'Mumbai'],
['Ali Yavar Jung National Institute for the Hearing Handicapped', 'Mumbai'],
['National Institute for the Visually Handicapped', 'Dehradun'],
['National Institute for the Orthopaedically Handicapped', 'Kolkata'],
['National Institute for the Mentally Handicapped', 'Secunderabad'],
['150+ schools and institutions across India', '(Various states)'],
]
inst_tbl = Table(inst_data, colWidths=[11*cm, 5.5*cm])
inst_tbl.setStyle(TableStyle([
('BACKGROUND', (0,0), (-1,0), TEAL),
('ROWBACKGROUNDS', (0,1), (-1,-1), [LIGHT_TEAL, white]),
('GRID', (0,0), (-1,-1), 0.5, GREY_BORDER),
('FONTSIZE', (0,1), (-1,-1), 8.5),
('FONTNAME', (0,1), (-1,-1), 'Helvetica'),
('VALIGN', (0,0), (-1,-1), 'TOP'),
('TOPPADDING', (0,0), (-1,-1), 5),
('BOTTOMPADDING', (0,0), (-1,-1), 5),
('LEFTPADDING', (0,0), (-1,-1), 8),
]))
story.append(inst_tbl)
# ── ICF MODEL section ─────────────────────────────────────────────
story.append(Spacer(1, 12))
story.append(SectionDivider("7. ICF MODEL (WHO 2001)"))
story.append(Spacer(1, 8))
story.append(Paragraph(
"ICF (International Classification of Functioning, Disability and Health) classifies functioning and disability "
"based on body functions and structure, activities, and participation - all modified by environmental and personal factors. "
"ICD-10 provides aetiologic framework; ICF classifies functioning - both are complementary and should be used together.", body))
story.append(Spacer(1, 8))
# Draw ICF model as a table diagram
icf_data = [
['', Paragraph('<b>Health Condition\n(disorder/disease)</b>',
ParagraphStyle('icf_h', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12)), ''],
[Paragraph('<b>Body Function\n& Structure\n(Impairment)</b>',
ParagraphStyle('icf1', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12)),
Paragraph('<b>Activities\n(Limitation)</b>',
ParagraphStyle('icf2', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12)),
Paragraph('<b>Participation\n(Restriction)</b>',
ParagraphStyle('icf3', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12))],
[Paragraph('<b>Environmental\nFactors</b>',
ParagraphStyle('icf4', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12)),
'',
Paragraph('<b>Personal\nFactors</b>',
ParagraphStyle('icf5', fontSize=9, fontName='Helvetica-Bold', textColor=white, alignment=TA_CENTER, leading=12))],
]
icf_tbl = Table(icf_data, colWidths=[5.5*cm, 5.5*cm, 5.5*cm], rowHeights=[42, 50, 42])
icf_tbl.setStyle(TableStyle([
('BACKGROUND', (1,0), (1,0), DARK_BLUE),
('BACKGROUND', (0,1), (0,1), MED_BLUE),
('BACKGROUND', (1,1), (1,1), TEAL),
('BACKGROUND', (2,1), (2,1), PURPLE),
('BACKGROUND', (0,2), (0,2), ORANGE),
('BACKGROUND', (2,2), (2,2), GREEN),
('BACKGROUND', (1,2), (1,2), white),
('BACKGROUND', (0,0), (0,0), white),
('BACKGROUND', (2,0), (2,0), white),
('VALIGN', (0,0), (-1,-1), 'MIDDLE'),
('ALIGN', (0,0), (-1,-1), 'CENTER'),
('GRID', (0,0), (-1,-1), 0, white),
('TOPPADDING', (0,0), (-1,-1), 6),
('BOTTOMPADDING', (0,0), (-1,-1), 6),
('ROUNDEDCORNERS', [6]),
]))
story.append(icf_tbl)
story.append(Spacer(1, 6))
icf_note = Paragraph(
'<i>ICF Components: Body Functions & Structure (Impairment) ↔ Activities (Limitation) ↔ Participation (Restriction), '
'all influenced by Environmental Factors and Personal Factors. Arrows indicate bidirectional interaction. '
'Source: WHO ICF, 2001</i>',
ParagraphStyle('icf_note', fontSize=7.5, fontName='Helvetica-Oblique', textColor=HexColor("#64748B"),
alignment=TA_CENTER, leading=11))
story.append(icf_note)
# Footer note
story.append(Spacer(1, 16))
story.append(HRFlowable(width="100%", thickness=0.8, color=GREY_BORDER, spaceAfter=6))
story.append(Paragraph(
'<b>Reference:</b> Park\'s Textbook of Preventive and Social Medicine, pp. 674-677. '
'Park K, Park JE. Handicapped Children. In: Park\'s Textbook of Preventive and Social Medicine. '
'Jabalpur: M/s Banarsidas Bhanot Publishers.',
ParagraphStyle('ref', fontSize=7.5, fontName='Helvetica', textColor=HexColor("#64748B"), leading=11)))
# ── BUILD ─────────────────────────────────────────────────────────
doc.build(story)
print(f"PDF created: {OUTPUT}")
cd /home/daytona/workspace/handicapped-children-spm && python create_pdf.py 2>&1
~/handicapped-children-spm/create_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/handicapped-children-spm/create_pdf.py'
cd /home/daytona/workspace/handicapped-children-spm && python create_pdf.py 2>&1
~/handicapped-children-spm/create_pdf.py
Successfully replaced 1 instance(s) of the string in '/home/daytona/workspace/handicapped-children-spm/create_pdf.py'
cd /home/daytona/workspace/handicapped-children-spm && python create_pdf.py 2>&1
ls -lh /home/daytona/workspace/handicapped-children-spm/Handicapped_Children_SPM…
Handicapped Children SPM
PDF Document · PDF