Extract all git question, with there value , it's a laq or a saq , mk dk or nk ?
~/
medical exam question classification MK DK NK LAQ SAQ meaning
~/attachments/17fe309c-8645-423e-a664-c786c1b3e9d0
mkdir -p "/tmp/workspace/git-question-extraction/output" && python -c "import pdfplumber; p='/tmp/workspace/attachments/17fe309c-8645-423e-a664-c786c1b3e9d0/Practice of Medicine (2).pdf'; out='/tmp/workspace/git-question-extraction/output/extracted.txt'; pdf=pdfplumber.open(p); f=open(out,'w',encoding='utf-8'); [f.write('\\n\\n===== PAGE %d =====\\n%s' % (i+1, page.extract_text() or '')) for i,page in enumerate(pdf.pages)]; f.close(); print('pages',len(pdf.pages),'out',out)"
"GIT" in ~/git-question-extraction/output
"LAQ" in ~/git-question-extraction/output
"SAQ" in ~/git-question-extraction/output
"MK" in ~/git-question-extraction/output
"DK" in ~/git-question-extraction/output
"NK" in ~/git-question-extraction/output
"5.5." in ~/git-question-extraction/output
python -c "import re; t=open('/tmp/workspace/git-question-extraction/output/extracted.txt',encoding='utf8').read(); s=t.index('HomUG-PM II.42.'); e=t.index('5.5. Disorders of Liver'); x=t[s:e]; parts=re.split(r'(?=HomUG-)',x); out='\\n\\n'.join(p.replace('\\n',' ') for p in parts if p.strip()); open('/tmp/workspace/git-question-extraction/output/git_rows_raw.txt','w',encoding='utf8').write(out); print('parts',len(parts)); print('chars',len(x))" && python -c "import re; x=open('/tmp/workspace/git-question-extraction/output/git_rows_raw.txt',encoding='utf8').read(); print('\\n'.join(x.split('\\n')[:35]))"
python - <<'PY' import re p='/tmp/workspace/git-question-extraction/output/git_rows_raw.txt' x=open(p,encoding='utf8').read() # Split on section heading secs=re.split(r'(?=HomUG-PM II\.\d+\.)',x) for sec in secs: h=re.match(r'(HomUG-PM II\.\d+\.\s*[^\n]+)',sec) if not h: continue title=h.group(1).replace('HomUG-PM ','') rows=re.split(r'(?=HomUG-)',sec)[1:] print('\n###',title,'ROWS',len(rows)) for r in rows: r=' '.join(r.split()) code=re.search(r'II\.\d+\.\d+',r) pri=re.search(r'\b(?:MK|DK|NK)\b',r) assess=[] # rough: everything after priority tail=r[pri.end():] if pri else '' if 'SAQ' in tail: assess.append('SAQ') if 'LAQ' in tail: assess.append('LAQ') if assess: print(code.group() if code else '?','|',pri.group() if pri else '?','|','/'.join(assess),'|',r[:240]) PY
python - <<'PY' import pdfplumber p='/tmp/workspace/attachments/17fe309c-8645-423e-a664-c786c1b3e9d0/Practice of Medicine (2).pdf' with pdfplumber.open(p) as pdf: for ix in [97,98,99,100]: page=pdf.pages[ix] print('\nPAGE',ix+1) tabs=page.extract_tables() print('tables',len(tabs)) for t in tabs: for r in t[:3]: print(r) PY
python - <<'PY' import re x=open('/tmp/workspace/git-question-extraction/output/git_rows_raw.txt',encoding='utf8').read() for sec in re.split(r'(?=HomUG-PM II\.\d+\.)',x): h=re.match(r'HomUG-PM (II\.\d+(?:\.[AB])?\.\s*[^\n]+)',sec) if not h: continue title=h.group(1) rows=re.split(r'(?=HomUG-)',sec)[1:] print('\n##',title) for r in rows: r=' '.join(r.split()) # identify code permits 52.A code=re.search(r'II\.\d+(?:\.[AB])?\.\d+',r) pri=re.search(r'\b(MK|DK|NK)\b',r) # take from priority to integration, summative appears after T-L method words # identify all sequence occurrences SAQ LAQ. Print compact if pri and ('SAQ' in r[pri.end():] or 'LAQ' in r[pri.end():]): # content around before SLO at priority: crude capture after competency code but order corrupted print(code.group() if code else '?', pri.group(), 'SAQ' if 'SAQ' in r[pri.end():] else '', 'LAQ' if 'LAQ' in r[pri.end():] else '', ' :: ', r[:150]) PY > "/tmp/workspace/git-question-extraction/output/summary.txt"
python - <<'PY' import re, os from openpyxl import Workbook from openpyxl.styles import Font, PatternFill, Alignment src='/tmp/workspace/git-question-extraction/output/git_rows_raw.txt' x=open(src,encoding='utf8').read() sections=re.split(r'(?=HomUG-PM II\.\d+)',x) rows=[] for sec in sections: hm=re.match(r'HomUG-PM (II\.\d+(?:\.[AB])?\.\s*[^\n]+)',sec) if not hm: continue topic=re.sub(r'\s+\d+\s*=+.*','',hm.group(1)).strip() # derive clean title after code title=re.sub(r'^II\.\d+(?:\.[AB])?\.\s*','',topic).strip() for r in re.split(r'(?=HomUG-)',sec)[1:]: clean=' '.join(r.split()) cm=re.search(r'II\.\d+(?:\.[AB])?\.\d+',clean) pm=re.search(r'\b(MK|DK|NK)\b',clean) if not (cm and pm): continue tail=clean[pm.end():] # Include only if published assessment fields include SAQ/LAQ anywhere after priority if not ('SAQ' in tail or 'LAQ' in tail): continue # SLO begins around a) and ends before Bloom level before priority pre=clean[:pm.start()] slo='' m=re.search(r'(\([abc]\)\s*.*)$',pre) if m: slo=m.group(1) else: # use competency title before likely code, ignore attributes slo=pre slo=re.sub(r'\s+\d+\s+=+ PAGE \d+ =+\s*',' ',slo) # infer assessment appearance exactly as recorded. This document does not assign marks. fmt=[] if 'SAQ' in tail: fmt.append('SAQ') if 'LAQ' in tail: fmt.append('LAQ') rows.append([cm.group(), title, slo[:1200], pm.group(), ' / '.join(fmt), 'Not specified in PDF']) # duplicates eliminate by code (rows unique) seen=set(); data=[] for r in rows: if r[0] not in seen: data.append(r);seen.add(r[0]) out='/tmp/workspace/git-question-extraction/output/GIT_question_classification.xlsx' wb=Workbook(); ws=wb.active; ws.title='GIT questions' ws.append(['Competency code','Topic','Question / learning outcome','Priority','Written assessment shown','Marks / value']) for r in data: ws.append(r) for c in ws[1]: c.font=Font(bold=True,color='FFFFFF');c.fill=PatternFill('solid',fgColor='1F4E78');c.alignment=Alignment(wrap_text=True) for row in ws.iter_rows(min_row=2): for c in row: c.alignment=Alignment(wrap_text=True,vertical='top') ws.freeze_panes='A2'; ws.auto_filter.ref=ws.dimensions for col,width in {'A':18,'B':38,'C':80,'D':11,'E':25,'F':22}.items(): ws.column_dimensions[col].width=width for i in range(2,ws.max_row+1): ws.row_dimensions[i].height=55 # summary s=wb.create_sheet('Summary') s.append(['Item','Count']) s.append(['Competencies with SAQ and/or LAQ listed',len(data)]) s.append(['SAQ listed',sum('SAQ' in r[4] for r in data)]) s.append(['LAQ listed',sum('LAQ' in r[4] for r in data)]) for tag in ['MK','DK','NK']: s.append([tag,sum(r[3]==tag for r in data)]) s.append(['Note','The PDF provides priority labels and assessment formats, but no numeric marks or values.']) for c in s[1]:c.font=Font(bold=True,color='FFFFFF');c.fill=PatternFill('solid',fgColor='1F4E78') s.column_dimensions['A'].width=48;s.column_dimensions['B'].width=85 for row in s.iter_rows(): for c in row:c.alignment=Alignment(wrap_text=True,vertical='top') wb.save(out) print(len(data),out) PY
GIT question classification
Spreadsheet · XLSX
Can you make a list in the chat and not a doc
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.42.1 | Anatomy, organization, blood/nerve supply, lymphatics, and landmarks of GIT | SAQ, LAQ | MK |
| II.42.2 | Digestion, absorption, enzymes, hormones, neurotransmitters, absorption sites | SAQ | MK |
| II.42.3 | Aetiology, pathogenesis and clinical features of common GI disorders | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.43.1 | Definition, aetiology and classification of aphthous ulcers | SAQ | MK |
| II.43.2 | Symptoms, morphology and differential diagnosis | SAQ | MK |
| II.43.3 | Predisposing factors, triggers and systemic/genetic factors | SAQ, LAQ | MK |
| II.43.6 | Oral hygiene, dietary advice and prevention counselling | SAQ, LAQ | NK |
| II.43.7 | Homoeopathic principles/remedies for aphthous ulcers | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.44.1 | Definition, aetiology and classification | SAQ | MK |
| II.44.2 | Symptoms, morphology and differential diagnosis | SAQ | MK |
| II.44.3 | Infectious agents, systemic diseases and irritants | SAQ, LAQ | MK |
| II.44.6 | Medication adherence, lifestyle modification and prevention | SAQ, LAQ | NK |
| II.44.7 | Homoeopathic principles/remedies for stomatitis | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.45.1 | Definition, aetiology and types of parotitis | SAQ | MK |
| II.45.2 | Symptoms, signs and complications | SAQ | MK |
| II.45.3 | Infectious agents and obstructive factors | SAQ, LAQ | MK |
| II.45.6 | Medication adherence and preventive measures | SAQ, LAQ | NK |
| II.45.7 | Homoeopathic principles/remedies for parotitis | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.46.1 | Definition, epidemiology and pathophysiology | SAQ | MK |
| II.46.2 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.46.3 | Barium swallow, manometry and endoscopy | SAQ, LAQ | MK |
| II.46.6 | Prognosis, lifestyle modification and counselling | SAQ, LAQ | NK |
| II.46.7 | Homoeopathic principles/remedies for achalasia | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.47.1 | Definition, types and prevalence | SAQ | MK |
| II.47.2 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.47.3 | Imaging modalities and endoscopy | SAQ, LAQ | MK |
| II.47.6 | Prognosis and preventive measures | SAQ, LAQ | NK |
| II.47.7 | Homoeopathic principles/remedies for hiatus hernia | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.48.1 | Definition, aetiology and pathophysiology of GERD/esophagitis | SAQ | MK |
| II.48.2 | Clinical presentation and diagnostic criteria | SAQ | MK |
| II.48.3 | Barium swallow, endoscopy and pH monitoring | SAQ, LAQ | MK |
| II.48.6 | Disease-management education and prevention | SAQ, LAQ | NK |
| II.48.7 | Homoeopathic principles/remedies for GERD | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.49.1 | Definition, classification and aetiology | SAQ | MK |
| II.49.2 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.49.3 | Imaging, endoscopy and biopsy | SAQ, LAQ | MK |
| II.49.6 | Prognosis, prevention and patient education | SAQ, LAQ | NK |
| II.49.7 | Homoeopathic principles/remedies for gastritis | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.50.1 | Definition and classification of peptic ulcers | SAQ | MK |
| II.50.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.50.4 | Endoscopy, biopsy and H. pylori tests | SAQ, LAQ | MK |
| II.50.7 | Prognosis, prevention and disease-management counselling | SAQ, LAQ | NK |
| II.50.8 | Homoeopathic principles/remedies for peptic ulcers | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.51.1 | Definition and classification of gastric carcinoma | SAQ | MK |
| II.51.2 | Aetiology and risk factors | SAQ | MK |
| II.51.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.51.4 | Imaging, biopsy and staging investigations | SAQ, LAQ | MK |
| II.51.7 | Prognosis, prevention and patient counselling | SAQ, LAQ | MK |
| II.51.8 | Homoeopathic principles/remedies for gastric carcinoma | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.52.1 | Definition and classification of malabsorption syndromes | SAQ | MK |
| II.52.2 | Aetiology and pathogenesis | SAQ | MK |
| II.52.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.52.4 | Laboratory tests and imaging investigations | SAQ, LAQ | MK |
| II.52.7 | Prognosis, prevention and patient education | SAQ, LAQ | NK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.52.A.1 | Definition, pathophysiology and epidemiology | SAQ | MK |
| II.52.A.2 | Immune pathophysiology of coeliac disease | SAQ | MK |
| II.52.A.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.52.A.4 | Serology and intestinal biopsy | SAQ, LAQ | MK |
| II.52.A.7 | Gluten-free diet, prognosis and counselling | SAQ, LAQ | NK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.52.B.1 | Definition and epidemiology | SAQ | MK |
| II.52.B.2 | Pathophysiology of lactose intolerance | SAQ | MK |
| II.52.B.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.52.B.4 | Hydrogen breath test and lactose-tolerance test | SAQ, LAQ | MK |
| II.52.B.7 | Dietary modification, prognosis and counselling | SAQ, LAQ | NK |
| II.52.B.8 | Homoeopathic principles/remedies for lactose intolerance | SAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.53.1 | Definition, pathophysiology and epidemiology of IBS | SAQ | MK |
| II.53.2 | Pathophysiology of IBS | SAQ | MK |
| II.53.3 | Symptoms, signs and diagnostic criteria | SAQ | MK |
| II.53.4 | Rome criteria and exclusion of other conditions | SAQ, LAQ | MK |
| II.53.7 | Prognosis, education and preventive advice | SAQ, LAQ | NK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.54.1 | Definition of inflammatory bowel disease | SAQ | MK |
| II.54.2 | Definition and epidemiology of Crohn's disease | SAQ | MK |
| II.54.3 | Pathophysiology of Crohn's disease | SAQ | MK |
| II.54.4 | Symptoms, signs and complications of Crohn's disease | SAQ | MK |
| II.54.5 | Endoscopy, imaging, laboratory tests and biopsy in Crohn's disease | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.54.8 | Definition and epidemiology of ulcerative colitis | SAQ | MK |
| II.54.9 | Pathophysiology of ulcerative colitis | SAQ | MK |
| II.54.10 | Symptoms, signs and complications of ulcerative colitis | SAQ | MK |
| II.54.11 | Endoscopy, imaging, laboratory tests and biopsy in ulcerative colitis | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.55.1 | Definition and epidemiology of abdominal tuberculosis | SAQ | MK |
| II.55.2 | Pathophysiology of abdominal tuberculosis | SAQ | MK |
| II.55.3 | Symptoms, signs and complications | SAQ | MK |
| II.55.4 | Imaging, laboratory tests, endoscopy and biopsy | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.56.1 | Definition and types of bowel neoplasia | SAQ | MK |
| II.56.2 | Pathophysiology of bowel neoplasia | SAQ | MK |
| II.56.3 | Symptoms, signs and complications | SAQ | MK |
| II.56.4 | Imaging, laboratory tests, biopsy and endoscopy | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.57.1 | Definition, types and pathophysiology of anorectal disorders | SAQ | MK |
| II.57.2 | Symptoms, signs and complications | SAQ | MK |
| II.57.4 | Physical examination, imaging and laboratory tests | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.58.1 | Definition and types of diverticulitis | SAQ | MK |
| II.58.2 | Pathophysiology of diverticulitis | SAQ | MK |
| II.58.3 | Symptoms, signs and complications | SAQ | MK |
| II.58.4 | Physical examination, imaging and laboratory tests | SAQ, LAQ | MK |
| Code | Question area | Type | Priority |
|---|---|---|---|
| II.59.1 | Major homoeopathic remedies for GI disorders | SAQ | MK |
| II.59.2 | Indications, symptoms and signs for remedy selection | SAQ | MK |
| II.59.3 | Remedy selection based on symptoms, case-taking and repertorisation | SAQ | MK |