MBBS 1st year physiology give me all topics and easy explain using this pdf and all mbbs resources calculate and give the topic mujhe acche se jo page upload kiye hai usme jitna topic hai usee explain karo or saab ek PDF mai convert kar doo 1 professional examination topics hai
cd /tmp/workspace && ls attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/ && python3 -c " import subprocess result = subprocess.run(['python3', '-m', 'pdfplumber', '--help'], capture_output=True, text=True) print(result.stdout[:200]) import pdfplumber with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages[:5]): text = page.extract_text() if text: print(f'--- Page {i+1} ---') print(text[:500]) "
cd /tmp/workspace && python3 -c " import pdfplumber all_text = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() if text: all_text[i+1] = text # Print page count and some sample pages print(f'Pages with text: {len(all_text)}') # Print pages to see all topics covered for pg in [1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130, 140]: if pg in all_text: print(f'=== PAGE {pg} ===') print(all_text[pg][:300]) print() " 2>&1 | head -200
cd /tmp/workspace && python3 -c " import pdfplumber # Extract ALL text from PDF all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 20: all_pages[i+1] = text # Save full text with open('/tmp/workspace/physiology_raw.txt', 'w') as f: for pg, text in all_pages.items(): f.write(f'=== PAGE {pg} ===\n') f.write(text) f.write('\n\n') print(f'Saved {len(all_pages)} pages') # Print full content in chunks for pg in range(1, 141): if pg in all_pages: print(f'PAGE {pg}: {all_pages[pg][:100]}') " 2>&1 | head -300
cd /tmp/workspace && python3 -c " import pdfplumber all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 20: all_pages[i+1] = text for pg in range(89, 141): if pg in all_pages: print(f'PAGE {pg}: {all_pages[pg][:100]}') " 2>&1
mkdir -p /tmp/workspace/physiology-pdf && ls /tmp/workspace/physiology-pdf/
cd /tmp/workspace && python3 << 'PYEOF' import pdfplumber # Extract ALL text from PDF organized by topic all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 30: # Remove header/footer noise lines = text.split('\n') clean_lines = [l for l in lines if 'SMCI' not in l and 'Sayta Medical' not in l and 'www.smci' not in l and 'M-9714941350' not in l] clean_text = '\n'.join(clean_lines).strip() if len(clean_text) > 20: all_pages[i+1] = clean_text # Group by topic headings topic_map = {} for pg, text in all_pages.items(): first_line = text.split('\n')[0].strip().upper() topic_map[pg] = {'heading': first_line, 'text': text} print(f"Pages with content: {len(all_pages)}") # Save a lookup of page->heading for pg, info in sorted(topic_map.items()): print(f"P{pg}: {info['heading'][:60]}") PYEOF
cd /tmp/workspace && python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch, cm from reportlab.lib import colors from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY import pdfplumber # Extract full PDF content all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 30: lines = text.split('\n') clean_lines = [l for l in lines if 'SMCI' not in l and 'Sayta Medical' not in l and 'www.smci' not in l and 'M-9714941350' not in l and 'Page ' not in l[-10:]] clean_text = '\n'.join(clean_lines).strip() if len(clean_text) > 20: all_pages[i+1] = clean_text def get_pages(page_range): """Get combined text from a range of pages""" texts = [] for pg in page_range: if pg in all_pages: texts.append(all_pages[pg]) return '\n'.join(texts) # Now build the PDF doc = SimpleDocTemplate( 'physiology-pdf/MBBS_Physiology_1st_Year_Notes.pdf', pagesize=A4, rightMargin=1.5*cm, leftMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.5*cm, ) styles = getSampleStyleSheet() # Custom styles title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=24, spaceAfter=12, textColor=colors.HexColor('#1a237e'), fontName='Helvetica-Bold', alignment=TA_CENTER) subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=12, spaceAfter=20, textColor=colors.HexColor('#5c6bc0'), fontName='Helvetica', alignment=TA_CENTER) chapter_style = ParagraphStyle('Chapter', parent=styles['Heading1'], fontSize=16, spaceAfter=8, spaceBefore=20, textColor=colors.white, fontName='Helvetica-Bold', backColor=colors.HexColor('#1a237e'), borderPadding=(6,6,6,6), leftIndent=0) section_style = ParagraphStyle('Section', parent=styles['Heading2'], fontSize=13, spaceAfter=6, spaceBefore=12, textColor=colors.HexColor('#1a237e'), fontName='Helvetica-Bold', borderPadding=(4,4,4,4)) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=10, spaceAfter=4, spaceBefore=2, fontName='Helvetica', leading=14, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=10, spaceAfter=3, spaceBefore=2, fontName='Helvetica', leading=13, leftIndent=15, bulletIndent=5) important_style = ParagraphStyle('Important', parent=styles['Normal'], fontSize=10, spaceAfter=4, spaceBefore=4, fontName='Helvetica-Bold', textColor=colors.HexColor('#b71c1c'), backColor=colors.HexColor('#ffebee'), leading=13, borderPadding=(4,4,4,4)) def make_chapter(title): return [Paragraph(f' {title}', chapter_style), Spacer(1, 6)] def make_section(title): return [HRFlowable(width="100%", thickness=1, color=colors.HexColor('#5c6bc0')), Paragraph(title, section_style), Spacer(1, 4)] def make_body(text): # Clean and format text paras = [] for line in text.split('\n'): line = line.strip() if not line: continue if line.startswith('•') or line.startswith('-') or line.startswith('▪'): paras.append(Paragraph(f'• {line[1:].strip()}', bullet_style)) elif len(line) > 3: paras.append(Paragraph(line, body_style)) return paras story = [] # ===================== COVER PAGE ===================== story.append(Spacer(1, 1.5*inch)) story.append(Paragraph('MBBS 1st Year', subtitle_style)) story.append(Spacer(1, 0.2*inch)) story.append(Paragraph('PHYSIOLOGY', title_style)) story.append(Spacer(1, 0.1*inch)) story.append(Paragraph('1st Professional Examination', subtitle_style)) story.append(HRFlowable(width="80%", thickness=3, color=colors.HexColor('#1a237e'), hAlign='CENTER')) story.append(Spacer(1, 0.3*inch)) story.append(Paragraph('Complete Topic-wise Notes', ParagraphStyle('sub2', parent=styles['Normal'], fontSize=14, alignment=TA_CENTER, textColor=colors.HexColor('#5c6bc0'), fontName='Helvetica-Bold'))) story.append(Spacer(1, 0.2*inch)) # Topic list from image topics_list = [ ['1. Emotion (Circuit) - Clinical MCQ', '2. Sleep'], ['3. Amygdala → Window (Limbic System)', '4. Lactation'], ['5. Vegetative Functions of Hypothalamus', '6. Blood Brain Barrier'], ['7. Circadian Rhythm / Biological Clock', '8. Transport (GnP)'], ['9. Hematology (RH Antigen, Blood Thinner, Erythropoiesis, Anaemia, Hemoglobin)', '10. Myelinogenesis'], ['11. Action Potential (AP)', '12. Nerve Injury'], ['13. Neurotransmitters (NT)', '14. Neuromuscular Junction (NMJ)'], ['15. EF-C Coupling (Excitation-Contraction)', '16. Hypertension, Cardiac Cycle, Output, Reflexes'], ['17. Deep Sea Physiology / High Altitude', '18. Pulmonary'], ['19. Cyanosis', '20. CO Poisoning / Hypoxia'], ['21. Counter Current / Micturition Reflex / Osmotic Dialysis', '22. Pituitary, Parathyroid, Adrenal'], ['23. Acromegaly, Tetany, Gigantism (GH)', '24. Aphasia'], ['25. Basal Ganglia', '26. Menstruation, Cryptorchidism, Menopause'], ['27. Taste & Smell Pathway & Adaptation', '28. Colour Vision / Vision Pathway'], ['29. +ve/-ve After Image', '30. VO2 Max'], ['31. Brain Death', '32. Homeostasis'], ] table = Table(topics_list, colWidths=[8.5*cm, 8.5*cm]) table.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,-1), colors.HexColor('#e8eaf6')), ('TEXTCOLOR', (0,0), (-1,-1), colors.HexColor('#1a237e')), ('FONTNAME', (0,0), (-1,-1), 'Helvetica'), ('FONTSIZE', (0,0), (-1,-1), 9), ('PADDING', (0,0), (-1,-1), 5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('ROWBACKGROUNDS', (0,0), (-1,-1), [colors.HexColor('#e8eaf6'), colors.HexColor('#c5cae9')]), ])) story.append(table) story.append(Spacer(1, 0.3*inch)) story.append(Paragraph('Source: Dr. Mayur Sayta - SMCI Physiology Notes + Standard Textbooks', ParagraphStyle('footer_note', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.grey, fontName='Helvetica-Oblique'))) story.append(PageBreak()) # ===================== TOPIC 1: HOMEOSTASIS ===================== story += make_chapter('TOPIC 1: HOMEOSTASIS') story += make_section('Definition') story.append(Paragraph('Homeostasis is the maintenance of a constant internal environment in the body despite changes in the external environment.', body_style)) story += make_section('Key Concepts') for point in [ '• The internal environment = extracellular fluid (ECF) surrounding cells', '• Claude Bernard first described "Milieu Intérieur" (internal environment)', '• Walter Cannon coined the term "Homeostasis"', '• Homeostasis is maintained by feedback mechanisms', ]: story.append(Paragraph(point, bullet_style)) story += make_section('Types of Feedback') story.append(Paragraph('1. Negative Feedback (Most Common):', ParagraphStyle('bold_body', parent=body_style, fontName='Helvetica-Bold'))) story.append(Paragraph('• When a variable deviates from the set point, mechanisms are activated to bring it BACK to normal', bullet_style)) story.append(Paragraph('• Example: Body temperature regulation - if temp rises, sweating occurs to cool down', bullet_style)) story.append(Paragraph('• Example: Blood glucose regulation by insulin and glucagon', bullet_style)) story.append(Paragraph('2. Positive Feedback (Amplification):', ParagraphStyle('bold_body', parent=body_style, fontName='Helvetica-Bold'))) story.append(Paragraph('• The response amplifies the stimulus (limited examples in body)', bullet_style)) story.append(Paragraph('• Example: Childbirth - oxytocin → more uterine contractions → more oxytocin', bullet_style)) story.append(Paragraph('• Example: Blood clotting cascade', bullet_style)) story += make_section('Variables Maintained by Homeostasis') vars_data = [['Variable', 'Normal Range'], ['Body Temperature', '37°C (98.6°F)'], ['Blood pH', '7.35 - 7.45'], ['Blood Glucose', '70-110 mg/dL (fasting)'], ['Blood Pressure', '120/80 mmHg'], ['Plasma Osmolarity', '285-295 mOsm/L'], ['Plasma Na+', '135-145 mEq/L'], ] t = Table(vars_data, colWidths=[9*cm, 8*cm]) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,-1), 'Helvetica'), ('FONTSIZE', (0,0), (-1,-1), 9), ('PADDING', (0,0), (-1,-1), 5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#e8eaf6')]), ])) story.append(t) story.append(PageBreak()) # ===================== TOPIC 2: ACTION POTENTIAL ===================== story += make_chapter('TOPIC 2: ACTION POTENTIAL (AP)') # From PDF pages 5-6 ap_text = get_pages([5, 6]) story += make_section('Definition') story.append(Paragraph('Action potential is defined as a series of electrical changes that occur in the membrane potential when it is stimulated.', body_style)) story += make_section('Resting Membrane Potential (RMP)') for point in [ '• RMP = -70 mV (inside negative, outside positive)', '• Maintained by Na+/K+ ATPase pump (3Na+ out, 2K+ in)', '• K+ leak channels keep inside negative', '• Large anions (proteins) inside cell', ]: story.append(Paragraph(point, bullet_style)) story += make_section('Phases of Action Potential') ap_phases = [['Phase', 'Event', 'Ion Movement'], ['Rising Phase (Depolarization)', 'Membrane becomes +30 mV', 'Na+ rushes IN through voltage-gated Na+ channels'], ['Falling Phase (Repolarization)', 'Returns to -70 mV', 'K+ rushes OUT, Na+ channels inactivate'], ['After-hyperpolarization', 'Goes below -70 mV', 'K+ channels remain open briefly'], ['Refractory Period', 'Membrane unresponsive', 'Na+ channels inactivated'], ] t2 = Table(ap_phases, colWidths=[4.5*cm, 5*cm, 7.5*cm]) t2.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1a237e')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,-1), 'Helvetica'), ('FONTSIZE', (0,0), (-1,-1), 9), ('PADDING', (0,0), (-1,-1), 4), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#9fa8da')), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#e8eaf6')]), ('VALIGN', (0,0), (-1,-1), 'TOP'), ])) story.append(t2) story += make_section('Refractory Periods') for point in [ '• Absolute Refractory Period (ARP): No new AP possible regardless of stimulus strength - Na+ channels inactivated', '• Relative Refractory Period (RRP): New AP possible only with STRONGER stimulus - some Na+ channels recovered', '• ARP ensures one-way conduction of nerve impulse', ]: story.append(Paragraph(point, bullet_style)) story += make_section('Ionic Basis (from PDF)') for line in ap_text.split('\n'): line = line.strip() if line and len(line) > 5 and 'Physiology' not in line: story.append(Paragraph(f'• {line}' if not line.startswith('•') else line, bullet_style)) story.append(PageBreak()) print("Part 1 built successfully") PYEOF echo "Exit: $?"
cd /tmp/workspace && python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch, cm from reportlab.lib import colors from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY import pdfplumber # Extract full PDF content all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 30: lines = text.split('\n') clean_lines = [l for l in lines if 'SMCI' not in l and 'Sayta' not in l and 'www.smci' not in l and '9714941350' not in l] clean_text = '\n'.join(clean_lines).strip() if len(clean_text) > 20: all_pages[i+1] = clean_text def get_pages(page_range): texts = [] for pg in page_range: if pg in all_pages: texts.append(all_pages[pg]) return '\n'.join(texts) def clean_page_text(text): """Return list of meaningful lines""" lines = [] for l in text.split('\n'): l = l.strip() if l and len(l) > 3 and 'Physiology' != l: lines.append(l) return lines doc = SimpleDocTemplate( 'physiology-pdf/MBBS_Physiology_1st_Year_Notes.pdf', pagesize=A4, rightMargin=1.5*cm, leftMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.5*cm, ) styles = getSampleStyleSheet() title_style = ParagraphStyle('TitleS', parent=styles['Title'], fontSize=26, spaceAfter=12, textColor=colors.HexColor('#1a237e'), fontName='Helvetica-Bold', alignment=TA_CENTER) sub_style = ParagraphStyle('SubS', parent=styles['Normal'], fontSize=13, spaceAfter=8, textColor=colors.HexColor('#5c6bc0'), fontName='Helvetica-Oblique', alignment=TA_CENTER) chapter_style = ParagraphStyle('ChapS', parent=styles['Heading1'], fontSize=15, spaceAfter=8, spaceBefore=16, textColor=colors.white, fontName='Helvetica-Bold', backColor=colors.HexColor('#1565c0'), borderPadding=(8,8,8,8)) section_style = ParagraphStyle('SecS', parent=styles['Heading2'], fontSize=12, spaceAfter=5, spaceBefore=10, textColor=colors.HexColor('#1565c0'), fontName='Helvetica-Bold') body_style = ParagraphStyle('BodyS', parent=styles['Normal'], fontSize=10, spaceAfter=3, leading=14, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('BulletS', parent=styles['Normal'], fontSize=10, spaceAfter=2, leading=13, leftIndent=12) imp_style = ParagraphStyle('ImpS', parent=styles['Normal'], fontSize=10, spaceAfter=3, leading=13, fontName='Helvetica-Bold', textColor=colors.HexColor('#b71c1c')) note_style = ParagraphStyle('NoteS', parent=styles['Normal'], fontSize=9, spaceAfter=3, leading=12, textColor=colors.HexColor('#4a148c'), fontName='Helvetica-Oblique', backColor=colors.HexColor('#f3e5f5'), borderPadding=(3,3,3,3)) def ch(title): return [Spacer(1,8), Paragraph(f' {title}', chapter_style), Spacer(1,6)] def sec(title): return [Paragraph(title, section_style)] def body(text): return [Paragraph(text, body_style)] def bul(text): return [Paragraph(f'• {text}', bullet_style)] def imp(text): return [Paragraph(f'★ {text}', imp_style)] def note(text): return [Paragraph(f'📝 Note: {text}', note_style)] def tbl(data, col_widths=None): if col_widths is None: col_widths = [17*cm/len(data[0])] * len(data[0]) t = Table(data, colWidths=col_widths) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1565c0')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTNAME', (0,1), (-1,-1), 'Helvetica'), ('FONTSIZE', (0,0), (-1,-1), 9), ('PADDING', (0,0), (-1,-1), 5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#90caf9')), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#e3f2fd')]), ('VALIGN', (0,0), (-1,-1), 'TOP'), ])) return [t, Spacer(1,4)] story = [] # ===== COVER PAGE ===== story.append(Spacer(1, 1*inch)) story.append(Paragraph('MBBS 1st Professional Examination', sub_style)) story.append(Spacer(1, 0.1*inch)) story.append(Paragraph('PHYSIOLOGY', title_style)) story.append(Paragraph('Complete Topic-wise Study Notes', sub_style)) story.append(HRFlowable(width="90%", thickness=3, color=colors.HexColor('#1a237e'), hAlign='CENTER')) story.append(Spacer(1, 0.3*inch)) story.append(Paragraph('Based on: Dr. Mayur Sayta SMCI Physiology Notes (140 pages)', ParagraphStyle('cov', parent=styles['Normal'], fontSize=10, alignment=TA_CENTER, textColor=colors.HexColor('#37474f')))) story.append(Spacer(1, 0.15*inch)) # Topic index table tdata = [ ['#', 'TOPIC', '#', 'TOPIC'], ['1', 'Homeostasis', '17', 'Hypothalamus Functions'], ['2', 'Action Potential', '18', 'Limbic System & Emotion'], ['3', 'NMJ & EF-C Coupling', '19', 'Sleep & EEG'], ['4', 'Nerve Injury', '20', 'Basal Ganglia'], ['5', 'Myelinogenesis', '21', 'Aphasia & Speech'], ['6', 'Hematology & Anemia', '22', 'Taste & Smell Pathways'], ['7', 'RH Antigen & Blood Groups', '23', 'Vision & Colour Vision'], ['8', 'Hemoglobin & O2 Transport', '24', 'After Images'], ['9', 'Cardiac Cycle', '25', 'Lactation'], ['10', 'Cardiac Output', '26', 'Menstruation & Menopause'], ['11', 'Hypertension & Reflexes', '27', 'Pituitary (GH, ADH, Oxytocin)'], ['12', 'Cyanosis', '28', 'Thyroid & Parathyroid'], ['13', 'Hypoxia & CO Poisoning', '29', 'Adrenal Glands'], ['14', 'High Altitude & Deep Sea', '30', 'Acromegaly, Gigantism, Tetany'], ['15', 'Counter Current Mechanism', '31', 'Blood Brain Barrier'], ['16', 'Micturition Reflex', '32', 'VO2 Max & Brain Death'], ] story += tbl(tdata, [1*cm, 7.5*cm, 1*cm, 7.5*cm]) story.append(PageBreak()) # ===== TOPIC 1: HOMEOSTASIS ===== story += ch('TOPIC 1: HOMEOSTASIS') story += sec('Definition') story += body('Homeostasis is the ability of the body to maintain a relatively stable internal environment despite changes in the external environment.') story += sec('Key Points') story += bul('Term coined by Walter Cannon (1929)') story += bul('Claude Bernard first described "Milieu Intérieur" - the internal environment') story += bul('Internal environment = Extracellular Fluid (ECF)') story += bul('Maintained by negative feedback mechanisms') story += sec('Feedback Mechanisms') story += imp('Negative Feedback (Most Important):') story += bul('Response OPPOSES the original change - brings variable back to set point') story += bul('Example 1: Body temperature ↑ → sweating → temperature ↓') story += bul('Example 2: Blood glucose ↑ → insulin release → glucose ↓') story += bul('Example 3: BP ↑ → baroreceptors → heart rate ↓ → BP ↓') story += imp('Positive Feedback (Amplification):') story += bul('Response REINFORCES the original change') story += bul('Example 1: Childbirth - oxytocin → contractions → more oxytocin') story += bul('Example 2: Blood clotting cascade') story += bul('Example 3: Depolarization during Action Potential') story += sec('Variables Maintained') story += tbl([ ['Variable', 'Normal Value', 'Regulated By'], ['Body Temperature', '37°C', 'Hypothalamus'], ['Blood pH', '7.35-7.45', 'Lungs + Kidneys'], ['Blood Glucose', '70-110 mg/dL', 'Insulin/Glucagon'], ['Blood Pressure', '120/80 mmHg', 'Baroreceptors/Kidneys'], ['Plasma Osmolarity', '285-295 mOsm/L', 'ADH/Kidneys'], ['Blood Na+', '135-145 mEq/L', 'Aldosterone'], ], [5*cm, 5*cm, 7*cm]) story += note('Homeostasis disturbance = Disease. All medical conditions are essentially failures of homeostasis.') story.append(PageBreak()) # ===== TOPIC 2: ACTION POTENTIAL ===== story += ch('TOPIC 2: ACTION POTENTIAL (AP)') ap_content = get_pages([5, 6]) story += sec('Definition') story += body('Action potential is a series of electrical changes that occur in the membrane potential when nerve/muscle is stimulated.') story += sec('Resting Membrane Potential (RMP)') story += bul('RMP = -70 mV (neurons) | -90 mV (skeletal muscle) | -85 mV (cardiac muscle)') story += bul('Inside is NEGATIVE, outside is POSITIVE') story += bul('Maintained by: Na+/K+ ATPase pump (3 Na+ out, 2 K+ in)') story += bul('K+ leak channels keep inside negative') story += sec('Phases of Action Potential') story += tbl([ ['Phase', 'mV Change', 'Ion Channel Event'], ['Rising (Depolarization)', '-70 → +30 mV', 'Voltage-gated Na+ channels OPEN → Na+ rushes IN'], ['Falling (Repolarization)', '+30 → -70 mV', 'Na+ channels inactivate, K+ channels OPEN → K+ rushes OUT'], ['After-hyperpolarization', 'Below -70 mV', 'K+ channels slow to close → extra K+ out'], ['Return to RMP', '-70 mV', 'Na+/K+ pump restores balance'], ], [4*cm, 3.5*cm, 9.5*cm]) story += sec('Refractory Periods') story += imp('Absolute Refractory Period (ARP):') story += bul('No stimulus can produce another AP - Na+ channels are inactivated') story += bul('Duration: 1-2 ms in neurons') story += bul('Ensures one-way conduction') story += imp('Relative Refractory Period (RRP):') story += bul('Stronger than normal stimulus needed') story += bul('Some Na+ channels have recovered') story += sec('Conduction of Nerve Impulse') story += bul('Local circuit currents flow ahead of AP') story += bul('Myelinated nerves: Saltatory conduction (at Nodes of Ranvier) - FASTER') story += bul('Unmyelinated nerves: Continuous conduction - SLOWER') story += bul('Conduction velocity: Aα (70-120 m/s) > Aβ > Aδ > C (0.5-2 m/s)') for line in clean_page_text(ap_content): if len(line) > 10 and 'Physiology' not in line: story += bul(line) story.append(PageBreak()) # ===== TOPIC 3: NMJ & EF-C COUPLING ===== story += ch('TOPIC 3: NEUROMUSCULAR JUNCTION (NMJ) & EXCITATION-CONTRACTION COUPLING') nmj_content = get_pages([9]) story += sec('Neuromuscular Junction (NMJ)') story += body('NMJ is the synapse between a motor nerve fiber and a skeletal muscle fiber.') story += sec('Components of NMJ') story += bul('Motor nerve terminal (presynaptic)') story += bul('Synaptic cleft (50 nm gap)') story += bul('Motor end plate (postsynaptic - muscle membrane)') story += sec('Events at NMJ') story += tbl([ ['Step', 'Event'], ['1', 'AP arrives at nerve terminal'], ['2', 'Voltage-gated Ca2+ channels open → Ca2+ enters'], ['3', 'Acetylcholine (ACh) released from vesicles'], ['4', 'ACh crosses synaptic cleft'], ['5', 'ACh binds to nicotinic receptors on motor end plate'], ['6', 'Na+ influx → End Plate Potential (EPP) generated'], ['7', 'EPP → AP in muscle fiber'], ['8', 'AChE (Acetylcholinesterase) breaks down ACh'], ], [1.5*cm, 15.5*cm]) story += sec('Myasthenia Gravis (Clinical Application)') for line in clean_page_text(nmj_content): if len(line) > 10: story += bul(line) story += note('Myasthenia Gravis = Autoimmune disease. Antibodies against nicotinic ACh receptors → muscle weakness. Treated with anticholinesterase drugs (Neostigmine).') story += sec('Excitation-Contraction (E-C) Coupling / EF-C Coupling') story += body('E-C coupling is the process by which the electrical signal (AP) in the muscle membrane triggers mechanical contraction.') story += tbl([ ['Step', 'Event'], ['1', 'AP travels along sarcolemma and down T-tubules'], ['2', 'T-tubule AP activates DHP receptors (voltage sensors)'], ['3', 'DHP receptors open Ryanodine receptors on SR (sarcoplasmic reticulum)'], ['4', 'Ca2+ released from SR → [Ca2+] rises from 10-7 to 10-5 M'], ['5', 'Ca2+ binds to Troponin C → conformational change'], ['6', 'Troponin-Tropomyosin moves → actin binding sites exposed'], ['7', 'Myosin heads bind actin → Cross-bridge formation'], ['8', 'Power stroke → muscle shortens (Sliding Filament Theory)'], ['9', 'Ca2+ pumped back to SR by Ca2+ ATPase → relaxation'], ], [1.5*cm, 15.5*cm]) story.append(PageBreak()) # ===== TOPIC 4: NERVE INJURY ===== story += ch('TOPIC 4: NERVE INJURY & MYELINOGENESIS') nerve_content = get_pages([89, 90]) story += sec('Classification of Nerve Injury (Seddon)') story += tbl([ ['Type', 'Description', 'Recovery'], ['Neuropraxia', 'Conduction block only, axon intact', 'Complete, weeks'], ['Axonotmesis', 'Axon cut, epineurium intact', 'Complete, months'], ['Neurotmesis', 'Complete nerve transection', 'Incomplete/surgery needed'], ], [4*cm, 8*cm, 5*cm]) story += sec('Wallerian Degeneration (Distal Segment)') story += bul('Occurs in distal segment (cut from cell body)') story += bul('Myelin breaks down → lipid droplets') story += bul('Axon fragments and degenerates') story += bul('Schwann cells proliferate → form Bands of Büngner (guide regeneration)') story += bul('Macrophages remove debris') story += sec('Chromatolysis (Proximal Segment / Cell Body Changes)') for line in clean_page_text(nerve_content): if len(line) > 10: story += bul(line) story += sec('Nerve Regeneration') story += bul('Rate: ~1-3 mm per day (1 inch per month)') story += bul('Axon sprouts grow down Bands of Büngner') story += bul('Re-myelination by Schwann cells') story += imp('MYELINOGENESIS') story += bul('Process of formation of myelin sheath') story += bul('In PNS: Schwann cells form myelin') story += bul('In CNS: Oligodendrocytes form myelin') story += bul('One Schwann cell myelinates ONE axon') story += bul('One oligodendrocyte myelinates MULTIPLE axons (up to 50)') story += bul('Myelin composition: 80% lipid (cholesterol, phospholipids), 20% protein') story.append(PageBreak()) # ===== TOPIC 5: HEMATOLOGY ===== story += ch('TOPIC 5: HEMATOLOGY - BLOOD, ERYTHROPOIESIS, ANEMIA, HEMOGLOBIN') blood_content = get_pages([11, 12, 13, 14, 15, 16, 17, 18]) story += sec('Functions of Blood (from PDF)') for line in clean_page_text(get_pages([11])): if len(line) > 10: story += bul(line) story += sec('Plasma Proteins') for line in clean_page_text(get_pages([13])): if len(line) > 10: story += bul(line) story += sec('Erythropoiesis') story += imp('Definition: Process of RBC formation in red bone marrow') story += tbl([ ['Stage', 'Features'], ['1. Proerythroblast', 'Large cell, no Hb, large nucleus'], ['2. Early Normoblast', 'Hb starts forming (basophilic)'], ['3. Intermediate Normoblast', 'More Hb, polychromatic'], ['4. Late Normoblast', 'Nucleus shrinks, Hb fills cell'], ['5. Reticulocyte', 'Nucleus extruded, RNA remains, 1-2 days in blood'], ['6. Mature RBC', 'Biconcave disc, no nucleus, 120 days lifespan'], ], [5*cm, 12*cm]) story += sec('Factors for Erythropoiesis') for line in clean_page_text(get_pages([15, 16])): if len(line) > 10: story += bul(line) story += sec('Hemoglobin') story += bul('Hemoglobin = 4 globin chains + 4 heme groups') story += bul('Each heme = protoporphyrin ring + Fe2+ (ferrous iron)') story += bul('Each Hb molecule carries 4 O2 molecules') story += bul('Normal Hb: Adult HbA (α2β2), HbA2 (α2δ2), HbF (α2γ2)') story += bul('Normal values: Male = 14-18 g/dL, Female = 12-16 g/dL') story += sec('Anemia - Definition, Types, and Causes') story += imp('Anemia = Reduced oxygen-carrying capacity of blood (low RBC/Hb/Hematocrit)') for line in clean_page_text(get_pages([17, 18])): if len(line) > 10: story += bul(line) story += sec('Iron Deficiency Anemia vs Megaloblastic Anemia') story += tbl([ ['Feature', 'Iron Deficiency', 'Megaloblastic (B12/Folate)'], ['RBC Type', 'Microcytic, Hypochromic', 'Macrocytic, Normochromic'], ['MCV', 'Low (<80 fL)', 'High (>100 fL)'], ['Cause', 'Low dietary Fe, blood loss', 'Lack of B12/Folate/Intrinsic Factor'], ['Smear', 'Pencil cells, Anisopoikilocytosis', 'Hypersegmented neutrophils'], ], [3.5*cm, 6.5*cm, 7*cm]) story.append(PageBreak()) # ===== TOPIC 6: RH ANTIGEN, BLOOD GROUPS, BLOOD THINNERS ===== story += ch('TOPIC 6: RH ANTIGEN, BLOOD GROUPS & BLOOD THINNERS') rh_content = get_pages([25, 26, 27]) story += sec('ABO Blood Group System') story += tbl([ ['Blood Group', 'Antigen on RBC', 'Antibody in Plasma', 'Can Donate To', 'Can Receive From'], ['A', 'A antigen', 'Anti-B', 'A, AB', 'A, O'], ['B', 'B antigen', 'Anti-A', 'B, AB', 'B, O'], ['AB', 'A and B', 'None', 'AB only', 'All groups'], ['O', 'None', 'Anti-A and Anti-B', 'All groups', 'O only'], ], [2.5*cm, 3.5*cm, 3.5*cm, 3.5*cm, 4*cm]) story += imp('O = Universal Donor | AB = Universal Recipient') story += sec('Rh Blood Group System') story += bul('Rh factor = Rhesus antigen (D antigen is most important)') story += bul('Rh positive (Rh+): Has D antigen (85% of population)') story += bul('Rh negative (Rh-): No D antigen (15% of population)') story += bul('Anti-D antibody forms only after sensitization (exposure to Rh+ blood)') story += bul('IgG type antibody - can cross placenta') story += sec('Erythroblastosis Fetalis (Hemolytic Disease of Newborn)') for line in clean_page_text(get_pages([26, 27])): if len(line) > 10: story += bul(line) story += imp('Prevention: Anti-D (Rho-GAM) given to Rh- mother within 72 hrs of delivery') story += sec('Blood Thinners / Anticoagulants') for line in clean_page_text(get_pages([23, 24])): if len(line) > 10: story += bul(line) story += tbl([ ['Anticoagulant', 'Mechanism', 'Use'], ['Heparin', 'Activates antithrombin III → inactivates thrombin and Xa', 'Immediate anticoagulation'], ['Warfarin', 'Inhibits Vitamin K → reduces II, VII, IX, X', 'Long-term oral anticoagulation'], ['EDTA', 'Chelates Ca2+', 'Lab specimen preservation'], ['Citrate/Oxalate', 'Binds Ca2+', 'Blood banking'], ], [3.5*cm, 8*cm, 5.5*cm]) story.append(PageBreak()) # ===== TOPIC 7: CARDIAC CYCLE ===== story += ch('TOPIC 7: CARDIAC CYCLE, OUTPUT & HYPERTENSION') cardiac_content = get_pages([62, 63, 64, 65, 66, 67, 68, 69]) story += sec('Cardiac Cycle') story += body('Sequence of events in one complete heartbeat (systole + diastole). Duration = 0.8 sec at 75 bpm.') story += tbl([ ['Phase', 'Duration', 'Valve Status', 'Key Event'], ['Atrial Systole', '0.1 sec', 'AV open, SL closed', 'Atria contract → 25-30% extra ventricular filling'], ['Isovolumetric Contraction', '0.05 sec', 'All valves CLOSED', 'Pressure rises, no volume change; 1st heart sound'], ['Rapid Ejection', '0.09 sec', 'SL valves OPEN', '70% of stroke volume ejected'], ['Reduced Ejection', '0.13 sec', 'SL open', 'Remaining 30% ejected'], ['Isovolumetric Relaxation', '0.08 sec', 'All valves CLOSED', 'Pressure falls, no volume change; 2nd heart sound'], ['Rapid Ventricular Filling', '0.11 sec', 'AV valves OPEN', '70% of filling occurs; 3rd heart sound'], ['Slow Filling (Diastasis)', '0.19 sec', 'AV open', 'Gradual filling'], ], [4*cm, 2.5*cm, 3.5*cm, 7*cm]) story += sec('Cardiac Output (CO)') for line in clean_page_text(get_pages([68])): if len(line) > 10: story += bul(line) story += imp('CO = Heart Rate × Stroke Volume = 72 × 70 = ~5040 mL/min (~5 L/min)') story += bul('Stroke Volume = EDV - ESV = 120 - 50 = 70 mL') story += bul('Ejection Fraction (EF) = SV/EDV = 70/120 = 58% (Normal > 55%)') story += bul('Cardiac Index = CO / BSA = 3.2 L/min/m² (normal)') story += sec('Factors Affecting Cardiac Output') story += tbl([ ['Factor', 'Effect on CO', 'Mechanism'], ['Preload ↑', 'CO ↑', 'Frank-Starling Law - more stretch → more force'], ['Afterload ↑', 'CO ↓', 'Increased resistance to ejection'], ['HR ↑', 'CO ↑', 'More beats/min'], ['Contractility ↑', 'CO ↑', 'Sympathetic stimulation, Ca2+'], ['Venous return ↑', 'CO ↑', 'More preload via Starling'], ], [3.5*cm, 3.5*cm, 10*cm]) story += sec('Hypertension') story += imp('Hypertension = Persistent BP > 140/90 mmHg') story += tbl([ ['Stage', 'Systolic', 'Diastolic'], ['Normal', '<120 mmHg', '<80 mmHg'], ['Elevated', '120-129', '<80'], ['Stage 1 HTN', '130-139', '80-89'], ['Stage 2 HTN', '≥140', '≥90'], ['Hypertensive Crisis', '>180', '>120'], ], [5*cm, 6*cm, 6*cm]) story += sec('Heart Sounds') for line in clean_page_text(get_pages([67])): if len(line) > 10: story += bul(line) story.append(PageBreak()) # ===== TOPIC 8: CYANOSIS, HYPOXIA, CO POISONING ===== story += ch('TOPIC 8: CYANOSIS, HYPOXIA & CO POISONING') cyan_content = get_pages([44, 45, 46]) story += sec('Hypoxia - Definition & Types') for line in clean_page_text(get_pages([44, 45])): if len(line) > 10: story += bul(line) story += tbl([ ['Type', 'Cause', 'PaO2', 'SaO2', 'a-v O2 diff'], ['Hypoxic Hypoxia', 'Low PO2 (altitude, drowning)', 'Low', 'Low', 'Normal'], ['Anemic Hypoxia', 'Low Hb (anemia, CO poisoning)', 'Normal', 'Normal', 'Low'], ['Stagnant/Circulatory', 'Low blood flow (cardiac failure)', 'Normal', 'Normal', 'High'], ['Histotoxic Hypoxia', 'Cells cannot use O2 (cyanide)', 'Normal', 'Normal', 'Low (high venous)'], ], [4*cm, 5*cm, 3*cm, 2.5*cm, 2.5*cm]) story += sec('Cyanosis') for line in clean_page_text(get_pages([46])): if len(line) > 10: story += bul(line) story += imp('Cyanosis appears when reduced Hb > 5 g/dL in capillary blood') story += tbl([ ['Type', 'Site', 'Cause', 'Temperature'], ['Central Cyanosis', 'Lips, tongue, mucous membranes', 'Low arterial SaO2', 'Warm'], ['Peripheral Cyanosis', 'Fingers, toes, nail beds', 'Slow circulation → more O2 extraction', 'Cold'], ], [4*cm, 5*cm, 5*cm, 3*cm]) story += sec('CO Poisoning (Carbon Monoxide)') story += imp('CO binds Hb 200-250x more avidly than O2 → forms Carboxyhemoglobin (COHb)') story += bul('Source: Incomplete combustion (car exhaust, coal fires)') story += bul('COHb is bright cherry-red color → "Cherry red" skin (paradoxically)') story += bul('Causes ANEMIC hypoxia + left shift of O2 dissociation curve') story += bul('Treatment: 100% O2 (reduces CO half-life from 5 hrs to 1 hr)') story += bul('Hyperbaric O2 if severe (CO half-life drops to 20 min)') story.append(PageBreak()) # ===== TOPIC 9: HIGH ALTITUDE & DEEP SEA ===== story += ch('TOPIC 9: HIGH ALTITUDE & DEEP SEA PHYSIOLOGY') altitude_content = get_pages([47, 48, 49]) story += sec('High Altitude Physiology') story += body('At high altitude, atmospheric PO2 falls → hypoxia → physiological adaptations.') story += imp('Acclimatization Responses:') for line in clean_page_text(altitude_content): if len(line) > 10: story += bul(line) story += tbl([ ['Adaptation', 'Mechanism', 'Time Course'], ['↑ Ventilation rate', 'Hypoxic ventilatory response (peripheral chemoreceptors)', 'Minutes'], ['↑ Erythropoietin', 'Kidney secretes EPO → ↑ RBC production', 'Days'], ['↑ 2,3-BPG in RBCs', 'Right shift of O2-Hb curve → better O2 release', 'Hours-Days'], ['Polycythemia', 'More RBCs to carry O2', '1-2 weeks'], ['Hyperventilation', 'Respiratory alkalosis → compensated by kidney', 'Days'], ['↑ Capillary density', 'Angiogenesis in muscles', 'Weeks'], ], [4.5*cm, 8*cm, 4.5*cm]) story += sec('Mountain Sickness') story += bul('Acute Mountain Sickness (AMS): Headache, nausea, dizziness (>2500m)') story += bul('High Altitude Pulmonary Edema (HAPE): Most dangerous - pulmonary HTN, pink frothy sputum') story += bul('High Altitude Cerebral Edema (HACE): Severe headache, ataxia, altered consciousness') story += bul('Treatment: Descend, O2, Acetazolamide (carbonic anhydrase inhibitor), Dexamethasone') story += sec('Deep Sea / Decompression Sickness') for line in clean_page_text(get_pages([48, 49])): if len(line) > 10: story += bul(line) story += imp("Caisson's Disease / 'Bends': N2 dissolved under pressure forms bubbles on rapid ascent") story += bul('Symptoms: Joint pain (bends), chest pain (chokes), neurological symptoms') story += bul('Treatment: Recompression in hyperbaric chamber, then slow decompression') story.append(PageBreak()) # ===== TOPIC 10: COUNTER CURRENT, MICTURITION, OSMOTIC DIALYSIS ===== story += ch('TOPIC 10: COUNTER-CURRENT MECHANISM, MICTURITION & OSMOTIC DIALYSIS') kidney_content = get_pages([51, 52, 53, 54, 55, 56, 57, 58, 59]) story += sec('Counter-Current Mechanism') story += body('Counter-current mechanism in the kidney concentrates urine by creating an osmotic gradient in the medulla.') story += imp('Counter-Current Multiplier (Loop of Henle):') story += bul('Ascending limb actively pumps Na+Cl- out (but impermeable to water)') story += bul('Descending limb is permeable to water (water leaves)') story += bul('Creates medullary hyperosmolarity (300→1200 mOsm/L from cortex to papilla)') story += imp('Counter-Current Exchanger (Vasa Recta):') story += bul('Blood vessels running parallel in opposite directions') story += bul('Prevents washing out of medullary gradient') story += bul('Urea recycling contributes to deep medullary concentration') story += sec('Nephron Structure') for line in clean_page_text(get_pages([53])): if len(line) > 10: story += bul(line) story += sec('Micturition Reflex') for line in clean_page_text(get_pages([59])): if len(line) > 10: story += bul(line) story += imp('Micturition Reflex Path:') story += bul('Bladder fills → stretch receptors activated → signals to micturition center (S2-S4)') story += bul('Parasympathetic: Detrusor contraction + internal sphincter relaxation') story += bul('Somatic (voluntary): External sphincter relaxation') story += bul('Voluntary control from higher centers (pontine micturition center)') story += sec('Osmotic Dialysis / Dialysis Principle') story += bul('Dialysis = removal of waste from blood using semipermeable membrane') story += bul('Hemodialysis: Blood flows across dialysate across artificial membrane') story += bul('Peritoneal dialysis: Peritoneum acts as natural membrane') story += bul('CAPD = Continuous Ambulatory Peritoneal Dialysis') story.append(PageBreak()) # ===== TOPIC 11: HYPOTHALAMUS & VEGETATIVE FUNCTIONS ===== story += ch('TOPIC 11: HYPOTHALAMUS - VEGETATIVE FUNCTIONS') hypo_content = get_pages([92, 93]) story += sec('Functions of Hypothalamus') story += body('Hypothalamus is the master controller of homeostasis and autonomic functions.') for line in clean_page_text(get_pages([92])): if len(line) > 10: story += bul(line) story += sec('Temperature Regulation') for line in clean_page_text(get_pages([93])): if len(line) > 10: story += bul(line) story += tbl([ ['Function', 'Mechanism'], ['Temperature regulation', 'Heat loss center (anterior) + Heat gain center (posterior)'], ['Hunger/Satiety', 'Lateral = hunger center; Ventromedial = satiety center'], ['Thirst', 'Osmoreceptors → drinking behavior'], ['Sleep-Wake Cycle', 'Controls circadian rhythms via SCN'], ['Autonomic control', 'Anterior = parasympathetic; Posterior = sympathetic'], ['Endocrine control', 'Releases releasing/inhibiting hormones for pituitary'], ['Emotion', 'Part of limbic system'], ['Water balance', 'ADH release from posterior pituitary'], ['Lactation', 'Oxytocin release → milk ejection reflex'], ], [5*cm, 12*cm]) story += sec('Blood Brain Barrier (BBB)') story += imp('BBB = selective barrier between blood and brain tissue') story += bul('Components: Tight junctions between capillary endothelial cells, astrocyte foot processes, basement membrane') story += bul('PERMEABLE to: O2, CO2, glucose (via GLUT1), lipid-soluble drugs, alcohol, caffeine') story += bul('IMPERMEABLE to: Large molecules, proteins, most drugs, polar compounds') story += bul('ABSENT at: Area postrema (vomiting center), hypothalamus nuclei, pineal gland, neurohypophysis') story += bul('Circumventricular organs have fenestrated capillaries (no BBB)') story += note('Neurophysin protein stays in brain - some nuclei near blood; BBB absent in hypothalamic nuclei allows hormones to reach circulation.') story.append(PageBreak()) # ===== TOPIC 12: SLEEP & CIRCADIAN RHYTHM ===== story += ch('TOPIC 12: SLEEP, EEG & CIRCADIAN RHYTHM') sleep_content = get_pages([100, 101, 102, 103, 104]) story += sec('Physiological Changes During Sleep') for line in clean_page_text(get_pages([100])): if len(line) > 10: story += bul(line) story += sec('Types of Sleep') for line in clean_page_text(get_pages([101])): if len(line) > 10: story += bul(line) story += tbl([ ['Feature', 'NREM Sleep', 'REM Sleep'], ['EEG', 'Slow, high amplitude waves', 'Fast, low amplitude (like awake)'], ['Eye movements', 'Absent', 'Rapid eye movements present'], ['Dreams', 'Rare', 'Vivid dreams occur'], ['HR/BP', 'Decreased', 'Variable/increased'], ['Muscle tone', 'Decreased', 'Almost absent (atonia)'], ['Duration/cycle', 'Stages 1-4, 75% of sleep', '25% of sleep, ~90 min cycles'], ['Growth Hormone', 'Released in Stage 3-4', 'Not released'], ], [5*cm, 6*cm, 6*cm]) story += sec('EEG Waves') story += tbl([ ['Wave', 'Frequency', 'Amplitude', 'State'], ['Alpha (α)', '8-13 Hz', 'Medium', 'Relaxed, eyes closed, awake'], ['Beta (β)', '13-30 Hz', 'Low', 'Alert, active thinking'], ['Theta (θ)', '4-7 Hz', 'Medium', 'Drowsy, NREM Stage 1-2'], ['Delta (δ)', '0.5-4 Hz', 'High', 'Deep sleep (Stage 3-4), anesthesia'], ], [3*cm, 3.5*cm, 3.5*cm, 7*cm]) for line in clean_page_text(get_pages([103, 104])): if len(line) > 10: story += bul(line) story += sec('Circadian Rhythm / Biological Clock') story += imp('Suprachiasmatic Nucleus (SCN) of hypothalamus = master clock') story += bul('SCN receives light signals from retina via retinohypothalamic tract') story += bul('Controls melatonin secretion from pineal gland') story += bul('Melatonin: High at night → promotes sleep, low during day') story += bul('Circadian rhythm ~ 24 hours (circadian = "about a day")') story += bul('Controls temperature, cortisol, growth hormone, sleep-wake cycles') story.append(PageBreak()) print("Part 2 built - story has", len(story), "elements") PYEOF echo "Exit: $?"
cd /tmp/workspace && python3 << 'PYEOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch, cm from reportlab.lib import colors from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, Table, TableStyle, HRFlowable, PageBreak from reportlab.lib.enums import TA_CENTER, TA_LEFT, TA_JUSTIFY import pdfplumber # Extract full PDF content all_pages = {} with pdfplumber.open('attachments/88dfc7a0-0957-4572-ac2f-8f41914d5aa9/Physiology Notes.pdf') as pdf: for i, page in enumerate(pdf.pages): text = page.extract_text() if text and len(text.strip()) > 30: lines = text.split('\n') clean_lines = [l for l in lines if 'SMCI' not in l and 'Sayta' not in l and 'www.smci' not in l and '9714941350' not in l] clean_text = '\n'.join(clean_lines).strip() if len(clean_text) > 20: all_pages[i+1] = clean_text def get_pages(page_range): texts = [] for pg in page_range: if pg in all_pages: texts.append(all_pages[pg]) return '\n'.join(texts) def clean_page_text(text): lines = [] for l in text.split('\n'): l = l.strip() if l and len(l) > 3 and l != 'Physiology': lines.append(l) return lines doc = SimpleDocTemplate( 'physiology-pdf/MBBS_Physiology_1st_Year_Notes.pdf', pagesize=A4, rightMargin=1.5*cm, leftMargin=1.5*cm, topMargin=1.5*cm, bottomMargin=1.5*cm, ) styles = getSampleStyleSheet() title_style = ParagraphStyle('TitleS', parent=styles['Title'], fontSize=26, spaceAfter=12, textColor=colors.HexColor('#1a237e'), fontName='Helvetica-Bold', alignment=TA_CENTER) sub_style = ParagraphStyle('SubS', parent=styles['Normal'], fontSize=13, spaceAfter=8, textColor=colors.HexColor('#5c6bc0'), fontName='Helvetica-Oblique', alignment=TA_CENTER) chapter_style = ParagraphStyle('ChapS', parent=styles['Heading1'], fontSize=15, spaceAfter=8, spaceBefore=4, textColor=colors.white, fontName='Helvetica-Bold', backColor=colors.HexColor('#1565c0'), borderPadding=(8,8,8,8)) section_style = ParagraphStyle('SecS', parent=styles['Heading2'], fontSize=12, spaceAfter=5, spaceBefore=10, textColor=colors.HexColor('#1565c0'), fontName='Helvetica-Bold') body_style = ParagraphStyle('BodyS', parent=styles['Normal'], fontSize=10, spaceAfter=3, leading=14, alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('BulletS', parent=styles['Normal'], fontSize=10, spaceAfter=2, leading=13, leftIndent=12) imp_style = ParagraphStyle('ImpS', parent=styles['Normal'], fontSize=10, spaceAfter=3, leading=13, fontName='Helvetica-Bold', textColor=colors.HexColor('#b71c1c')) note_style = ParagraphStyle('NoteS', parent=styles['Normal'], fontSize=9, spaceAfter=3, leading=12, textColor=colors.HexColor('#4a148c'), fontName='Helvetica-Oblique') def ch(title): return [Spacer(1,6), Paragraph(f' {title}', chapter_style), Spacer(1,6)] def sec(title): return [Paragraph(title, section_style)] def body(text): return [Paragraph(text, body_style)] def bul(text): return [Paragraph(f' * {text}', bullet_style)] def imp(text): return [Paragraph(f'>>> {text}', imp_style)] def note(text): return [Paragraph(f'[NOTE] {text}', note_style)] def tbl(data, col_widths=None): if col_widths is None: n = len(data[0]) col_widths = [17*cm/n] * n t = Table(data, colWidths=col_widths, repeatRows=1) t.setStyle(TableStyle([ ('BACKGROUND', (0,0), (-1,0), colors.HexColor('#1565c0')), ('TEXTCOLOR', (0,0), (-1,0), colors.white), ('FONTNAME', (0,0), (-1,0), 'Helvetica-Bold'), ('FONTNAME', (0,1), (-1,-1), 'Helvetica'), ('FONTSIZE', (0,0), (-1,-1), 9), ('PADDING', (0,0), (-1,-1), 5), ('GRID', (0,0), (-1,-1), 0.5, colors.HexColor('#90caf9')), ('ROWBACKGROUNDS', (0,1), (-1,-1), [colors.white, colors.HexColor('#e3f2fd')]), ('VALIGN', (0,0), (-1,-1), 'TOP'), ('WORDWRAP', (0,0), (-1,-1), True), ])) return [t, Spacer(1,4)] story = [] # ======== COVER PAGE ======== story.append(Spacer(1, 0.8*inch)) story.append(Paragraph('MBBS 1st Professional Examination', sub_style)) story.append(Paragraph('PHYSIOLOGY', title_style)) story.append(Paragraph('Complete Topic-wise Exam Notes', sub_style)) story.append(HRFlowable(width="90%", thickness=3, color=colors.HexColor('#1a237e'), hAlign='CENTER')) story.append(Spacer(1, 0.2*inch)) story.append(Paragraph('Based on: Dr. Mayur Sayta SMCI Physiology Notes (140 pages) + Standard Medical Textbooks', ParagraphStyle('cov', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.grey))) story.append(Spacer(1, 0.15*inch)) tdata = [['#', 'TOPIC', '#', 'TOPIC'], ['1', 'Homeostasis', '17', 'Hypothalamus Functions & BBB'], ['2', 'Action Potential (AP)', '18', 'Limbic System & Emotion Circuit'], ['3', 'NMJ & EF-C Coupling', '19', 'Sleep, EEG & Circadian Rhythm'], ['4', 'Nerve Injury & Myelinogenesis', '20', 'Basal Ganglia & Disorders'], ['5', 'Hematology & Erythropoiesis', '21', 'Aphasia & Speech'], ['6', 'Anemia & Hemoglobin', '22', 'Taste & Smell Pathways'], ['7', 'RH Antigen & Blood Groups', '23', 'Colour Vision & Vision Pathway'], ['8', 'Blood Thinners & Coagulation', '24', '+ve/-ve After Image & VO2 Max'], ['9', 'Cardiac Cycle & Heart Sounds', '25', 'Lactation'], ['10', 'Cardiac Output & Hypertension', '26', 'Menstruation, Cryptorchidism & Menopause'], ['11', 'Cyanosis', '27', 'Pituitary: GH, ADH, Oxytocin'], ['12', 'Hypoxia & CO Poisoning', '28', 'Thyroid & Parathyroid'], ['13', 'High Altitude Physiology', '29', 'Adrenal Glands & Disorders'], ['14', 'Deep Sea & Decompression', '30', 'Acromegaly, Gigantism & Tetany'], ['15', 'Counter Current Mechanism', '31', 'Brain Death'], ['16', 'Micturition Reflex', '32', 'Neurotransmitters'], ] story += tbl(tdata, [1.2*cm, 7.4*cm, 1.2*cm, 7.2*cm]) story.append(PageBreak()) # ===== 1. HOMEOSTASIS ===== story += ch('1. HOMEOSTASIS') story += sec('Definition & Key Concepts') story += body('Homeostasis = maintenance of stable internal environment despite external changes.') story += bul('Coined by Walter Cannon (1929) | Claude Bernard - Milieu Interieur') story += bul('Internal environment = Extracellular Fluid (ECF) surrounding cells') story += sec('Feedback Mechanisms') story += imp('Negative Feedback (Most Common - brings back to normal):') story += bul('Thermoregulation: Temp rises -> sweating -> temp falls') story += bul('Blood glucose: Glucose rises -> insulin -> glucose falls') story += bul('Blood pressure: BP rises -> baroreceptors -> HR down -> BP falls') story += imp('Positive Feedback (Amplifies change):') story += bul('Childbirth: Oxytocin -> uterine contraction -> more oxytocin') story += bul('Blood clotting cascade | Action potential depolarization phase') story += sec('Key Values Maintained') story += tbl([['Variable','Normal'],['Body Temp','37 deg C'],['Blood pH','7.35-7.45'], ['Blood glucose','70-110 mg/dL'],['BP','120/80 mmHg'],['Na+','135-145 mEq/L']], [8*cm, 9*cm]) story.append(PageBreak()) # ===== 2. ACTION POTENTIAL ===== story += ch('2. ACTION POTENTIAL (AP)') story += sec('Definition') story += body('AP = series of electrical changes in membrane potential when nerve/muscle is stimulated.') story += sec('Resting Membrane Potential (RMP)') story += bul('RMP = -70 mV in neurons | -90 mV skeletal muscle | -85 mV cardiac muscle') story += bul('Inside NEGATIVE, outside POSITIVE') story += bul('Maintained by Na+/K+ ATPase pump: pumps 3 Na+ OUT, 2 K+ IN') story += bul('K+ leak channels also contribute to negativity') story += sec('Phases') story += tbl([ ['Phase', 'mV', 'Ion Event'], ['Depolarization', '-70 to +30 mV', 'Voltage-gated Na+ channels OPEN, Na+ rushes IN'], ['Repolarization', '+30 to -70 mV', 'K+ channels open, K+ rushes OUT; Na+ channels inactivate'], ['After-hyperpolarization', 'Below -70 mV', 'K+ channels close slowly'], ['Return to RMP', '-70 mV', 'Na+/K+ pump restores balance'], ], [4*cm, 3*cm, 10*cm]) story += sec('Refractory Periods') story += imp('Absolute Refractory Period (ARP): No AP possible - Na+ channels inactivated') story += imp('Relative Refractory Period (RRP): AP possible with stronger stimulus') story += bul('ARP ensures ONE-WAY conduction of nerve impulse') story += sec('Conduction Velocity') story += tbl([ ['Fiber Type', 'Myelinated?', 'Velocity', 'Function'], ['A-alpha', 'Yes', '70-120 m/s', 'Motor to skeletal muscle, proprioception'], ['A-beta', 'Yes', '30-70 m/s', 'Touch, pressure'], ['A-delta', 'Yes', '5-30 m/s', 'Fast pain, temperature'], ['C fibers', 'No', '0.5-2 m/s', 'Slow pain, temperature, autonomic'], ], [2.5*cm, 3*cm, 3.5*cm, 8*cm]) for line in clean_page_text(get_pages([5, 6])): story += bul(line) story.append(PageBreak()) # ===== 3. NMJ & E-C COUPLING ===== story += ch('3. NMJ (NEUROMUSCULAR JUNCTION) & EF-C COUPLING') story += sec('Neuromuscular Junction') story += body('NMJ = synapse between motor nerve and skeletal muscle. Neurotransmitter = Acetylcholine (ACh).') story += sec('Events at NMJ') story += tbl([ ['Step', 'Event'], ['1', 'AP reaches presynaptic terminal'], ['2', 'Ca2+ enters via voltage-gated channels'], ['3', 'ACh vesicles fuse with membrane -> ACh released'], ['4', 'ACh crosses 50nm synaptic cleft'], ['5', 'ACh binds nicotinic receptors on motor end plate'], ['6', 'Na+ influx -> End Plate Potential (EPP)'], ['7', 'EPP triggers AP in muscle'], ['8', 'AChE destroys ACh in cleft'], ], [2*cm, 15*cm]) story += sec('Clinical: Myasthenia Gravis') for line in clean_page_text(get_pages([9])): story += bul(line) story += note('Myasthenia Gravis = Ab against ACh receptors -> muscle weakness; Rx: Neostigmine (anticholinesterase)') story += sec('Excitation-Contraction (E-C) Coupling') story += body('How AP in muscle membrane triggers mechanical contraction (Sliding Filament Theory).') story += tbl([ ['Step', 'Event'], ['1', 'AP along sarcolemma into T-tubules'], ['2', 'T-tubule activates DHP receptors (voltage sensors)'], ['3', 'DHP opens Ryanodine receptors on SR -> Ca2+ released'], ['4', 'Ca2+ rises from 10^-7 to 10^-5 M'], ['5', 'Ca2+ binds Troponin C -> moves Tropomyosin'], ['6', 'Actin active sites exposed -> Myosin head binds'], ['7', 'Power stroke -> muscle shortens'], ['8', 'ATP hydrolysis -> myosin head detaches'], ['9', 'Ca2+ pumped back into SR -> relaxation'], ], [2*cm, 15*cm]) story += sec('Sarcomere (from PDF Pages 2-4)') for line in clean_page_text(get_pages([2, 3, 4])): story += bul(line) story.append(PageBreak()) # ===== 4. NERVE INJURY ===== story += ch('4. NERVE INJURY & MYELINOGENESIS') story += sec('Classification of Nerve Injury (Seddon)') story += tbl([ ['Type', 'Pathology', 'Recovery'], ['Neuropraxia', 'Conduction block; axon intact', 'Complete in weeks'], ['Axonotmesis', 'Axon cut; epineurium intact', 'Complete in months'], ['Neurotmesis', 'Complete transection', 'Incomplete; surgery needed'], ], [4*cm, 7*cm, 6*cm]) story += sec('Wallerian Degeneration (Distal to cut)') story += bul('Myelin breaks down; axon fragments') story += bul('Schwann cells proliferate -> form Bands of Bungner') story += bul('Macrophages clean up debris') story += bul('Regeneration rate: 1-3 mm/day (~1 inch/month)') story += sec('Chromatolysis (Cell Body Changes)') for line in clean_page_text(get_pages([89, 90])): story += bul(line) story += sec('Myelinogenesis') story += imp('Process of myelin sheath formation during development') story += tbl([ ['', 'PNS (Peripheral)', 'CNS (Central)'], ['Cell type', 'Schwann cells', 'Oligodendrocytes'], ['Axons per cell', '1 axon per Schwann cell', 'Up to 50 axons per oligodendrocyte'], ['Myelin composition', '80% lipid, 20% protein', 'Same composition'], ['Regeneration', 'Possible (Schwann cells guide)', 'Limited (inhibitory factors: NogoA, MAG)'], ], [4*cm, 6.5*cm, 6.5*cm]) story.append(PageBreak()) # ===== 5. HEMATOLOGY ===== story += ch('5. HEMATOLOGY: BLOOD, ERYTHROPOIESIS, ANEMIA & HEMOGLOBIN') story += sec('Functions of Blood') for line in clean_page_text(get_pages([11])): story += bul(line) story += sec('Blood Composition') story += bul('Plasma (55%) = water + proteins + ions + nutrients + hormones') story += bul('Formed elements (45%) = RBC (99%) + WBC + Platelets') story += bul('Hematocrit = % of blood volume that is RBCs (Normal: Male 42-52%, Female 37-47%)') story += sec('Plasma Proteins') for line in clean_page_text(get_pages([13, 14])): story += bul(line) story += sec('Erythropoiesis - Stages') story += tbl([ ['Stage', 'Key Feature'], ['Proerythroblast', 'Large cell, no Hb, large nucleus'], ['Early Normoblast', 'Hb begins (basophilic)'], ['Intermediate Normoblast', 'Hb increasing, polychromatic'], ['Late Normoblast', 'Nucleus shrinks, Hb fills cell'], ['Reticulocyte', 'Nucleus extruded; RNA remains; 1-2 days in blood'], ['Mature RBC', 'Biconcave disc; no nucleus; 120 day lifespan'], ], [5*cm, 12*cm]) story += sec('Factors Required for Erythropoiesis') for line in clean_page_text(get_pages([15, 16])): story += bul(line) story += sec('Hemoglobin') story += bul('Structure: 4 globin chains + 4 heme groups; each heme has Fe2+ center') story += bul('Each Hb carries 4 O2 molecules (1 per heme)') story += bul('Types: HbA (alpha2beta2) adult | HbA2 (alpha2delta2) | HbF (alpha2gamma2) fetal') story += bul('Normal Hb: Male 14-18 g/dL, Female 12-16 g/dL') story += sec('Anemia - Classification') for line in clean_page_text(get_pages([17, 18])): story += bul(line) story += tbl([ ['Type', 'RBC Size', 'RBC Color', 'Cause'], ['Iron deficiency', 'Microcytic (<80 fL)', 'Hypochromic', 'Low iron intake/absorption, blood loss'], ['B12/Folate deficiency', 'Macrocytic (>100 fL)', 'Normochromic', 'Lack of B12/folate/intrinsic factor'], ['Aplastic anemia', 'Normocytic', 'Normochromic', 'Bone marrow failure'], ['Hemolytic anemia', 'Variable', 'Normochromic', 'Increased RBC destruction'], ['Thalassemia', 'Microcytic', 'Hypochromic', 'Defective globin chain synthesis'], ], [4*cm, 3.5*cm, 3*cm, 6.5*cm]) story.append(PageBreak()) # ===== 6. RH ANTIGEN, BLOOD GROUPS, BLOOD THINNERS ===== story += ch('6. RH ANTIGEN, BLOOD GROUPS & BLOOD THINNERS') story += sec('ABO Blood Group System') story += tbl([ ['Blood Group', 'Antigen on RBC', 'Ab in Plasma', 'Donate To', 'Receive From'], ['A', 'A antigen', 'Anti-B', 'A, AB', 'A, O'], ['B', 'B antigen', 'Anti-A', 'B, AB', 'B, O'], ['AB', 'A & B', 'None', 'AB only', 'All (Universal Recipient)'], ['O', 'None', 'Anti-A & Anti-B', 'All (Universal Donor)', 'O only'], ], [2.5*cm, 3.5*cm, 3.5*cm, 4*cm, 3.5*cm]) story += sec('Rh Blood Group & Erythroblastosis Fetalis') story += bul('D antigen = most important Rh antigen') story += bul('Rh+ = has D antigen (85% population) | Rh- = no D antigen (15%)') for line in clean_page_text(get_pages([26, 27])): story += bul(line) story += imp('Prevention: Anti-D immunoglobulin (Rho-GAM) given to Rh- mother within 72 hrs') story += sec('Anticoagulants / Blood Thinners') for line in clean_page_text(get_pages([23, 24])): story += bul(line) story += tbl([ ['Drug', 'Mechanism', 'Route', 'Reversal'], ['Heparin', 'Activates Antithrombin III -> inactivates thrombin + Xa', 'IV/SC', 'Protamine sulfate'], ['Warfarin', 'Inhibits Vit K -> reduces factors II, VII, IX, X', 'Oral', 'Vit K, FFP'], ['EDTA', 'Chelates Ca2+ -> prevents coagulation', 'Lab tube', '-'], ['Citrate', 'Binds Ca2+', 'Blood banking', '-'], ], [3*cm, 8*cm, 2.5*cm, 3.5*cm]) story.append(PageBreak()) # ===== 7. CARDIAC CYCLE, OUTPUT, HYPERTENSION ===== story += ch('7. CARDIAC CYCLE, OUTPUT & HYPERTENSION') story += sec('Cardiac Cycle (Duration = 0.8 sec at 75 bpm)') for line in clean_page_text(get_pages([62, 63, 64])): story += bul(line) story += tbl([ ['Phase', 'Duration', 'Valves', 'Key Event'], ['Atrial Systole', '0.1 sec', 'AV open, SL closed', 'Extra 25-30% filling'], ['Isovolumetric Contraction', '0.05 sec', 'All CLOSED', 'Pressure rises; S1 heart sound'], ['Rapid Ejection', '0.09 sec', 'SL OPEN', '70% SV ejected'], ['Reduced Ejection', '0.13 sec', 'SL open', 'Remaining 30% ejected'], ['Isovolumetric Relaxation', '0.08 sec', 'All CLOSED', 'Pressure falls; S2 heart sound'], ['Rapid Filling', '0.11 sec', 'AV OPEN', '70% filling; S3 (if heard)'], ['Diastasis', '0.19 sec', 'AV open', 'Slow passive filling'], ], [4.5*cm, 2*cm, 3.5*cm, 7*cm]) story += sec('Heart Sounds') for line in clean_page_text(get_pages([67])): story += bul(line) story += sec('ECG') for line in clean_page_text(get_pages([65, 66])): story += bul(line) story += sec('Cardiac Output') for line in clean_page_text(get_pages([68, 69])): story += bul(line) story += imp('CO = HR x SV = 72 x 70 = ~5 L/min') story += imp('Ejection Fraction = SV/EDV = 70/120 = 58% (Normal >55%)') story += sec('Hypertension') story += tbl([ ['Classification', 'Systolic', 'Diastolic'], ['Normal', '<120', '<80'], ['Elevated', '120-129', '<80'], ['Stage 1 HTN', '130-139', '80-89'], ['Stage 2 HTN', '>= 140', '>= 90'], ['Hypertensive Crisis', '>180', '>120'], ], [6*cm, 5.5*cm, 5.5*cm]) story.append(PageBreak()) # ===== 8. CYANOSIS, HYPOXIA, CO ===== story += ch('8. CYANOSIS, HYPOXIA & CO POISONING') story += sec('Hypoxia - Types') for line in clean_page_text(get_pages([44, 45])): story += bul(line) story += tbl([ ['Type', 'Cause', 'PaO2', 'Example'], ['Hypoxic Hypoxia', 'Low PO2', 'LOW', 'High altitude, drowning, hypoventilation'], ['Anemic Hypoxia', 'Low Hb', 'Normal', 'Anemia, CO poisoning'], ['Circulatory/Stagnant', 'Low blood flow', 'Normal', 'Heart failure, shock'], ['Histotoxic Hypoxia', 'Cells cannot use O2', 'Normal', 'Cyanide poisoning'], ], [4*cm, 4.5*cm, 3*cm, 5.5*cm]) story += sec('Cyanosis') for line in clean_page_text(get_pages([46])): story += bul(line) story += imp('Cyanosis appears when reduced Hb >5 g/dL in capillary blood') story += tbl([ ['Type', 'Site', 'Cause', 'Temp'], ['Central', 'Lips, tongue, mouth', 'Low arterial SaO2', 'Warm'], ['Peripheral', 'Fingers, toes, nails', 'Slow circulation', 'Cold'], ], [3*cm, 5*cm, 6*cm, 3*cm]) story += sec('CO Poisoning') story += imp('CO binds Hb 200-250x more than O2 -> forms Carboxyhemoglobin (COHb)') story += bul('Source: Incomplete combustion (car exhaust, coal fires, generators)') story += bul('COHb = bright cherry-red -> "cherry red" lips paradoxically') story += bul('Causes anemic hypoxia + LEFT shift of O2-Hb dissociation curve') story += bul('Treatment: 100% O2 (half-life 5 hrs -> 1 hr) | Hyperbaric O2 if severe (20 min)') story.append(PageBreak()) # ===== 9. HIGH ALTITUDE ===== story += ch('9. HIGH ALTITUDE & DEEP SEA PHYSIOLOGY') story += sec('High Altitude - Acclimatization') for line in clean_page_text(get_pages([47])): story += bul(line) story += tbl([ ['Adaptation', 'Mechanism', 'Time'], ['Increased ventilation', 'Peripheral chemoreceptors detect hypoxia', 'Minutes'], ['Increased EPO', 'Kidneys secrete erythropoietin', 'Hours-Days'], ['Polycythemia', 'More RBCs produced', '1-2 weeks'], ['Increased 2,3-BPG', 'Right shifts O2-Hb curve -> better O2 delivery', 'Hours'], ['Respiratory alkalosis', 'Compensated by renal HCO3- excretion', 'Days'], ['Increased capillary density', 'Angiogenesis in tissues', 'Weeks-months'], ], [5*cm, 8*cm, 4*cm]) story += imp('Mountain Sickness:') story += bul('AMS (>2500m): Headache, nausea, fatigue - Rx: Rest, descent, Acetazolamide') story += bul('HAPE: Pulmonary HTN, pink frothy sputum, crepitations - EMERGENCY') story += bul('HACE: Severe headache, ataxia, altered sensorium - Dexamethasone, descent') story += sec('Deep Sea Physiology / Decompression Sickness') for line in clean_page_text(get_pages([48, 49])): story += bul(line) story += imp("Decompression/Caisson's Disease ('Bends'):") story += bul('N2 dissolves in blood under pressure; rapid ascent causes N2 bubbles') story += bul('Symptoms: Bends (joint pain), Chokes (chest), Staggers (neuro), Skin bends') story += bul('Treatment: Recompression chamber, then slow decompression + O2') story.append(PageBreak()) # ===== 10. COUNTER CURRENT & MICTURITION ===== story += ch('10. COUNTER-CURRENT MECHANISM, MICTURITION & OSMOTIC DIALYSIS') story += sec('Kidney Functions') for line in clean_page_text(get_pages([51, 52])): story += bul(line) story += sec('Counter-Current Multiplier (Loop of Henle)') story += body('Creates osmotic gradient in renal medulla to concentrate urine.') story += bul('Descending limb: Permeable to water -> water leaves -> tubular fluid becomes concentrated') story += bul('Ascending limb (thick): Impermeable to water but actively pumps Na+Cl- out') story += bul('Net effect: Creates medullary osmolarity gradient (300 -> 1200 mOsm/kg from cortex to papilla)') story += imp('Counter-Current Exchanger (Vasa Recta):') story += bul('Blood vessels run parallel in opposite directions alongside loop') story += bul('Prevent washing out of medullary gradient') story += bul('Urea recycling contributes to inner medullary concentration') story += sec('Micturition Reflex') for line in clean_page_text(get_pages([59])): story += bul(line) story += imp('Micturition Reflex Arc:') story += bul('Bladder fills -> stretch receptors -> afferents to S2-S4') story += bul('Parasympathetic (S2-S4): Detrusor muscle contracts + internal sphincter relaxes') story += bul('Somatic (pudendal nerve): External sphincter relaxes voluntarily') story += bul('Higher control: Pontine micturition center + cortex (voluntary control)') story += sec('Osmotic Dialysis / Hemodialysis') story += bul('Dialysis = removal of waste products using semipermeable membrane') story += bul('Hemodialysis: Blood vs. dialysate across artificial membrane (cellulose, polysulfone)') story += bul('Peritoneal dialysis: Peritoneum as natural membrane') story += bul('Indications: Acute/chronic renal failure, life-threatening electrolyte disorders') story.append(PageBreak()) # ===== 11. HYPOTHALAMUS ===== story += ch('11. HYPOTHALAMUS - VEGETATIVE FUNCTIONS & BLOOD BRAIN BARRIER') story += sec('Functions of Hypothalamus') for line in clean_page_text(get_pages([92, 93])): story += bul(line) story += tbl([ ['Function', 'Detail'], ['Temperature regulation', 'Anterior hypothalamus = heat loss center; Posterior = heat gain center'], ['Hunger & Satiety', 'Lateral area = hunger center; Ventromedial nucleus = satiety center (bilateral lesion -> hyperphagia)'], ['Thirst', 'Osmoreceptors sense ECF osmolarity -> drinking'], ['Circadian rhythm', 'SCN (suprachiasmatic nucleus) = biological clock -> melatonin from pineal'], ['Autonomic control', 'Anterior = parasympathetic; Posterior = sympathetic'], ['Endocrine', 'TRH, CRH, GnRH, GHRH, Somatostatin -> pituitary'], ['Water balance', 'ADH release -> renal water reabsorption'], ['Emotion', 'Part of limbic system; connected to amygdala'], ['Lactation', 'Oxytocin release -> milk ejection reflex'], ], [4*cm, 13*cm]) story += sec('Blood Brain Barrier (BBB)') story += imp('BBB = selective barrier between blood and brain tissue') story += bul('Structure: Tight junctions between capillary endothelial cells + astrocyte foot processes + basement membrane') story += bul('PERMEABLE: O2, CO2, glucose (GLUT1), lipid-soluble drugs, alcohol, caffeine, water') story += bul('IMPERMEABLE: Large proteins, polar compounds, most drugs, bacteria') story += bul('ABSENT (circumventricular organs): Area postrema (vomiting), hypothalamic nuclei, pineal, neurohypophysis') story += note('Neurophysin protein stays in brain. Some hypothalamic nuclei near blood brain barrier allow hormones to reach circulation.') story.append(PageBreak()) # ===== 12. LIMBIC SYSTEM & EMOTION ===== story += ch('12. LIMBIC SYSTEM, EMOTION CIRCUIT & AMYGDALA') story += sec('Limbic System Components') story += bul('Limbic system = emotional brain; includes: Amygdala, Hippocampus, Cingulate gyrus, Parahippocampal gyrus, Fornix, Hypothalamus, Thalamus') story += bul('Functions: Emotions, memory, olfaction, behavior, autonomic responses') story += sec('Amygdala - Window to Emotion') story += imp('Amygdala = Almond-shaped structure in medial temporal lobe = key for FEAR, emotions') story += bul('Amygdala processes: Fear, anxiety, aggression, emotional memory') story += bul('Amygdala -> Hypothalamus -> Autonomic responses (fight or flight)') story += bul('Amygdala -> Hippocampus -> Emotional memory formation') story += bul('Bilateral amygdala lesion = Kluver-Bucy Syndrome (hypersexuality, hyperorality, visual agnosia, loss of fear)') story += sec('Papez Circuit (Emotion Circuit) - Clinical MCQ') story += tbl([ ['Component', 'Connection'], ['Hippocampus', '-> Fornix ->'], ['Mamillary Bodies', '-> Mamillothalamic tract ->'], ['Anterior Thalamus', '-> Internal capsule ->'], ['Cingulate Gyrus', '-> Cingulum ->'], ['Parahippocampal gyrus', '-> Back to Hippocampus'], ], [5*cm, 12*cm]) story += imp('Papez circuit: Hippocampus -> Fornix -> Mamillary bodies -> Thalamus -> Cingulate gyrus -> back to Hippocampus') story += note('Clinical MCQ: Damage to Papez circuit = emotional memory loss, seen in Korsakoff syndrome (mamillary body damage from thiamine deficiency in alcoholics)') story.append(PageBreak()) # ===== 13. SLEEP ===== story += ch('13. SLEEP, EEG & CIRCADIAN RHYTHM') story += sec('Physiological Changes During Sleep') for line in clean_page_text(get_pages([100])): story += bul(line) story += sec('Types & Stages of Sleep') for line in clean_page_text(get_pages([101, 102])): story += bul(line) story += tbl([ ['Feature', 'NREM Sleep', 'REM Sleep'], ['EEG', 'Slow waves (delta in Stage 3-4)', 'Fast waves (like awake) - paradoxical sleep'], ['Eye movements', 'Absent', 'Rapid eye movements present'], ['Dreams', 'Rare/vague', 'Vivid, story-like dreams'], ['HR/BP/Resp', 'Decreased', 'Variable/irregular'], ['Muscle tone', 'Decreased', 'Absent (atonia - prevents acting out dreams)'], ['Growth Hormone', 'Released (Stage 3-4)', 'Not released'], ['% of sleep', '75% of total sleep', '25% (~90 min cycles throughout night)'], ], [4*cm, 6.5*cm, 6.5*cm]) story += sec('EEG Waves') for line in clean_page_text(get_pages([103, 104])): story += bul(line) story += tbl([ ['Wave', 'Hz', 'State'], ['Delta (delta)', '0.5-4 Hz', 'Deep sleep (Stage 3-4), anesthesia, pathological in awake adults'], ['Theta (theta)', '4-7 Hz', 'Drowsy, Stage 1-2 NREM, normal in children'], ['Alpha (alpha)', '8-13 Hz', 'Relaxed awake, eyes closed'], ['Beta (beta)', '13-30 Hz', 'Alert, active thinking, eyes open'], ['Gamma', '>30 Hz', 'High cognitive activity, perception'], ], [2.5*cm, 3*cm, 11.5*cm]) story += sec('Circadian Rhythm / Biological Clock') story += imp('SCN (Suprachiasmatic Nucleus) of hypothalamus = master pacemaker (~24 hr rhythm)') story += bul('SCN receives light input from retina via retinohypothalamic tract') story += bul('SCN -> Pineal gland -> Melatonin secretion') story += bul('Melatonin: HIGH at night -> promotes sleep; LOW during day') story += bul('Controls: Body temperature fluctuations, cortisol peaks (morning), sleep-wake cycle, hormone release') story.append(PageBreak()) # ===== 14. BASAL GANGLIA ===== story += ch('14. BASAL GANGLIA & DISORDERS') story += sec('Components of Basal Ganglia') for line in clean_page_text(get_pages([94])): story += bul(line) story += bul('Components: Caudate nucleus + Putamen (= Striatum) + Globus pallidus + Subthalamic nucleus + Substantia nigra') story += sec('Functions') story += bul('Part of extrapyramidal system') story += bul('Controls: Initiation of voluntary movement, smooth/automatic movements, learning motor tasks') story += bul('Dopamine (from substantia nigra pars compacta) -> facilitates movement via D1/D2 receptors') story += sec('Clinical Disorders') for line in clean_page_text(get_pages([95, 96])): story += bul(line) story += tbl([ ['Disorder', 'Lesion', 'Features'], ['Parkinsons Disease', 'Substantia nigra (dopamine depletion)', 'TRAP: Tremor (resting), Rigidity (lead pipe), Akinesia, Postural instability'], ['Huntingtons Disease', 'Caudate + putamen degeneration (GABAergic)', 'Chorea (involuntary dance-like movements), dementia; AD inheritance, CAG repeat'], ['Hemiballismus', 'Subthalamic nucleus lesion', 'Violent flinging movements of one side (contralateral)'], ['Athetosis', 'Putamen lesion', 'Slow, writhing movements of distal limbs'], ], [4*cm, 5*cm, 8*cm]) story.append(PageBreak()) # ===== 15. APHASIA ===== story += ch('15. APHASIA & SPEECH') story += sec('Speech Areas (from PDF Pages 108-109)') for line in clean_page_text(get_pages([108, 109])): story += bul(line) story += sec('Types of Aphasia') story += tbl([ ['Type', 'Area Lesion', 'Features', 'Comprehension'], ['Brocas (Expressive)', 'Brocas area (left frontal - BA 44,45)', 'Non-fluent, effortful speech; Can understand', 'INTACT'], ['Wernickes (Receptive)', 'Wernickes area (left temporal - BA 22)', 'Fluent but meaningless speech (word salad)', 'IMPAIRED'], ['Conduction aphasia', 'Arcuate fasciculus', 'Cannot repeat; fluent speech; poor repetition', 'Intact'], ['Global aphasia', 'Large left hemisphere', 'All language functions impaired', 'Impaired'], ['Anomic aphasia', 'Angular gyrus', 'Cannot name objects; otherwise normal', 'Intact'], ], [3.5*cm, 4.5*cm, 5.5*cm, 3.5*cm]) story += imp('Key Memory Trick: Brocas = Brocas Breaks speech (cannot speak fluently); Wernickes = Words are Wrong (can speak but wrong words)') story.append(PageBreak()) # ===== 16. TASTE & SMELL ===== story += ch('16. TASTE, SMELL PATHWAYS & ADAPTATION') story += sec('Taste (Gustation)') story += imp('Five basic tastes: Sweet, Sour, Salty, Bitter, Umami (glutamate)') story += bul('Receptors: Taste buds on tongue (papillae: circumvallate, fungiform, foliate)') story += bul('Anterior 2/3 tongue: CN VII (chorda tympani)') story += bul('Posterior 1/3 tongue: CN IX (glossopharyngeal)') story += bul('Epiglottis: CN X (vagus)') story += bul('Pathway: Taste receptors -> NTS (nucleus tractus solitarius, medulla) -> VPM thalamus -> Primary gustatory cortex (parietal operculum)') story += sec('Smell (Olfaction)') story += bul('Olfactory receptor neurons in olfactory epithelium (superior nasal cavity)') story += bul('Only sensory pathway that does NOT relay via thalamus first') story += bul('Pathway: Olfactory receptors -> Olfactory bulb -> Olfactory tract -> Primary olfactory cortex (piriform cortex, uncus, amygdala)') story += bul('Olfactory information -> Hippocampus -> Memory (smell and memory strongly linked)') story += sec('Adaptation') story += bul('Adaptation = decreased sensitivity to continuous stimulus') story += bul('Smell adapts rapidly (can become unaware of own perfume/body odor)') story += bul('Taste adapts more slowly') story += bul('Mechanism: Receptor fatigue at peripheral level + central inhibition') story.append(PageBreak()) # ===== 17. COLOUR VISION & VISION PATHWAY ===== story += ch('17. COLOUR VISION, VISION PATHWAY & AFTER IMAGES') story += sec('Colour Vision - Trichromatic Theory (Young-Helmholtz)') story += imp('3 types of cone photoreceptors in retina:') story += tbl([ ['Cone Type', 'Maximum Sensitivity', 'Pigment'], ['S cones (Blue)', '420 nm', 'Cyanolabe'], ['M cones (Green)', '530 nm', 'Chlorolabe'], ['L cones (Red)', '560-580 nm', 'Erythrolabe'], ], [5*cm, 5*cm, 7*cm]) story += bul('Colour perception = combination of stimulation of these 3 types') story += bul('Colour blindness: Most common = Red-Green colour blindness (X-linked recessive)') story += bul('Achromatopsia = total colour blindness (rare)') story += sec('Vision Pathway') story += tbl([ ['Structure', 'Function'], ['Photoreceptors (rods/cones)', 'Convert light to electrical signals'], ['Bipolar cells', 'Transmit signals from photoreceptors'], ['Ganglion cells', 'Axons form optic nerve (CN II)'], ['Optic chiasm', 'Nasal fibers CROSS to opposite side; temporal fibers stay ipsilateral'], ['Optic tract', 'From chiasm to lateral geniculate nucleus'], ['Lateral Geniculate Nucleus (LGN)', 'Thalamus relay for vision'], ['Optic radiation', 'LGN -> Primary visual cortex'], ['Primary visual cortex (V1)', 'Calcarine sulcus, occipital lobe (BA 17)'], ], [6*cm, 11*cm]) story += sec('+ve and -ve After Images') story += imp('After Image = visual perception remaining after stimulus is removed') story += bul('Positive after image: Same color/brightness as original stimulus; occurs in dark; due to continued neural firing') story += bul('Negative after image: Complementary color/reversed brightness; due to receptor fatigue/adaptation') story += bul('Example: Stare at red object -> look at white wall -> see GREEN (complementary color)') story += bul('Mechanism: Red cones fatigue -> when looking at white (all wavelengths) -> non-fatigued blue+green cones more active -> cyan/green perceived') story.append(PageBreak()) # ===== 18. VO2 MAX & BRAIN DEATH ===== story += ch('18. VO2 MAX & BRAIN DEATH') story += sec('VO2 Max (Maximal Oxygen Consumption)') story += imp('VO2 max = Maximum amount of oxygen the body can utilize during intense exercise') story += bul('Unit: mL O2/kg/min') story += bul('Normal: Sedentary male ~35-40 mL/kg/min; Female ~30-35 mL/kg/min') story += bul('Elite athletes: >60-80 mL/kg/min (e.g., cyclists, cross-country skiers)') story += bul('Measurement: Fick principle: VO2 = CO x (CaO2 - CvO2)') story += bul('Limiting factors: Cardiac output (most important), O2 delivery, muscle O2 extraction') story += bul('Increases with: Aerobic training, altitude acclimatization') story += bul('Decreases with: Age, obesity, deconditioning, cardiorespiratory disease') story += bul('Clinical use: Measure of cardiorespiratory fitness; surgical risk assessment') story += sec('Brain Death') story += imp('Brain death = irreversible cessation of all brain functions including brainstem') story += tbl([ ['Criteria for Brain Death Diagnosis', ''], ['Prerequisite', 'Known cause; no confounding factors (drugs, hypothermia, metabolic disturbance)'], ['Coma', 'No eye opening, no verbal, no motor response to stimuli'], ['No brainstem reflexes', 'Absent: pupillary, corneal, oculocephalic, oculovestibular, gag, cough reflexes'], ['Apnea test', 'No respiratory effort with PaCO2 >60 mmHg'], ['Ancillary tests', 'EEG (flat/isoelectric), cerebral angiography (no flow), transcranial Doppler'], ['Legal declaration', '2 physicians required in many countries; time of brain death = time of death'], ], [6*cm, 11*cm]) story += bul('Brain death confirmed = organs can be donated for transplantation') story += bul('Differs from: Coma (brain function reduced but present), Vegetative state (some brainstem function)') story.append(PageBreak()) # ===== 19. LACTATION ===== story += ch('19. LACTATION') story += sec('Lactation (from PDF Pages 119-120)') for line in clean_page_text(get_pages([119, 120])): story += bul(line) story += sec('Hormonal Control') story += tbl([ ['Phase', 'Hormone', 'Role'], ['Mammogenesis (breast dev)', 'Estrogen, Progesterone, GH, Prolactin', 'Duct and alveolar development during pregnancy'], ['Lactogenesis (milk secretion)', 'Prolactin (from anterior pituitary)', 'Initiates and maintains milk production postpartum'], ['Galactokinesis (milk ejection)', 'Oxytocin (from posterior pituitary)', 'Milk ejection reflex - myoepithelial cells contract'], ], [4*cm, 5.5*cm, 7.5*cm]) story += imp('Suckling -> Sensory impulses -> Hypothalamus -> Oxytocin release -> Milk ejection') story += imp('Suckling also inhibits GnRH -> inhibits ovulation -> lactational amenorrhea') story += bul('Colostrum: First milk, yellowish, protein-rich, contains IgA antibodies, secreted first 2-3 days') story += bul('Breast milk composition: Carbohydrates (lactose), fat, proteins, IgA, growth factors, lysozyme') story.append(PageBreak()) # ===== 20. MENSTRUATION, CRYPTORCHIDISM, MENOPAUSE ===== story += ch('20. MENSTRUATION, CRYPTORCHIDISM & MENOPAUSE') story += sec('Menstrual Cycle (28 days)') story += tbl([ ['Phase', 'Days', 'Hormones', 'Uterine Changes'], ['Menstrual Phase', '1-5', 'Low E + P', 'Endometrial shedding, bleeding'], ['Proliferative (Follicular)', '6-14', 'Rising Estrogen', 'Endometrium rebuilds (estrogen-driven)'], ['Ovulation', 'Day 14', 'LH surge', 'Egg released from follicle'], ['Secretory (Luteal)', '15-28', 'Progesterone dominant', 'Glands secrete, prepare for implantation'], ['If no pregnancy', 'Day 28', 'E + P fall', 'Corpus luteum degenerates -> menstruation'], ], [4*cm, 2.5*cm, 5*cm, 5.5*cm]) for line in clean_page_text(get_pages([])): story += bul(line) story += sec('Cryptorchidism') story += imp('Cryptorchidism = undescended testis (absent from normal scrotal position)') story += bul('Normally testes descend by: 36 weeks gestation (most); by 1 year of age (3-4%)') story += bul('Complications: Infertility (spermatogenesis needs 2°C lower than body temp), malignancy risk (testicular cancer), torsion') story += bul('Treatment: Orchiopexy (surgical fixation) before 2 years of age') story += bul('Hormonal treatment: hCG or GnRH agonists (limited success)') story += sec('Menopause') story += imp('Menopause = permanent cessation of menstruation due to ovarian failure (average age 51)') story += bul('Diagnosis: 12 consecutive months of amenorrhea') story += bul('Cause: Ovarian follicle depletion -> Low estrogen -> High FSH/LH (loss of negative feedback)') story += tbl([ ['Symptom/Change', 'Mechanism'], ['Hot flashes/flushes', 'Estrogen withdrawal -> altered thermoregulation'], ['Vaginal atrophy', 'Low estrogen -> mucosal thinning'], ['Osteoporosis', 'Low estrogen -> increased osteoclast activity'], ['Cardiovascular risk', 'Loss of cardioprotective effects of estrogen'], ['Mood changes', 'Estrogen effects on serotonin/norepinephrine'], ['Urinary symptoms', 'Urethral/bladder atrophy'], ], [5*cm, 12*cm]) story.append(PageBreak()) # ===== 21. PITUITARY HORMONES ===== story += ch('21. PITUITARY GLAND: GH, ADH, OXYTOCIN') story += sec('Growth Hormone (GH)') for line in clean_page_text(get_pages([115, 116, 117])): story += bul(line) story += sec('ADH (Antidiuretic Hormone / Vasopressin)') for line in clean_page_text(get_pages([118])): story += bul(line) story += imp('ADH Actions: 1) Increases water reabsorption in collecting duct (main) 2) Vasoconstriction at high doses') story += bul('Released from posterior pituitary (neurohypophysis) - made in supraoptic nucleus') story += bul('Stimulus for ADH: Increased plasma osmolarity, decreased blood volume/pressure') story += bul('Diabetes Insipidus = lack of ADH or ADH receptor insensitivity -> massive dilute urine output') story += sec('Oxytocin') for line in clean_page_text(get_pages([119, 120])): story += bul(line) story += imp('Oxytocin Actions: 1) Uterine contraction during labor 2) Milk ejection reflex during lactation') story += bul('Made in paraventricular nucleus; stored in posterior pituitary') story += bul('Ferguson reflex: Baby head on cervix -> more oxytocin -> more contractions (positive feedback)') story.append(PageBreak()) # ===== 22. THYROID & PARATHYROID ===== story += ch('22. THYROID & PARATHYROID GLANDS') story += sec('Thyroid Hormone Synthesis') for line in clean_page_text(get_pages([121])): story += bul(line) story += tbl([ ['Step', 'Process'], ['1', 'Iodide trapping: Iodide pumped into follicular cell (NIS - sodium iodide symporter)'], ['2', 'Oxidation: I- -> I2 by thyroid peroxidase + H2O2'], ['3', 'Organification: I2 + tyrosine residues on Tg -> MIT, DIT'], ['4', 'Coupling: MIT+DIT -> T3; DIT+DIT -> T4 (thyroxine)'], ['5', 'Storage: As colloid in follicle (bound to Tg)'], ['6', 'Secretion: Tg endocytosed; T3/T4 released by proteolysis'], ], [2*cm, 15*cm]) story += sec('Functions of Thyroid Hormones') for line in clean_page_text(get_pages([122, 123])): story += bul(line) story += sec('Hyperthyroidism vs Hypothyroidism') for line in clean_page_text(get_pages([124, 125, 126, 127])): story += bul(line) story += tbl([ ['Feature', 'Hyperthyroidism', 'Hypothyroidism'], ['BMR', 'Increased', 'Decreased'], ['Heart rate', 'Tachycardia', 'Bradycardia'], ['Weight', 'Loss', 'Gain'], ['Temperature tolerance', 'Heat intolerance', 'Cold intolerance'], ['Skin', 'Warm, moist, sweating', 'Dry, coarse, cold'], ['Reflexes', 'Brisk (hyperreflexia)', 'Slow (delayed relaxation)'], ['Cause (common)', 'Graves disease (TSH-R Ab)', 'Hashimotos thyroiditis (anti-TPO Ab)'], ], [4*cm, 6.5*cm, 6.5*cm]) story += sec('Parathyroid Hormone (PTH)') for line in clean_page_text(get_pages([128, 129, 130])): story += bul(line) story += imp('PTH: Raises blood Ca2+ (acts on bone, kidney, indirectly gut via Vit D)') story += imp('Calcitonin: Lowers blood Ca2+ (secreted by C cells of thyroid)') story.append(PageBreak()) # ===== 23. ADRENAL & DISORDERS ===== story += ch('23. ADRENAL GLANDS, ACROMEGALY, GIGANTISM & TETANY') story += sec('Adrenal Glands') for line in clean_page_text(get_pages([134, 135, 136, 137, 138, 139, 140])): story += bul(line) story += tbl([ ['Zone', 'Hormone', 'Action'], ['Cortex - Zona Glomerulosa', 'Mineralocorticoids (Aldosterone)', 'Na+ retention, K+ excretion -> water retention -> BP control'], ['Cortex - Zona Fasciculata', 'Glucocorticoids (Cortisol)', 'Glucose metabolism, anti-inflammatory, stress response'], ['Cortex - Zona Reticularis', 'Sex steroids (DHEA, androstenedione)', 'Adrenarche, body hair, libido'], ['Medulla', 'Epinephrine (80%), Norepinephrine (20%)', 'Fight-or-flight response, sympathomimetic effects'], ], [4.5*cm, 4.5*cm, 8*cm]) story += imp('Cushing Syndrome: Excess cortisol -> central obesity, moon face, buffalo hump, striae, HTN, DM, osteoporosis') story += imp('Addisons Disease: Adrenocortical failure -> weakness, hyperpigmentation, hyponatremia, hyperkalemia, hypotension') story += imp('Conns Syndrome: Excess aldosterone -> hypertension + hypokalemia + metabolic alkalosis') story += sec('Acromegaly & Gigantism (GH disorders)') for line in clean_page_text(get_pages([117])): story += bul(line) story += tbl([ ['Condition', 'Cause', 'Age', 'Features'], ['Gigantism', 'Excess GH BEFORE epiphyseal fusion', 'Children', 'Very tall stature, normal proportions'], ['Acromegaly', 'Excess GH AFTER epiphyseal fusion', 'Adults', 'Enlarged hands/feet/face, protruding jaw, wide teeth spacing, organomegaly'], ], [4*cm, 5*cm, 3*cm, 5*cm]) story += sec('Tetany') story += imp('Tetany = Involuntary muscle spasms/cramps due to LOW blood calcium or alkalosis') story += bul('Causes: Hypoparathyroidism, Vit D deficiency, alkalosis (hyperventilation), hypomagnesemia') story += bul('Clinical signs: Chvosteks sign (tapping facial nerve -> facial muscle twitch); Trousseaus sign (BP cuff -> carpopedal spasm)') story += bul('Latent tetany: Shown by these provocative tests; Manifest tetany: Spontaneous spasms') story += bul('Treatment: IV calcium gluconate (acute), Vit D + oral calcium (chronic), Mg replacement if needed') story.append(PageBreak()) # ===== FINAL TOPIC: NEUROTRANSMITTERS ===== story += ch('24. NEUROTRANSMITTERS (NT)') story += sec('Definition & Classification') story += body('Neurotransmitters = chemical messengers released from nerve terminals that transmit signals across synapses.') for line in clean_page_text(get_pages([91])): story += bul(line) story += tbl([ ['NT', 'Type', 'Location', 'Function', 'Disease when Low'], ['Acetylcholine', 'Small molecule', 'NMJ, parasympathetic, basal forebrain', 'Muscle contraction, memory, ANS', 'Alzheimers, Myasthenia Gravis'], ['Dopamine', 'Catecholamine', 'Substantia nigra, VTA, nucleus accumbens', 'Movement, reward, motivation', 'Parkinsons (movement), Schizophrenia (reward)'], ['Serotonin (5-HT)', 'Indolamine', 'Raphe nuclei', 'Mood, sleep, appetite', 'Depression'], ['Norepinephrine', 'Catecholamine', 'Locus coeruleus', 'Attention, arousal, fight-or-flight', 'Depression, ADHD'], ['GABA', 'Amino acid', 'Widespread in CNS', 'Main INHIBITORY NT', 'Anxiety, epilepsy'], ['Glutamate', 'Amino acid', 'Widespread in CNS', 'Main EXCITATORY NT', 'Neurodegeneration if excess'], ['Glycine', 'Amino acid', 'Spinal cord, brainstem', 'Inhibitory', 'Hyperekplexia'], ['Endorphins', 'Neuropeptide', 'Widespread', 'Pain modulation, euphoria', 'Chronic pain'], ], [3*cm, 3*cm, 4*cm, 4*cm, 3*cm]) story.append(PageBreak()) # Final summary story += ch('QUICK REVISION: EXAM IMPORTANT POINTS') story += sec('Most Common MCQ Points') story += imp('Homeostasis: Negative feedback most common | Positive feedback = childbirth, blood clotting') story += imp('AP: ARP - no stimulus works; RRP - needs stronger stimulus') story += imp('NMJ: ACh + nicotinic receptor; AChE destroys ACh; MG = anti-AChR antibodies') story += imp('Blood groups: O = universal donor; AB = universal recipient') story += imp('CO poisoning: Cherry red skin; 200x higher affinity for Hb than O2; Rx = 100% O2') story += imp('Cyanosis: Reduced Hb >5 g/dL; Central = warm; Peripheral = cold') story += imp('Papez circuit: Hippocampus -> Fornix -> Mamillary bodies -> Thalamus -> Cingulate gyrus') story += imp('Brocas area: Non-fluent speech, can understand; Wernickes: Fluent but incomprehensible') story += imp('Tetany: Chvostek + Trousseau signs; Low Ca2+ or alkalosis') story += imp('BBB absent at: Area postrema, circumventricular organs, hypothalamic nuclei') story += imp('VO2 max: Best measure of cardiorespiratory fitness; limited mainly by cardiac output') story += imp('Brain death: ALL brainstem reflexes absent + no respiratory effort') story += imp('Acromegaly (adults) vs Gigantism (children) = both from excess GH') story += imp('Oxytocin: Uterine contraction + milk ejection (Ferguson reflex = positive feedback)') story += imp('ADH from supraoptic nucleus; Oxytocin from paraventricular nucleus - both stored in posterior pituitary') story += imp('PTH raises Ca2+; Calcitonin lowers Ca2+') story += imp('Aldosterone: Na+ in, K+ out (Conns = high aldosterone = HTN + hypokalemia)') story += imp('Cushing: High cortisol = moon face, buffalo hump, central obesity, striae') story += imp('Addisons: Low cortisol = weakness, bronze skin (high ACTH -> MSH effect), hyponatremia') story += imp('REM sleep: Vivid dreams, muscle atonia, paradoxical EEG; occurs 90-min cycles') story += imp('SCN = master biological clock; melatonin from pineal gland = promotes sleep') story += imp('Colour blindness: X-linked recessive; most common = red-green') story += imp('Negative after image = complementary colour due to receptor fatigue') story += imp('Myelination: PNS = Schwann cells (1:1); CNS = Oligodendrocytes (1:many)') story.append(Spacer(1, 0.5*inch)) story.append(HRFlowable(width="90%", thickness=2, color=colors.HexColor('#1a237e'), hAlign='CENTER')) story.append(Spacer(1, 0.1*inch)) story.append(Paragraph('ALL THE BEST FOR YOUR MBBS 1st Professional Examination!', ParagraphStyle('end', parent=styles['Normal'], fontSize=14, alignment=TA_CENTER, fontName='Helvetica-Bold', textColor=colors.HexColor('#1a237e')))) story.append(Paragraph('Based on SMCI Physiology Notes by Dr. Mayur Sayta + Standard Physiology Textbooks', ParagraphStyle('src', parent=styles['Normal'], fontSize=9, alignment=TA_CENTER, textColor=colors.grey, fontName='Helvetica-Oblique'))) # Build PDF doc.build(story) print("PDF BUILT SUCCESSFULLY!") # Check file import os size = os.path.getsize('physiology-pdf/MBBS_Physiology_1st_Year_Notes.pdf') print(f"File size: {size/1024:.1f} KB") PYEOF echo "Exit: $?"
Give me
MBBS Physiology 1st Year Notes
PDF Document · PDF
| # | Topic |
|---|---|
| 1 | Homeostasis |
| 2 | Action Potential (AP) |
| 3 | NMJ & EF-C Coupling |
| 4 | Nerve Injury & Myelinogenesis |
| 5 | Hematology, Erythropoiesis, Hemoglobin, Anemia |
| 6 | RH Antigen, Blood Groups, Blood Thinners |
| 7 | Cardiac Cycle, Output, Heart Sounds, ECG, Hypertension |
| 8 | Cyanosis, Hypoxia, CO Poisoning |
| 9 | High Altitude & Deep Sea Physiology |
| 10 | Counter-Current Mechanism, Micturition Reflex, Osmotic Dialysis |
| 11 | Hypothalamus (Vegetative Functions) & Blood Brain Barrier |
| 12 | Limbic System, Emotion Circuit, Amygdala (Papez Circuit) |
| 13 | Sleep, EEG & Circadian Rhythm / Biological Clock |
| 14 | Basal Ganglia & Disorders (Parkinson, Huntington) |
| 15 | Aphasia & Speech (Broca vs Wernicke) |
| 16 | Taste & Smell Pathways + Adaptation |
| 17 | Colour Vision, Vision Pathway, +ve/-ve After Images |
| 18 | VO2 Max & Brain Death |
| 19 | Lactation |
| 20 | Menstruation, Cryptorchidism, Menopause |
| 21 | Pituitary: GH, ADH, Oxytocin |
| 22 | Thyroid & Parathyroid |
| 23 | Adrenal Glands, Acromegaly, Gigantism, Tetany |
| 24 | Neurotransmitters (NT) |
| + | Quick Revision - Exam Important Points |