This are my two patients case history So now you prepare How to describe history points Examination every point step by step Then diffrential Diagnosis According to standard practical books like pg clinic by dr prafulla and dr pk mukherjee And kanski And every word by decribing which question examiner can ask what are possible answer and how to describe Every thing is very very detail and acurate Extra point theory if you want to add add that too Do both case one by one dont mix it With possible diagram
python3 << 'EOF' import pdfplumber pdf_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.pdf" with pdfplumber.open(pdf_path) as pdf: print(f"Total pages: {len(pdf.pages)}\n") for page_num, page in enumerate(pdf.pages): print(f"--- PAGE {page_num + 1} ---") text = page.extract_text() print(text) print("\n") EOF
python3 << 'EOF' import pdfplumber import json pdf_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.pdf" try: with pdfplumber.open(pdf_path) as pdf: print(f"Total pages: {len(pdf.pages)}") all_text = [] for page_num, page in enumerate(pdf.pages): print(f"\n=== PAGE {page_num + 1} ===") # Try different extraction methods text = page.extract_text() if text: print(text[:500]) all_text.append(text) # Also check if there are tables tables = page.extract_tables() if tables: print(f"Found {len(tables)} tables on this page") for i, table in enumerate(tables): print(f"Table {i+1}:") for row in table[:3]: # First 3 rows print(row) except Exception as e: print(f"Error: {e}") import traceback traceback.print_exc() EOF
python3 << 'EOF' from pypdf import PdfReader pdf_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.pdf" try: reader = PdfReader(pdf_path) print(f"Total pages: {len(reader.pages)}\n") for page_num, page in enumerate(reader.pages): print(f"===== PAGE {page_num + 1} =====") text = page.extract_text() print(text) print("\n") except Exception as e: print(f"Error: {e}") import traceback traceback.print_exc() EOF
I have pdf please assess
python3 << 'EOF' from pdf2image import convert_from_path import os pdf_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.pdf" # Check if pdf2image is available try: images = convert_from_path(pdf_path, first_page=1, last_page=2) for i, image in enumerate(images): image.save(f'/tmp/workspace/page_{i+1}.png', 'PNG') print(f"Converted page {i+1} to image") except Exception as e: print(f"pdf2image not available: {e}") # Try using pypdf to get raw content from pypdf import PdfReader reader = PdfReader(pdf_path) print(f"PDF has {len(reader.pages)} pages") # Check page dimensions for i, page in enumerate(reader.pages): print(f"Page {i+1}: {page.mediabox}") EOF
python3 << 'EOF' from docx import Document doc_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.docx" doc = Document(doc_path) print("=== DOCUMENT CONTENT ===\n") for para in doc.paragraphs: if para.text.strip(): print(para.text) # Also check tables if any if doc.tables: print("\n=== TABLES ===") for table_idx, table in enumerate(doc.tables): print(f"\nTable {table_idx + 1}:") for row in table.rows: row_data = [cell.text for cell in row.cells] print(" | ".join(row_data)) EOF
python3 << 'EOF' from docx import Document import zipfile doc_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.docx" try: # Try direct extraction first doc = Document(doc_path) print(f"Document loaded. Paragraphs: {len(doc.paragraphs)}, Tables: {len(doc.tables)}") all_text = [] for para in doc.paragraphs: text = para.text.strip() if text: all_text.append(text) if all_text: print("\n".join(all_text)) else: print("No paragraphs found. Checking for images/embedded content...") # Try unpacking the docx to see what's inside import tempfile import os with tempfile.TemporaryDirectory() as tmpdir: with zipfile.ZipFile(doc_path, 'r') as zip_ref: zip_ref.extractall(tmpdir) # List all files print("\nFiles in DOCX:") for root, dirs, files in os.walk(tmpdir): for file in files: filepath = os.path.join(root, file) print(f" {filepath}") # Try reading document.xml doc_xml_path = os.path.join(tmpdir, 'word', 'document.xml') if os.path.exists(doc_xml_path): with open(doc_xml_path, 'r', encoding='utf-8') as f: content = f.read() print("\n=== DOCUMENT.XML (first 2000 chars) ===") print(content[:2000]) except Exception as e: print(f"Error: {e}") import traceback traceback.print_exc() EOF
python3 << 'EOF' import zipfile import os from PIL import Image doc_path = "/tmp/workspace/attachments/e61ce95b-60de-4984-a6b1-b87562cb98f0/RD 2 cases.docx" # Extract images from the docx extract_dir = "/tmp/workspace/extracted_images" os.makedirs(extract_dir, exist_ok=True) with zipfile.ZipFile(doc_path, 'r') as zip_ref: # Extract all images for file in zip_ref.namelist(): if 'media/image' in file: zip_ref.extract(file, extract_dir) print(f"Extracted: {file}") # List extracted images image_dir = os.path.join(extract_dir, 'word', 'media') if os.path.exists(image_dir): images = sorted(os.listdir(image_dir)) print(f"\nFound {len(images)} images") for img in images: src = os.path.join(image_dir, img) dst = f"/tmp/workspace/{img}" os.rename(src, dst) print(f"Moved to: {dst}") # Check image info try: im = Image.open(dst) print(f" - {img}: {im.size} ({im.format})") except: pass EOF
python3 << 'EOF' import pytesseract from PIL import Image import os image_dir = "/tmp/workspace" # Process all images and extract text all_text = {} for img_num in range(2, 9): img_path = f"{image_dir}/image{img_num}.jpeg" if os.path.exists(img_path): print(f"\n{'='*60}") print(f"IMAGE {img_num}") print('='*60) try: img = Image.open(img_path) text = pytesseract.image_to_string(img) all_text[f"image{img_num}"] = text print(text) except Exception as e: print(f"Error processing image{img_num}: {e}") EOF
python3 << 'EOF' from PIL import Image import os # List all extracted images image_dir = "/tmp/workspace" for i in range(1, 9): img_path = f"{image_dir}/image{i}.jpeg" if os.path.exists(img_path): img = Image.open(img_path) print(f"Image {i}: Size {img.size}, Mode: {img.mode}") # Try to save at different quality to see content thumb = img.copy() thumb.thumbnail((200, 200)) print(f" Created thumbnail") # Now let's try to copy images to a location we can view import shutil for i in range(2, 9): src = f"/tmp/workspace/image{i}.jpeg" dst = f"/tmp/workspace/case_image_{i}.jpg" if os.path.exists(src): shutil.copy(src, dst) print(f"Copied: {dst}") EOF