Cedar Ridge Intake
Workflow
- Read the user prompt and
input/payloads/answer_template.jsonbefore querying the portal. Treat the template as authoritative for field names, allowed values, required IDs, ordering, and count keys. - Resolve
<TASK_ENV_BASE_URL>from the task environment instructions. Query only the target roster, batch, program, transfer, referral, or patient IDs named by the prompt/template. - Gather portal context with the bundled helper when useful:
python scripts/fetch_portal_context.py --base-url "$TASK_ENV_BASE_URL" --roster "<ROSTER_ID>"
python scripts/fetch_portal_context.py --base-url "$TASK_ENV_BASE_URL" --referral-batch "<BATCH_ID>"
python scripts/fetch_portal_context.py --base-url "$TASK_ENV_BASE_URL" --transfer-batch "<BATCH_ID>"
python scripts/fetch_portal_context.py --base-url "$TASK_ENV_BASE_URL" --program "<PROGRAM_CODE>"
- Read references/portal_schema.md when writing custom SQL or when the helper output is not enough.
- Read references/decision_rules.md for reusable normalization rules by workflow.
- Build the JSON directly from the current portal records. Do not reuse example final values or invent free-form codes. Sort lists exactly as the template says; for unordered code sets, prefer the template's allowed-value order for stable output.
- Before finalizing, verify the response is valid JSON, contains every required key, uses only allowed enum values, preserves required nulls as JSON
null, and has cohort/summary counts recomputed from the patient/referral rows.
Portal Habits
- Prefer
POST /queryfor multi-table joins andGETendpoints for quick spot checks. - Keep task data scoped: filter by the prompt's roster ID, batch ID, program code, transfer IDs, referral IDs, or patient IDs.
- If a template and inferred rule conflict, follow the template and include only fields it requests.
- Final answers for these tasks should be JSON only unless the prompt explicitly asks for prose.