Make it easy and simple to understand and remember by making the wording simple without skipping or missing anythjng important
cd /home/daytona/workspace/attachments/3cbf2140-d8c9-4434-9d45-9db55ecddf9e && python3 -c " import pdfplumber with pdfplumber.open('Dosage Chp Parentrals.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') for i, page in enumerate(pdf.pages): text = page.extract_text() print(f'--- PAGE {i+1} ---') print(text) print() "
python3 -c " import subprocess result = subprocess.run(['which', 'tesseract'], capture_output=True, text=True) print('tesseract:', result.stdout.strip()) result2 = subprocess.run(['which', 'pdftoppm'], capture_output=True, text=True) print('pdftoppm:', result2.stdout.strip()) result3 = subprocess.run(['python3', '-c', 'import pytesseract; print(pytesseract.__version__)'], capture_output=True, text=True) print('pytesseract:', result3.stdout.strip(), result3.stderr.strip()) "
mkdir -p /home/daytona/workspace/parenteral-ocr && cd /home/daytona/workspace/parenteral-ocr && pdftoppm -r 200 "/home/daytona/workspace/attachments/3cbf2140-d8c9-4434-9d45-9db55ecddf9e/Dosage Chp Parentrals.pdf" page && ls | head -30
cd /home/daytona/workspace/parenteral-ocr && python3 -c " import pytesseract from PIL import Image import os all_text = [] for i in range(1, 24): fname = f'page-{i:02d}.ppm' img = Image.open(fname) text = pytesseract.image_to_string(img) all_text.append(f'=== PAGE {i} ===\n{text}') print(f'Done page {i}') full_text = '\n\n'.join(all_text) with open('full_text.txt', 'w') as f: f.write(full_text) print('Saved to full_text.txt') print(f'Total chars: {len(full_text)}') "
cd /home/daytona/workspace/parenteral-ocr && python3 -c " from PIL import Image import base64, os # Convert PPM to PNG for viewing for i in range(1, 24): fname = f'page-{i:02d}.ppm' img = Image.open(fname) img.save(f'page-{i:02d}.png') print('All converted to PNG') "
cd /home/daytona/workspace/parenteral-ocr && python3 -c " from PIL import Image import os # Resize images to smaller size for viewing for i in range(1, 24): img = Image.open(f'page-{i:02d}.ppm') # Resize to width 800 maintaining aspect ratio w, h = img.size new_w = 800 new_h = int(h * new_w / w) img_small = img.resize((new_w, new_h), Image.LANCZOS) img_small.save(f'small-{i:02d}.jpg', 'JPEG', quality=85) size = os.path.getsize(f'small-{i:02d}.jpg') print(f'page {i}: {size} bytes') "
cd /home/daytona/workspace/parenteral-ocr && python3 -c " import pytesseract from PIL import Image, ImageFilter, ImageEnhance import re all_text = [] for i in range(1, 24): img = Image.open(f'page-{i:02d}.ppm') # Convert to grayscale and enhance contrast img = img.convert('L') enhancer = ImageEnhance.Contrast(img) img = enhancer.enhance(2.0) # Use page segmentation mode 6 (assume a single uniform block of text) custom_config = r'--oem 3 --psm 6' text = pytesseract.image_to_string(img, config=custom_config) all_text.append(f'=== PAGE {i} ===\n{text}') full_text = '\n\n'.join(all_text) with open('full_text_enhanced.txt', 'w') as f: f.write(full_text) print(full_text) " 2>&1 | head -300
cd /home/daytona/workspace/parenteral-ocr && python3 -c " import pytesseract from PIL import Image, ImageEnhance import sys all_text = [] for i in range(13, 24): img = Image.open(f'page-{i:02d}.ppm') img = img.convert('L') enhancer = ImageEnhance.Contrast(img) img = enhancer.enhance(2.0) custom_config = r'--oem 3 --psm 6' text = pytesseract.image_to_string(img, config=custom_config) all_text.append(f'=== PAGE {i} ===\n{text}') print('\n\n'.join(all_text)) " 2>&1
| Route | Where | Notes |
|---|---|---|
| IV (Intravenous) | Into a vein | Fastest; can't be taken back once given |
| IM (Intramuscular) | Into a muscle | Adults: gluteus maximus most common; Infants: deltoid or thigh |
| SC (Subcutaneous) | Under the skin | Small amounts only; loose tissue of outer upper arm |
| ID (Intradermal) | Into the skin layers | Very shallow; used for allergy tests & diagnostics |
| Intra-arterial | Into an artery | Used when immediate effect in a peripheral area is needed (e.g., corticosteroids, local anesthetics) |
| Type | What it is |
|---|---|
| Solution for injection | Drug fully dissolved in a solvent |
| Powder for injection | Dry powder; add solvent before use (e.g., Insulin injection USP) |
| Suspension for injection | Drug particles suspended in a liquid (e.g., Imipenem + Cilastatin for IM use) |
| Emulsion for injection | Oil-in-water or water-in-oil (e.g., IV fat emulsions) |
| Substance | Purpose |
|---|---|
| Buffers | Keep the pH stable (e.g., citric acid/sodium citrate system pH 2.5–6; sodium phosphate system pH 6.6–7.5) |
| Tonicity modifiers | Make the solution isotonic (same concentration as blood) |
| Chelating agents | Grab heavy metal ions that would damage the drug (e.g., EDTA, citric acid salts) — heavy metals like Fe, Cu, Cr cause oxidation of drugs like adrenaline |
| Solubilizing agents | Increase drug solubility (e.g., PEG, glycerin, ethanol) |
| Antimicrobial preservatives | Prevent microbial growth |
| Stabilizers | Prevent drug breakdown |
| Protectants | Protect during freeze-drying (lyophilization) — e.g., sucrose, glucose prevent protein denaturation; glycerol maintains hydration |
| Buffer System | pH Range |
|---|---|
| Acetic acid / sodium acetate | 3.5–5.7 |
| Citric acid / sodium citrate | 2.5–6.0 |
| Sodium phosphate | 6.6–7.5 |
| Maleate | 5.2–6.8 |
| Method | Used For |
|---|---|
| Steam sterilization (Autoclave) | Aqueous solutions with good heat tolerance |
| Dry heat sterilization | Fixed oils, glycerin; kills spores |
| Filtration | Heat-sensitive solutions; membrane filter (cellulose acetate or nitrate) |
| Gas sterilization (e.g., EtO) | Surgical supplies, catheters, needles, syringes |
| Ionizing radiation | Plastic/polymer products (e.g., polyethylene) |
| Type | Main Component | Use |
|---|---|---|
| Type I (Borosilicate) | B₂O₃ | Best; all parenterals |
| Type II (Soda-lime) | Na₂O | Aqueous solutions |
| Type III | Na₂O | Non-aqueous (oils) |
| Type NP | P₂O₅ | Non-parenteral use only |
| Type | What it means |
|---|---|
| Single-dose (ampule) | Used once, then discarded — sealed glass |
| Multi-dose (vial) | Hermetically sealed; allows repeated withdrawal of portions; must contain antimicrobial preservative |