Cedar Ridge Intake Coordination — Reusable Operating Rules
Purpose
Execute intake-coordination tasks against the Cedar Ridge Intake Coordination Portal. This skill covers patient access verification, referral auditing, transfer review, chronic-care enrollment panel assembly, and referral-to-chart activation. Adapt the workflow to whichever intake domain the prompt specifies.
Pre-Flight
Environment
The portal base URL and allowed endpoints are defined in environment_access.md at the repository root. Read that file first and resolve <TASK_ENV_BASE_URL> (or TASK_ENV_BASE_URL) placeholders in prompts to the base_url value it declares. Use only the endpoints listed in its allowed_endpoints block; do not invent URLs.
allowed route set (subject to change — always consult environment_access.md):
GET /
GET /patients
GET /patients/{patient_id}
GET /referrals
GET /referrals/{referral_id}
GET /transfers
GET /transfers/{transfer_id}
GET /documents
GET /chart/{patient_id}
GET /programs/{program_code}/candidates
GET /icd/{code}
GET /pharmacies
POST /query
No credentials are required.
Answer Template
Every task includes an input/payloads/answer_template.json that defines the required output shape. Read it first — before fetching any portal data. The template specifies:
- Required top-level keys and their types
- Enum sets for every controlled-vocabulary field
- Ordering rules for lists (ascending by ID, alphabetical by code, unordered set)
- Mandatory patient/referral/transfer IDs when the scope is pre-defined
- Summary/count fields with exact key names and precision
Do not deviate from the template. Use only values enumerated in the schema. Introduce no new keys or free-form prose outside the JSON structure.
Task Identification
The prompt names exactly one domain object that scopes the work:
| Concept |
Identified by |
Portal fetch |
| Patient access roster |
roster_id (e.g. NPI-JUN-01) |
Read target_roster.json if present; otherwise seed from prompt IDs |
| Referral batch |
batch_id (e.g. ORTHO-JUN-01, PULM-JUN-02) |
GET /referrals filtered to batch |
| Transfer batch |
batch_id (e.g. DIAL-WINTER-01) |
GET /transfers filtered to batch |
| Program enrollment panel |
program_code (e.g. DMHTN-2026A) |
GET /programs/{program_code}/candidates |
Use the portal to discover the full set of records within the scoped batch — do not assume the prompt lists every ID.
Portal Interaction Pattern
Fetch Order
Work from collections to individual records:
- Fetch the collection appropriate to the task (
/patients, /referrals, /transfers, /programs/{code}/candidates).
- Filter to the scoped batch/roster/program. If the collection endpoint returns records from multiple batches, use
POST /query with a SQL SELECT (or WHERE batch_id = ...) to narrow. Alternatively, iterate the collection and filter client-side on the batch/roster field.
- Drill into each record individually:
GET /patients/{patient_id} — patient identity, insurance, demographics
GET /referrals/{referral_id} — referral detail, ICD codes, urgency, authorization fields
GET /transfers/{transfer_id} — transfer request, packet status, requested start date
GET /chart/{patient_id} — active problems, vitals, labs, medications, consent status
GET /documents — document metadata (type, received date, patient/transfer link)
GET /icd/{code} — ICD-10 chapter and description for each diagnosis code
GET /pharmacies — pharmacy network directory
- Cross-reference patient-level data across endpoints by
patient_id.
Using POST /query
The read-only SQL endpoint accepts a JSON body with a query field. Prefer it for:
- Filtering referral or transfer collections to a specific batch when the collection endpoint lacks a
?batch= parameter
- Reconciling document-to-referral or document-to-transfer links
- Joining insurance IDs across patients to detect shared-insurance anomalies
Parameters beyond query are not documented; do not invent them.
Document Freshness Rules
When checking document staleness, apply these freshness limits (observed from portal data; verify against actual portal records on each run):
| Document type |
Staleness threshold |
| hbsag |
365 days |
| hep_b_antibody_core |
365 days (or lifetime, per portal) |
| history_physical |
180 days |
| monthly_labs |
30 days |
| ppd_or_cxr |
365 days |
A document is stale if current_date - received_date > freshness_limit_days. Staleness limits may be embedded in portal document records — defer to portal values when present.
Domain-Specific Patterns
1. Patient Access Verification (train_001 pattern)
When the prompt mentions: roster, primary care intake, access verification, insurance/prescription/pharmacy validation.
Workflow:
- Read the roster file (
target_roster.json) for requested_service_date and service_line.
- For each patient in the roster, fetch
GET /patients/{patient_id}.
- From the patient record, extract insurance status, prescription benefit status, pharmacy assignment, and risk fields.
- Cross-check the assigned pharmacy against
GET /pharmacies to determine in-network / out-of-network.
- Derive
blocked_reason_codes from the union of any failing checks — see the Blocker Codes section below.
- Build
cohort_summary with counts by registration status, overall risk, and lifestyle risk.
Risk derivation: lifestyle_risk and overall_risk come from the patient record. If the portal provides them as structured fields, copy directly. If derived, use the portal's risk model (check for flags like smoking, BMI, prior utilization in chart data).
Registration status logic:
approved: no blockers, all checks pass
hold: one or more non-clinical blockers (coverage, pharmacy, contact, address)
clinical_review: lifestyle_risk or overall_risk = high, or clinical-flag blockers
rejected: coverage_expired + no alternatives, excluded service line, or explicit portal rejection
2. Referral Audit (train_002 pattern)
When the prompt mentions: referral batch audit, orthopedic/spine/joint referral, ICD coding review, scheduling readiness.
Workflow:
- Fetch all referrals in the batch (
GET /referrals filtered to batch).
- For each referral, fetch its detail record, the linked patient record, and any associated documents.
- For each ICD code on the referral, fetch
GET /icd/{code} and compare the chapter against the referral's narrative service line.
- Detect:
- ICD chapter mismatch: ICD code chapter ≠ expected chapter for the referral's stated service line
- Narrative mismatch: referral narrative text does not match the ICD description
- Laterality mismatch: ICD code specifies a side (left/right/bilateral) that conflicts with the referral narrative
- Duplicates: same patient, same procedure/body part, overlapping or identical dates → group together
- Shared insurance anomaly: same insurance policy ID on referrals for different patients with different surnames or DOBs
- Missing records/imaging: referral expects records/imaging that are absent from
/documents
- Authorization blockers: auth_status is
pending, denied, or not_submitted
- Assign
readiness_status per referral:
ready: no blockers, no discrepancies, authorization approved
blocked: one or more hard blockers (auth_denied, missing imaging, missing records)
under_review: ICD or narrative discrepancies needing clinical review
admin_followup: duplicates, insurance anomalies, pending auth
- Assign
priority_tier:
tier_1_immediate: urgent + ready, or urgent + only admin-fixable blockers
tier_2_short_term: routine + ready or under_review
tier_3_administrative: admin-only issues, duplicates, insurance verification
null: for referrals that are already scheduled or fully resolved
Duplicate resolution: When referrals share the same patient and overlapping clinical intent, recommend consolidate_to_primary and designate the earliest-created or most-complete referral as primary. Use keep_separate when the referrals target different body parts or unrelated conditions.
3. Transfer Review (train_003 pattern)
When the prompt mentions: dialysis, transfer batch, packet completeness, document freshness/staleness, facility capacity, winter/Gulf Coast arrivals.
Workflow:
- Fetch all transfers in the batch (
GET /transfers filtered to batch).
- For each transfer, fetch the linked patient record and any packet documents.
- Check packet completeness against the required document set for dialysis intake:
- Required: face_sheet, history_physical, physician_orders, insurance_proof, medication_list, allergy_list, vascular_access_report, monthly_labs, treatment_flowsheets, hbsag, hep_b_antibody_core, ppd_or_cxr, flu_vaccine, pneumonia_vaccine, transportation
- Check document staleness against the freshness limits above.
- Assess capacity: the transfer record carries a
requested_start date. Determine open in-center hemodialysis chair count from portal facility/capacity data.
- Derive
feasibility:
ready_on_requested_start: packet complete, capacity available
packet_not_ready_capacity_available: packet incomplete but chairs open
packet_not_ready_capacity_unavailable: both packet and capacity issues
capacity_unavailable: packet complete but no chairs
- Assign
final_intake_decision:
accept: packet complete, capacity available, no clinical flags
hold: packet or capacity issue that is resolvable
clinical_review: clinical flags in chart, abnormal labs, high-risk patient
- Set
next_contact_owner and next_contact_route based on the blocking issue.
4. Chronic-Care Enrollment Panel (train_004 pattern)
When the prompt mentions: chronic-care, enrollment panel, program code (DMHTN, etc.), candidates, DM/HTN.
Workflow:
- Fetch
GET /programs/{program_code}/candidates — this returns the candidate list.
- For each candidate, fetch
GET /patients/{patient_id} and GET /chart/{patient_id}.
- Determine
eligible (boolean):
- True: patient has active DM/HTN diagnosis, chart is active, consent is on file
- False: wrong target condition, chart not active, consent declined/missing
- Assign
enrollment_status:
enroll: eligible, all chart artifacts present, consent obtained
hold: eligible but missing chart artifacts or consent
reject: ineligible (wrong condition, consent declined, chart inactive)
- Populate
reason_codes from the template's allowed set reflecting why the patient is at their status.
- Set
follow_up_cadence:
weekly: high-touch (recent hospitalization, low adherence, recent ED visit)
biweekly: CKD comorbidity
monthly: standard DM/HTN management
deferred: not enrolling now but may later
none: rejected
- Determine
missing_chart_artifacts by comparing expected chart sections against what /chart/{patient_id} returns.
- Assign
outreach_channel per patient preference from their record (phone, portal, sms, email, none).
- Assign
initial_monitoring_package:
standard_dm_htn: bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation, care_plan_setup
high_touch_dm_htn: standard components + consent_packet + chart_update_request (if needed), shorter first_checkin_days
deferred: not enrolling now
not_applicable: rejected
5. Referral-to-Chart Activation (train_005 pattern)
When the prompt mentions: pulmonary referral, chart activation, reconciliation, ready referrals, correspondence queue.
This combines elements of the referral audit (#2) with an additional chart-activation layer. After auditing referrals:
- For each ready referral, determine what chart artifacts exist vs. are needed:
create_chart: no chart exists for the patient → create demographics, active_problems, medications, allergies, vitals, labs, consent
update_chart: chart exists but is incomplete → list only missing artifacts
no_chart_action: chart is complete and current
- Build the
correspondence_queue for referrals needing outreach:
clinical_code_clarification: ICD/narrative mismatches
auth_records_request: missing records or authorization issues
duplicate_resolution: duplicate groups needing consolidation
appointment_hold_notice: referral is blocked because an appointment was scheduled before clearance
- Build
priority_order: rank non-ready referrals highest-priority-first, assigning tier_1_immediate → tier_2_short_term → tier_3_administrative.
Controlled Vocabulary Reference
These sets appear across multiple templates. Use only the values enumerated in the current task's answer_template.json — the lists below are a cross-task reference, not authoritative for any single task.
Blocker / Reason Codes (variable by domain)
Patient-access blockers: coverage_expired, coverage_pending, emergency_contact_missing, excluded_service_line, missing_address, pbm_invalid, pbm_missing, pbm_policy_mismatch, pharmacy_out_of_network, pharmacy_unknown, preferred_contact_unavailable, overall_risk_high
Referral issue codes: icd_chapter_mismatch, narrative_mismatch, laterality_mismatch, duplicate_referral, shared_insurance_anomaly, missing_records, missing_imaging, auth_blocker, already_scheduled
Referral action codes: request_corrected_icd, confirm_narrative, confirm_laterality, consolidate_duplicate, verify_insurance_id, request_records, request_imaging, resolve_authorization, review_existing_appointment
Chart-activation blocker codes: clinical_code_discrepancy, records_missing, imaging_missing, authorization_blocked, duplicate_review, scheduled_before_clearance
Enrollment reason codes: meets_dmhtn_criteria, recent_hospitalization_high_touch, low_adherence_high_touch, ckd_biweekly_monitoring, recent_ed_high_touch, consent_declined, consent_missing, chart_not_active, stale_active_problems, missing_recent_vitals, missing_recent_labs, missing_medication_list, wrong_target_condition, missing_active_dmhtn_diagnosis
Dialysis transfer required documents: allergy_list, face_sheet, flu_vaccine, hbsag, hep_b_antibody_core, history_physical, insurance_proof, medication_list, monthly_labs, physician_orders, pneumonia_vaccine, ppd_or_cxr, transportation, treatment_flowsheets, vascular_access_report
Readiness Status (referral)
ready, blocked, under_review, admin_followup
Registration Status (patient access)
approved, hold, clinical_review, rejected
Priority Tier
tier_1_immediate, tier_2_short_term, tier_3_administrative
Risk Levels
low, medium, high
Insurance / Pharmacy Status
Insurance: valid, invalid, missing
Pharmacy: in_network, out_of_network, unknown
Intake Decision (transfers)
accept, hold, clinical_review
Enrollment Status (chronic care)
enroll, hold, reject
Output Formatting Rules
- Output JSON only — no prose, no markdown fences, no commentary outside the JSON object.
- Ordered lists obey the template: ascending by ID, alphabetical by code/name, or unordered-set semantics as specified.
- IDs are uppercase — match the portal's casing exactly.
- Null vs. empty: use
null for optional fields explicitly typed as nullable; use [] for empty lists; omit a key only if the template marks it optional.
- Counts are integers — never floats, never strings.
- Dates use
YYYY-MM-DD format.
- Empty lists in summaries: if no referrals are in a category (e.g. no auth_blockers), return
[] not null.
- Cohort/summary counts must sum correctly:
total must equal the sum of per-status counts, and per-status counts must equal the number of items with that status.
Common Pitfalls
- Not reading the answer template first: Every task's template defines its exact vocabulary. Codes and keys differ across domains even when they sound similar.
- Assuming the batch/roster ID from the prompt: Verify through the portal that the named batch exists and returns records.
- Client-side vs. server-side filtering: If
GET /referrals returns more than the target batch, use POST /query with WHERE batch_id = '...'. Do not silently process the wrong records.
- Staleness math:
current_date - received_date in days, not months or years.
- Duplicate detection scope: Check for same patient + same body part/procedure + overlapping time window, not just same patient.
- Shared insurance requires different patients: Same insurance ID on the same patient's multiple referrals is normal; it's only anomalous across different patients.
- Laterality from ICD codes: ICD-10 laterality is encoded in the final character position; not all codes have laterality.
- Consent is a chart artifact: In chronic-care enrollment, consent status comes from the chart, not the patient record.
Task-Type Quick Dispatch
| Prompt signal |
Follow pattern |
Primary endpoint |
| roster, primary care, access verification, insurance validation |
§1 Patient Access |
/patients, /pharmacies |
| referral batch audit, orthopedic/spine/joint, ICD coding, scheduling readiness |
§2 Referral Audit |
/referrals, /patients, /documents, /icd/{code}, POST /query |
| dialysis, transfer batch, packet completeness, facility capacity |
§3 Transfer Review |
/transfers, /patients, /documents |
| chronic-care, enrollment panel, program code, DM/HTN, candidates |
§4 Enrollment Panel |
/programs/{code}/candidates, /patients, /chart/{id} |
| pulmonary referral, chart activation, correspondence queue, ready referrals |
§5 Chart Activation |
/referrals, /patients, /chart/{id}, /documents, /icd/{code} |
1---2name: self-attempt-03-513description: Cedar Ridge Intake Coordination — Reusable Operating Rules4---5# Cedar Ridge Intake Coordination — Reusable Operating Rules67## Purpose89Execute intake-coordination tasks against the Cedar Ridge Intake Coordination Portal. This skill covers patient access verification, referral auditing, transfer review, chronic-care enrollment panel assembly, and referral-to-chart activation. Adapt the workflow to whichever intake domain the prompt specifies.1011## Pre-Flight1213### Environment1415The portal base URL and allowed endpoints are defined in `environment_access.md` at the repository root. Read that file first and resolve `<TASK_ENV_BASE_URL>` (or `TASK_ENV_BASE_URL`) placeholders in prompts to the `base_url` value it declares. Use only the endpoints listed in its `allowed_endpoints` block; do not invent URLs.1617```18allowed route set (subject to change — always consult environment_access.md):19 GET /20 GET /patients21 GET /patients/{patient_id}22 GET /referrals23 GET /referrals/{referral_id}24 GET /transfers25 GET /transfers/{transfer_id}26 GET /documents27 GET /chart/{patient_id}28 GET /programs/{program_code}/candidates29 GET /icd/{code}30 GET /pharmacies31 POST /query32```3334No credentials are required.3536### Answer Template3738Every task includes an `input/payloads/answer_template.json` that defines the required output shape. Read it first — before fetching any portal data. The template specifies:3940- Required top-level keys and their types41- Enum sets for every controlled-vocabulary field42- Ordering rules for lists (ascending by ID, alphabetical by code, unordered set)43- Mandatory patient/referral/transfer IDs when the scope is pre-defined44- Summary/count fields with exact key names and precision4546**Do not deviate from the template.** Use only values enumerated in the schema. Introduce no new keys or free-form prose outside the JSON structure.4748### Task Identification4950The prompt names exactly one domain object that scopes the work:5152| Concept | Identified by | Portal fetch |53|---------|---------------|--------------|54| Patient access roster | `roster_id` (e.g. NPI-JUN-01) | Read `target_roster.json` if present; otherwise seed from prompt IDs |55| Referral batch | `batch_id` (e.g. ORTHO-JUN-01, PULM-JUN-02) | `GET /referrals` filtered to batch |56| Transfer batch | `batch_id` (e.g. DIAL-WINTER-01) | `GET /transfers` filtered to batch |57| Program enrollment panel | `program_code` (e.g. DMHTN-2026A) | `GET /programs/{program_code}/candidates` |5859Use the portal to discover the full set of records within the scoped batch — do not assume the prompt lists every ID.6061## Portal Interaction Pattern6263### Fetch Order6465Work from collections to individual records:66671. **Fetch the collection** appropriate to the task (`/patients`, `/referrals`, `/transfers`, `/programs/{code}/candidates`).682. **Filter** to the scoped batch/roster/program. If the collection endpoint returns records from multiple batches, use `POST /query` with a SQL `SELECT` (or `WHERE batch_id = ...`) to narrow. Alternatively, iterate the collection and filter client-side on the batch/roster field.693. **Drill into each record** individually:70 - `GET /patients/{patient_id}` — patient identity, insurance, demographics71 - `GET /referrals/{referral_id}` — referral detail, ICD codes, urgency, authorization fields72 - `GET /transfers/{transfer_id}` — transfer request, packet status, requested start date73 - `GET /chart/{patient_id}` — active problems, vitals, labs, medications, consent status74 - `GET /documents` — document metadata (type, received date, patient/transfer link)75 - `GET /icd/{code}` — ICD-10 chapter and description for each diagnosis code76 - `GET /pharmacies` — pharmacy network directory774. **Cross-reference** patient-level data across endpoints by `patient_id`.7879### Using POST /query8081The read-only SQL endpoint accepts a JSON body with a `query` field. Prefer it for:82- Filtering referral or transfer collections to a specific batch when the collection endpoint lacks a `?batch=` parameter83- Reconciling document-to-referral or document-to-transfer links84- Joining insurance IDs across patients to detect shared-insurance anomalies8586Parameters beyond `query` are not documented; do not invent them.8788### Document Freshness Rules8990When checking document staleness, apply these freshness limits (observed from portal data; verify against actual portal records on each run):9192| Document type | Staleness threshold |93|---------------|---------------------|94| hbsag | 365 days |95| hep_b_antibody_core | 365 days (or lifetime, per portal) |96| history_physical | 180 days |97| monthly_labs | 30 days |98| ppd_or_cxr | 365 days |99100A document is **stale** if `current_date - received_date > freshness_limit_days`. Staleness limits may be embedded in portal document records — defer to portal values when present.101102## Domain-Specific Patterns103104### 1. Patient Access Verification (train_001 pattern)105106**When the prompt mentions**: roster, primary care intake, access verification, insurance/prescription/pharmacy validation.107108**Workflow**:1091. Read the roster file (`target_roster.json`) for `requested_service_date` and `service_line`.1102. For each patient in the roster, fetch `GET /patients/{patient_id}`.1113. From the patient record, extract insurance status, prescription benefit status, pharmacy assignment, and risk fields.1124. Cross-check the assigned pharmacy against `GET /pharmacies` to determine in-network / out-of-network.1135. Derive `blocked_reason_codes` from the union of any failing checks — see the **Blocker Codes** section below.1146. Build `cohort_summary` with counts by registration status, overall risk, and lifestyle risk.115116**Risk derivation**: `lifestyle_risk` and `overall_risk` come from the patient record. If the portal provides them as structured fields, copy directly. If derived, use the portal's risk model (check for flags like smoking, BMI, prior utilization in chart data).117118**Registration status logic**:119- `approved`: no blockers, all checks pass120- `hold`: one or more non-clinical blockers (coverage, pharmacy, contact, address)121- `clinical_review`: lifestyle_risk or overall_risk = `high`, or clinical-flag blockers122- `rejected`: coverage_expired + no alternatives, excluded service line, or explicit portal rejection123124### 2. Referral Audit (train_002 pattern)125126**When the prompt mentions**: referral batch audit, orthopedic/spine/joint referral, ICD coding review, scheduling readiness.127128**Workflow**:1291. Fetch all referrals in the batch (`GET /referrals` filtered to batch).1302. For each referral, fetch its detail record, the linked patient record, and any associated documents.1313. For each ICD code on the referral, fetch `GET /icd/{code}` and compare the chapter against the referral's narrative service line.1324. Detect:133 - **ICD chapter mismatch**: ICD code chapter ≠ expected chapter for the referral's stated service line134 - **Narrative mismatch**: referral narrative text does not match the ICD description135 - **Laterality mismatch**: ICD code specifies a side (left/right/bilateral) that conflicts with the referral narrative136 - **Duplicates**: same patient, same procedure/body part, overlapping or identical dates → group together137 - **Shared insurance anomaly**: same insurance policy ID on referrals for different patients with different surnames or DOBs138 - **Missing records/imaging**: referral expects records/imaging that are absent from `/documents`139 - **Authorization blockers**: auth_status is `pending`, `denied`, or `not_submitted`1405. Assign `readiness_status` per referral:141 - `ready`: no blockers, no discrepancies, authorization approved142 - `blocked`: one or more hard blockers (auth_denied, missing imaging, missing records)143 - `under_review`: ICD or narrative discrepancies needing clinical review144 - `admin_followup`: duplicates, insurance anomalies, pending auth1456. Assign `priority_tier`:146 - `tier_1_immediate`: urgent + ready, or urgent + only admin-fixable blockers147 - `tier_2_short_term`: routine + ready or under_review148 - `tier_3_administrative`: admin-only issues, duplicates, insurance verification149 - `null`: for referrals that are already scheduled or fully resolved150151**Duplicate resolution**: When referrals share the same patient and overlapping clinical intent, recommend `consolidate_to_primary` and designate the earliest-created or most-complete referral as primary. Use `keep_separate` when the referrals target different body parts or unrelated conditions.152153### 3. Transfer Review (train_003 pattern)154155**When the prompt mentions**: dialysis, transfer batch, packet completeness, document freshness/staleness, facility capacity, winter/Gulf Coast arrivals.156157**Workflow**:1581. Fetch all transfers in the batch (`GET /transfers` filtered to batch).1592. For each transfer, fetch the linked patient record and any packet documents.1603. Check packet completeness against the required document set for dialysis intake:161 - Required: face_sheet, history_physical, physician_orders, insurance_proof, medication_list, allergy_list, vascular_access_report, monthly_labs, treatment_flowsheets, hbsag, hep_b_antibody_core, ppd_or_cxr, flu_vaccine, pneumonia_vaccine, transportation1624. Check document staleness against the freshness limits above.1635. Assess capacity: the transfer record carries a `requested_start` date. Determine open in-center hemodialysis chair count from portal facility/capacity data.1646. Derive `feasibility`:165 - `ready_on_requested_start`: packet complete, capacity available166 - `packet_not_ready_capacity_available`: packet incomplete but chairs open167 - `packet_not_ready_capacity_unavailable`: both packet and capacity issues168 - `capacity_unavailable`: packet complete but no chairs1697. Assign `final_intake_decision`:170 - `accept`: packet complete, capacity available, no clinical flags171 - `hold`: packet or capacity issue that is resolvable172 - `clinical_review`: clinical flags in chart, abnormal labs, high-risk patient1738. Set `next_contact_owner` and `next_contact_route` based on the blocking issue.174175### 4. Chronic-Care Enrollment Panel (train_004 pattern)176177**When the prompt mentions**: chronic-care, enrollment panel, program code (DMHTN, etc.), candidates, DM/HTN.178179**Workflow**:1801. Fetch `GET /programs/{program_code}/candidates` — this returns the candidate list.1812. For each candidate, fetch `GET /patients/{patient_id}` and `GET /chart/{patient_id}`.1823. Determine `eligible` (boolean):183 - True: patient has active DM/HTN diagnosis, chart is active, consent is on file184 - False: wrong target condition, chart not active, consent declined/missing1854. Assign `enrollment_status`:186 - `enroll`: eligible, all chart artifacts present, consent obtained187 - `hold`: eligible but missing chart artifacts or consent188 - `reject`: ineligible (wrong condition, consent declined, chart inactive)1895. Populate `reason_codes` from the template's allowed set reflecting why the patient is at their status.1906. Set `follow_up_cadence`:191 - `weekly`: high-touch (recent hospitalization, low adherence, recent ED visit)192 - `biweekly`: CKD comorbidity193 - `monthly`: standard DM/HTN management194 - `deferred`: not enrolling now but may later195 - `none`: rejected1967. Determine `missing_chart_artifacts` by comparing expected chart sections against what `/chart/{patient_id}` returns.1978. Assign `outreach_channel` per patient preference from their record (phone, portal, sms, email, none).1989. Assign `initial_monitoring_package`:199 - `standard_dm_htn`: bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation, care_plan_setup200 - `high_touch_dm_htn`: standard components + consent_packet + chart_update_request (if needed), shorter first_checkin_days201 - `deferred`: not enrolling now202 - `not_applicable`: rejected203204### 5. Referral-to-Chart Activation (train_005 pattern)205206**When the prompt mentions**: pulmonary referral, chart activation, reconciliation, ready referrals, correspondence queue.207208This combines elements of the referral audit (#2) with an additional chart-activation layer. After auditing referrals:2092101. For each **ready** referral, determine what chart artifacts exist vs. are needed:211 - `create_chart`: no chart exists for the patient → create demographics, active_problems, medications, allergies, vitals, labs, consent212 - `update_chart`: chart exists but is incomplete → list only missing artifacts213 - `no_chart_action`: chart is complete and current2142. Build the `correspondence_queue` for referrals needing outreach:215 - `clinical_code_clarification`: ICD/narrative mismatches216 - `auth_records_request`: missing records or authorization issues217 - `duplicate_resolution`: duplicate groups needing consolidation218 - `appointment_hold_notice`: referral is blocked because an appointment was scheduled before clearance2193. Build `priority_order`: rank non-ready referrals highest-priority-first, assigning `tier_1_immediate` → `tier_2_short_term` → `tier_3_administrative`.220221## Controlled Vocabulary Reference222223These sets appear across multiple templates. Use **only** the values enumerated in the current task's `answer_template.json` — the lists below are a cross-task reference, not authoritative for any single task.224225### Blocker / Reason Codes (variable by domain)226227Patient-access blockers: `coverage_expired`, `coverage_pending`, `emergency_contact_missing`, `excluded_service_line`, `missing_address`, `pbm_invalid`, `pbm_missing`, `pbm_policy_mismatch`, `pharmacy_out_of_network`, `pharmacy_unknown`, `preferred_contact_unavailable`, `overall_risk_high`228229Referral issue codes: `icd_chapter_mismatch`, `narrative_mismatch`, `laterality_mismatch`, `duplicate_referral`, `shared_insurance_anomaly`, `missing_records`, `missing_imaging`, `auth_blocker`, `already_scheduled`230231Referral action codes: `request_corrected_icd`, `confirm_narrative`, `confirm_laterality`, `consolidate_duplicate`, `verify_insurance_id`, `request_records`, `request_imaging`, `resolve_authorization`, `review_existing_appointment`232233Chart-activation blocker codes: `clinical_code_discrepancy`, `records_missing`, `imaging_missing`, `authorization_blocked`, `duplicate_review`, `scheduled_before_clearance`234235Enrollment reason codes: `meets_dmhtn_criteria`, `recent_hospitalization_high_touch`, `low_adherence_high_touch`, `ckd_biweekly_monitoring`, `recent_ed_high_touch`, `consent_declined`, `consent_missing`, `chart_not_active`, `stale_active_problems`, `missing_recent_vitals`, `missing_recent_labs`, `missing_medication_list`, `wrong_target_condition`, `missing_active_dmhtn_diagnosis`236237Dialysis transfer required documents: `allergy_list`, `face_sheet`, `flu_vaccine`, `hbsag`, `hep_b_antibody_core`, `history_physical`, `insurance_proof`, `medication_list`, `monthly_labs`, `physician_orders`, `pneumonia_vaccine`, `ppd_or_cxr`, `transportation`, `treatment_flowsheets`, `vascular_access_report`238239### Readiness Status (referral)240`ready`, `blocked`, `under_review`, `admin_followup`241242### Registration Status (patient access)243`approved`, `hold`, `clinical_review`, `rejected`244245### Priority Tier246`tier_1_immediate`, `tier_2_short_term`, `tier_3_administrative`247248### Risk Levels249`low`, `medium`, `high`250251### Insurance / Pharmacy Status252Insurance: `valid`, `invalid`, `missing`253Pharmacy: `in_network`, `out_of_network`, `unknown`254255### Intake Decision (transfers)256`accept`, `hold`, `clinical_review`257258### Enrollment Status (chronic care)259`enroll`, `hold`, `reject`260261## Output Formatting Rules2622631. **Output JSON only** — no prose, no markdown fences, no commentary outside the JSON object.2642. **Ordered lists** obey the template: ascending by ID, alphabetical by code/name, or unordered-set semantics as specified.2653. **IDs are uppercase** — match the portal's casing exactly.2664. **Null vs. empty**: use `null` for optional fields explicitly typed as nullable; use `[]` for empty lists; omit a key only if the template marks it optional.2675. **Counts are integers** — never floats, never strings.2686. **Dates use `YYYY-MM-DD`** format.2697. **Empty lists in summaries**: if no referrals are in a category (e.g. no auth_blockers), return `[]` not `null`.2708. **Cohort/summary counts must sum correctly**: `total` must equal the sum of per-status counts, and per-status counts must equal the number of items with that status.271272## Common Pitfalls273274- **Not reading the answer template first**: Every task's template defines its exact vocabulary. Codes and keys differ across domains even when they sound similar.275- **Assuming the batch/roster ID from the prompt**: Verify through the portal that the named batch exists and returns records.276- **Client-side vs. server-side filtering**: If `GET /referrals` returns more than the target batch, use `POST /query` with `WHERE batch_id = '...'`. Do not silently process the wrong records.277- **Staleness math**: `current_date - received_date` in days, not months or years.278- **Duplicate detection scope**: Check for same patient + same body part/procedure + overlapping time window, not just same patient.279- **Shared insurance requires different patients**: Same insurance ID on the same patient's multiple referrals is normal; it's only anomalous across different patients.280- **Laterality from ICD codes**: ICD-10 laterality is encoded in the final character position; not all codes have laterality.281- **Consent is a chart artifact**: In chronic-care enrollment, consent status comes from the chart, not the patient record.282283## Task-Type Quick Dispatch284285| Prompt signal | Follow pattern | Primary endpoint |286|---------------|---------------|------------------|287| roster, primary care, access verification, insurance validation | §1 Patient Access | `/patients`, `/pharmacies` |288| referral batch audit, orthopedic/spine/joint, ICD coding, scheduling readiness | §2 Referral Audit | `/referrals`, `/patients`, `/documents`, `/icd/{code}`, `POST /query` |289| dialysis, transfer batch, packet completeness, facility capacity | §3 Transfer Review | `/transfers`, `/patients`, `/documents` |290| chronic-care, enrollment panel, program code, DM/HTN, candidates | §4 Enrollment Panel | `/programs/{code}/candidates`, `/patients`, `/chart/{id}` |291| pulmonary referral, chart activation, correspondence queue, ready referrals | §5 Chart Activation | `/referrals`, `/patients`, `/chart/{id}`, `/documents`, `/icd/{code}` |