You are an expert medical educator and high-yield revision specialist for competitive exams (NEET-PG, FMGE, INI-CET, USMLE Step 2/3, PLAB). Input: I am attaching an MCQ PDF containing hundreds of multiple-choice questions (single best answer type). Task: Perform a complete topic-wise analysis of every single MCQ in the PDF and convert it into the most concise, high-yield revision notes possible. Step-by-step instructions (follow exactly): Extract & Categorize Read every MCQ. Identify the exact disease/condition/syndrome/topic each question is testing. Note the chapter/system if mentioned. Merge Common Topics Aggressively merge all overlapping or related topics into single master topics. Example: “Rheumatic fever”, “Rheumatic heart disease”, “Jones criteria”, “Mitral stenosis” → merge into one topic “Rheumatic Heart Disease & Acute Rheumatic Fever”. “Diabetic ketoacidosis”, “Hyperosmolar hyperglycemic state”, “Type-1 DM complications” → merge into “Diabetic Emergencies & Acute Complications of DM”. For every merged topic, first write one single line at the top: Merged Topics: Acute Rheumatic Fever, Rheumatic Heart Disease, Jones criteria, Mitral stenosis, Aortic regurgitation (all MCQs merged). Output Format for EACH Merged Topic (strict structure): Topic Name: [Clear, concise, exam-friendly name] Merged Topics: [One-line list of all original topics merged] Stem Clues (High-yield presentation): • Bullet list of the most common MCQ stem triggers and classic presentations that point to this disease (age, gender, key symptoms, signs, risk factors, “classic vignette” phrases). Investigations (Key & Diagnostic): • Most important lab tests, imaging, special tests with their characteristic findings. • Mention gold-standard test and any pathognomonic findings. Treatment & Management: • First-line drugs/doses (if asked frequently), step-wise management, surgical indications, follow-up. • Any “must-know” emergency treatment or specific guidelines. Specific Peculiarities & Red Flags (Differentiation): • Unique clinical pearls, pathognomonic signs, buzzwords, or features that instantly distinguish this disease from close differentials in MCQs. • Any “never miss” or “always think of” points. Quick-Revision Memory Aids (Last 30-minute revision): • Mnemonics, acronyms, short memory hooks, visual associations, “one-liner” facts, or tables that can be revised in under 2 minutes before the exam. • Include any high-yield numbers (incidence, cut-offs, percentages) that repeatedly appear in MCQs. Final Output Instructions: Organise all topics in a logical order (by system → by frequency of appearance). Use clear headings, bullet points,buzz words, bold text, and tables wherever helpful. Keep language extremely concise and exam-oriented (no long paragraphs). Begin your response directly with the first merged topic. Avoid abbreviations .Do not add any meta-commentary or apology. Start working immediately after you receive the PDF. Generate answer in DOCX file. Recheck all MCQ, Don't miss any. . And recheck for all missing MCQ. No backgrounds colours. It will waste ink during printing. All text must be in black ink. Use only bold, italic or different font size to differentiate heading or some important stuff. Remove all blank space. So I can take printout in minimal number of pages. Minimum font size of 9 or more. keep all available images,ECG, x ray require to diagnosis in revision word document.

Reading File
Reading File
Running Command

python3 << 'EOF' from pypdf import PdfReader import os pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" reader = PdfReader(pdf_path) print(f"Total pages: {len(reader.pages)}") # Extract first 5 pages to understand structure for i in range(min(5, len(reader.pages))): print(f"\n=== PAGE {i+1} ===") text = reader.pages[i].extract_text() print(text[:2000]) EOF

Running Command

python3 << 'EOF' from pypdf import PdfReader import json import re pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" reader = PdfReader(pdf_path) total_pages = len(reader.pages) print(f"Total pages: {total_pages}") # Extract all text - the PDF has question page and then answer/explanation page # Structure: odd pages = question, even pages = answer+explanation all_text = [] for i in range(total_pages): text = reader.pages[i].extract_text() if text and text.strip(): all_text.append(f"\n===PAGE {i+1}===\n{text}") full_text = "\n".join(all_text) # Save to file for processing with open("/home/daytona/workspace/git_mcq_raw.txt", "w") as f: f.write(full_text) print(f"Saved {len(full_text)} characters") print(f"Non-empty pages: {len(all_text)}") # Show a sample of explanation pages for i in range(2, min(20, total_pages), 2): text = reader.pages[i].extract_text() if text and 'Explanation' in text: print(f"\n=== EXPLANATION PAGE {i+1} ===") print(text[:1500]) break EOF

