Cedar Ridge Intake Coordination
Overview
The Cedar Ridge Intake Coordination Portal exposes a read-only REST API and a POST /query SQL endpoint. Every task supplies a base URL placeholder like <TASK_ENV_BASE_URL>. Replace it with the actual base URL provided in the task prompt and use it for every request.
All endpoints return JSON. The /chart/{patient_id} endpoint bundles the richest dataset — use it as the primary source for patient-level decisions.
Endpoint Quick Reference
| Endpoint |
Purpose |
Query Params |
GET /patients |
Patient demographics |
?q=, ?limit= |
GET /patients/{id} |
Single patient profile |
— |
GET /referrals |
Referral records |
?batch_id=, ?service_line=, ?limit= |
GET /referrals/{id} |
Single referral |
— |
GET /transfers |
Transfer records |
?batch_id=, ?limit= |
GET /transfers/{id} |
Single transfer |
— |
GET /documents |
Document inventory |
varies |
GET /chart/{patient_id} |
Complete chart |
— |
GET /programs/{code}/candidates |
Program candidates |
— |
GET /icd/{code} |
ICD-10 metadata |
— |
GET /pharmacies |
Pharmacy directory |
— |
POST /query |
Read-only SQL |
body {"sql": "..."} |
Full field-level schemas for every major endpoint response shape are in references/api_reference.md.
SQL Queries
Use POST /query with {"sql": "SELECT ..."} for batch-level filtering and joins. The response shape is {"columns": [...], "rows": [...], "row_count": N, "truncated": false}.
-- Fetch all referrals for a batch
SELECT * FROM referrals WHERE batch_id = '<BATCH_ID>' ORDER BY referral_id
-- Fetch all transfers for a batch
SELECT * FROM transfers WHERE batch_id = '<BATCH_ID>' ORDER BY transfer_id
-- Fetch roster records
SELECT * FROM intake_rosters WHERE roster_id = '<ROSTER_ID>' ORDER BY patient_id
-- Count scheduled transfers by date and chair window
SELECT requested_start_date, chair_window, days_requested, COUNT(*) AS scheduled
FROM transfers WHERE requested_start_date = '2026-12-08'
GROUP BY requested_start_date, chair_window, days_requested
General Workflow
Every task supplies an answer_template.json in input/payloads/ that defines the exact output shape, key names, allowed values, and ordering rules. Read that template first. Produce one JSON object matching it exactly — no prose outside the JSON.
- Read the prompt to identify the batch/roster/program identifier.
- Read
answer_template.json for the required output shape and controlled values.
- Query the portal for the relevant records (referrals, transfers, patients, charts, candidates).
- Cross-reference records: use
/chart/{patient_id} to pull coverage, PBM, pharmacies, lifestyle, clinical history, chart artifacts, and related referrals/transfers/rosters. Use /icd/{code} to pull ICD chapter, description, laterality, and service_family.
- Apply the business rules in references/business_rules.md to determine each field.
- Construct the JSON answer following the template ordering rules exactly.
Task-Type Workflows
Patient Access Verification (Roster Intake)
For new-patient roster intake tasks:
- Read the roster from the task payload to get
roster_id and the target patient list. Pull requested_service_date and service_line from the roster record via SQL or the roster payload.
- For each target patient, fetch
GET /chart/{patient_id}.
- From
chart.coverage: determine insurance_status (valid/invalid/missing). Check status, termination_date, service_lines, network_status.
- From
chart.pbm: determine prescription_status (valid/invalid/missing). Check active and status.
- From
chart.pharmacies: determine pharmacy_status (in_network/out_of_network/unknown). Check network_status.
- From
chart.lifestyle: determine lifestyle_risk. Evaluate smoking, alcohol, exercise, sleep.
- From
chart.patient: check address, emergency_contact_present, and preferred_contact availability.
- Determine
overall_risk and registration_status. Collect blocked_reason_codes.
- Build
cohort_summary with integer counts across all patients.
Referral Readiness Audit
For batch referral audit tasks:
- Fetch referrals for the target batch:
GET /referrals?batch_id=<BATCH> or SQL.
- For each referral, fetch
GET /icd/{code} to get chapter and service_family.
- Compare ICD chapter against the expected chapter for the referral's
service_line. Flag chapter mismatches and narrative/reason mismatches.
- Detect duplicates: group by
(patient_id, icd10_code). Referrals sharing both patient and ICD are duplicates. Referrals flagged "possible duplicate" in notes but differing in either field are reviewed and cleared.
- Detect shared insurance anomalies: same
insurance_id on different patient_id values.
- Identify blockers:
records_received=0, imaging_received=0, auth_status=denied or pending.
- Flag already-scheduled referrals:
appointment_scheduled=1.
- Assign
readiness_status, priority_tier, and build action_plan.
- Build
icd_discrepancies, duplicate_groups, shared_insurance_anomalies, blocker_sets, ready_to_schedule, and summary.
Dialysis Transfer Review
For transfer batch review tasks:
- Fetch transfers:
GET /transfers?batch_id=<BATCH>.
- For each transfer, fetch
GET /chart/{patient_id} and GET /documents for the patient.
- Check packet completeness against the required document list (see business rules). Identify
missing_required_documents.
- Check document staleness: compare
received_date against freshness_limit_days for each time-sensitive document type.
- Evaluate capacity for the requested start date using SQL aggregation on transfers.
- Determine
feasibility, final_intake_decision, next_contact_owner, and next_contact_route.
- Build
cohort_summary.
Program Enrollment Panel
For chronic-care program enrollment tasks:
- Fetch candidates:
GET /programs/{code}/candidates.
- For each candidate, fetch
GET /chart/{patient_id}.
- Evaluate eligibility:
target_condition must match the program, consent_status must be signed.
- Assess chart completeness: check
existing_chart, chart_artifacts, artifact staleness.
- Evaluate clinical triggers:
recent_hospitalization, chronic_conditions (CKD), adherence_score.
- Assign
eligible, enrollment_status, reason_codes, follow_up_cadence, missing_chart_artifacts, outreach_channel, and initial_monitoring_package.
- Build
summary with integer counts.
Referral-to-Chart Activation
For referral intake with chart activation requirements:
- Fetch referrals for the target batch.
- For each referral, fetch
GET /chart/{patient_id} and GET /icd/{code}.
- Determine
readiness_by_referral with readiness_status and blocker_codes.
- Identify
clinical_code_discrepancy_referrals.
- Build
blocker_sets (authorization, records, imaging).
- Handle duplicates: true duplicates form
duplicate_groups; reviewed-and-cleared go in cleared_duplicate_review_referrals.
- For ready referrals, determine
chart_action and artifacts_to_create based on which chart artifacts are missing or stale.
- Build
correspondence_queue for non-ready referrals.
- Build
priority_order for non-ready referrals, highest priority first.
Business Rules
Detailed rules for insurance validation, ICD chapter/service-family mapping, duplicate detection, shared insurance anomaly resolution, document completeness and staleness, capacity assessment, program eligibility criteria, follow-up cadence, monitoring packages, chart activation, correspondence templates, priority tiers, and the full reason-code catalog are in references/business_rules.md. Load that file whenever applying decision logic to specific patients or referrals.
Output Construction
- Match the template's key names, ordering, and controlled values exactly.
- Treat reason-code and issue-code arrays as unordered sets, but list referral/patient arrays in the ascending order specified by the template.
- Use
null only where the template explicitly allows it.
- If a list would be empty, return
[], not null or omitted.
- Include every top-level key required by the template, even if empty.
- Counts in the summary must be exact integers reflecting all rows in the output.
1---2name: cedar-ridge-intake-103description: Complete Cedar Ridge Intake Coordination tasks using the shared read-only REST API and SQL endpoint. Use when the task involves patient access verification, referral readiness audits, dialysis transfer reviews, chronic-care program enrollment panels, or referral-to-chart activation at Cedar Ridge. Covers insurance and PBM validation, ICD chapter and narrative matching, duplicate detection, shared insurance anomaly resolution, document packet completeness and staleness checks, capacity assessment, program eligibility determination, and chart artifact activation.4metadata:5 source: https://skillmd.com/skills/prism-shadow/cedar-ridge-intake-106---78# Cedar Ridge Intake Coordination910## Overview1112The Cedar Ridge Intake Coordination Portal exposes a read-only REST API and a `POST /query` SQL endpoint. Every task supplies a base URL placeholder like `<TASK_ENV_BASE_URL>`. Replace it with the actual base URL provided in the task prompt and use it for every request.1314All endpoints return JSON. The `/chart/{patient_id}` endpoint bundles the richest dataset — use it as the primary source for patient-level decisions.1516## Endpoint Quick Reference1718| Endpoint | Purpose | Query Params |19|---|---|---|20| `GET /patients` | Patient demographics | `?q=`, `?limit=` |21| `GET /patients/{id}` | Single patient profile | — |22| `GET /referrals` | Referral records | `?batch_id=`, `?service_line=`, `?limit=` |23| `GET /referrals/{id}` | Single referral | — |24| `GET /transfers` | Transfer records | `?batch_id=`, `?limit=` |25| `GET /transfers/{id}` | Single transfer | — |26| `GET /documents` | Document inventory | varies |27| `GET /chart/{patient_id}` | Complete chart | — |28| `GET /programs/{code}/candidates` | Program candidates | — |29| `GET /icd/{code}` | ICD-10 metadata | — |30| `GET /pharmacies` | Pharmacy directory | — |31| `POST /query` | Read-only SQL | body `{"sql": "..."}` |3233Full field-level schemas for every major endpoint response shape are in [references/api_reference.md](references/api_reference.md).3435## SQL Queries3637Use `POST /query` with `{"sql": "SELECT ..."}` for batch-level filtering and joins. The response shape is `{"columns": [...], "rows": [...], "row_count": N, "truncated": false}`.3839```sql40-- Fetch all referrals for a batch41SELECT * FROM referrals WHERE batch_id = '<BATCH_ID>' ORDER BY referral_id4243-- Fetch all transfers for a batch44SELECT * FROM transfers WHERE batch_id = '<BATCH_ID>' ORDER BY transfer_id4546-- Fetch roster records47SELECT * FROM intake_rosters WHERE roster_id = '<ROSTER_ID>' ORDER BY patient_id4849-- Count scheduled transfers by date and chair window50SELECT requested_start_date, chair_window, days_requested, COUNT(*) AS scheduled51FROM transfers WHERE requested_start_date = '2026-12-08'52GROUP BY requested_start_date, chair_window, days_requested53```5455## General Workflow5657Every task supplies an `answer_template.json` in `input/payloads/` that defines the exact output shape, key names, allowed values, and ordering rules. Read that template first. Produce one JSON object matching it exactly — no prose outside the JSON.58591. Read the prompt to identify the batch/roster/program identifier.602. Read `answer_template.json` for the required output shape and controlled values.613. Query the portal for the relevant records (referrals, transfers, patients, charts, candidates).624. Cross-reference records: use `/chart/{patient_id}` to pull coverage, PBM, pharmacies, lifestyle, clinical history, chart artifacts, and related referrals/transfers/rosters. Use `/icd/{code}` to pull ICD chapter, description, laterality, and service_family.635. Apply the business rules in [references/business_rules.md](references/business_rules.md) to determine each field.646. Construct the JSON answer following the template ordering rules exactly.6566## Task-Type Workflows6768### Patient Access Verification (Roster Intake)6970For new-patient roster intake tasks:71721. Read the roster from the task payload to get `roster_id` and the target patient list. Pull `requested_service_date` and `service_line` from the roster record via SQL or the roster payload.732. For each target patient, fetch `GET /chart/{patient_id}`.743. From `chart.coverage`: determine `insurance_status` (valid/invalid/missing). Check `status`, `termination_date`, `service_lines`, `network_status`.754. From `chart.pbm`: determine `prescription_status` (valid/invalid/missing). Check `active` and `status`.765. From `chart.pharmacies`: determine `pharmacy_status` (in_network/out_of_network/unknown). Check `network_status`.776. From `chart.lifestyle`: determine `lifestyle_risk`. Evaluate smoking, alcohol, exercise, sleep.787. From `chart.patient`: check `address`, `emergency_contact_present`, and `preferred_contact` availability.798. Determine `overall_risk` and `registration_status`. Collect `blocked_reason_codes`.809. Build `cohort_summary` with integer counts across all patients.8182### Referral Readiness Audit8384For batch referral audit tasks:85861. Fetch referrals for the target batch: `GET /referrals?batch_id=<BATCH>` or SQL.872. For each referral, fetch `GET /icd/{code}` to get chapter and service_family.883. Compare ICD chapter against the expected chapter for the referral's `service_line`. Flag chapter mismatches and narrative/reason mismatches.894. Detect duplicates: group by `(patient_id, icd10_code)`. Referrals sharing both patient and ICD are duplicates. Referrals flagged "possible duplicate" in `notes` but differing in either field are reviewed and cleared.905. Detect shared insurance anomalies: same `insurance_id` on different `patient_id` values.916. Identify blockers: `records_received=0`, `imaging_received=0`, `auth_status=denied` or `pending`.927. Flag already-scheduled referrals: `appointment_scheduled=1`.938. Assign `readiness_status`, `priority_tier`, and build `action_plan`.949. Build `icd_discrepancies`, `duplicate_groups`, `shared_insurance_anomalies`, `blocker_sets`, `ready_to_schedule`, and `summary`.9596### Dialysis Transfer Review9798For transfer batch review tasks:991001. Fetch transfers: `GET /transfers?batch_id=<BATCH>`.1012. For each transfer, fetch `GET /chart/{patient_id}` and `GET /documents` for the patient.1023. Check packet completeness against the required document list (see business rules). Identify `missing_required_documents`.1034. Check document staleness: compare `received_date` against `freshness_limit_days` for each time-sensitive document type.1045. Evaluate capacity for the requested start date using SQL aggregation on transfers.1056. Determine `feasibility`, `final_intake_decision`, `next_contact_owner`, and `next_contact_route`.1067. Build `cohort_summary`.107108### Program Enrollment Panel109110For chronic-care program enrollment tasks:1111121. Fetch candidates: `GET /programs/{code}/candidates`.1132. For each candidate, fetch `GET /chart/{patient_id}`.1143. Evaluate eligibility: `target_condition` must match the program, `consent_status` must be `signed`.1154. Assess chart completeness: check `existing_chart`, `chart_artifacts`, artifact staleness.1165. Evaluate clinical triggers: `recent_hospitalization`, `chronic_conditions` (CKD), `adherence_score`.1176. Assign `eligible`, `enrollment_status`, `reason_codes`, `follow_up_cadence`, `missing_chart_artifacts`, `outreach_channel`, and `initial_monitoring_package`.1187. Build `summary` with integer counts.119120### Referral-to-Chart Activation121122For referral intake with chart activation requirements:1231241. Fetch referrals for the target batch.1252. For each referral, fetch `GET /chart/{patient_id}` and `GET /icd/{code}`.1263. Determine `readiness_by_referral` with `readiness_status` and `blocker_codes`.1274. Identify `clinical_code_discrepancy_referrals`.1285. Build `blocker_sets` (authorization, records, imaging).1296. Handle duplicates: true duplicates form `duplicate_groups`; reviewed-and-cleared go in `cleared_duplicate_review_referrals`.1307. For ready referrals, determine `chart_action` and `artifacts_to_create` based on which chart artifacts are missing or stale.1318. Build `correspondence_queue` for non-ready referrals.1329. Build `priority_order` for non-ready referrals, highest priority first.133134## Business Rules135136Detailed rules for insurance validation, ICD chapter/service-family mapping, duplicate detection, shared insurance anomaly resolution, document completeness and staleness, capacity assessment, program eligibility criteria, follow-up cadence, monitoring packages, chart activation, correspondence templates, priority tiers, and the full reason-code catalog are in [references/business_rules.md](references/business_rules.md). Load that file whenever applying decision logic to specific patients or referrals.137138## Output Construction139140- Match the template's key names, ordering, and controlled values exactly.141- Treat reason-code and issue-code arrays as unordered sets, but list referral/patient arrays in the ascending order specified by the template.142- Use `null` only where the template explicitly allows it.143- If a list would be empty, return `[]`, not null or omitted.144- Include every top-level key required by the template, even if empty.145- Counts in the summary must be exact integers reflecting all rows in the output.