Cedar Ridge Intake Coordination tasks
Each task gives you a prompt, an input/payloads/answer_template.json, and network access to a
read-only clinical-intake portal. Your job: gather the relevant records, apply the intake
business rules, and emit a single JSON object that conforms exactly to the template. The
grader compares your JSON to a gold answer — controlled values, keys, ordering, and summary
counts all matter, and no prose is allowed outside the JSON.
Workflow
Read the inputs. Read the prompt and
input/payloads/answer_template.jsonin full. Note the target id (roster/batch/program), the required top-level keys, every controlled-value (enum) list, ordering directives, and any pinned constants (task_id, ids). Some tasks add an extra payload (e.g.target_roster.json) — read it too.Connect to the portal. Get the base URL from
environment_access.md(GDPEVO_ENV_BASE_URL) and use only the endpoints listed there. PreferPOST /query(read-only SQL) for reconciliation; use the REST views for convenience. The helperscripts/portal.pywraps both:python3 scripts/portal.py --env <path>/environment_access.md tables python3 scripts/portal.py --env <path>/environment_access.md schema referrals python3 scripts/portal.py --env <path>/environment_access.md sql "SELECT ... ORDER BY ..." python3 scripts/portal.py --env <path>/environment_access.md get /programs/<code>/candidatesGET /healthshows per-table row counts as a sanity check. Seereferences/data_model.mdfor the full schema, endpoints, and the service-line↔ICD-chapter reference.Identify the family and pull the roster/batch/program. Match the template to one of the five families in
references/task_families.md. Fetch the exact working set (every patient, referral, transfer, or candidate the prompt scopes) and all the tables that family needs. Include every member the portal returns — don't sample.Apply the decision rules from
references/task_families.mdper row. Those rubrics (coverage/PBM/pharmacy status, risk scoring, readiness/blocker logic, coding discrepancies, duplicates, packet completeness/freshness, capacity feasibility, program eligibility & monitoring packages, chart activation, correspondence, priority tiers) reproduce every worked example. When a rubric offers a threshold as a heuristic, apply it consistently and sanity-check against the cohort.Assemble the JSON to the template. Use the template's keys, in the item ordering it specifies (usually ascending id). Use only the template's controlled values in each field. Compute every summary/cohort count from your own rows so they reconcile exactly. Surface the template's constraints with:
python3 scripts/template_constraints.py <path>/input/payloads/answer_template.jsonSelf-check before returning (see checklist below), then output the JSON object and nothing else.
Output discipline
- Return exactly one JSON object; no commentary, markdown fences, or trailing text.
- Echo pinned constants verbatim (
task_id,roster_id/batch_id/program_code). - Every enum-typed field must hold a value from that field's template list — never invent codes or reuse a code from a different field.
- Lists follow the template's ordering rule (ascending id, alphabetical, "urgency then status", etc.); lists marked "unordered set" still must contain the right members with no duplicates.
- Integer counts are integers; keep the full set of count keys even when a count is 0.
- Ids stay in the portal's exact casing (referral/patient ids uppercase as returned).
Self-check
- Top-level keys == the template's required set; constants echoed verbatim.
- Row count == number of scoped patients/referrals/transfers/candidates; ordered correctly.
- Every enum value is a member of its field's allowed list.
- Each row's reason/issue/blocker/action codes are internally consistent with its status.
- Every summary/cohort count equals the recomputed tally from the rows (totals add up).
- Date fields come from the data (roster service date, transfer start, received dates).
- Output is a single JSON object, no prose.
Notes & judgment calls
- Some rules are semantic (narrative / clinical-reason mismatch, clinical-vs-administrative
document severity). Use the ICD description and service-line context;
references/records the observed conventions. - Freshness for documents (family C) is computed from
received_datevs the transfer'srequested_start_date; freshness for chart artifacts (families D/E) is pre-computed inchart_artifacts.status— read it, don't recompute. - The reference rubrics were derived from a handful of examples. If the live data contradicts a stated threshold, trust the data and the template's controlled vocabulary over the heuristic.