Summarize it into few pages
python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/04b0b6e0-874b-4e00-b863-f6c2cb0c3cec/scope_ws_material.pdf') as pdf: print(f'Total pages: {len(pdf.pages)}') # Extract first few pages to understand structure for i, page in enumerate(pdf.pages[:5]): text = page.extract_text() print(f'\\n--- PAGE {i+1} ---') print(text[:800] if text else '[No text]') "
python3 -c " import pdfplumber with pdfplumber.open('/tmp/workspace/attachments/04b0b6e0-874b-4e00-b863-f6c2cb0c3cec/scope_ws_material.pdf') as pdf: full_text = '' for i, page in enumerate(pdf.pages): text = page.extract_text() if text: full_text += f'\n\n=== PAGE {i+1} ===\n' + text print(full_text) " > /tmp/workspace/scope_full_text.txt 2>&1 wc -l /tmp/workspace/scope_full_text.txt
python3 << 'EOF' from reportlab.lib.pagesizes import A4 from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle from reportlab.lib.units import inch, cm from reportlab.lib import colors from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, HRFlowable, Table, TableStyle from reportlab.lib.enums import TA_LEFT, TA_CENTER, TA_JUSTIFY import os os.makedirs('/tmp/workspace/scope-summary', exist_ok=True) doc = SimpleDocTemplate( '/tmp/workspace/scope-summary/SCoPE_Workshop_Summary.pdf', pagesize=A4, rightMargin=2.2*cm, leftMargin=2.2*cm, topMargin=2*cm, bottomMargin=2*cm ) styles = getSampleStyleSheet() # Custom styles title_style = ParagraphStyle('Title', parent=styles['Title'], fontSize=20, textColor=colors.HexColor('#1a3a5c'), spaceAfter=6, alignment=TA_CENTER) subtitle_style = ParagraphStyle('Subtitle', parent=styles['Normal'], fontSize=11, textColor=colors.HexColor('#3d6b9e'), spaceAfter=14, alignment=TA_CENTER) seg_header_style = ParagraphStyle('SegHeader', parent=styles['Heading1'], fontSize=13, textColor=colors.white, spaceBefore=14, spaceAfter=6, backColor=colors.HexColor('#1a3a5c'), borderPad=(6,6,6,6), leading=18) sub_header_style = ParagraphStyle('SubHeader', parent=styles['Heading2'], fontSize=11, textColor=colors.HexColor('#1a3a5c'), spaceBefore=8, spaceAfter=4, leading=14) body_style = ParagraphStyle('Body', parent=styles['Normal'], fontSize=9.5, leading=14, spaceAfter=5, textColor=colors.HexColor('#222222'), alignment=TA_JUSTIFY) bullet_style = ParagraphStyle('Bullet', parent=styles['Normal'], fontSize=9.5, leading=13, spaceAfter=3, leftIndent=14, firstLineIndent=-10, textColor=colors.HexColor('#222222')) story = [] # ---- TITLE PAGE CONTENT ---- story.append(Spacer(1, 0.3*inch)) story.append(Paragraph("SCoPE Workshop", title_style)) story.append(Paragraph("Skills of Communication, Orientation, Professionalism & Ethics", subtitle_style)) story.append(Paragraph("Reading Material for Residents - Summary", subtitle_style)) story.append(HRFlowable(width="100%", thickness=2, color=colors.HexColor('#1a3a5c'), spaceAfter=10)) story.append(Paragraph( "The SCoPE Workshop, conducted by the Directorate of Medical Education (DME) under the College of Physicians and Surgeons Pakistan (CPSP), " "prepares postgraduate residents for effective medical practice through four core segments. Residents must complete a virtual learning phase " "(pre-test score ≥75%) before advancing to the face-to-face workshop.", body_style)) story.append(Spacer(1, 0.15*inch)) # ---- SEGMENT 1: ORIENTATION ---- story.append(Paragraph(" SEGMENT 1: Orientation ", seg_header_style)) story.append(Paragraph("About CPSP", sub_header_style)) story.append(Paragraph( "The College of Physicians and Surgeons Pakistan (CPSP) was established in 1962 under an act of parliament. " "It is the premier postgraduate medical institution of Pakistan, responsible for Fellowships, Memberships, and specialist training across medicine, surgery, and dentistry. " "Governance is provided by the CPSP Council, while specialty-specific curricula are developed by faculties in collaboration with the DME.", body_style)) story.append(Paragraph("Residency Program Structure", sub_header_style)) story.append(Paragraph( "Residents register on the CPSP e-portal, where they can access their training schedule, WPBA forms, learning resources, and logbook. " "The training period varies by specialty and ends when competency is achieved, not merely by time served. " "Supervisors guide and assess residents in accredited hospitals; accreditation is reviewed every 1-3 years.", body_style)) story.append(Paragraph("Workplace-Based Assessment (WPBA)", sub_header_style)) bullets_wpba = [ "<b>Mini-CEX</b>: Observes actual clinical encounters (history, examination, management, counselling). ~20 min + 5 min feedback.", "<b>DOPS</b>: Assesses competence in short practical procedures.", "<b>CBD</b>: Case-based discussion of clinical decision-making.", "<b>MSF/TAB</b>: Multi-source and team-based behavioural feedback.", "Specialty-specific alternatives: Mini-IPX (Radiology), Mini-PEX/DOTS (Basic Sciences), O-CEX/OSCAR (Ophthalmology), ECE (Pathology).", "Minimum: one Mini-CEX and one DOPS per quarter. Unsatisfactory performance requires remedial assessment.", ] for b in bullets_wpba: story.append(Paragraph(f"• {b}", bullet_style)) story.append(Paragraph("Resident Responsibilities on the E-Portal", sub_header_style)) story.append(Paragraph( "Residents must maintain an online logbook, complete all prescribed WPBAs, access curricula and guidelines, and communicate with supervisors via the portal. " "Certificates of completion and examination eligibility are managed through the same system.", body_style)) story.append(Spacer(1, 0.1*inch)) # ---- SEGMENT 2: COMMUNICATION SKILLS ---- story.append(Paragraph(" SEGMENT 2: Communication Skills ", seg_header_style)) story.append(Paragraph("Why Communication Matters", sub_header_style)) story.append(Paragraph( "Effective communication is central to patient safety and satisfaction. Poor communication is one of the leading causes of medical errors. " "Good communication builds trust, improves adherence to treatment, and reduces complaints and litigation.", body_style)) story.append(Paragraph("Key Communication Models", sub_header_style)) comm_models = [ ("<b>Calgary-Cambridge Model</b>", "Structures the medical interview into five stages: Initiating the session, Gathering information, Physical examination, Explanation & planning, and Closing the session. Emphasises both disease framework and the patient's own perspective (ideas, concerns, expectations - ICE)."), ("<b>SPIKES Protocol</b>", "Six-step framework for breaking bad news: Setting up, Perception (patient's understanding), Invitation (how much they want to know), Knowledge (delivery of information), Emotions (respond empathetically), Strategy & Summary."), ("<b>SBAR</b>", "Structured handover tool: Situation, Background, Assessment, Recommendation. Used for rapid, safe clinical handovers."), ("<b>Teach-Back Method</b>", "Confirms patient understanding by asking them to repeat information in their own words."), ] for model, desc in comm_models: story.append(Paragraph(f"• {model}: {desc}", bullet_style)) story.append(Paragraph("Non-Verbal Communication", sub_header_style)) story.append(Paragraph( "Body language, eye contact, facial expressions, posture, and proximity all contribute significantly to communication. " "Maintaining an open, non-judgmental demeanour and active listening are as important as verbal content.", body_style)) story.append(Paragraph("Communicating with Difficult Patients", sub_header_style)) story.append(Paragraph( "Remain calm, acknowledge emotions, avoid confrontation, and use de-escalation strategies. " "In written communication (referrals, discharge notes), clarity and completeness are essential to prevent information gaps.", body_style)) story.append(Spacer(1, 0.1*inch)) # ---- SEGMENT 3: PROFESSIONALISM & ETHICS ---- story.append(Paragraph(" SEGMENT 3: Professionalism & Ethics ", seg_header_style)) story.append(Paragraph("Core Professional Attributes", sub_header_style)) prof_attrs = [ "Altruism - placing patient interests above self-interest.", "Accountability - to patients, society, and the profession.", "Excellence - commitment to ongoing learning and competence.", "Duty - availability and responsiveness to patients.", "Honour and integrity - honesty in all professional actions.", "Respect for others - patients, colleagues, and support staff.", ] for a in prof_attrs: story.append(Paragraph(f"• {a}", bullet_style)) story.append(Paragraph("The Four Pillars of Medical Ethics", sub_header_style)) ethics_pillars = [ ("<b>Autonomy</b>", "Respect the patient's right to make informed decisions about their own care. Obtain valid informed consent."), ("<b>Beneficence</b>", "Act in the best interest of the patient; provide treatments with proven benefit."), ("<b>Non-Maleficence</b>", "Avoid causing harm; weigh risks against benefits carefully."), ("<b>Justice</b>", "Fair distribution of healthcare resources and equitable treatment of all patients regardless of background."), ] for pillar, desc in ethics_pillars: story.append(Paragraph(f"• {pillar}: {desc}", bullet_style)) story.append(Paragraph("Informed Consent", sub_header_style)) story.append(Paragraph( "Valid consent requires the patient to have decision-making capacity, be given adequate information (diagnosis, treatment options, risks, benefits, alternatives), " "and make a voluntary, uncoerced choice. Special considerations apply for minors, mentally incapacitated patients, and emergencies.", body_style)) story.append(Paragraph("Confidentiality", sub_header_style)) story.append(Paragraph( "Patient information must be kept confidential. Exceptions include situations of serious risk to others (e.g. public health threats), " "legal requirements, or when the patient provides consent for disclosure.", body_style)) story.append(Paragraph("Clinical Ethics in Practice (Case Scenarios)", sub_header_style)) story.append(Paragraph( "The segment presents real-life scenarios illustrating ethical tensions, such as a patient with bacterial meningitis refusing treatment " "(beneficence vs. autonomy) and a patient declining surgery for a probable lung cancer (informed refusal by a competent adult). " "The key principle: a competent adult's informed refusal must be respected, but clinicians must ensure true understanding and explore underlying fears.", body_style)) story.append(Paragraph("Unprofessional Behaviour", sub_header_style)) story.append(Paragraph( "Includes disrespect, dishonesty, impairment, boundary violations, discrimination, and failure to report errors. " "CPSP has a formal mechanism for addressing complaints; residents are expected to uphold the profession's standards at all times.", body_style)) story.append(Spacer(1, 0.1*inch)) # ---- SEGMENT 4: LEADERSHIP & TEAM BUILDING ---- story.append(Paragraph(" SEGMENT 4: Leadership and Team Building ", seg_header_style)) story.append(Paragraph("Leadership Styles", sub_header_style)) leadership = [ ("<b>Transformational</b>", "Inspires and motivates through vision and enthusiasm; fosters innovation."), ("<b>Transactional</b>", "Relies on clear roles, rules, and rewards/consequences."), ("<b>Servant</b>", "Prioritises the needs of the team; builds trust and well-being."), ("<b>Democratic/Participative</b>", "Involves team in decision-making; improves buy-in."), ("<b>Autocratic</b>", "Centralised decision-making; appropriate in emergencies."), ("<b>Laissez-Faire</b>", "Delegates decisions to team; effective with highly competent, self-directed teams."), ] for style_name, desc in leadership: story.append(Paragraph(f"• {style_name}: {desc}", bullet_style)) story.append(Paragraph("Effective Teamwork in Healthcare", sub_header_style)) story.append(Paragraph( "Evidence shows that multidisciplinary teamwork reduces hospitalisation time, lowers patient mortality, improves patient satisfaction, " "and increases staff well-being. Effective teams have shared objectives, clear roles, open communication, and constructive debate.", body_style)) team_dims = [ "<b>Clear Team Identity</b>: Shared purpose, mutual support, reduced duplication.", "<b>Team Objectives</b>: 6-8 key goals aligned with organisational mission.", "<b>Role Clarity</b>: Prevents overlap and gaps; increases confidence.", "<b>Effective Processes</b>: Participative decision-making, open information flow, constructive conflict.", "<b>Inter-Team Working</b>: Cooperative relationships across departments and disciplines.", "<b>Clarity of Leadership</b>: Defined leadership correlates with lower stress and higher innovation.", ] for d in team_dims: story.append(Paragraph(f"• {d}", bullet_style)) story.append(Paragraph("Team Development Stages (Tuckman)", sub_header_style)) tuckman = ["Forming - team is assembled, roles unclear.", "Storming - conflicts emerge as roles are negotiated.", "Norming - norms established, cooperation improves.", "Performing - team works effectively toward shared goals.", "Adjourning - team disbands or restructures."] for t in tuckman: story.append(Paragraph(f"• {t}", bullet_style)) story.append(Paragraph("Self-Assessment Tools (Appendices)", sub_header_style)) story.append(Paragraph( "Residents are asked to complete three self-assessment tools before the face-to-face workshop: " "(1) Personal Resilience Questionnaire - identifies resilience factors and areas for growth; " "(2) Big Five Personality Test (OCEAN) - measures Openness, Conscientiousness, Extraversion, Agreeableness, Neuroticism; " "(3) Leadership Style Questionnaire - identifies preferred leadership approach across Democratic, Coaching, Visionary, Pacesetting, and other styles. " "Results are brought to the workshop for group discussion.", body_style)) story.append(Spacer(1, 0.2*inch)) story.append(HRFlowable(width="100%", thickness=1, color=colors.HexColor('#1a3a5c'), spaceAfter=8)) story.append(Paragraph( "<i>Summary prepared from: SCoPE Workshop Reading Material for Residents, Directorate of Medical Education, CPSP. (52 pages)</i>", ParagraphStyle('Footer', parent=styles['Normal'], fontSize=8, textColor=colors.grey, alignment=TA_CENTER))) doc.build(story) print("PDF created successfully.") EOF
SCoPE Workshop Summary
PDF Document · PDF