Running Command

python3 << 'EOF' from pypdf import PdfReader import re pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" reader = PdfReader(pdf_path) total_pages = len(reader.pages) # Parse MCQs - explanation pages contain "Key learning points" and "Explanation" # Let's extract all Q+A pairs systematically mcqs = [] i = 0 while i < total_pages: page_text = reader.pages[i].extract_text() or "" # Explanation pages have "Key learning points" and "Explanation" if "Key learning points" in page_text and "Explanation" in page_text: # Extract question number q_num_match = re.search(r'Question (\d+) of (\d+)', page_text) q_num = q_num_match.group(1) if q_num_match else "?" # Extract question text (before "Key learning points") parts = page_text.split("Key learning points") q_text = parts[0].strip() # Clean up question text q_text = re.sub(r'Previous Question \d+ of \d+ Next', '', q_text) q_text = re.sub(r'Exit session\s*English\s*French', '', q_text) q_text = re.sub(r'\d{2}:\d{2}:\d{2}', '', q_text) q_text = q_text.strip() # Extract explanation if "Explanation" in page_text: exp_parts = page_text.split("Explanation") explanation = exp_parts[1] if len(exp_parts) > 1 else "" # Clean up explanation explanation = re.sub(r'Add revision notes.*', '', explanation, flags=re.DOTALL) explanation = explanation.strip() else: explanation = "" # Extract key learning points klp = "" if len(parts) > 1: klp_text = parts[1] if "Explanation" in klp_text: klp = klp_text.split("Explanation")[0] klp = re.sub(r'^Gastroenterology\s*', '', klp).strip() mcqs.append({ "q_num": q_num, "question": q_text, "key_learning": klp, "explanation": explanation }) i += 1 print(f"Total MCQs extracted: {len(mcqs)}") print("\n=== SAMPLE MCQs ===") for mcq in mcqs[:5]: print(f"\nQ{mcq['q_num']}: {mcq['question'][:200]}") print(f"KLP: {mcq['key_learning'][:200]}") print(f"Exp: {mcq['explanation'][:300]}") print("---") EOF

Running Command

python3 << 'EOF' from pypdf import PdfReader import re import json pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" reader = PdfReader(pdf_path) total_pages = len(reader.pages) # Better extraction - get all explanation pages with full content mcqs = [] for i in range(total_pages): page_text = reader.pages[i].extract_text() or "" if "Key learning points" in page_text and "Explanation" in page_text: # Extract question number q_num_match = re.search(r'Question (\d+) of (\d+)', page_text) q_num = q_num_match.group(1) if q_num_match else str(len(mcqs)+1) set_num = q_num_match.group(2) if q_num_match else "?" # Full page text full_text = page_text # Extract key learning points klp_match = re.search(r'Key learning points\s*Gastroenterology\s*(.*?)(?:Explanation)', full_text, re.DOTALL) klp = klp_match.group(1).strip() if klp_match else "" # Extract explanation exp_match = re.search(r'Explanation\s*(.*?)(?:Add revision notes|Reference:|$)', full_text, re.DOTALL) explanation = exp_match.group(1).strip() if exp_match else "" # Remove stats like "Surgical resection \n 61%" explanation = re.sub(r'\n[A-Za-z\s\(\)]+\s*\n\s*\d+%', '', explanation) explanation = re.sub(r'Next question.*', '', explanation, flags=re.DOTALL) explanation = re.sub(r'Save notes.*', '', explanation, flags=re.DOTALL) explanation = re.sub(r'Correct\s*Amazing!.*', '', explanation, flags=re.DOTALL) explanation = re.sub(r'Incorrect\s*Good try!.*', '', explanation, flags=re.DOTALL) explanation = re.sub(r'\d+%', '', explanation) explanation = explanation.strip() # Extract question (before "Key learning points") q_text_match = re.search(r'(?:Exit session\s*)?(?:English\s+French\s*)?(?:\d{2}:\d{2}:\d{2}\s*)?(.*?)(?:Key learning points)', full_text, re.DOTALL) q_text = q_text_match.group(1).strip() if q_text_match else "" q_text = re.sub(r'Previous Question \d+ of \d+ Next', '', q_text) q_text = re.sub(r'Exit session\s*English\s*French', '', q_text) q_text = re.sub(r'English\s+French\s*', '', q_text) q_text = re.sub(r'\d{2}:\d{2}:\d{2}', '', q_text) q_text = re.sub(r'Exit session', '', q_text) q_text = q_text.strip() mcqs.append({ "page": i+1, "q_num": q_num, "set_num": set_num, "question": q_text, "key_learning": klp, "explanation": explanation }) print(f"Total MCQs: {len(mcqs)}") # Save structured data with open("/home/daytona/workspace/git_mcqs_structured.json", "w") as f: json.dump(mcqs, f, indent=2, ensure_ascii=False) # Print all questions with their topics print("\n=== ALL MCQ TOPICS ===") for mcq in mcqs: q = mcq['question'][:150].replace('\n', ' ') klp = mcq['key_learning'][:100].replace('\n', ' ') print(f"Q{mcq['q_num']} (pg{mcq['page']}): {q}") print(f" KLP: {klp}") print() EOF

