Cedar Ridge Intake Coordination Skill
Overview
This skill solves intake coordination tasks against the Cedar Ridge Intake Coordination Portal. The portal exposes patient, referral, transfer, chart, program, and clinical data through REST endpoints and a read-only SQL query interface. Each task requires querying the portal, applying domain-specific business rules to cross-reference records, and producing a structured JSON answer that follows a strict template with controlled enum values.
1. Portal Endpoints
Base URL is provided as <TASK_ENV_BASE_URL> in each task prompt. Use these endpoints:
| Method |
Path |
Purpose |
| GET |
/ |
Portal home page |
| GET |
/patients |
List/search patients (supports q, limit query params) |
| GET |
/patients/{patient_id} |
Single patient record |
| GET |
/referrals |
List/search referrals (supports batch_id, service_line, limit) |
| GET |
/referrals/{referral_id} |
Single referral |
| GET |
/transfers |
List/search transfers (supports batch_id, limit) |
| GET |
/transfers/{transfer_id} |
Single transfer |
| GET |
/documents |
List documents (no filters shown) |
| GET |
/chart/{patient_id} |
Chart data for a patient |
| GET |
/programs/{program_code}/candidates |
Program candidate list |
| GET |
/icd/{code} |
ICD-10 code metadata |
| GET |
/pharmacies |
List pharmacies |
| POST |
/query |
Read-only SQL (body: {"sql": "SELECT ..."}) |
No authentication is required.
2. Database Schema
The SQL endpoint (POST /query) is often the most efficient way to gather data. Key tables:
- intake_rosters:
roster_id, patient_id, requested_service_date, service_line, source_note
- patients:
patient_id, first_name, last_name, dob, phone, email, language, address, existing_chart, preferred_contact, emergency_contact_present
- coverage:
coverage_id, patient_id, payer, policy_number, group_number, effective_date, termination_date, network_status, service_lines, status
- pbm:
pbm_id, patient_id, payer, policy_number, active, formulary_status, specialty_required, status
- patient_pharmacy:
patient_id, pharmacy_id, preference_rank
- pharmacies:
pharmacy_id, name, address, phone, network_status
- lifestyle:
patient_id, smoking_status, alcohol_use, exercise_frequency, sleep_hours
- referrals:
referral_id, batch_id, service_line, date_received, patient_id, payer, insurance_id, referring_physician, referring_practice, referring_phone, referring_fax, icd10_code, diagnosis_description, referral_reason, urgency, records_received, imaging_received, auth_required, auth_status, appointment_scheduled, appointment_date, assigned_physician, notes
- transfers:
transfer_id, batch_id, patient_id, referring_facility, requested_start_date, requested_end_date, modality, days_requested, chair_window, transportation, status_note
- documents:
document_id, patient_id, referral_id, transfer_id, doc_type, status, finalized, received_date, service_date, content_tag, notes
- icd_codes:
code, description, chapter, service_family, laterality
- chart_artifacts:
artifact_id, patient_id, artifact_type, status, last_updated, value_summary
- clinical_history:
patient_id, chronic_conditions, surgeries, medication_count, allergy_count, recent_hospitalization, risk_flags
- program_candidates:
program_code, patient_id, candidate_date, source, consent_status, preferred_outreach, adherence_score, target_condition
- facility_capacity:
location_id, date, modality, open_chairs
3. Task-Type Business Rules
3A. New Patient Access Verification (e.g., intake roster)
For each patient on the roster, determine:
insurance_status (from coverage table):
valid: coverage status = "active", network_status = "in_network", and the service_lines field contains the required service_line
invalid: coverage is expired/pending, or the required service_line is NOT in service_lines
missing: no coverage record found
prescription_status (from pbm table):
valid: active = 1, status = "approved" (or formulary_status = "covered")
invalid: active = 0, status = "rejected", or formulary_status indicates rejection
missing: no PBM record
pharmacy_status (from patient_pharmacy + pharmacies join):
in_network: preferred pharmacy's network_status = "in_network"
out_of_network: preferred pharmacy's network_status = "out_of_network"
unknown: no pharmacy preference or pharmacy not found
lifestyle_risk (from lifestyle table):
high: current smoker + no exercise + low sleep (< 6), OR heavy alcohol + former smoker + very low sleep
medium: current or former smoker with moderate other factors
low: former smoker with good exercise and sleep
overall_risk: Composite of lifestyle_risk plus coverage/pharmacy/PBM issues:
high: lifestyle=high OR multiple blocking issues (expired coverage + out-of-network pharmacy)
medium: lifestyle=medium with some issues, or low lifestyle but significant blockers
low: no significant issues
registration_status:
approved: all insurance/prescription valid, pharmacy in-network, low/medium overall risk
hold: fixable blocking issues (pending coverage, PBM issues, pharmacy out-of-network)
clinical_review: high overall risk with clinical concerns
rejected: unresolvable issues (expired coverage + excluded service line)
blocked_reason_codes: List all specific blockers from the allowed values in the answer template. Key mappings:
- coverage
status = "expired" → coverage_expired
- coverage
status = "pending" → coverage_pending
- service_line not in coverage
service_lines → excluded_service_line
- patient
address is null → missing_address
- patient
emergency_contact_present = 0 → emergency_contact_missing
- PBM
active = 0 or status = "rejected" → pbm_invalid
- No PBM record or formulary not confirmed →
pbm_missing
- PBM policy_number differs from coverage policy_number →
pbm_policy_mismatch
- Pharmacy out-of-network →
pharmacy_out_of_network
- Pharmacy not found →
pharmacy_unknown
- preferred_contact method unreachable (e.g., preferred "email" but email is null, or preferred "sms" but phone is null) →
preferred_contact_unavailable
- overall_risk = "high" →
overall_risk_high
3B. Referral Batch Readiness Audit (orthopedic, pulmonary, etc.)
For each referral in the batch:
ICD code audit: Cross-reference each referral's icd10_code against icd_codes table:
- If
service_family does not match the referral's service_line → clinical code discrepancy (include in clinical_code_discrepancy_referrals)
- Only flag mismatches where the ICD code's
service_family genuinely conflicts with the referral service_line; matching service_family means no discrepancy even if diagnosis_description is generic
Duplicate detection:
- Same
patient_id with same icd10_code in same batch → duplicate_referral issue; the first (lowest referral_id) is the primary
- Same
insurance_id across different patients → shared_insurance_anomaly; disposition depends on whether patients are distinct
Blocking issues:
records_received = 0 → missing_records / records_missing
imaging_received = 0 → missing_imaging / imaging_missing
auth_required = 1 and auth_status in ("denied", "pending", "not_submitted") → auth_blocker / authorization_blocked
appointment_scheduled = 1 before blockers resolved → already_scheduled / scheduled_before_clearance
- ICD service_family mismatch →
clinical_code_discrepancy
readiness_status:
ready: no blocking issues (may have informational codes like already_scheduled)
blocked: has hard blockers (auth denied, missing records/imaging)
under_review: has soft issues needing confirmation (ICD discrepancy, shared insurance, duplicate flag)
admin_followup: administrative duplicate resolution needed
priority_tier (for non-ready referrals):
tier_1_immediate: urgent referrals OR auth denied with scheduled appointment
tier_2_short_term: routine referrals with resolvable blockers
tier_3_administrative: duplicate consolidation, already-scheduled
ready_to_schedule: Referrals with readiness_status = "ready" and all prerequisites met
3C. Dialysis Transfer Review
For each transfer in the batch:
Packet completeness: Check documents table for required document types. A document is missing if:
- No document of that type exists for the transfer, OR
- The document exists but
finalized = 0 (draft status)
Required document types (from answer template): 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
Stale documents: Among finalized docs, check freshness against the transfer's requested_start_date:
hbsag: must be within 90 days of requested_start_date
hep_b_antibody_core: must be within 90 days
history_physical: must be within 365 days
monthly_labs: must be within 30 days
ppd_or_cxr: must be within 365 days
Calculate age as: requested_start_date - received_date in days. If age exceeds the freshness limit, the document is stale.
Capacity: Query facility_capacity table for the requested_start_date, filtering by modality = "in_center_hemodialysis". Sum open_chairs across all locations for that date. If no capacity rows exist for the requested date, open_chairs_total = 0.
feasibility:
ready_on_requested_start: packet complete AND capacity available (open_chairs > 0)
packet_not_ready_capacity_available: packet incomplete AND capacity available
packet_not_ready_capacity_unavailable: packet incomplete AND no capacity
capacity_unavailable: packet complete but no capacity
final_intake_decision:
accept: ready_on_requested_start
hold: packet issues are minor/fixable, or capacity-only issue
clinical_review: significant packet gaps or multiple stale documents
next_contact_owner / next_contact_route:
- accept →
scheduling_coordinator / internal_queue
- hold →
intake_coordinator / route based on transportation status
- clinical_review →
clinical_nurse / fax_referring_facility
3D. Chronic Care Enrollment Panel
For each program candidate:
eligibility: Must satisfy ALL:
target_condition matches the program's target (e.g., "diabetes_hypertension" for DMHTN-2026A)
consent_status = "signed"
existing_chart = 1
- Patient has the relevant active diagnoses (diabetes + hypertension in chronic_conditions)
enrollment_status:
enroll: eligible
hold: potentially eligible but missing consent or chart (fixable)
reject: wrong target condition, consent declined, or no relevant diagnoses
reason_codes: Include all applicable codes from the template's allowed_values. Key mappings:
- Eligible with DM+HTN →
meets_dmhtn_criteria
recent_hospitalization = 1 → recent_hospitalization_high_touch
adherence_score < 50 → low_adherence_high_touch
- Has CKD condition →
ckd_biweekly_monitoring
risk_flags contains "recent_ed_visit" → recent_ed_high_touch
consent_status = "declined" → consent_declined
consent_status = "missing" → consent_missing
existing_chart = 0 → chart_not_active
- Chart artifact
active_problems with status "stale" → stale_active_problems
target_condition doesn't match program → wrong_target_condition
- No diabetes/hypertension in chronic_conditions →
missing_active_dmhtn_diagnosis
Chart artifact assessment: Query chart_artifacts for each patient. Missing artifacts from the template's allowed set include:
chart_record: missing if existing_chart = 0
active_problems, vitals, labs, medications, consent: missing if no current artifact of that type exists for the patient
follow_up_cadence:
- Enrolled with hospitalization, low adherence, or ED visit →
weekly
- Enrolled with CKD →
biweekly
- Enrolled standard →
monthly
- Hold →
deferred
- Reject →
none
outreach_channel: Use candidate's preferred_outreach field (mapped to template: phone, portal, sms, email). Reject → none.
initial_monitoring_package:
- Enrolled high-touch (hospitalized, low adherence, ED visit):
high_touch_dm_htn with bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation, care_plan_setup; first_checkin_days = 7
- Enrolled with CKD:
high_touch_dm_htn same components; first_checkin_days = 14
- Enrolled standard:
standard_dm_htn with bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation; first_checkin_days = 30
- Hold:
deferred with consent_packet (+ chart_update_request if chart missing); first_checkin_days = null
- Reject:
not_applicable with empty components; first_checkin_days = null
3E. Referral-to-Chart Activation (Pulmonary)
Combines referral readiness checks with chart activation needs:
readiness_by_referral: For each referral, determine readiness_status and blocker_codes following the same rules as 3B, but using this task's specific blocker code vocab.
clinical_code_discrepancy_referrals: Referral IDs where ICD service_family doesn't match referral service_line.
blocker_sets: Group blocked referrals by blocker type (authorization, records, imaging).
duplicate_handling: Identify duplicate referral groups, specify which referral to keep. Referrals flagged "possible duplicate" in notes but confirmed as distinct patients go in cleared_duplicate_review_referrals.
ready_referral_chart_needs: For each ready/under_review referral, determine chart action:
create_chart: patient has existing_chart = 0
update_chart: patient has existing_chart = 1 but chart artifacts are missing/stale
no_chart_action: chart is complete and current
For artifacts_to_create, list missing chart artifact types.
correspondence_queue: Generate correspondence entries for referrals needing outreach:
- ICD mismatch →
clinical_code_clarification
- Auth denied + missing records →
auth_records_request
- Duplicate referrals →
duplicate_resolution
- Already scheduled →
appointment_hold_notice
priority_order: Rank non-ready referrals by severity (higher priority first).
4. General Procedures
Read the task prompt carefully — it specifies the batch/roster/program ID and which patient population to process.
Read the answer template — it defines the exact JSON structure, required fields, and allowed enum values. Always comply with these constraints.
Gather all relevant data — use the SQL endpoint to efficiently pull related records. Common queries:
SELECT * FROM intake_rosters WHERE roster_id = '<ID>'
SELECT * FROM referrals WHERE batch_id = '<ID>'
SELECT * FROM transfers WHERE batch_id = '<ID>'
SELECT * FROM coverage WHERE patient_id IN (...)
SELECT * FROM pbm WHERE patient_id IN (...)
- ICD cross-reference:
SELECT * FROM icd_codes WHERE code IN (...)
- Document check:
SELECT * FROM documents WHERE transfer_id IN (...) or WHERE referral_id IN (...)
- Chart status:
SELECT * FROM chart_artifacts WHERE patient_id IN (...)
- Pharmacy network: join
patient_pharmacy with pharmacies
- Capacity:
SELECT date, SUM(open_chairs) FROM facility_capacity WHERE ... GROUP BY date
Apply business rules per task type (see Section 3).
Build the answer JSON matching the template exactly:
- Use only allowed enum values
- Sort lists as specified (ascending by ID unless otherwise noted)
- Treat reason_code/blocker_code arrays as unordered sets
- Include all required top-level keys
- Compute cohort/summary counts as integer aggregates
Verify the answer before submission:
- All required keys present
- All enum values match allowed sets
- List ordering matches template specification
- Summary counts are consistent with individual records
- No free-form text where controlled values are expected
5. Common Pitfalls
- Don't over-flag narrative mismatches: A generic "specialty consultation" diagnosis description does NOT constitute a narrative_mismatch if the ICD code's service_family matches the referral's service_line. Only flag when there's a genuine cross-reference error.
- Don't conflate "draft" with "missing": A document that exists but is unfinalized (draft) means the item is incomplete/missing for completeness purposes, but the document type itself is "present as draft".
- Capacity data may not cover all dates: If the
facility_capacity table has no rows for a requested date, that date has 0 open chairs.
- PBM policy_number cross-reference: Check whether the PBM record's
policy_number matches the coverage record's policy_number for the same patient. A mismatch indicates pbm_policy_mismatch.
- Preferred contact availability: If a patient's preferred_contact is "email" but
email is null, or preferred is "sms" but phone is null, flag as preferred_contact_unavailable.
- ICD laterality: Only flag
laterality_mismatch when the ICD code specifies a laterality (e.g., "left") but the referral narrative does not acknowledge it. If the ICD code itself contains the laterality, there may be no mismatch.
- Duplicate detection: Two referrals for the same patient with the same ICD code are duplicates. The primary referral is the one with the lower referral_id.
- Shared insurance across different patients: Different patients sharing the same
insurance_id is an anomaly requiring verification.
1---2name: reflect-3-attempt-02-193description: Cedar Ridge Intake Coordination Skill4---5# Cedar Ridge Intake Coordination Skill67## Overview89This skill solves intake coordination tasks against the Cedar Ridge Intake Coordination Portal. The portal exposes patient, referral, transfer, chart, program, and clinical data through REST endpoints and a read-only SQL query interface. Each task requires querying the portal, applying domain-specific business rules to cross-reference records, and producing a structured JSON answer that follows a strict template with controlled enum values.1011---1213## 1. Portal Endpoints1415Base URL is provided as `<TASK_ENV_BASE_URL>` in each task prompt. Use these endpoints:1617| Method | Path | Purpose |18|--------|------|---------|19| GET | `/` | Portal home page |20| GET | `/patients` | List/search patients (supports `q`, `limit` query params) |21| GET | `/patients/{patient_id}` | Single patient record |22| GET | `/referrals` | List/search referrals (supports `batch_id`, `service_line`, `limit`) |23| GET | `/referrals/{referral_id}` | Single referral |24| GET | `/transfers` | List/search transfers (supports `batch_id`, `limit`) |25| GET | `/transfers/{transfer_id}` | Single transfer |26| GET | `/documents` | List documents (no filters shown) |27| GET | `/chart/{patient_id}` | Chart data for a patient |28| GET | `/programs/{program_code}/candidates` | Program candidate list |29| GET | `/icd/{code}` | ICD-10 code metadata |30| GET | `/pharmacies` | List pharmacies |31| POST | `/query` | Read-only SQL (body: `{"sql": "SELECT ..."}`) |3233No authentication is required.3435---3637## 2. Database Schema3839The SQL endpoint (`POST /query`) is often the most efficient way to gather data. Key tables:4041- **intake_rosters**: `roster_id, patient_id, requested_service_date, service_line, source_note`42- **patients**: `patient_id, first_name, last_name, dob, phone, email, language, address, existing_chart, preferred_contact, emergency_contact_present`43- **coverage**: `coverage_id, patient_id, payer, policy_number, group_number, effective_date, termination_date, network_status, service_lines, status`44- **pbm**: `pbm_id, patient_id, payer, policy_number, active, formulary_status, specialty_required, status`45- **patient_pharmacy**: `patient_id, pharmacy_id, preference_rank`46- **pharmacies**: `pharmacy_id, name, address, phone, network_status`47- **lifestyle**: `patient_id, smoking_status, alcohol_use, exercise_frequency, sleep_hours`48- **referrals**: `referral_id, batch_id, service_line, date_received, patient_id, payer, insurance_id, referring_physician, referring_practice, referring_phone, referring_fax, icd10_code, diagnosis_description, referral_reason, urgency, records_received, imaging_received, auth_required, auth_status, appointment_scheduled, appointment_date, assigned_physician, notes`49- **transfers**: `transfer_id, batch_id, patient_id, referring_facility, requested_start_date, requested_end_date, modality, days_requested, chair_window, transportation, status_note`50- **documents**: `document_id, patient_id, referral_id, transfer_id, doc_type, status, finalized, received_date, service_date, content_tag, notes`51- **icd_codes**: `code, description, chapter, service_family, laterality`52- **chart_artifacts**: `artifact_id, patient_id, artifact_type, status, last_updated, value_summary`53- **clinical_history**: `patient_id, chronic_conditions, surgeries, medication_count, allergy_count, recent_hospitalization, risk_flags`54- **program_candidates**: `program_code, patient_id, candidate_date, source, consent_status, preferred_outreach, adherence_score, target_condition`55- **facility_capacity**: `location_id, date, modality, open_chairs`5657---5859## 3. Task-Type Business Rules6061### 3A. New Patient Access Verification (e.g., intake roster)6263For each patient on the roster, determine:6465**insurance_status** (from `coverage` table):66- `valid`: coverage `status` = "active", `network_status` = "in_network", and the `service_lines` field contains the required service_line67- `invalid`: coverage is expired/pending, or the required service_line is NOT in `service_lines`68- `missing`: no coverage record found6970**prescription_status** (from `pbm` table):71- `valid`: `active` = 1, `status` = "approved" (or formulary_status = "covered")72- `invalid`: `active` = 0, `status` = "rejected", or formulary_status indicates rejection73- `missing`: no PBM record7475**pharmacy_status** (from `patient_pharmacy` + `pharmacies` join):76- `in_network`: preferred pharmacy's `network_status` = "in_network"77- `out_of_network`: preferred pharmacy's `network_status` = "out_of_network"78- `unknown`: no pharmacy preference or pharmacy not found7980**lifestyle_risk** (from `lifestyle` table):81- `high`: current smoker + no exercise + low sleep (< 6), OR heavy alcohol + former smoker + very low sleep82- `medium`: current or former smoker with moderate other factors83- `low`: former smoker with good exercise and sleep8485**overall_risk**: Composite of lifestyle_risk plus coverage/pharmacy/PBM issues:86- `high`: lifestyle=high OR multiple blocking issues (expired coverage + out-of-network pharmacy)87- `medium`: lifestyle=medium with some issues, or low lifestyle but significant blockers88- `low`: no significant issues8990**registration_status**:91- `approved`: all insurance/prescription valid, pharmacy in-network, low/medium overall risk92- `hold`: fixable blocking issues (pending coverage, PBM issues, pharmacy out-of-network)93- `clinical_review`: high overall risk with clinical concerns94- `rejected`: unresolvable issues (expired coverage + excluded service line)9596**blocked_reason_codes**: List all specific blockers from the allowed values in the answer template. Key mappings:97- coverage `status` = "expired" → `coverage_expired`98- coverage `status` = "pending" → `coverage_pending`99- service_line not in coverage `service_lines` → `excluded_service_line`100- patient `address` is null → `missing_address`101- patient `emergency_contact_present` = 0 → `emergency_contact_missing`102- PBM `active` = 0 or `status` = "rejected" → `pbm_invalid`103- No PBM record or formulary not confirmed → `pbm_missing`104- PBM policy_number differs from coverage policy_number → `pbm_policy_mismatch`105- Pharmacy out-of-network → `pharmacy_out_of_network`106- Pharmacy not found → `pharmacy_unknown`107- preferred_contact method unreachable (e.g., preferred "email" but email is null, or preferred "sms" but phone is null) → `preferred_contact_unavailable`108- overall_risk = "high" → `overall_risk_high`109110---111112### 3B. Referral Batch Readiness Audit (orthopedic, pulmonary, etc.)113114For each referral in the batch:115116**ICD code audit**: Cross-reference each referral's `icd10_code` against `icd_codes` table:117- If `service_family` does not match the referral's `service_line` → clinical code discrepancy (include in `clinical_code_discrepancy_referrals`)118- Only flag mismatches where the ICD code's `service_family` genuinely conflicts with the referral `service_line`; matching service_family means no discrepancy even if diagnosis_description is generic119120**Duplicate detection**:121- Same `patient_id` with same `icd10_code` in same batch → `duplicate_referral` issue; the first (lowest `referral_id`) is the primary122- Same `insurance_id` across different patients → `shared_insurance_anomaly`; disposition depends on whether patients are distinct123124**Blocking issues**:125- `records_received` = 0 → `missing_records` / `records_missing`126- `imaging_received` = 0 → `missing_imaging` / `imaging_missing`127- `auth_required` = 1 and `auth_status` in ("denied", "pending", "not_submitted") → `auth_blocker` / `authorization_blocked`128- `appointment_scheduled` = 1 before blockers resolved → `already_scheduled` / `scheduled_before_clearance`129- ICD service_family mismatch → `clinical_code_discrepancy`130131**readiness_status**:132- `ready`: no blocking issues (may have informational codes like `already_scheduled`)133- `blocked`: has hard blockers (auth denied, missing records/imaging)134- `under_review`: has soft issues needing confirmation (ICD discrepancy, shared insurance, duplicate flag)135- `admin_followup`: administrative duplicate resolution needed136137**priority_tier** (for non-ready referrals):138- `tier_1_immediate`: urgent referrals OR auth denied with scheduled appointment139- `tier_2_short_term`: routine referrals with resolvable blockers140- `tier_3_administrative`: duplicate consolidation, already-scheduled141142**ready_to_schedule**: Referrals with `readiness_status` = "ready" and all prerequisites met143144---145146### 3C. Dialysis Transfer Review147148For each transfer in the batch:149150**Packet completeness**: Check `documents` table for required document types. A document is missing if:151- No document of that type exists for the transfer, OR152- The document exists but `finalized` = 0 (draft status)153154Required document types (from answer template): 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_report155156**Stale documents**: Among finalized docs, check freshness against the transfer's `requested_start_date`:157- `hbsag`: must be within 90 days of requested_start_date158- `hep_b_antibody_core`: must be within 90 days159- `history_physical`: must be within 365 days160- `monthly_labs`: must be within 30 days161- `ppd_or_cxr`: must be within 365 days162163Calculate age as: `requested_start_date - received_date` in days. If age exceeds the freshness limit, the document is stale.164165**Capacity**: Query `facility_capacity` table for the `requested_start_date`, filtering by `modality = "in_center_hemodialysis"`. Sum `open_chairs` across all locations for that date. If no capacity rows exist for the requested date, open_chairs_total = 0.166167**feasibility**:168- `ready_on_requested_start`: packet complete AND capacity available (open_chairs > 0)169- `packet_not_ready_capacity_available`: packet incomplete AND capacity available170- `packet_not_ready_capacity_unavailable`: packet incomplete AND no capacity171- `capacity_unavailable`: packet complete but no capacity172173**final_intake_decision**:174- `accept`: ready_on_requested_start175- `hold`: packet issues are minor/fixable, or capacity-only issue176- `clinical_review`: significant packet gaps or multiple stale documents177178**next_contact_owner** / **next_contact_route**:179- accept → `scheduling_coordinator` / `internal_queue`180- hold → `intake_coordinator` / route based on transportation status181- clinical_review → `clinical_nurse` / `fax_referring_facility`182183---184185### 3D. Chronic Care Enrollment Panel186187For each program candidate:188189**eligibility**: Must satisfy ALL:1901. `target_condition` matches the program's target (e.g., "diabetes_hypertension" for DMHTN-2026A)1912. `consent_status` = "signed"1923. `existing_chart` = 11934. Patient has the relevant active diagnoses (diabetes + hypertension in chronic_conditions)194195**enrollment_status**:196- `enroll`: eligible197- `hold`: potentially eligible but missing consent or chart (fixable)198- `reject`: wrong target condition, consent declined, or no relevant diagnoses199200**reason_codes**: Include all applicable codes from the template's allowed_values. Key mappings:201- Eligible with DM+HTN → `meets_dmhtn_criteria`202- `recent_hospitalization` = 1 → `recent_hospitalization_high_touch`203- `adherence_score` < 50 → `low_adherence_high_touch`204- Has CKD condition → `ckd_biweekly_monitoring`205- `risk_flags` contains "recent_ed_visit" → `recent_ed_high_touch`206- `consent_status` = "declined" → `consent_declined`207- `consent_status` = "missing" → `consent_missing`208- `existing_chart` = 0 → `chart_not_active`209- Chart artifact `active_problems` with status "stale" → `stale_active_problems`210- `target_condition` doesn't match program → `wrong_target_condition`211- No diabetes/hypertension in chronic_conditions → `missing_active_dmhtn_diagnosis`212213**Chart artifact assessment**: Query `chart_artifacts` for each patient. Missing artifacts from the template's allowed set include:214- `chart_record`: missing if `existing_chart` = 0215- `active_problems`, `vitals`, `labs`, `medications`, `consent`: missing if no current artifact of that type exists for the patient216217**follow_up_cadence**:218- Enrolled with hospitalization, low adherence, or ED visit → `weekly`219- Enrolled with CKD → `biweekly`220- Enrolled standard → `monthly`221- Hold → `deferred`222- Reject → `none`223224**outreach_channel**: Use candidate's `preferred_outreach` field (mapped to template: phone, portal, sms, email). Reject → `none`.225226**initial_monitoring_package**:227- Enrolled high-touch (hospitalized, low adherence, ED visit): `high_touch_dm_htn` with bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation, care_plan_setup; first_checkin_days = 7228- Enrolled with CKD: `high_touch_dm_htn` same components; first_checkin_days = 14229- Enrolled standard: `standard_dm_htn` with bp_cuff, glucometer, lab_order_a1c_cmp_lipid, medication_reconciliation; first_checkin_days = 30230- Hold: `deferred` with consent_packet (+ chart_update_request if chart missing); first_checkin_days = null231- Reject: `not_applicable` with empty components; first_checkin_days = null232233---234235### 3E. Referral-to-Chart Activation (Pulmonary)236237Combines referral readiness checks with chart activation needs:238239**readiness_by_referral**: For each referral, determine readiness_status and blocker_codes following the same rules as 3B, but using this task's specific blocker code vocab.240241**clinical_code_discrepancy_referrals**: Referral IDs where ICD service_family doesn't match referral service_line.242243**blocker_sets**: Group blocked referrals by blocker type (authorization, records, imaging).244245**duplicate_handling**: Identify duplicate referral groups, specify which referral to keep. Referrals flagged "possible duplicate" in notes but confirmed as distinct patients go in `cleared_duplicate_review_referrals`.246247**ready_referral_chart_needs**: For each ready/under_review referral, determine chart action:248- `create_chart`: patient has `existing_chart` = 0249- `update_chart`: patient has `existing_chart` = 1 but chart artifacts are missing/stale250- `no_chart_action`: chart is complete and current251252For artifacts_to_create, list missing chart artifact types.253254**correspondence_queue**: Generate correspondence entries for referrals needing outreach:255- ICD mismatch → `clinical_code_clarification`256- Auth denied + missing records → `auth_records_request`257- Duplicate referrals → `duplicate_resolution`258- Already scheduled → `appointment_hold_notice`259260**priority_order**: Rank non-ready referrals by severity (higher priority first).261262---263264## 4. General Procedures2652661. **Read the task prompt carefully** — it specifies the batch/roster/program ID and which patient population to process.2672682. **Read the answer template** — it defines the exact JSON structure, required fields, and allowed enum values. Always comply with these constraints.2692703. **Gather all relevant data** — use the SQL endpoint to efficiently pull related records. Common queries:271 - `SELECT * FROM intake_rosters WHERE roster_id = '<ID>'`272 - `SELECT * FROM referrals WHERE batch_id = '<ID>'`273 - `SELECT * FROM transfers WHERE batch_id = '<ID>'`274 - `SELECT * FROM coverage WHERE patient_id IN (...)`275 - `SELECT * FROM pbm WHERE patient_id IN (...)`276 - ICD cross-reference: `SELECT * FROM icd_codes WHERE code IN (...)`277 - Document check: `SELECT * FROM documents WHERE transfer_id IN (...)` or `WHERE referral_id IN (...)`278 - Chart status: `SELECT * FROM chart_artifacts WHERE patient_id IN (...)`279 - Pharmacy network: join `patient_pharmacy` with `pharmacies`280 - Capacity: `SELECT date, SUM(open_chairs) FROM facility_capacity WHERE ... GROUP BY date`2812824. **Apply business rules per task type** (see Section 3).2832845. **Build the answer JSON** matching the template exactly:285 - Use only allowed enum values286 - Sort lists as specified (ascending by ID unless otherwise noted)287 - Treat reason_code/blocker_code arrays as unordered sets288 - Include all required top-level keys289 - Compute cohort/summary counts as integer aggregates2902916. **Verify the answer** before submission:292 - All required keys present293 - All enum values match allowed sets294 - List ordering matches template specification295 - Summary counts are consistent with individual records296 - No free-form text where controlled values are expected297298---299300## 5. Common Pitfalls301302- **Don't over-flag narrative mismatches**: A generic "specialty consultation" diagnosis description does NOT constitute a narrative_mismatch if the ICD code's service_family matches the referral's service_line. Only flag when there's a genuine cross-reference error.303- **Don't conflate "draft" with "missing"**: A document that exists but is unfinalized (draft) means the item is incomplete/missing for completeness purposes, but the document type itself is "present as draft".304- **Capacity data may not cover all dates**: If the `facility_capacity` table has no rows for a requested date, that date has 0 open chairs.305- **PBM policy_number cross-reference**: Check whether the PBM record's `policy_number` matches the coverage record's `policy_number` for the same patient. A mismatch indicates `pbm_policy_mismatch`.306- **Preferred contact availability**: If a patient's preferred_contact is "email" but `email` is null, or preferred is "sms" but `phone` is null, flag as `preferred_contact_unavailable`.307- **ICD laterality**: Only flag `laterality_mismatch` when the ICD code specifies a laterality (e.g., "left") but the referral narrative does not acknowledge it. If the ICD code itself contains the laterality, there may be no mismatch.308- **Duplicate detection**: Two referrals for the same patient with the same ICD code are duplicates. The primary referral is the one with the lower referral_id.309- **Shared insurance across different patients**: Different patients sharing the same `insurance_id` is an anomaly requiring verification.