Cedar Ridge Intake Coordination
Overview
The Cedar Ridge Intake Coordination Portal exposes a set of REST endpoints for
healthcare intake workflows: patient demographics, insurance, pharmacy networks,
referrals, transfers, clinical documents, ICD-10 metadata, program candidates,
chart records, and a read-only SQL query endpoint. Every task follows the same
pattern: read the input prompt, read the answer template, fetch live data from
the portal at <TASK_ENV_BASE_URL>, cross-reference values across endpoints,
derive decisions from the controlled vocabularies, and output a single JSON
object matching the template exactly.
Portal Endpoints
| Endpoint |
Returns |
GET / |
Portal root / health |
GET /patients |
All patients |
GET /patients/{patient_id} |
Single patient record |
GET /referrals |
All referrals |
GET /referrals/{referral_id} |
Single referral record |
GET /transfers |
All transfers |
GET /transfers/{transfer_id} |
Single transfer record |
GET /documents |
All documents |
GET /chart/{patient_id} |
Patient chart data |
GET /programs/{program_code}/candidates |
Program candidate list |
GET /icd/{code} |
ICD-10 code metadata (chapter, description) |
GET /pharmacies |
Pharmacy directory |
POST /query |
Read-only SQL (body: {"sql": "SELECT ..."}) |
See references/api_reference.md for field-level
schemas of every endpoint response.
Universal Workflow
- Read
input/prompt.txt for the task description and the batch/roster/program
identifier. Note the <TASK_ENV_BASE_URL> placeholder.
- Read
input/payloads/answer_template.json for the exact JSON shape,
controlled vocabularies, ordering rules, and required keys.
- Replace
<TASK_ENV_BASE_URL> with the actual base URL given in the task
environment. Use curl -s for every GET call.
- Collect all referenced records: fetch the collection endpoint first, then
individual records, then related data (patients for referrals, chart for
patients, ICD for codes, documents for transfers/referrals).
- Cross-reference fields across endpoints. For example, referral records link
to patients and ICD-10 codes; transfer records link to documents and patients.
- Apply the domain-specific rules documented below and in the references.
- Assemble the output JSON exactly as the template specifies. Respect every
ordering rule (ascending IDs, alphabetical for doc types). Use only the
controlled values from the template.
ICD-10 Chapter Matching
ICD-10 codes encode chapters in the first character and numeric range:
| Chapter |
Code Range |
Typical Service Lines |
| J00-J99 |
Diseases of the respiratory system |
Pulmonary |
| M00-M99 |
Diseases of the musculoskeletal system |
Orthopedics, Spine, Joint |
| S00-T88 |
Injury, poisoning, external causes |
Trauma (not ortho) |
| I00-I99 |
Diseases of the circulatory system |
Cardiology |
| E00-E89 |
Endocrine, nutritional, metabolic |
Diabetes, HTN management |
| N00-N99 |
Diseases of the genitourinary system |
Dialysis, Nephrology |
A code belongs to chapter X if its leading character and numeric range fall
within the chapter bounds. When a referral's ICD-10 code does not match the
expected chapter for its service line (e.g., an S-code for an orthopedic
referral), flag it as icd_chapter_mismatch. The portal's GET /icd/{code}
endpoint returns the actual chapter for any code — always validate against that
response, not from memory.
Insurance, Pharmacy, and Registration Status
Patient records include insurance plan details, prescription benefit (PBM)
information, and preferred pharmacy assignments. When assessing access:
- insurance_status:
valid when coverage is active and includes the service
line; invalid when expired, pending, or excludes the service line; missing
when no record exists.
- prescription_status:
valid when PBM is active and plan matches; invalid
when PBM is inactive or plan mismatches; missing when no PBM record exists.
- pharmacy_status:
in_network when preferred pharmacy matches the plan
network; out_of_network when it does not; unknown when pharmacy or plan
data is absent.
- registration_status is a function of all status fields plus risk:
approved only when all statuses are valid/in_network and risk is low;
rejected when coverage is expired, service line excluded, or multiple
hard blockers; clinical_review when risk is high or soft blockers exist;
hold when coverage is pending and nothing is expired.
Blocked reason codes map directly to specific conditions found in the data:
coverage_expired when plan end date is past, coverage_pending when start
date is in the future, excluded_service_line when the plan does not cover the
service, pbm_invalid / pbm_missing / pbm_policy_mismatch for PBM issues,
pharmacy_out_of_network / pharmacy_unknown for pharmacy issues,
overall_risk_high when risk is high, and additional codes for missing
demographics/contacts. Only include codes that actually apply to the patient.
Document Freshness Rules
Dialysis and transfer packets contain lab/vaccine documents with validity windows:
| Document Type |
Freshness Limit |
hbsag |
30 days |
monthly_labs |
30 days |
ppd_or_cxr |
30 days |
history_physical |
365 days |
hep_b_antibody_core |
No fixed expiry (one-time) |
A document is stale when (as_of_date - received_date) > freshness_limit_days.
Use the date implied by the task context or the requested start date as the
reference date for staleness checks.
Referral Readiness and Chart Activation
Referral audit workflows check multiple conditions:
- ICD discrepancy: Compare the ICD-10 chapter to the expected service-line
chapter. Also check narrative/laterality when the template requests it.
- Document blockers:
missing_records when a referral has no associated
documents or chart record; missing_imaging when required imaging is absent.
- Authorization blockers: Check the auth status field on the referral
(
pending, denied, not_submitted).
- Duplicate handling: When two referrals share the same patient and
clinically overlap, flag as duplicate. The earlier-created referral is
typically the primary. Recommend
consolidate_to_primary unless they are
distinct service episodes.
- Shared insurance anomalies: When two different patients share the same
insurance policy ID, flag for verification.
- Already scheduled: When a referral shows an appointment date before
clearance, flag as
scheduled_before_clearance.
Priority tiers: tier_1_immediate for clinical safety issues (wrong chapter
with active schedule), tier_2_short_term for missing records/imaging/auth,
tier_3_administrative for insurance verification and non-urgent paperwork.
Controlled Vocabularies Quick Reference
See references/vocabularies.md for the complete
set of controlled values organized by workflow type.
SQL Reconciliation
When records need cross-referencing beyond what individual GET calls provide,
use POST /query with a read-only SQL statement. The endpoint accepts standard
SQL SELECT. Use this to reconcile referral-patients, find missing documents by
patient, or identify duplicate insurance IDs across patients.
1---2name: cedar-ridge-intake-183description: "Cedar Ridge Intake Coordination Portal workflows covering patient access verification, referral auditing, dialysis transfer review, chronic-care enrollment panels, and referral-to-chart activation. Use when the task references the Cedar Ridge Intake Coordination Portal, a TASK_ENV_BASE_URL, or any Cedar Ridge intake batch/roster (e.g. NPI-, ORTHO-, DIAL-, PULM-, DMHTN-). Trigger on phrases like intake coordination, Cedar Ridge, patient access verification, referral readiness, transfer review, enrollment panel, chart activation, or when a JSON answer template requires controlled healthcare-intake vocabularies."4license: MIT5compatibility: designed for codex6metadata:7 source: https://skillmd.com/skills/prism-shadow/cedar-ridge-intake-188---910# Cedar Ridge Intake Coordination1112## Overview1314The Cedar Ridge Intake Coordination Portal exposes a set of REST endpoints for15healthcare intake workflows: patient demographics, insurance, pharmacy networks,16referrals, transfers, clinical documents, ICD-10 metadata, program candidates,17chart records, and a read-only SQL query endpoint. Every task follows the same18pattern: read the input prompt, read the answer template, fetch live data from19the portal at `<TASK_ENV_BASE_URL>`, cross-reference values across endpoints,20derive decisions from the controlled vocabularies, and output a single JSON21object matching the template exactly.2223## Portal Endpoints2425| Endpoint | Returns |26|---|---|27| `GET /` | Portal root / health |28| `GET /patients` | All patients |29| `GET /patients/{patient_id}` | Single patient record |30| `GET /referrals` | All referrals |31| `GET /referrals/{referral_id}` | Single referral record |32| `GET /transfers` | All transfers |33| `GET /transfers/{transfer_id}` | Single transfer record |34| `GET /documents` | All documents |35| `GET /chart/{patient_id}` | Patient chart data |36| `GET /programs/{program_code}/candidates` | Program candidate list |37| `GET /icd/{code}` | ICD-10 code metadata (chapter, description) |38| `GET /pharmacies` | Pharmacy directory |39| `POST /query` | Read-only SQL (body: `{"sql": "SELECT ..."}`) |4041See [references/api_reference.md](references/api_reference.md) for field-level42schemas of every endpoint response.4344## Universal Workflow45461. Read `input/prompt.txt` for the task description and the batch/roster/program47 identifier. Note the `<TASK_ENV_BASE_URL>` placeholder.482. Read `input/payloads/answer_template.json` for the exact JSON shape,49 controlled vocabularies, ordering rules, and required keys.503. Replace `<TASK_ENV_BASE_URL>` with the actual base URL given in the task51 environment. Use `curl -s` for every GET call.524. Collect all referenced records: fetch the collection endpoint first, then53 individual records, then related data (patients for referrals, chart for54 patients, ICD for codes, documents for transfers/referrals).555. Cross-reference fields across endpoints. For example, referral records link56 to patients and ICD-10 codes; transfer records link to documents and patients.576. Apply the domain-specific rules documented below and in the references.587. Assemble the output JSON exactly as the template specifies. Respect every59 ordering rule (ascending IDs, alphabetical for doc types). Use only the60 controlled values from the template.6162## ICD-10 Chapter Matching6364ICD-10 codes encode chapters in the first character and numeric range:6566| Chapter | Code Range | Typical Service Lines |67|---|---|---|68| J00-J99 | Diseases of the respiratory system | Pulmonary |69| M00-M99 | Diseases of the musculoskeletal system | Orthopedics, Spine, Joint |70| S00-T88 | Injury, poisoning, external causes | Trauma (not ortho) |71| I00-I99 | Diseases of the circulatory system | Cardiology |72| E00-E89 | Endocrine, nutritional, metabolic | Diabetes, HTN management |73| N00-N99 | Diseases of the genitourinary system | Dialysis, Nephrology |7475A code belongs to chapter X if its leading character and numeric range fall76within the chapter bounds. When a referral's ICD-10 code does not match the77expected chapter for its service line (e.g., an S-code for an orthopedic78referral), flag it as `icd_chapter_mismatch`. The portal's `GET /icd/{code}`79endpoint returns the actual chapter for any code — always validate against that80response, not from memory.8182## Insurance, Pharmacy, and Registration Status8384Patient records include insurance plan details, prescription benefit (PBM)85information, and preferred pharmacy assignments. When assessing access:8687- **insurance_status**: `valid` when coverage is active and includes the service88 line; `invalid` when expired, pending, or excludes the service line; `missing`89 when no record exists.90- **prescription_status**: `valid` when PBM is active and plan matches; `invalid`91 when PBM is inactive or plan mismatches; `missing` when no PBM record exists.92- **pharmacy_status**: `in_network` when preferred pharmacy matches the plan93 network; `out_of_network` when it does not; `unknown` when pharmacy or plan94 data is absent.95- **registration_status** is a function of all status fields plus risk:96 `approved` only when all statuses are valid/in_network and risk is low;97 `rejected` when coverage is expired, service line excluded, or multiple98 hard blockers; `clinical_review` when risk is high or soft blockers exist;99 `hold` when coverage is pending and nothing is expired.100101Blocked reason codes map directly to specific conditions found in the data:102`coverage_expired` when plan end date is past, `coverage_pending` when start103date is in the future, `excluded_service_line` when the plan does not cover the104service, `pbm_invalid` / `pbm_missing` / `pbm_policy_mismatch` for PBM issues,105`pharmacy_out_of_network` / `pharmacy_unknown` for pharmacy issues,106`overall_risk_high` when risk is high, and additional codes for missing107demographics/contacts. Only include codes that actually apply to the patient.108109## Document Freshness Rules110111Dialysis and transfer packets contain lab/vaccine documents with validity windows:112113| Document Type | Freshness Limit |114|---|---|115| `hbsag` | 30 days |116| `monthly_labs` | 30 days |117| `ppd_or_cxr` | 30 days |118| `history_physical` | 365 days |119| `hep_b_antibody_core` | No fixed expiry (one-time) |120121A document is stale when `(as_of_date - received_date) > freshness_limit_days`.122Use the date implied by the task context or the requested start date as the123reference date for staleness checks.124125## Referral Readiness and Chart Activation126127Referral audit workflows check multiple conditions:128129- **ICD discrepancy**: Compare the ICD-10 chapter to the expected service-line130 chapter. Also check narrative/laterality when the template requests it.131- **Document blockers**: `missing_records` when a referral has no associated132 documents or chart record; `missing_imaging` when required imaging is absent.133- **Authorization blockers**: Check the auth status field on the referral134 (`pending`, `denied`, `not_submitted`).135- **Duplicate handling**: When two referrals share the same patient and136 clinically overlap, flag as duplicate. The earlier-created referral is137 typically the primary. Recommend `consolidate_to_primary` unless they are138 distinct service episodes.139- **Shared insurance anomalies**: When two different patients share the same140 insurance policy ID, flag for verification.141- **Already scheduled**: When a referral shows an appointment date before142 clearance, flag as `scheduled_before_clearance`.143144Priority tiers: `tier_1_immediate` for clinical safety issues (wrong chapter145with active schedule), `tier_2_short_term` for missing records/imaging/auth,146`tier_3_administrative` for insurance verification and non-urgent paperwork.147148## Controlled Vocabularies Quick Reference149150See [references/vocabularies.md](references/vocabularies.md) for the complete151set of controlled values organized by workflow type.152153## SQL Reconciliation154155When records need cross-referencing beyond what individual GET calls provide,156use `POST /query` with a read-only SQL statement. The endpoint accepts standard157SQL SELECT. Use this to reconcile referral-patients, find missing documents by158patient, or identify duplicate insurance IDs across patients.