[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7360DRQJR23SSHTRBA23H6T":3,"skill-same:01M7360DRQJR23SSHTRBA23H6T":96},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":51,"repositoryHtmlUrl":52,"repositoryHomepageUrl":53,"ownerHtmlUrl":54,"ownerBlogUrl":55,"ownerDescription":56,"updatedAt":57,"install":58,"resources":71},"01M7360DRQJR23SSHTRBA23H6T","clinical-doc-assistant",null,"Use this skill when a clinician, practice manager, or healthcare developer needs to draft, structure, or retrieve clinical documentation — including SOAP notes, referral letters, prior authorization forms, discharge summaries, and care plan narratives. Connects to FHIR R4-compliant APIs (Epic, Cerner, Azure Health Data Services, HAPI FHIR) to pull structured patient data and generate documentation drafts. Also supports manual input when no EHR connection is available. DO NOT use for direct diagnosis, prescribing decisions, or any task requiring a licensed clinical judgment — this skill assists with documentation only.","gdgshanghai\u002FGemma4-Hackathon-ShangHai","gdgshanghai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5126070?v=4","01M735YHZA3ECRD4R8DEYB7FHG","GDG Shanghai","01M735YJ01SZV0AZMKN5DFSXH7",13,"MIT","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: clinical-doc-assistant\nversion: \"1.0.4\"\ndescription: \"Use this skill when a clinician, practice manager, or healthcare developer needs to draft, structure, or retrieve clinical documentation — including SOAP notes, referral letters, prior authorization forms, discharge summaries, and care plan narratives. Connects to FHIR R4-compliant APIs (Epic, Cerner, Azure Health Data Services, HAPI FHIR) to pull structured patient data and generate documentation drafts. Also supports manual input when no EHR connection is available. DO NOT use for direct diagnosis, prescribing decisions, or any task requiring a licensed clinical judgment — this skill assists with documentation only.\"\ntags: [\"healthcare\", \"fhir\", \"clinical\", \"ehr\", \"documentation\", \"soap\", \"prior-auth\", \"referral\", \"discharge\"]\nauthor: \"optimusprime19\"\nlicense: \"MIT\"\nhomepage: https:\u002F\u002Fgithub.com\u002Foptimusprime19\u002Fclinical-doc-assistant\nrepository: https:\u002F\u002Fgithub.com\u002Foptimusprime19\u002Fclinical-doc-assistant\nrequiredEnv:\n  - FHIR_BASE_URL        # e.g. https:\u002F\u002Fyour-ehr.example.com\u002Ffhir\u002FR4 (not needed if FHIR_SANDBOX_MODE=true)\n  - FHIR_CLIENT_ID       # OAuth2 client ID from your EHR app registration\n  - FHIR_CLIENT_SECRET   # OAuth2 client secret\n  - FHIR_TOKEN_URL       # Token endpoint for SMART on FHIR auth\noptionalEnv:\n  - FHIR_TENANT_ID       # Required for Azure Health Data Services only\n  - FHIR_SANDBOX_MODE    # Set to \"true\" to use public HAPI sandbox — no credentials needed\n  - CLINICAL_DOC_API_URL # Hosted backend URL for credit-based generation (see backend.py)\n  - CLINICAL_DOC_API_KEY # API key for the hosted backend\n  - LLM_API_KEY          # Required server-side if you self-host backend.py. Uses Gemma 4 via OpenAI-compatible API.\n---\n\n# Clinical Documentation Assistant\n\n## Overview\n\nThis skill enables an OpenClaw agent to connect to any FHIR R4-compliant EHR, retrieve structured patient data, and generate high-quality clinical documentation drafts. It covers the most time-consuming document types in outpatient and inpatient settings.\n\n**Supported document types:**\n- SOAP notes (Subjective \u002F Objective \u002F Assessment \u002F Plan)\n- Referral letters (specialist, imaging, therapy)\n- Prior authorization requests (insurance)\n- Discharge summaries\n- Care plan narratives\n- Patient-facing after-visit summaries\n\n**Supported FHIR backends:**\n- Epic (SMART on FHIR)\n- Cerner (Millennium)\n- Azure Health Data Services\n- HAPI FHIR (public sandbox for testing)\n- Any R4-compliant server\n\n> ⚠️ **Clinical Disclaimer:** All output is a documentation *draft* intended to be reviewed, edited, and signed by a licensed clinician. This skill does not provide clinical advice, diagnoses, or prescriptions.\n\n> 🔒 **Privacy \u002F PHI Warning:** FHIR data is fetched into the agent's context for the session only and is not written to disk by this skill. If you use the hosted backend (`CLINICAL_DOC_API_URL`), patient context is transmitted to that server — only use a backend you control in a HIPAA-eligible environment. **Do not use a third-party hosted backend with real patient data unless a BAA is in place.** For development and testing, always use `FHIR_SANDBOX_MODE=true` with synthetic data only.\n\n---\n\n## Quick Start (Sandbox Mode — No EHR Needed)\n\nSet `FHIR_SANDBOX_MODE=true` to use the public HAPI R4 sandbox. No credentials required. Ideal for testing and development.\n\n```bash\nexport FHIR_SANDBOX_MODE=true\n```\n\nThen ask your agent:\n> \"Pull patient John Smith from the FHIR sandbox and draft a SOAP note for today's hypertension follow-up.\"\n\n---\n\n## Authentication\n\nThis skill uses **SMART on FHIR** (OAuth2) for EHR connections. Set up once per environment.\n\n### Step 1 — Register your app with your EHR\n\nEach EHR has its own developer portal:\n- **Epic:** https:\u002F\u002Ffhir.epic.com → create a non-production app → note Client ID\n- **Cerner:** https:\u002F\u002Fcode.cerner.com → register app → note Client ID + Secret\n- **Azure AHDS:** Azure Portal → FHIR service → Authentication\n\n### Step 2 — Set environment variables\n\n```bash\nexport FHIR_BASE_URL=\"https:\u002F\u002Ffhir.epic.com\u002Finterconnect-fhir-oauth\u002Fapi\u002FFHIR\u002FR4\"\nexport FHIR_CLIENT_ID=\"your-client-id\"\nexport FHIR_CLIENT_SECRET=\"your-client-secret\"\nexport FHIR_TOKEN_URL=\"https:\u002F\u002Ffhir.epic.com\u002Finterconnect-fhir-oauth\u002Foauth2\u002Ftoken\"\n```\n\n### Step 3 — Test the connection\n\nAsk the agent:\n> \"Check my FHIR connection status.\"\n\nThe agent will attempt a token fetch and a `GET \u002Fmetadata` call, then report back.\n\n---\n\n## FHIR Data Retrieval\n\nThe agent fetches only the resources needed for the requested document. All calls are read-only GET requests.\n\n### Patient lookup\n\n```\n\"Find patient [name] born [DOB]\"\n\"Look up patient MRN 1234567\"\n\"Search for patients with last name Rodriguez\"\n```\n\nInternally calls:\n```\nGET \u002FPatient?name=Rodriguez&birthdate=1975-04-12\nGET \u002FPatient\u002F[id]\n```\n\n### Condition list\n\n```\n\"What are the active conditions for this patient?\"\n```\n\nCalls:\n```\nGET \u002FCondition?patient=[id]&clinical-status=active\n```\n\n### Medication list\n\n```\n\"Pull current medications for patient [id]\"\n```\n\nCalls:\n```\nGET \u002FMedicationRequest?patient=[id]&status=active\n```\n\n### Recent vitals\n\n```\n\"Get the last set of vitals for this patient\"\n```\n\nCalls:\n```\nGET \u002FObservation?patient=[id]&category=vital-signs&_sort=-date&_count=10\n```\n\n### Lab results\n\n```\n\"Pull recent labs — focus on HbA1c and BMP\"\n```\n\nCalls:\n```\nGET \u002FObservation?patient=[id]&category=laboratory&_sort=-date&_count=20\n```\n\n### Encounter history\n\n```\n\"Show encounters from the last 6 months\"\n```\n\nCalls:\n```\nGET \u002FEncounter?patient=[id]&date=ge2025-09-01&_sort=-date\n```\n\n---\n\n## Document Generation\n\nOnce patient data is retrieved, ask the agent to generate any document type.\n\n### SOAP Note\n\n**Trigger phrases:**\n- \"Draft a SOAP note for today's visit\"\n- \"Write a SOAP note for this patient's diabetes follow-up\"\n- \"Generate a clinical note — chief complaint is chest pain\"\n\n**What the agent does:**\n1. Retrieves active conditions, current meds, recent vitals, and relevant labs\n2. Asks you for any additional subjective information (chief complaint, HPI)\n3. Structures the note into S \u002F O \u002F A \u002F P sections\n4. Flags any data gaps (missing vitals, no recent labs)\n\n**Example output structure:**\n\n```\nSUBJECTIVE:\nPatient is a 58-year-old male presenting for routine diabetes follow-up.\nReports improved energy since medication adjustment. No hypoglycemic episodes.\nDenies chest pain, shortness of breath, or lower extremity edema.\n\nOBJECTIVE:\nVitals (2026-03-15): BP 132\u002F78, HR 72, Wt 198 lbs, BMI 29.4\nHbA1c (2026-02-10): 7.2% (↓ from 7.9% in November)\nCurrent Meds: Metformin 1000mg BID, Lisinopril 10mg daily\n\nASSESSMENT:\n1. Type 2 Diabetes Mellitus — improving, at goal\n2. Hypertension — controlled\n\nPLAN:\n1. Continue current regimen\n2. Repeat HbA1c in 3 months\n3. Annual ophthalmology referral ordered\n4. Follow up in 3 months or sooner if concerns\n```\n\n---\n\n### Referral Letter\n\n**Trigger phrases:**\n- \"Write a referral to cardiology for this patient\"\n- \"Draft a referral letter to Dr. Chen for physical therapy\"\n- \"Generate an imaging referral for MRI of the lumbar spine\"\n\n**What the agent does:**\n1. Pulls relevant conditions, meds, and recent encounter notes\n2. Asks for referring provider name, specialty, and clinical question\n3. Formats a professional referral letter with clinical context\n\n**Example:**\n\n```\n[Date]\n\nRe: [Patient Name], DOB [Date], MRN [Number]\n\nDear Dr. [Specialist],\n\nI am referring the above-named patient for cardiology evaluation.\n[Patient] is a 64-year-old female with a history of hypertension and\nhyperlipidemia presenting with exertional dyspnea over the past 6 weeks.\nRecent ECG showed non-specific ST changes. Echo has not been performed.\n\nCurrent medications: Amlodipine 5mg, Atorvastatin 40mg, ASA 81mg.\n\nI would appreciate your evaluation and recommendations.\n\nSincerely,\n[Referring Provider]\n```\n\n---\n\n### Prior Authorization Request\n\n**Trigger phrases:**\n- \"Draft a prior auth for [medication\u002Fprocedure]\"\n- \"Generate a prior authorization for Humira for this patient\"\n- \"Write a PA request for MRI lumbar spine — payer is BlueCross\"\n\n**What the agent does:**\n1. Retrieves diagnosis codes (ICD-10) from active conditions\n2. Looks up the requested item's typical HCPCS\u002FCPT code\n3. Generates a structured PA narrative with clinical justification\n4. Lists supporting labs or imaging that strengthen the case\n\n**Key fields generated:**\n- Member ID (from input)\n- Requesting provider NPI (from input)\n- Diagnosis codes (from FHIR Condition resources)\n- Requested service + procedure\u002Fdrug code\n- Clinical justification narrative\n- Supporting documentation checklist\n\n---\n\n### Discharge Summary\n\n**Trigger phrases:**\n- \"Generate a discharge summary for this patient\"\n- \"Draft a hospital discharge note — patient is going home today\"\n\n**What the agent does:**\n1. Pulls the current\u002Frecent encounter, active conditions, procedures, and meds\n2. Asks for admission diagnosis, hospital course summary, and discharge instructions\n3. Formats a complete discharge summary with follow-up plan\n\n---\n\n### After-Visit Summary (Patient-Facing)\n\n**Trigger phrases:**\n- \"Write a patient-friendly after-visit summary\"\n- \"Generate an AVS in plain language for this patient\"\n\n**What the agent does:**\n1. Translates clinical note content into plain English (8th-grade reading level)\n2. Lists medications with plain-language instructions\n3. Includes follow-up appointments and warning signs to watch for\n\n---\n\n## Manual Mode (No FHIR Connection)\n\nIf no EHR is connected, the agent will prompt you to provide patient data manually. Useful for small practices, telehealth, or demos.\n\nAsk: \"Draft a SOAP note — I'll provide the patient data manually.\"\n\nThe agent will ask for:\n- Chief complaint and HPI\n- Vitals\n- Active conditions and medications\n- Assessment and plan outline\n\n---\n\n## Hosted Backend (Credit-Based Generation)\n\nFor high-volume use or team deployments, a managed API backend handles generation, audit logging, and HIPAA-aligned data handling.\n\nSet these variables to enable:\n```bash\nexport CLINICAL_DOC_API_URL=\"https:\u002F\u002Fapi.yourdomain.com\u002Fv1\"\nexport CLINICAL_DOC_API_KEY=\"your-api-key\"\n```\n\nWhen set, document generation routes through the hosted backend instead of the local LLM. Credits are deducted per document generated. Visit [your site] to purchase credits and manage your account.\n\n**Hosted backend advantages:**\n- Audit log of every document draft (for compliance)\n- No patient data stored — stateless processing\n- Team accounts with per-provider usage tracking\n- 99.9% uptime SLA\n\n---\n\n## Data Privacy & HIPAA Considerations\n\n- **Local mode:** Patient data is fetched into the agent's context for the duration of the session only. No data is written to disk by this skill.\n- **Hosted mode:** Requests are processed statelessly. No PHI is retained after response delivery. Review the hosted backend's BAA before use in production.\n- **Audit trail:** Clinicians should save final signed documents in their EHR per their organization's policies. This skill generates drafts only.\n- **De-identification:** For development and testing, use `FHIR_SANDBOX_MODE=true` with synthetic data only.\n\n> 🔒 Before using with real patient data, ensure your deployment satisfies your organization's HIPAA security requirements and that a Business Associate Agreement (BAA) is in place with any third-party service.\n\n---\n\n## Troubleshooting\n\n**\"FHIR connection failed: 401 Unauthorized\"**\n- Token may have expired. The skill auto-refreshes tokens, but check that `FHIR_CLIENT_SECRET` is current.\n- Confirm your app registration is approved and not in sandbox-only mode.\n\n**\"Patient not found\"**\n- Try searching by MRN instead of name (name matching varies by EHR).\n- Check that your app has `Patient.read` and `Patient.search` scopes granted.\n\n**\"Missing vitals \u002F labs in output\"**\n- The patient may not have recent observations in the EHR.\n- The agent will flag missing data sections in the draft and prompt you to fill them in manually.\n\n**\"SMART on FHIR scopes error\"**\n- Ensure your registered app includes these scopes:\n  `patient\u002FPatient.read patient\u002FCondition.read patient\u002FMedicationRequest.read patient\u002FObservation.read patient\u002FEncounter.read`\n\n**Sandbox mode not working**\n- Public HAPI sandbox: `https:\u002F\u002Fhapi.fhir.org\u002FbaseR4`\n- Confirm `FHIR_SANDBOX_MODE=true` is set and `FHIR_BASE_URL` is unset or points to the sandbox.\n\n---\n\n## Example Workflows\n\n### Full outpatient visit workflow\n```\nUser: \"Pull patient Jane Doe, DOB 1968-03-22, from the FHIR server.\"\nAgent: [Fetches Patient, Condition, MedicationRequest, Observation]\n       \"Found Jane Doe (MRN 7823991). Active conditions: HTN, T2DM, CKD stage 2.\n        Current meds: Lisinopril, Metformin, Amlodipine. Last vitals: 3 weeks ago.\"\n\nUser: \"She's here for a diabetes follow-up. Chief complaint: fatigue, better than last visit.\n       Draft a SOAP note.\"\nAgent: [Generates full SOAP note with populated O section from FHIR data]\n       \"Here is the draft SOAP note. Vitals from today's visit are missing —\n        please add them before signing.\"\n```\n\n### Quick prior auth\n```\nUser: \"Generate a prior auth for Ozempic for this patient — payer is Aetna.\"\nAgent: [Pulls active conditions, labs (HbA1c), current meds]\n       \"Draft PA narrative ready. Diagnosis: T2DM (E11.9). Supporting:\n        HbA1c 8.4% (2026-02-01), inadequate response to Metformin 2000mg.\n        Do you want to add any additional clinical notes before I finalize?\"\n```\n\n---\n\n## Version History\n\n| Version | Date       | Changes                              |\n|---------|------------|--------------------------------------|\n| 1.0.5   | 2026-06-08 | Backend uses Gemma 4 API (`LLM_API_KEY`). |\n| 1.0.4   | 2026-03-29 | Added CORS production warning. |\n| 1.0.0   | 2026-03-29 | Initial release. SOAP, referral, prior auth, discharge, AVS. SMART on FHIR auth. Sandbox mode. |\n\n---\n\n*Questions or issues? Open a GitHub issue or reach out via the OpenClaw Discord.*\n","# Clinical Documentation Assistant\n\n## Overview\n\nThis skill enables an OpenClaw agent to connect to any FHIR R4-compliant EHR, retrieve structured patient data, and generate high-quality clinical documentation drafts. It covers the most time-consuming document types in outpatient and inpatient settings.\n\n**Supported document types:**\n- SOAP notes (Subjective \u002F Objective \u002F Assessment \u002F Plan)\n- Referral letters (specialist, imaging, therapy)\n- Prior authorization requests (insurance)\n- Discharge summaries\n- Care plan narratives\n- Patient-facing after-visit summaries\n\n**Supported FHIR backends:**\n- Epic (SMART on FHIR)\n- Cerner (Millennium)\n- Azure Health Data Services\n- HAPI FHIR (public sandbox for testing)\n- Any R4-compliant server\n\n> ⚠️ **Clinical Disclaimer:** All output is a documentation *draft* intended to be reviewed, edited, and signed by a licensed clinician. This skill does not provide clinical advice, diagnoses, or prescriptions.\n\n> 🔒 **Privacy \u002F PHI Warning:** FHIR data is fetched into the agent's context for the session only and is not written to disk by this skill. If you use the hosted backend (`CLINICAL_DOC_API_URL`), patient context is transmitted to that server — only use a backend you control in a HIPAA-eligible environment. **Do not use a third-party hosted backend with real patient data unless a BAA is in place.** For development and testing, always use `FHIR_SANDBOX_MODE=true` with synthetic data only.\n\n---\n\n## Quick Start (Sandbox Mode — No EHR Needed)\n\nSet `FHIR_SANDBOX_MODE=true` to use the public HAPI R4 sandbox. No credentials required. Ideal for testing and development.\n\n```bash\nexport FHIR_SANDBOX_MODE=true\n```\n\nThen ask your agent:\n> \"Pull patient John Smith from the FHIR sandbox and draft a SOAP note for today's hypertension follow-up.\"\n\n---\n\n## Authentication\n\nThis skill uses **SMART on FHIR** (OAuth2) for EHR connections. Set up once per environment.\n\n### Step 1 — Register your app with your EHR\n\nEach EHR has its own developer portal:\n- **Epic:** https:\u002F\u002Ffhir.epic.com → create a non-production app → note Client ID\n- **Cerner:** https:\u002F\u002Fcode.cerner.com → register app → note Client ID + Secret\n- **Azure AHDS:** Azure Portal → FHIR service → Authentication\n\n### Step 2 — Set environment variables\n\n```bash\nexport FHIR_BASE_URL=\"https:\u002F\u002Ffhir.epic.com\u002Finterconnect-fhir-oauth\u002Fapi\u002FFHIR\u002FR4\"\nexport FHIR_CLIENT_ID=\"your-client-id\"\nexport FHIR_CLIENT_SECRET=\"your-client-secret\"\nexport FHIR_TOKEN_URL=\"https:\u002F\u002Ffhir.epic.com\u002Finterconnect-fhir-oauth\u002Foauth2\u002Ftoken\"\n```\n\n### Step 3 — Test the connection\n\nAsk the agent:\n> \"Check my FHIR connection status.\"\n\nThe agent will attempt a token fetch and a `GET \u002Fmetadata` call, then report back.\n\n---\n\n## FHIR Data Retrieval\n\nThe agent fetches only the resources needed for the requested document. All calls are read-only GET requests.\n\n### Patient lookup\n\n```\n\"Find patient [name] born [DOB]\"\n\"Look up patient MRN 1234567\"\n\"Search for patients with last name Rodriguez\"\n```\n\nInternally calls:\n```\nGET \u002FPatient?name=Rodriguez&birthdate=1975-04-12\nGET \u002FPatient\u002F[id]\n```\n\n### Condition list\n\n```\n\"What are the active conditions for this patient?\"\n```\n\nCalls:\n```\nGET \u002FCondition?patient=[id]&clinical-status=active\n```\n\n### Medication list\n\n```\n\"Pull current medications for patient [id]\"\n```\n\nCalls:\n```\nGET \u002FMedicationRequest?patient=[id]&status=active\n```\n\n### Recent vitals\n\n```\n\"Get the last set of vitals for this patient\"\n```\n\nCalls:\n```\nGET \u002FObservation?patient=[id]&category=vital-signs&_sort=-date&_count=10\n```\n\n### Lab results\n\n```\n\"Pull recent labs — focus on HbA1c and BMP\"\n```\n\nCalls:\n```\nGET \u002FObservation?patient=[id]&category=laboratory&_sort=-date&_count=20\n```\n\n### Encounter history\n\n```\n\"Show encounters from the last 6 months\"\n```\n\nCalls:\n```\nGET \u002FEncounter?patient=[id]&date=ge2025-09-01&_sort=-date\n```\n\n---\n\n## Document Generation\n\nOnce patient data is retrieved, ask the agent to generate any document type.\n\n### SOAP Note\n\n**Trigger phrases:**\n- \"Draft a SOAP note for today's visit\"\n- \"Write a SOAP note for this patient's diabetes follow-up\"\n- \"Generate a clinical note — chief complaint is chest pain\"\n\n**What the agent does:**\n1. Retrieves active conditions, current meds, recent vitals, and relevant labs\n2. Asks you for any additional subjective information (chief complaint, HPI)\n3. Structures the note into S \u002F O \u002F A \u002F P sections\n4. Flags any data gaps (missing vitals, no recent labs)\n\n**Example output structure:**\n\n```\nSUBJECTIVE:\nPatient is a 58-year-old male presenting for routine diabetes follow-up.\nReports improved energy since medication adjustment. No hypoglycemic episodes.\nDenies chest pain, shortness of breath, or lower extremity edema.\n\nOBJECTIVE:\nVitals (2026-03-15): BP 132\u002F78, HR 72, Wt 198 lbs, BMI 29.4\nHbA1c (2026-02-10): 7.2% (↓ from 7.9% in November)\nCurrent Meds: Metformin 1000mg BID, Lisinopril 10mg daily\n\nASSESSMENT:\n1. Type 2 Diabetes Mellitus — improving, at goal\n2. Hypertension — controlled\n\nPLAN:\n1. Continue current regimen\n2. Repeat HbA1c in 3 months\n3. Annual ophthalmology referral ordered\n4. Follow up in 3 months or sooner if concerns\n```\n\n---\n\n### Referral Letter\n\n**Trigger phrases:**\n- \"Write a referral to cardiology for this patient\"\n- \"Draft a referral letter to Dr. Chen for physical therapy\"\n- \"Generate an imaging referral for MRI of the lumbar spine\"\n\n**What the agent does:**\n1. Pulls relevant conditions, meds, and recent encounter notes\n2. Asks for referring provider name, specialty, and clinical question\n3. Formats a professional referral letter with clinical context\n\n**Example:**\n\n```\n[Date]\n\nRe: [Patient Name], DOB [Date], MRN [Number]\n\nDear Dr. [Specialist],\n\nI am referring the above-named patient for cardiology evaluation.\n[Patient] is a 64-year-old female with a history of hypertension and\nhyperlipidemia presenting with exertional dyspnea over the past 6 weeks.\nRecent ECG showed non-specific ST changes. Echo has not been performed.\n\nCurrent medications: Amlodipine 5mg, Atorvastatin 40mg, ASA 81mg.\n\nI would appreciate your evaluation and recommendations.\n\nSincerely,\n[Referring Provider]\n```\n\n---\n\n### Prior Authorization Request\n\n**Trigger phrases:**\n- \"Draft a prior auth for [medication\u002Fprocedure]\"\n- \"Generate a prior authorization for Humira for this patient\"\n- \"Write a PA request for MRI lumbar spine — payer is BlueCross\"\n\n**What the agent does:**\n1. Retrieves diagnosis codes (ICD-10) from active conditions\n2. Looks up the requested item's typical HCPCS\u002FCPT code\n3. Generates a structured PA narrative with clinical justification\n4. Lists supporting labs or imaging that strengthen the case\n\n**Key fields generated:**\n- Member ID (from input)\n- Requesting provider NPI (from input)\n- Diagnosis codes (from FHIR Condition resources)\n- Requested service + procedure\u002Fdrug code\n- Clinical justification narrative\n- Supporting documentation checklist\n\n---\n\n### Discharge Summary\n\n**Trigger phrases:**\n- \"Generate a discharge summary for this patient\"\n- \"Draft a hospital discharge note — patient is going home today\"\n\n**What the agent does:**\n1. Pulls the current\u002Frecent encounter, active conditions, procedures, and meds\n2. Asks for admission diagnosis, hospital course summary, and discharge instructions\n3. Formats a complete discharge summary with follow-up plan\n\n---\n\n### After-Visit Summary (Patient-Facing)\n\n**Trigger phrases:**\n- \"Write a patient-friendly after-visit summary\"\n- \"Generate an AVS in plain language for this patient\"\n\n**What the agent does:**\n1. Translates clinical note content into plain English (8th-grade reading level)\n2. Lists medications with plain-language instructions\n3. Includes follow-up appointments and warning signs to watch for\n\n---\n\n## Manual Mode (No FHIR Connection)\n\nIf no EHR is connected, the agent will prompt you to provide patient data manually. Useful for small practices, telehealth, or demos.\n\nAsk: \"Draft a SOAP note — I'll provide the patient data manually.\"\n\nThe agent will ask for:\n- Chief complaint and HPI\n- Vitals\n- Active conditions and medications\n- Assessment and plan outline\n\n---\n\n## Hosted Backend (Credit-Based Generation)\n\nFor high-volume use or team deployments, a managed API backend handles generation, audit logging, and HIPAA-aligned data handling.\n\nSet these variables to enable:\n```bash\nexport CLINICAL_DOC_API_URL=\"https:\u002F\u002Fapi.yourdomain.com\u002Fv1\"\nexport CLINICAL_DOC_API_KEY=\"your-api-key\"\n```\n\nWhen set, document generation routes through the hosted backend instead of the local LLM. Credits are deducted per document generated. Visit [your site] to purchase credits and manage your account.\n\n**Hosted backend advantages:**\n- Audit log of every document draft (for compliance)\n- No patient data stored — stateless processing\n- Team accounts with per-provider usage tracking\n- 99.9% uptime SLA\n\n---\n\n## Data Privacy & HIPAA Considerations\n\n- **Local mode:** Patient data is fetched into the agent's context for the duration of the session only. No data is written to disk by this skill.\n- **Hosted mode:** Requests are processed statelessly. No PHI is retained after response delivery. Review the hosted backend's BAA before use in production.\n- **Audit trail:** Clinicians should save final signed documents in their EHR per their organization's policies. This skill generates drafts only.\n- **De-identification:** For development and testing, use `FHIR_SANDBOX_MODE=true` with synthetic data only.\n\n> 🔒 Before using with real patient data, ensure your deployment satisfies your organization's HIPAA security requirements and that a Business Associate Agreement (BAA) is in place with any third-party service.\n\n---\n\n## Troubleshooting\n\n**\"FHIR connection failed: 401 Unauthorized\"**\n- Token may have expired. The skill auto-refreshes tokens, but check that `FHIR_CLIENT_SECRET` is current.\n- Confirm your app registration is approved and not in sandbox-only mode.\n\n**\"Patient not found\"**\n- Try searching by MRN instead of name (name matching varies by EHR).\n- Check that your app has `Patient.read` and `Patient.search` scopes granted.\n\n**\"Missing vitals \u002F labs in output\"**\n- The patient may not have recent observations in the EHR.\n- The agent will flag missing data sections in the draft and prompt you to fill them in manually.\n\n**\"SMART on FHIR scopes error\"**\n- Ensure your registered app includes these scopes:\n  `patient\u002FPatient.read patient\u002FCondition.read patient\u002FMedicationRequest.read patient\u002FObservation.read patient\u002FEncounter.read`\n\n**Sandbox mode not working**\n- Public HAPI sandbox: `https:\u002F\u002Fhapi.fhir.org\u002FbaseR4`\n- Confirm `FHIR_SANDBOX_MODE=true` is set and `FHIR_BASE_URL` is unset or points to the sandbox.\n\n---\n\n## Example Workflows\n\n### Full outpatient visit workflow\n```\nUser: \"Pull patient Jane Doe, DOB 1968-03-22, from the FHIR server.\"\nAgent: [Fetches Patient, Condition, MedicationRequest, Observation]\n       \"Found Jane Doe (MRN 7823991). Active conditions: HTN, T2DM, CKD stage 2.\n        Current meds: Lisinopril, Metformin, Amlodipine. Last vitals: 3 weeks ago.\"\n\nUser: \"She's here for a diabetes follow-up. Chief complaint: fatigue, better than last visit.\n       Draft a SOAP note.\"\nAgent: [Generates full SOAP note with populated O section from FHIR data]\n       \"Here is the draft SOAP note. Vitals from today's visit are missing —\n        please add them before signing.\"\n```\n\n### Quick prior auth\n```\nUser: \"Generate a prior auth for Ozempic for this patient — payer is Aetna.\"\nAgent: [Pulls active conditions, labs (HbA1c), current meds]\n       \"Draft PA narrative ready. Diagnosis: T2DM (E11.9). Supporting:\n        HbA1c 8.4% (2026-02-01), inadequate response to Metformin 2000mg.\n        Do you want to add any additional clinical notes before I finalize?\"\n```\n\n---\n\n## Version History\n\n| Version | Date       | Changes                              |\n|---------|------------|--------------------------------------|\n| 1.0.5   | 2026-06-08 | Backend uses Gemma 4 API (`LLM_API_KEY`). |\n| 1.0.4   | 2026-03-29 | Added CORS production warning. |\n| 1.0.0   | 2026-03-29 | Initial release. SOAP, referral, prior auth, discharge, AVS. SMART on FHIR auth. Sandbox mode. |\n\n---\n\n*Questions or issues? Open a GitHub issue or reach out via the OpenClaw Discord.*\n",{"name":5,"tags":24,"author":34,"license":15,"version":35,"homepage":36,"repository":36,"description":7,"optionalEnv":37,"requiredEnv":43},[25,26,27,28,29,30,31,32,33],"healthcare","fhir","clinical","ehr","documentation","soap","prior-auth","referral","discharge","optimusprime19","1.0.4","https:\u002F\u002Fgithub.com\u002Foptimusprime19\u002Fclinical-doc-assistant",[38,39,40,41,42],"FHIR_TENANT_ID","FHIR_SANDBOX_MODE","CLINICAL_DOC_API_URL","CLINICAL_DOC_API_KEY","LLM_API_KEY",[44,45,46,47],"FHIR_BASE_URL","FHIR_CLIENT_ID","FHIR_CLIENT_SECRET","FHIR_TOKEN_URL","main","387b39b08bd780367babea04534da9849b379997","submissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant",57,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai","https:\u002F\u002Fhackathon.googdg.cn","https:\u002F\u002Fgithub.com\u002Fgdgshanghai","https:\u002F\u002Fwww.meetup.com\u002FShanghai-GDG","上海谷歌开发者社区","2026-06-09 12:00:59",{"source":8,"skillName":5,"commands":59,"prompt":69,"zipAvailable":70},[60,63,66],{"tool":61,"command":62},"npx","npx skills add gdgshanghai\u002FGemma4-Hackathon-ShangHai --skill clinical-doc-assistant",{"tool":64,"command":65},"bunx","bunx skills add gdgshanghai\u002FGemma4-Hackathon-ShangHai --skill clinical-doc-assistant",{"tool":67,"command":68},"pnpm","pnpm dlx skills add gdgshanghai\u002FGemma4-Hackathon-ShangHai --skill clinical-doc-assistant","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002FSKILL.md",true,[72,78,84,88,92],{"path":73,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":76,"sourceHtmlUrl":77},"_meta.json","REFERENCE","参考文档",141,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002F_meta.json",{"path":79,"resourceType":80,"resourceTypeDesc":81,"sizeBytes":82,"sourceHtmlUrl":83},"backend.py","SCRIPT","脚本",8789,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002Fbackend.py",{"path":85,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":86,"sourceHtmlUrl":87},"FHIR-REFERENCE.md",5147,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002FFHIR-REFERENCE.md",{"path":89,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":90,"sourceHtmlUrl":91},"README.md",2601,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002FREADME.md",{"path":93,"resourceType":74,"resourceTypeDesc":75,"sizeBytes":94,"sourceHtmlUrl":95},"skill-card.md",2999,"https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002Fskill-card.md",[97,104,111,116,121],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7362JPSXA582MHZCGPMHPJX","virtual-patient-roleplay","Simulate standardized patient encounters for medical training, supporting OSCE-style history-taking practice, communication skills rehearsal, and educational debriefing.","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fskills\u002Fclawhub\u002Fvirtual-patient-roleplay\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7362C21A9DWS468QZ6HJTWK","patient-consent-simplifier","Simplify informed consent documents into patient-friendly language while maintaining regulatory compliance (FDA 21CFR50, ICH-GCP, HIPAA) and required legal elements.","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fskills\u002Fclawhub\u002Fpatient-consent-simplifier\u002FSKILL.md",[],[],{"skillNo":112,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7361N1KS557KZQTQTHY7GKH","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fskills\u002Fclawhub\u002Fclinical-doc-assistant\u002FSKILL.md",[],[],{"skillNo":117,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":19},"01M7361C36ZDEVGDE9M4FCHHPK","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fvirtual-patient-roleplay\u002FSKILL.md",[],[],{"skillNo":122,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":19},"01M73614KRJX93MCW07PATMP13","https:\u002F\u002Fgithub.com\u002Fgdgshanghai\u002FGemma4-Hackathon-ShangHai\u002Fblob\u002Fmain\u002Fsubmissions\u002F2026\u002Ftrack_A\u002FDoctorClaw\u002Fbackend\u002Fagent_workspace\u002Fskills\u002Fclawhub\u002Fpatient-consent-simplifier\u002FSKILL.md",[],[]]