Patient came to ed with this usg report. Complaint of pain in abdomen, drowsy/lethargic. Bp 130/80, pr 100/min, Spo2 94% on RA. What should be my line of management.
ls /tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/ && file /tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic
python3 -c " from PIL import Image import os img = Image.open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic') img.save('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg', 'JPEG') print('Converted successfully') print('Size:', img.size) "
pip install --user pillow-heif 2>&1 | tail -5 && python3 -c " from pillow_heif import register_heif_opener from PIL import Image register_heif_opener() img = Image.open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic') img.save('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg', 'JPEG', quality=95) print('Converted successfully, size:', img.size) "
which convert && convert /tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic /tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg && echo "Done"
python3 -c " import subprocess, sys # Try using ffmpeg or ImageMagick result = subprocess.run(['ffmpeg', '-i', '/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic', '/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg', '-y'], capture_output=True, text=True) print('stdout:', result.stdout) print('stderr:', result.stderr[:500]) print('returncode:', result.returncode) "
python3 -c " # Try reading raw HEIC as bytes and look for embedded JPEG with open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/IMG20260717152644.heic', 'rb') as f: data = f.read() print('File size:', len(data), 'bytes') # Look for JPEG SOI marker jpg_start = data.find(b'\xff\xd8\xff') print('JPEG marker at:', jpg_start) if jpg_start > 0: jpg_end = data.rfind(b'\xff\xd9') print('JPEG end at:', jpg_end) with open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg', 'wb') as f: f.write(data[jpg_start:jpg_end+2]) print('Extracted JPEG') "
python3 -c " from PIL import Image img = Image.open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_report.jpg') print('Mode:', img.mode, 'Size:', img.size) # Resize to smaller img_small = img.resize((800, int(800*img.size[1]/img.size[0])), Image.LANCZOS) img_small.save('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_small.jpg', 'JPEG', quality=85) print('Small size:', img_small.size) import os print('File size:', os.path.getsize('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_small.jpg')) "
python3 -c " # Try to do OCR or at least describe the image using base64 approach # First let's check what text is visible in the image import base64 with open('/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_small.jpg', 'rb') as f: data = f.read() print('Image size for base64:', len(data), 'bytes') # Try pytesseract OCR import subprocess result = subprocess.run(['python3', '-c', 'import pytesseract; from PIL import Image; img=Image.open(\"/tmp/workspace/attachments/d4a228ba-133e-481a-a8ea-0359afbc0be9/usg_small.jpg\"); text=pytesseract.image_to_string(img); print(text)'], capture_output=True, text=True) print('OCR output:', result.stdout[:2000]) print('OCR errors:', result.stderr[:200]) "
| Test | Reason |
|---|---|
| CBG / RBS | Rule out hypoglycemia/DKA |
| ABG | Hypoxia cause, metabolic acidosis |
| CBC | Infection, bleeding (Hb drop) |
| CMP / LFT / RFT | Organ failure |
| Serum amylase/lipase | Pancreatitis |
| LFT + bilirubin | Biliary pathology |
| Coagulation (PT/INR) | Bleeding, liver failure |
| Serum lactate | Sepsis/ischemia |
| Urine R/E | Infection, hematuria |
| Blood cultures x2 | If sepsis suspected |
| ECG | Rule out cardiac cause |
| Beta-hCG (if female, reproductive age) | Ectopic pregnancy |
Usg of patient - GB lumen filled with sludge Marked GB wall edema Liver enlarged & coarser in echoes due to multiple solid nodular lesions S/O metastasis likely Renal parenchymal echoes slight more S/O Cortical geriatric atrophic renal chanc Only 1 simple Bosniak Type 1 cyst in left kidney middle part [22mm] Spleen echoes congestive due to portal hypertension Mild pyloric antrum thickening approx. only 6mm [peptic nature] Engorged portal vein at porta hepatis with lamellar thrombus in intra hepatic portal circulation components lumen resulting into hyperdynamic portal spleenic & mesen vein S/O Intra hepatic portal hypertension Normal appearing common duct, IVC, Ureter & Urinary bladder Early generalized prostate gland prominence. Atherosclerotic aorta Moderate echoic collection in peritoneal cavity of abdomen & pelvis? malignant ascitis:
| USG Finding | Clinical Significance |
|---|---|
| Liver metastases + coarse echoes | Primary malignancy (likely GI - gastric/colonic/pancreatic) with hepatic metastasis |
| Portal vein thrombus + intrahepatic lamellar thrombus | Malignant portal vein thrombosis - driving portal hypertension |
| Spleen congestion | Secondary to portal hypertension |
| Malignant ascites (moderate, echoic) | Peritoneal carcinomatosis - very poor prognosis marker |
| GB sludge + wall edema | Secondary acalculous cholecystitis / portal cholecystopathy |
| Pyloric antrum thickening 6mm | Possible primary gastric malignancy as the source |
| Atherosclerotic aorta + prostatic prominence | Elderly male patient |
| Renal cortical atrophy | Baseline CKD - affects drug dosing |
Per Yamada's Gastroenterology: "Management involves patient stabilization (airway, BP), triaging to appropriate level of care, identification of precipitating factors, and empiric lactulose." - Yamada's Textbook of Gastroenterology, 7e
Goldman-Cecil Medicine: "Malignant ascites portends a poor prognosis, with 1-year survival of 40% and 3-year survival of less than 10%." - Goldman-Cecil Medicine, 2 Vol Set
Sleisenger & Fordtran's Gastroenterology: "Malignant ascites with 1-year survival of 40% and <10% at 3 years. Repeated therapeutic paracentesis with or without indwelling peritoneal catheter is the most commonly used invasive treatment."