Running Command

python3 << 'EOF' import pdfplumber import os from pypdf import PdfReader import fitz # PyMuPDF pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" # Create images directory os.makedirs("/home/daytona/workspace/git_images", exist_ok=True) # Extract images using PyMuPDF doc = fitz.open(pdf_path) print(f"Total pages: {len(doc)}") image_count = 0 image_pages = [] for page_num in range(len(doc)): page = doc[page_num] image_list = page.get_images(full=True) if image_list: # Get page text to understand context text = page.get_text()[:200].replace('\n', ' ') for img_index, img in enumerate(image_list): xref = img[0] base_image = doc.extract_image(xref) image_bytes = base_image["image"] image_ext = base_image["ext"] # Only save substantial images (>5KB to skip icons/logos) if len(image_bytes) > 5000: image_filename = f"/home/daytona/workspace/git_images/page{page_num+1}_img{img_index+1}.{image_ext}" with open(image_filename, "wb") as f: f.write(image_bytes) image_count += 1 image_pages.append({ "page": page_num + 1, "file": image_filename, "size": len(image_bytes), "context": text }) print(f"Page {page_num+1}: image saved ({len(image_bytes)} bytes) - {text[:100]}") print(f"\nTotal medical images extracted: {image_count}") EOF

Running Command

pip install --user pymupdf --quiet 2>&1 | tail -5

Running Command

python3 << 'EOF' import sys sys.path.insert(0, '/home/daytona/.local/lib/python3.11/site-packages') import fitz import os import json pdf_path = "/home/daytona/workspace/attachments/d6c089e8-c2a4-4a30-be1a-12fb294e22a8/BMJ OnExamination GIT 2025 part 2-compressed.pdf" os.makedirs("/home/daytona/workspace/git_images", exist_ok=True) doc = fitz.open(pdf_path) print(f"Total pages: {len(doc)}") image_info = [] image_count = 0 for page_num in range(len(doc)): page = doc[page_num] image_list = page.get_images(full=True) if image_list: text = page.get_text()[:300].replace('\n', ' ') for img_index, img in enumerate(image_list): xref = img[0] try: base_image = doc.extract_image(xref) image_bytes = base_image["image"] image_ext = base_image["ext"] # Only save substantial images (>10KB to skip icons/logos/UI elements) if len(image_bytes) > 10000: image_filename = f"page{page_num+1}_img{img_index+1}.{image_ext}" full_path = f"/home/daytona/workspace/git_images/{image_filename}" with open(full_path, "wb") as f: f.write(image_bytes) image_count += 1 image_info.append({ "page": page_num + 1, "file": full_path, "filename": image_filename, "size": len(image_bytes), "context": text[:200] }) print(f"Pg{page_num+1}: {image_filename} ({len(image_bytes)//1024}KB) | {text[:80]}") except Exception as e: pass print(f"\nTotal medical images: {image_count}") with open("/home/daytona/workspace/git_image_info.json", "w") as f: json.dump(image_info, f, indent=2) EOF

Running Command

ls /home/daytona/workspace/git_images/ | head -20 echo "---" ls /home/daytona/skills/docx/

Continue

Running Command

ls /home/daytona/workspace/git_images/ | wc -l ls /home/daytona/workspace/ ls /home/daytona/skills/docx/scripts/

Running Command

cat /home/daytona/workspace/git_image_info.json | python3 -c " import json,sys data=json.load(sys.stdin) # Print only answer/explanation pages (odd-indexed images - the 'answer' page images) for d in data: print(f\"Pg{d['page']}: {d['filename']} | {d['context'][:120]}\") " | head -60

This is a shared conversation. Sign in to Orris to start your own chat.