According to this give questions make a doc of questions and with answers.
Answer all the questions
~/
~/attachments/77523246-de9e-442a-9473-4825c0428d25
mkdir -p "/tmp/workspace/cardiopulmonary-mcq/src" "/tmp/workspace/cardiopulmonary-mcq/output" && python3 - <<'PY' from PIL import Image,ImageEnhance,ImageFilter p='/tmp/workspace/attachments/77523246-de9e-442a-9473-4825c0428d25/1000246618 (1).jpg' im=Image.open(p) print(im.size) im=im.crop((0,90,715,1060)).resize((2145,2910)) im=ImageEnhance.Contrast(im).enhance(2) im=ImageEnhance.Sharpness(im).enhance(2) im.save('/tmp/workspace/cardiopulmonary-mcq/src/current_enhanced.png') PY tesseract "/tmp/workspace/cardiopulmonary-mcq/src/current_enhanced.png" "/tmp/workspace/cardiopulmonary-mcq/src/current_ocr" --psm 6 2>/dev/null && wc -l "/tmp/workspace/cardiopulmonary-mcq/src/current_ocr.txt"
asthma COPD congenital heart disease
GINA 2025 asthma silent chest poor prognosis pursed lip breathing emphysema guideline
python3 -c "import importlib.util; print('easyocr',importlib.util.find_spec('easyocr')); print('paddleocr',importlib.util.find_spec('paddleocr')); print('cv2',importlib.util.find_spec('cv2')); print('keras_ocr',importlib.util.find_spec('keras_ocr'))"
python3 - <<'PY' import importlib.util print(importlib.util.find_spec('pytesseract')) PY
~/cardiopulmonary-mcq/src/create_answers_doc.py
from docx import Document
from docx.shared import Inches, Pt, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.enum.section import WD_SECTION
from docx.oxml import OxmlElement
from docx.oxml.ns import qn
items = [
(1, 'Identify the rhythm on the ECG trace shown.', 'Cannot be determined from the supplied photograph because the ECG trace itself is not visible. The original ECG strip is needed.'),
(2, 'Identify the finding that is not a poor prognostic sign in acute asthma.', 'The answer depends on the complete options. Silent chest, hypercapnia, exhaustion and a paradoxical thoracoabdominal pattern are all life-threatening features, not reassuring findings.'),
(3, 'Chronic asthma: identify the immune-cell pattern.', 'T-helper 2 (Th2)-predominant inflammation with eosinophils is characteristic.'),
(4, 'Identify an early clinical manifestation of cardiogenic shock.', 'Tachycardia with cool, clammy skin and altered perfusion is typical. Hypotension may develop as shock progresses.'),
(5, 'Which cardiac property prevents chaotic re-excitation?', 'The refractory period. It prevents immediate re-stimulation of myocardium after depolarization.'),
(6, 'Most common cause of aortic stenosis in a young person.', 'Congenital bicuspid aortic valve.'),
(7, 'Identify the statement relating to persistence/closure of the ductus arteriosus.', 'Failure of ductal closure causes patent ductus arteriosus (PDA). Functional closure normally follows the rise in oxygen tension and fall in prostaglandins after birth.'),
(8, 'Percussion note over normal lung.', 'Resonant.'),
(9, 'Why do patients with emphysema breathe with pursed lips?', 'To create positive expiratory pressure and reduce premature small-airway collapse.'),
(10, 'What does the P wave represent?', 'Atrial depolarization.'),
(11, 'What is broken-heart syndrome?', 'Takotsubo (stress) cardiomyopathy.'),
(12, 'Preferred test for assessment of suspected valvular heart disease.', 'Transthoracic echocardiography (TTE), with transesophageal echocardiography when further detail is needed.'),
(13, 'NYHA class for marked limitation of physical activity but comfort at rest.', 'NYHA class III.'),
(14, 'Identify a feature not characteristic of asthma.', 'Persistent, largely irreversible airflow obstruction is not characteristic of typical asthma; asthma usually has variable, reversible obstruction.'),
(15, 'Essential investigation to assess severity/staging of valvular heart disease.', 'Echocardiography with Doppler assessment.'),
(16, 'Best initial assessment in an acute asthma exacerbation.', 'Peak expiratory flow (PEF), where the patient can perform it, together with pulse oximetry and clinical severity assessment.'),
(17, 'Condition associated with clubbing rather than uncomplicated asthma.', 'Bronchiectasis is a classic association. Clubbing is not typical of asthma.'),
(18, 'Hallmark ECG feature of Wolff-Parkinson-White syndrome.', 'Short PR interval with a delta wave and widened QRS complex.'),
(19, 'Question referring to cyanotic/congenital heart disease.', 'The exact wording/options are not legible enough to select safely. Please provide a clear crop if you need a single option letter.'),
(20, 'Most sensitive biomarker for myocardial injury.', 'Cardiac troponin (high-sensitivity troponin assay).'),
(21, 'Identify the degree of AV block on the supplied ECG.', 'Cannot be determined because the ECG image is not visible in the photograph.'),
(22, 'Normal PR interval.', '0.12 to 0.20 seconds (120 to 200 ms).'),
(23, 'Chest X-ray with a boot-shaped heart.', 'Tetralogy of Fallot.'),
(24, 'Dullness to percussion with increased vocal resonance.', 'Pulmonary consolidation, such as lobar pneumonia.'),
(25, 'Question concerning pulmonary hypertension and its cause.', 'The full wording/options are too indistinct to answer reliably. Pulmonary arterial hypertension must be distinguished from pulmonary hypertension secondary to left-heart or lung disease.'),
(26, 'Drug class used to treat asthma.', 'Beta-2 agonists are bronchodilators used for symptom relief; inhaled corticosteroids are core anti-inflammatory controller treatment.'),
(27, 'Question concerning a genetic/autosomal-dominant condition.', 'The wording is too unclear for a defensible single answer.'),
(28, 'Investigation most likely abnormal in a patient with hypertension.', 'An ECG may show left ventricular hypertrophy, but the correct option depends on the complete stem and choices.'),
(29, 'General approach to hypertension management.', 'Lifestyle measures plus antihypertensive therapy when indicated. Lifestyle measures include reducing salt intake, weight management, exercise, limiting alcohol and smoking cessation.'),
(30, 'Recommended treatment for asthma.', 'Inhaled corticosteroid-containing therapy is recommended. Add a bronchodilator according to severity; allergen immunotherapy is only for selected sensitized patients.'),
(31, 'Feature not included in tetralogy of Fallot.', 'Increased pulmonary blood flow is not a feature. Tetralogy causes right ventricular outflow obstruction and reduced pulmonary flow.'),
(32, 'Best bedside finding in suspected coarctation of the aorta.', 'Compare upper- and lower-limb pulses and blood pressures. Delayed/weak femoral pulses relative to radial pulses are characteristic.'),
(33, 'Most accurate diagnostic test for bronchial asthma.', 'Demonstration of variable expiratory airflow limitation on spirometry, typically with bronchodilator reversibility. Bronchial challenge can help when spirometry is normal.'),
(34, 'What does the T wave represent?', 'Ventricular repolarization.'),
(35, 'What does the P wave represent on ECG?', 'Atrial depolarization.'),
(36, 'Question concerning long-standing work-related respiratory symptoms.', 'Occupational asthma is suggested when symptoms vary with workplace exposure and improve away from work. Confirm with serial peak flows and specialist assessment.'),
(37, 'Immediate response in acute asthma with clinical deterioration.', 'Give inhaled short-acting beta-2 agonist promptly, oxygen if hypoxemic, systemic corticosteroid early, and urgently assess severity.'),
(38, 'Test not routinely used to diagnose or monitor asthma.', 'Diffusing capacity for carbon monoxide (DLCO) is generally not used for routine asthma diagnosis or monitoring.'),
(39, 'Hallmark feature of asthma.', 'Variable expiratory airflow limitation caused by bronchial hyperresponsiveness and inflammation.'),
(40, 'Early diagnosis/clinical finding in asthma.', 'Airway hyperresponsiveness with variable, reversible obstruction. A normal examination between attacks does not exclude asthma.'),
(41, 'ST elevation in leads II, III and aVF.', 'Inferior-wall myocardial infarction.'),
(42, 'Child with asthma symptoms persisting despite bronchodilator therapy.', 'This indicates an exacerbation requiring urgent reassessment and escalation, usually including systemic corticosteroid. A silent chest, fatigue or rising CO2 requires emergency care.'),
(43, 'Percussion finding in pneumonia with alveolar fluid.', 'Dullness to percussion.'),
(44, 'Identify the ECG diagnosis shown.', 'Cannot be determined because the ECG strip is not visible in the uploaded photograph.'),
(45, 'What part of the cardiac cycle is represented by the QRS complex?', 'Ventricular depolarization.'),
(46, 'Symptom not characteristic of pneumonia.', 'A productive cough, fever, pleuritic pain and dyspnea can occur in pneumonia. The selected option depends on the exact options, which are not readable.'),
(47, 'Identify the ECG territory/diagnosis from the image.', 'Cannot be determined because the referenced ECG image is absent from the supplied photograph.'),
(48, 'Inflammation of trachea and bronchi lasting about 1 to 3 weeks.', 'Acute bronchitis.'),
(49, 'Main respiratory symptom of COPD.', 'Chronic cough, often with sputum production, and progressive exertional dyspnea.'),
(50, 'Older adult with prolonged hoarseness.', 'Laryngeal carcinoma must be excluded, especially in a smoker. Persistent hoarseness warrants laryngoscopic assessment.'),
(51, 'P wave on ECG.', 'Atrial depolarization.'),
(52, 'Broken-heart syndrome.', 'Takotsubo cardiomyopathy.'),
(53, 'Antidote for heparin.', 'Protamine sulfate.'),
(54, 'Identify the ECG diagnosis shown.', 'Cannot be determined without the actual ECG image. A clear ECG strip is required.'),
(55, 'Sharp pleuritic pain with fever, chills, raised white cell count and respiratory symptoms.', 'Pneumonia with pleurisy is likely, but clinical examination and chest imaging are needed for confirmation.'),
(56, 'Most common cause of aortic stenosis in older people.', 'Degenerative calcific aortic valve disease.'),
(57, 'Identify the echocardiographic image.', 'Cannot be determined because the echocardiogram is not visible in the photograph.'),
(58, 'Respiratory-failure question involving pulmonary edema and blood gases.', 'Pulmonary edema commonly causes hypoxemic respiratory failure. Hypercapnia may occur in severe fatigue or coexisting COPD, but it is not the usual early pattern.'),
(59, 'When is spironolactone contraindicated?', 'Hyperkalemia or significant risk of hyperkalemia, including severe renal impairment.'),
(60, 'Young patient with severe mitral stenosis and atrial fibrillation: best treatment strategy.', 'Anticoagulation with a vitamin K antagonist is recommended for AF with moderate-to-severe rheumatic mitral stenosis. Rate control and assessment for percutaneous mitral commissurotomy are also important.')
]
out = '/tmp/workspace/cardiopulmonary-mcq/output/Cardiopulmonary_MCQ_Answers.docx'
doc = Document()
sec = doc.sections[0]
sec.top_margin = Inches(0.65); sec.bottom_margin = Inches(0.65)
sec.left_margin = Inches(0.72); sec.right_margin = Inches(0.72)
styles = doc.styles
styles['Normal'].font.name = 'Arial'; styles['Normal'].font.size = Pt(10)
for name in ['Title','Heading 1','Heading 2']:
styles[name].font.name = 'Arial'
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
r = p.add_run('Cardiopulmonary MCQs: Answer Guide')
r.bold = True; r.font.size = Pt(18); r.font.color.rgb = RGBColor(31,78,121)
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
r = p.add_run('Prepared from the supplied photograph')
r.italic = True; r.font.size = Pt(10)
note = doc.add_paragraph()
note.style = 'Intense Quote'
note.add_run('Important note: ').bold = True
note.add_run('Several stems, options, and all referenced ECG/echo figures are blurred or not visible in the photo. Answers below give the best clinically correct answer where the stem was readable. Items that cannot be answered safely from the image are explicitly marked rather than guessed.')
# header/footer
header = sec.header.paragraphs[0]
header.text = 'Cardiopulmonary MCQ Answer Guide'
header.alignment = WD_ALIGN_PARAGRAPH.RIGHT
header.runs[0].font.size = Pt(8)
footer = sec.footer.paragraphs[0]
footer.alignment = WD_ALIGN_PARAGRAPH.CENTER
fld = OxmlElement('w:fldSimple'); fld.set(qn('w:instr'), 'PAGE')
footer._p.append(fld)
for n, question, answer in items:
p = doc.add_paragraph(style='Heading 2')
p.paragraph_format.space_before = Pt(6)
p.paragraph_format.space_after = Pt(2)
p.add_run(f'{n}. {question}')
p = doc.add_paragraph()
p.paragraph_format.left_indent = Inches(0.18)
p.paragraph_format.space_after = Pt(4)
run = p.add_run('Answer: '); run.bold = True; run.font.color.rgb = RGBColor(31,78,121)
p.add_run(answer)
p=doc.add_paragraph()
p.style='Intense Quote'
p.add_run('Study reminder: ').bold=True
p.add_run('This is a learning aid, not patient-specific medical advice. For image-based questions, send the original ECG/echo image or a clearer screenshot to obtain a definitive answer.')
doc.save(out)
print(out)
python3 "/tmp/workspace/cardiopulmonary-mcq/src/create_answers_doc.py" && python3 - <<'PY' from docx import Document p='/tmp/workspace/cardiopulmonary-mcq/output/Cardiopulmonary_MCQ_Answers.docx' d=Document(p) print('paragraphs:',len(d.paragraphs)) print('file ok') print('\n'.join(x.text for x in d.paragraphs[:12])) PY ls -lh "/tmp/workspace/cardiopulmonary-mcq/output/Cardiopulmonary_MCQ_Answers.docx"
Cardiopulmonary MCQ Answers
Word Document · DOCX