Cedar Ridge Intake Coordination — task solver
Each task gives you (1) a running read-only portal, (2) a natural-language
prompt.txt naming a target id (roster / referral batch / transfer batch /
program) and, (3) an input/payloads/answer_template.json that specifies the
exact output shape and controlled vocabularies. Your job: pull the source
facts from the portal, apply the domain rules, and emit one JSON object that
conforms to the template. The portal never returns a finished answer — every
graded field is derived by you.
Workflow
Reach the environment. Read environment_access.md for
GDPEVO_ENV_BASE_URL (no credentials). Use it wherever the prompt shows
<TASK_ENV_BASE_URL>. Confirm reachability (GET /health). See
references/environment.md for endpoints, the read-only SQL endpoint
(POST /query with {"sql": "..."}), the full table schema, and the
controlled vocabularies. Prefer the SQL endpoint — it exposes every column
and supports joins.
Read the task template first. Open input/payloads/answer_template.json.
It is authoritative for: required top-level keys, list ordering, item keys,
every enum's allowed values, count-object keys, and any required_value
constants (e.g. task_id, batch_id, program_code). Never invent keys or
emit values outside an enum's allowed set. Read prompt.txt for the target id
and any dates/service line to echo.
Identify the task family (see routing table) and open its rule file.
Scope to the target id. The DB holds many sibling batches/rosters/programs
and distractor referral rows. Filter strictly by the prompt's
batch_id / roster_id / program_code. Never let out-of-scope rows leak in.
Gather + compute. Pull the needed tables for the in-scope entities and
apply the family rules field by field. The logic is deterministic — write a
small script (curl/python against /query) that fetches, computes, and
assembles the object rather than eyeballing rows. Recompute, don't guess.
Format per template & self-verify (checklist below). Output JSON only
— no prose, no markdown fences — unless the template/prompt says otherwise.
Task-family routing
Match the prompt + template top-level keys to one family, then follow its file:
| If the task is about… |
Family |
Rules file |
| New-patient access verification for an intake roster; insurance / prescription / pharmacy / lifestyle / overall risk / registration status |
A |
references/family_intake_verification.md |
| Referral batch audit for scheduling readiness; icd/duplicate/shared-insurance/records/imaging/auth, action plan, summary |
B |
references/family_referral_readiness.md |
| Dialysis transfer batch review; packet completeness/freshness, chair capacity feasibility, intake decision |
C |
references/family_transfer_review.md |
| Chronic-care program enrollment panel for a program code; eligibility, reason codes, cadence, monitoring package |
D |
references/family_program_enrollment.md |
| Referral-to-chart activation; readiness, blocker sets, duplicate handling, chart-artifact needs, correspondence, priority |
E |
references/family_referral_activation.md |
A held-out task is almost certainly a sibling instance of one of these
families (a different id). The rules are written as general predicates over
source columns, so they transfer — but always re-derive from the live data;
never copy any value from the training examples.
Global output conventions (apply to every family)
- Constants: set
task_id / batch_id / roster_id / program_code to the
template's required_value (or the prompt's id). Echo dates/service_line from
the environment (e.g. roster row), not from memory.
- Ordering: honor each template's stated ordering exactly — usually ascending
by
referral_id / transfer_id / patient_id; groups by group_id;
anomalies by insurance_id. When a field is a "set" (issue/reason/blocker/
artifact codes), order is not graded, but sorting ascending/alphabetical is the
safe default (and some templates require alphabetical, e.g. artifacts).
- Count objects: include every enum key, zero-filled — do not omit zero
counts. "By-pair" count lists (e.g. urgency×status) include only occurring
(count ≥ 1) combinations, in the template's stated order.
- Enums only: every enum/code value must be from the template's allowed list.
If your derived signal has no matching allowed value, you mis-derived — re-check.
- IDs verbatim: use uppercase IDs exactly as the portal returns them.
- Nulls: use
null (not 0/"") where the template allows null, e.g.
first_checkin_days, priority_tier for ready referrals.
Recurring gotchas (these bite)
- Filter to the target id and drop
distractor referral rows.
- Chapter vs service_family (families B/E): icd_chapter_mismatch is a
chapter comparison; a code can have the right service_family but wrong chapter.
In family E, the clinical-code check keys on service_family + referral_reason.
- Transfer freshness reference date = that transfer's
requested_start_date,
not "today" (family C). Most error-prone parameter in the whole task set.
notes='possible duplicate' is the duplicate-review flag in family E (and a
distractor in family B, where duplicates are structural: same patient+ICD).
existing_chart vs artifact freshness (families D/E) are independent:
a patient can have existing_chart==1 yet need every artifact recreated
(artifact "needs creation" ⟺ absent OR status != 'current').
- Records/imaging/auth truth comes from the referrals integer flags, not the
documents table.
- Some fields are INFERRED (a branch no training batch exercised) — the rule
files mark them. Apply the documented inference, and if the live data hits an
unexercised branch, reason from the enum names + field semantics.
Verification checklist (before returning)
1---2name: cedar-ridge-intake-33description: Solve Cedar Ridge Intake Coordination Portal tasks — read-only healthcare intake/referral/transfer/program data reconciled into a single strict-schema JSON answer. Use when a task points at a portal base URL (GDPEVO_ENV_BASE_URL / <TASK_ENV_BASE_URL>) and asks for a JSON object following an input/payloads/answer_template.json, covering patient access verification, referral batch readiness/activation, dialysis transfer review, or chronic-care program enrollment.4---56# Cedar Ridge Intake Coordination — task solver78Each task gives you (1) a running read-only portal, (2) a natural-language9`prompt.txt` naming a target **id** (roster / referral batch / transfer batch /10program) and, (3) an `input/payloads/answer_template.json` that specifies the11**exact output shape and controlled vocabularies**. Your job: pull the source12facts from the portal, apply the domain rules, and emit **one JSON object** that13conforms to the template. The portal never returns a finished answer — every14graded field is derived by you.1516## Workflow17181. **Reach the environment.** Read `environment_access.md` for19 `GDPEVO_ENV_BASE_URL` (no credentials). Use it wherever the prompt shows20 `<TASK_ENV_BASE_URL>`. Confirm reachability (`GET /health`). See21 `references/environment.md` for endpoints, the read-only SQL endpoint22 (`POST /query` with `{"sql": "..."}`), the full table schema, and the23 controlled vocabularies. **Prefer the SQL endpoint** — it exposes every column24 and supports joins.25262. **Read the task template first.** Open `input/payloads/answer_template.json`.27 It is authoritative for: required top-level keys, list ordering, item keys,28 every enum's allowed values, count-object keys, and any `required_value`29 constants (e.g. `task_id`, `batch_id`, `program_code`). Never invent keys or30 emit values outside an enum's allowed set. Read `prompt.txt` for the target id31 and any dates/service line to echo.32333. **Identify the task family** (see routing table) and open its rule file.34354. **Scope to the target id.** The DB holds many sibling batches/rosters/programs36 and `distractor referral` rows. Filter strictly by the prompt's37 `batch_id` / `roster_id` / `program_code`. Never let out-of-scope rows leak in.38395. **Gather + compute.** Pull the needed tables for the in-scope entities and40 apply the family rules field by field. The logic is deterministic — write a41 small script (curl/python against `/query`) that fetches, computes, and42 assembles the object rather than eyeballing rows. Recompute, don't guess.43446. **Format per template & self-verify** (checklist below). Output **JSON only**45 — no prose, no markdown fences — unless the template/prompt says otherwise.4647## Task-family routing4849Match the prompt + template top-level keys to one family, then follow its file:5051| If the task is about… | Family | Rules file |52|---|---|---|53| New-patient **access verification** for an intake **roster**; insurance / prescription / pharmacy / lifestyle / overall risk / registration status | A | `references/family_intake_verification.md` |54| **Referral batch audit** for scheduling readiness; icd/duplicate/shared-insurance/records/imaging/auth, action plan, summary | B | `references/family_referral_readiness.md` |55| **Dialysis transfer** batch review; packet completeness/freshness, chair capacity feasibility, intake decision | C | `references/family_transfer_review.md` |56| **Chronic-care program enrollment** panel for a program code; eligibility, reason codes, cadence, monitoring package | D | `references/family_program_enrollment.md` |57| **Referral-to-chart activation**; readiness, blocker sets, duplicate handling, chart-artifact needs, correspondence, priority | E | `references/family_referral_activation.md` |5859A held-out task is almost certainly a **sibling instance** of one of these60families (a different id). The rules are written as general predicates over61source columns, so they transfer — but always re-derive from the live data;62never copy any value from the training examples.6364## Global output conventions (apply to every family)6566- **Constants**: set `task_id` / `batch_id` / `roster_id` / `program_code` to the67 template's `required_value` (or the prompt's id). Echo dates/`service_line` from68 the environment (e.g. roster row), not from memory.69- **Ordering**: honor each template's stated ordering exactly — usually ascending70 by `referral_id` / `transfer_id` / `patient_id`; groups by `group_id`;71 anomalies by `insurance_id`. When a field is a "set" (issue/reason/blocker/72 artifact codes), order is not graded, but sorting ascending/alphabetical is the73 safe default (and some templates require alphabetical, e.g. artifacts).74- **Count objects**: include **every** enum key, zero-filled — do not omit zero75 counts. "By-pair" count lists (e.g. urgency×status) include only occurring76 (count ≥ 1) combinations, in the template's stated order.77- **Enums only**: every enum/code value must be from the template's allowed list.78 If your derived signal has no matching allowed value, you mis-derived — re-check.79- **IDs verbatim**: use uppercase IDs exactly as the portal returns them.80- **Nulls**: use `null` (not 0/"") where the template allows null, e.g.81 `first_checkin_days`, `priority_tier` for ready referrals.8283## Recurring gotchas (these bite)8485- **Filter to the target id** and drop `distractor referral` rows.86- **Chapter vs service_family** (families B/E): icd_chapter_mismatch is a87 *chapter* comparison; a code can have the right service_family but wrong chapter.88 In family E, the clinical-code check keys on *service_family* + *referral_reason*.89- **Transfer freshness reference date = that transfer's `requested_start_date`**,90 not "today" (family C). Most error-prone parameter in the whole task set.91- **`notes='possible duplicate'`** is the duplicate-review flag in family E (and a92 distractor in family B, where duplicates are structural: same patient+ICD).93- **`existing_chart` vs artifact freshness** (families D/E) are independent:94 a patient can have `existing_chart==1` yet need every artifact recreated95 (artifact "needs creation" ⟺ absent OR `status != 'current'`).96- Records/imaging/auth truth comes from the **referrals integer flags**, not the97 documents table.98- Some fields are **INFERRED** (a branch no training batch exercised) — the rule99 files mark them. Apply the documented inference, and if the live data hits an100 unexercised branch, reason from the enum names + field semantics.101102## Verification checklist (before returning)103104- [ ] Output is valid JSON, only the required top-level keys, JSON-only if required.105- [ ] Every list has the right length and ordering; every constant matches the template.106- [ ] Every enum/code value ∈ the template's allowed set.107- [ ] Count objects are internally consistent: totals equal list lengths; each108 `*_counts` object sums to the number of rows; per-pair counts sum to the109 follow-up/total; zero keys present.110- [ ] Cross-field consistency: e.g. a referral in `ready_to_schedule`/`ready`111 has empty issues; a `blocked` referral has a blocking code; `missing_chart_112 artifacts` matches the artifact reason codes; ineligible program candidates113 have empty artifact lists.114- [ ] You scoped strictly to the target id and excluded distractors.