Which books do you have in database?
Check whats written on 205 page of harrison principle book
"e205" in /textbooks/9781265977061
"PAGE 205" in /textbooks/9781265977061
Create pdf on this topic and also include images
mkdir -p /home/daytona/workspace/cardinal-manifestations && ls /home/daytona/workspace/cardinal-manifestations/
~/cardinal-manifestations/generate_pdf.py
from reportlab.lib.pagesizes import letter
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.lib.units import inch
from reportlab.lib import colors
from reportlab.platypus import (
SimpleDocTemplate, Paragraph, Spacer, Image, HRFlowable,
PageBreak, KeepTogether
)
from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY
import urllib.request
import os
import tempfile
OUTPUT = "/home/daytona/workspace/cardinal-manifestations/Cardinal_Manifestations_of_Disease.pdf"
IMG_DIR = "/home/daytona/workspace/cardinal-manifestations/imgs"
os.makedirs(IMG_DIR, exist_ok=True)
def download_image(url, fname):
path = os.path.join(IMG_DIR, fname)
if os.path.exists(path):
return path
try:
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
with urllib.request.urlopen(req, timeout=15) as r, open(path, "wb") as f:
f.write(r.read())
return path
except Exception as e:
print(f" Failed {fname}: {e}")
return None
# โโโ Images โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
images_data = [
{
"url": "https://cdn.orris.care/cdss_images/a9f1f3c0d14eb31471d93fc93f0e396fce4f153f1f9e6aada9df544638f27ec1.png",
"fname": "fig14-1.png",
"caption": "FIGURE 14-1 Components of a typical cutaneous nerve. Primary afferents include large-diameter myelinated (Aฮฒ), small-diameter myelinated (Aฮด), and unmyelinated (C) axons. Sympathetic postganglionic fibers are unmyelinated.",
},
{
"url": "https://cdn.orris.care/cdss_images/2bf387b0a72d2a87ae058513391efc236066f92b1cd5f573c160515c5a303d1e.png",
"fname": "fig14-2.png",
"caption": "FIGURE 14-2 Events leading to activation, sensitization, and spread of sensitization of primary afferent nociceptor terminals. A. Direct activation by intense pressure and cell damage releasing K+, PGs, and BK. B. Secondary activation via substance P causing vasodilation, neurogenic edema, and release of histamine and serotonin.",
},
{
"url": "https://cdn.orris.care/cdss_images/b5ec7f9b69258518b92552eb7475898a5163532ce4639ac3041df8305236e364.png",
"fname": "fig14-3.png",
"caption": "FIGURE 14-3 The convergence-projection hypothesis of referred pain. Visceral afferent nociceptors converge on the same pain-projection neurons as somatic afferents, causing the brain to mislocalize the pain source.",
},
{
"url": "https://cdn.orris.care/cdss_images/874f97726ccff95aa75cf4861e71555ca3b736ec29b54b62bfa3e8a7d00a0ce9.png",
"fname": "fig14-4.png",
"caption": "FIGURE 14-4 Pain modulation pathways connecting the thalamus, hypothalamus, brainstem, and spinal cord. Descending pathways modulate nociceptive transmission.",
},
]
print("Downloading images...")
for img in images_data:
p = download_image(img["url"], img["fname"])
img["path"] = p
print(f" {'OK' if p else 'FAIL'} โ {img['fname']}")
# โโโ Document styles โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
doc = SimpleDocTemplate(
OUTPUT,
pagesize=letter,
rightMargin=0.85*inch, leftMargin=0.85*inch,
topMargin=1*inch, bottomMargin=1*inch,
)
styles = getSampleStyleSheet()
title_style = ParagraphStyle("TitleStyle", parent=styles["Title"],
fontSize=24, textColor=colors.HexColor("#1a3a5c"),
spaceAfter=6, leading=28)
subtitle_style = ParagraphStyle("SubtitleStyle", parent=styles["Normal"],
fontSize=13, textColor=colors.HexColor("#4a6d8c"),
spaceAfter=4, alignment=TA_CENTER, leading=16)
source_style = ParagraphStyle("SourceStyle", parent=styles["Normal"],
fontSize=10, textColor=colors.HexColor("#666666"),
spaceAfter=20, alignment=TA_CENTER, italic=True)
h1_style = ParagraphStyle("H1", parent=styles["Heading1"],
fontSize=16, textColor=colors.HexColor("#1a3a5c"),
spaceBefore=18, spaceAfter=6, borderPad=2,
backColor=colors.HexColor("#eaf2fb"),
leading=20, leftIndent=-4, rightIndent=-4, borderWidth=0)
h2_style = ParagraphStyle("H2", parent=styles["Heading2"],
fontSize=13, textColor=colors.HexColor("#2c5f8a"),
spaceBefore=14, spaceAfter=4, leading=16)
h3_style = ParagraphStyle("H3", parent=styles["Heading3"],
fontSize=11, textColor=colors.HexColor("#3d7ab5"),
spaceBefore=10, spaceAfter=3, leading=14)
body_style = ParagraphStyle("Body", parent=styles["Normal"],
fontSize=10.5, leading=15, spaceAfter=8, alignment=TA_JUSTIFY)
caption_style = ParagraphStyle("Caption", parent=styles["Italic"],
fontSize=9, textColor=colors.HexColor("#444444"),
spaceAfter=10, alignment=TA_CENTER, leading=12)
bullet_style = ParagraphStyle("Bullet", parent=styles["Normal"],
fontSize=10.5, leading=14, spaceAfter=5,
leftIndent=14, bulletIndent=4)
def H(text, style): return Paragraph(text, style)
def P(text): return Paragraph(text, body_style)
def B(text): return Paragraph(f"โข {text}", bullet_style)
def SP(n=8): return Spacer(1, n)
def HR(): return HRFlowable(width="100%", thickness=1,
color=colors.HexColor("#c0d6e8"), spaceAfter=8)
def add_image(img_dict, width=5.0*inch):
items = []
if img_dict.get("path") and os.path.exists(img_dict["path"]):
try:
items.append(SP(6))
items.append(Image(img_dict["path"], width=width, height=width*0.7))
items.append(Paragraph(img_dict["caption"], caption_style))
except Exception as e:
print(f" Image render failed: {e}")
return items
# โโโ Content โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story = []
# Cover
story.append(SP(40))
story.append(H("Cardinal Manifestations of Disease", title_style))
story.append(SP(6))
story.append(H("Part 2 โ Harrison's Principles of Internal Medicine, 22nd Edition (2025)", subtitle_style))
story.append(H("McGraw Hill Medical", subtitle_style))
story.append(SP(4))
story.append(H("Source: Harrison's Principles of Internal Medicine, 22e (2025), McGraw Hill", source_style))
story.append(HR())
story.append(SP(8))
story.append(P(
"The Cardinal Manifestations of Disease section of Harrison's Principles of Internal Medicine covers the fundamental symptoms and signs that drive clinical medicine โ pain, fever, dyspnea, and many others. Understanding these manifestations enables the clinician to recognize patterns of tissue damage, identify likely diseases, and choose targeted investigations. This document provides a comprehensive overview of the two most prominent cardinal manifestations: <b>Pain</b> and <b>Fever</b>."
))
story.append(PageBreak())
# โโ SECTION 1: PAIN โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story.append(H("Section 1 โ Pain", h1_style))
story.append(HR())
story.append(SP(4))
story.append(H("Chapter 14: Pain โ Pathophysiology and Management", h2_style))
story.append(P("<i>James P. Rathmell, Howard L. Fields</i>"))
story.append(SP(6))
story.append(P(
"The province of medicine is to preserve and restore health and to relieve suffering. Understanding pain is essential to both goals. Pain is the most common symptom that brings a patient to a physician's attention. The function of the pain sensory system is to protect the body and maintain homeostasis. It does this by detecting, localizing, and identifying potential or actual tissue-damaging processes. Because different diseases produce characteristic patterns of tissue damage, the quality, time course, and location of a patient's pain lend important diagnostic clues."
))
# 1.1 Pain Sensory System
story.append(H("The Pain Sensory System", h2_style))
story.append(P(
"Pain is an unpleasant sensation localized to a part of the body. It is often described in terms of a penetrating or tissue-destructive process (e.g., stabbing, burning, twisting, tearing, squeezing) and/or of a bodily or emotional reaction (e.g., terrifying, nauseating, sickening). Any pain of moderate or higher intensity is accompanied by anxiety and the urge to escape or terminate the feeling. These properties illustrate the duality of pain: it is both <b>sensation</b> and <b>emotion</b>."
))
story.append(P(
"When it is acute, pain is characteristically associated with behavioral arousal and a stress response consisting of increased blood pressure, heart rate, pupil diameter, and plasma cortisol levels. In addition, local muscle contraction (e.g., limb flexion, abdominal wall rigidity) is often present."
))
# Peripheral Mechanisms
story.append(H("Peripheral Mechanisms", h3_style))
story.append(P(
"A peripheral nerve consists of the axons of three different types of neurons: primary sensory afferents, motor neurons, and sympathetic postganglionic neurons. Primary afferents are classified by their diameter, degree of myelination, and conduction velocity:"
))
story.append(B("<b>Aฮฒ fibers</b> โ large diameter, respond to light touch; do not produce pain under normal conditions."))
story.append(B("<b>Aฮด fibers</b> โ small diameter, myelinated; mediate sharp, well-localized pain."))
story.append(B("<b>C fibers</b> โ unmyelinated; mediate dull, burning, poorly localized pain."))
story.append(SP(6))
story += add_image(images_data[0], width=4.8*inch)
story.append(SP(8))
story.append(P(
"Sensitization: When intense, repeated, or prolonged stimuli are applied to damaged or inflamed tissues, the threshold for activating primary afferent nociceptors is lowered, and the frequency of firing is higher for all stimulus intensities. Inflammatory mediators such as bradykinin (BK), nerve growth factor (NGF), and prostaglandins (PGs) contribute to peripheral sensitization and underlie the clinical phenomena of <b>hyperalgesia</b> (increased pain from a normally painful stimulus) and <b>allodynia</b> (pain from a normally non-painful stimulus)."
))
story += add_image(images_data[1], width=4.8*inch)
story.append(SP(8))
# Central Mechanisms
story.append(H("Central Mechanisms", h3_style))
story.append(P(
"Most spinal dorsal horn neurons activated by primary afferent nociceptors send their axons to the contralateral thalamus via the spinothalamic tract, lying in the anterolateral white matter of the spinal cord. The spinothalamic tract is the most important ascending pathway for pain. Importantly, visceral afferent nociceptors converge on the same pain-projection neurons as somatic afferents โ this explains <b>referred pain</b>, whereby pain originating in a visceral organ is perceived in a somatic site (e.g., cardiac ischemia felt in the left arm)."
))
story += add_image(images_data[2], width=4.8*inch)
story.append(SP(8))
# Pain Modulation
story.append(H("Pain Modulation", h2_style))
story.append(P(
"The pain produced by injuries of similar magnitude is remarkably variable in different situations and in different individuals. Pain-modulating circuits can both enhance and suppress pain. Descending pathways from the midbrain periaqueductal gray (PAG) and rostral ventromedial medulla (RVM) project to the spinal dorsal horn and modulate nociceptive transmission. Key neurotransmitters include:"
))
story.append(B("<b>Endogenous opioids</b> (enkephalins, endorphins, dynorphins) โ inhibit nociceptive transmission."))
story.append(B("<b>Serotonin (5-HT) and norepinephrine</b> โ released by descending pathways; generally inhibitory."))
story.append(B("<b>Substance P and CGRP</b> โ promote nociceptive transmission and neurogenic inflammation."))
story += add_image(images_data[3], width=4.8*inch)
story.append(SP(8))
# Neuropathic Pain
story.append(H("Neuropathic Pain", h2_style))
story.append(P(
"Lesions of the peripheral or central nociceptive pathways can produce neuropathic pain. This type of pain typically has an unusual <b>burning, tingling, or electric shock-like quality</b> and may occur spontaneously or be triggered by very light touch. Key features include:"
))
story.append(B("<b>Allodynia</b> โ pain evoked by normally non-painful stimuli."))
story.append(B("<b>Hyperpathia</b> โ greatly exaggerated pain response to mild stimuli."))
story.append(B("<b>Sensory deficit</b> co-extensive with the area of pain."))
story.append(SP(6))
story.append(P(
"Examples include diabetic peripheral neuropathy, postherpetic neuralgia, and complex regional pain syndrome (CRPS). Damaged primary afferents develop increased sodium channel density, spontaneous activity, and adrenergic sensitivity, all contributing to the pain."
))
# Chronic Pain
story.append(H("Chronic Pain", h2_style))
story.append(P(
"Patients with chronic pain may have objective signs of the painful condition or may show no obvious physical pathology. Chronic pain is one of the most important public health problems, costing the American economy well over $100 billion annually. The distinction between acute and chronic pain is clinically essential:"
))
story.append(B("<b>Acute pain</b> serves as a protective signal; treatment is aimed at the underlying cause plus analgesia."))
story.append(B("<b>Chronic pain</b> (>3 months) is often a disease in its own right, requiring multimodal management including pharmacotherapy, physical therapy, cognitive-behavioral therapy, and sometimes interventional procedures."))
story.append(SP(6))
# Treatment of Pain
story.append(H("Treatment of Pain โ Key Principles", h2_style))
story.append(B("<b>Non-opioid analgesics</b>: NSAIDs and acetaminophen for mild-to-moderate pain; block PG synthesis (COX inhibition)."))
story.append(B("<b>Opioid analgesics</b>: Act on ฮผ, ฮบ, ฮด receptors; indicated for moderate-to-severe pain. Risk of dependence requires careful patient selection."))
story.append(B("<b>Adjuvant analgesics</b>: Tricyclic antidepressants, SNRIs, and gabapentinoids (gabapentin, pregabalin) are first-line for neuropathic pain."))
story.append(B("<b>Interventional procedures</b>: Nerve blocks, epidural steroids, neuromodulation (spinal cord stimulation) for refractory cases."))
story.append(SP(10))
story.append(PageBreak())
# โโ SECTION 2: FEVER โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story.append(H("Section 2 โ Fever and Hyperthermia", h1_style))
story.append(HR())
story.append(SP(4))
story.append(H("Definition and Normal Body Temperature", h2_style))
story.append(P(
"A normal body temperature is maintained by the hypothalamic thermoregulatory center, which balances heat production (from metabolic activity in muscle and liver) with heat dissipation (from the skin and lungs). According to a study of 35,000 individuals โฅ18 years of age, the mean oral temperature is <b>36.6ยฐC</b>. A temperature of <b>>37.7ยฐC (99.9ยฐF)</b>, representing the 99th percentile for healthy individuals, defines a <b>fever</b>."
))
story.append(P(
"Body temperature shows diurnal variation โ lower at 8 A.M. and higher at 4 P.M. Rectal temperatures are generally 0.4ยฐC (0.7ยฐF) higher than oral readings. An increase in baseline temperature of 0.15ยฐC (1 standard deviation) correlates with a 0.52% absolute increase in 1-year mortality after controlling for age, sex, race, and comorbidities."
))
story.append(H("Fever versus Hyperthermia", h2_style))
story.append(P(
"<b>Fever</b> is an elevation of body temperature that exceeds normal daily variation and occurs in conjunction with an <b>increase in the hypothalamic set point</b> (e.g., from 37ยฐC to 39ยฐC). This is driven by endogenous pyrogens (e.g., IL-1, IL-6, TNF-ฮฑ) acting on the anterior hypothalamus to increase prostaglandin E2 (PGE2) synthesis."
))
story.append(P(
"<b>Hyperthermia</b>, by contrast, is an uncontrolled increase in body temperature that overwhelms or bypasses hypothalamic thermoregulation โ the set point is NOT raised. Antipyretics are ineffective in hyperthermia (e.g., heat stroke, malignant hyperthermia, neuroleptic malignant syndrome) because PGE2 is not elevated."
))
# Key differences table as bullets
story.append(H("Key Differences: Fever vs. Hyperthermia", h3_style))
story.append(B("<b>Fever</b>: Hypothalamic set point โ | Mediated by pyrogens/PGE2 | Responds to antipyretics | Protective"))
story.append(B("<b>Hyperthermia</b>: Set point normal | Thermoregulation overwhelmed/bypassed | Does NOT respond to antipyretics | Dangerous"))
story.append(SP(6))
story.append(H("Pathogenesis of Fever", h2_style))
story.append(P(
"When monocytes/macrophages are activated by exogenous pyrogens (e.g., LPS, bacterial toxins, viral antigens), they produce endogenous pyrogens including:"
))
story.append(B("<b>Interleukin-1 (IL-1ฮฑ and IL-1ฮฒ)</b> โ the prototypical endogenous pyrogen."))
story.append(B("<b>Tumor necrosis factor alpha (TNF-ฮฑ)</b>"))
story.append(B("<b>Interleukin-6 (IL-6)</b>"))
story.append(B("<b>Interferon-ฮณ (IFN-ฮณ)</b> โ particularly during viral infections."))
story.append(SP(6))
story.append(P(
"These cytokines cross the blood-brain barrier or act at circumventricular organs to stimulate arachidonic acid metabolism, producing <b>PGE2</b>. PGE2 acts on EP3 receptors in the hypothalamic preoptic area to raise the thermoregulatory set point. Vasoconstriction, shivering, and behavioral heat conservation follow until core temperature matches the new set point."
))
story.append(H("Disease Categories That Present with Fever as a Cardinal Sign", h2_style))
story.append(B("<b>Infectious diseases</b> โ bacterial, viral, fungal, parasitic"))
story.append(B("<b>Autoimmune and non-infectious inflammatory disorders</b> โ SLE, RA, vasculitis"))
story.append(B("<b>Malignancies</b> โ lymphoma (Pel-Ebstein fever), solid tumors, leukemia"))
story.append(B("<b>Medication-related</b> โ drug fever, vaccine reactions"))
story.append(B("<b>Endocrine disorders</b> โ hyperthyroidism, adrenal insufficiency"))
story.append(B("<b>Intrinsic hypothalamic malfunction</b> โ hypothalamic lesions"))
story.append(SP(8))
story.append(H("Acute-Phase Response", h3_style))
story.append(P(
"Fever is invariably accompanied by an acute-phase response. The liver produces increased amounts of <b>C-reactive protein (CRP)</b>, serum amyloid A (SAA), fibrinogen, and complement proteins. Unlike erythrocyte sedimentation rate (ESR), which may vary, CRP levels remain elevated throughout a febrile illness. Acute-phase reactants serve as useful biomarkers to monitor disease activity."
))
story.append(H("Treatment of Fever", h2_style))
story.append(P(
"The decision to treat fever depends on clinical context. Not all fevers require treatment โ fever enhances immune function and may slow microbial replication. However, treatment is warranted when:"
))
story.append(B("Temperature >40ยฐC (104ยฐF) โ risk of protein denaturation, seizures, cardiovascular stress."))
story.append(B("Patients with cardiac, pulmonary, or neurological compromise."))
story.append(B("Pregnant patients (risk of neural tube defects, preterm labor)."))
story.append(B("Pediatric patients at risk for febrile seizures."))
story.append(SP(6))
story.append(H("Antipyretic Regimens", h3_style))
story.append(B("<b>Aspirin and NSAIDs</b> โ inhibit cyclooxygenase (COX), reducing PGE2. Effective antipyretics and anti-inflammatories."))
story.append(B("<b>Acetaminophen</b> โ preferred in children (avoids Reye syndrome risk with aspirin), in pregnancy, and in patients with GI/renal concerns."))
story.append(B("<b>Glucocorticoids</b> โ block arachidonic acid release; used in specific inflammatory conditions."))
story.append(B("<b>Anticytokine therapies</b> โ IL-1 antagonists (anakinra, canakinumab), TNF inhibitors; indicated for autoimmune/autoinflammatory diseases with fever."))
story.append(SP(10))
# โโ Summary โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
story.append(PageBreak())
story.append(H("Summary", h1_style))
story.append(HR())
story.append(SP(6))
story.append(P(
"Cardinal manifestations of disease are the core symptoms and signs that guide clinical diagnosis and management. Pain and fever, the two manifestations covered in this document, are among the most universal in medicine:"
))
story.append(SP(6))
story.append(B("<b>Pain</b> arises from activation of peripheral nociceptors via mechanical, thermal, or chemical stimuli. Ascending spinothalamic pathways transmit nociceptive signals to the thalamus and cortex. Descending pathways modulate pain. Neuropathic pain results from damage to or dysfunction of the nociceptive pathway itself and is characterized by allodynia, hyperpathia, and spontaneous pain."))
story.append(SP(4))
story.append(B("<b>Fever</b> results from cytokine-driven resetting of the hypothalamic thermostat via PGE2. It must be distinguished from hyperthermia, in which the thermoregulatory set point is normal but overwhelmed. Fever accompanies an acute-phase response and may be caused by infection, malignancy, autoimmune disease, drugs, or endocrine disorders."))
story.append(SP(12))
story.append(HR())
story.append(Paragraph(
"<i>Source: Harrison's Principles of Internal Medicine, 22nd Edition (2025), Part 2: Cardinal Manifestations and Presentation of Disease. McGraw Hill Medical.</i>",
ParagraphStyle("footer", parent=styles["Normal"], fontSize=9,
textColor=colors.HexColor("#666666"), alignment=TA_CENTER)
))
# โโโ Build โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
doc.build(story)
print(f"\nPDF saved to: {OUTPUT}")
cd /home/daytona/workspace/cardinal-manifestations && python generate_pdf.py
ls -lh /home/daytona/workspace/cardinal-manifestations/Cardinal_Manifestations_of_Disease.pdf
Cardinal Manifestations of Disease
PDF Document ยท PDF