Cedar Intake Reconciliation
Use this skill to turn Cedar Ridge portal records into the exact JSON object requested by the task template.
Core Workflow
- Read the prompt and
input/payloads/answer_template.jsonfirst. Treat the template as the schema, controlled vocabulary, ordering rule, and count contract. - Extract the target identifier from the prompt or template: roster ID, referral batch ID, transfer batch ID, or program code.
- Query only records scoped to that target and its linked patient IDs. Prefer REST endpoints for direct objects and
POST /queryfor joins. - Derive fields from portal data, not from prose expectations. Use the rules below only when the template does not define a different rule.
- Emit JSON only. Include required zero-count keys and empty arrays. Sort rows exactly as the template specifies; otherwise sort IDs ascending and sort artifact/document code arrays alphabetically.
Portal Access
Use the task base URL from the prompt or environment access file. Credentials are not needed.
Useful endpoints:
GET /patients/{patient_id}for patient, coverage, PBM, pharmacies, lifestyle, documents, chart artifacts, and program candidates.GET /chart/{patient_id}for chart artifacts and clinical history.GET /referrals?batch_id=...,GET /transfers?batch_id=..., andGET /programs/{program_code}/candidates.GET /icd/{code}for ICD chapter, service family, description, and laterality.POST /querywith{"sql": "..."}for scoped joins.
The helper script can print formatted JSON:
python scripts/portal_fetch.py --base-url "$TASK_ENV_BASE_URL" referrals BATCH_ID
python scripts/portal_fetch.py --base-url "$TASK_ENV_BASE_URL" transfers BATCH_ID
python scripts/portal_fetch.py --base-url "$TASK_ENV_BASE_URL" program PROGRAM_CODE
python scripts/portal_fetch.py --base-url "$TASK_ENV_BASE_URL" chart PATIENT_ID
python scripts/portal_fetch.py --base-url "$TASK_ENV_BASE_URL" sql "select * from referrals where batch_id='BATCH_ID' order by referral_id"
Access Verification
For new-patient roster tasks:
- Read
intake_rostersforrequested_service_date,service_line, and patient IDs. - Set insurance
validwhen coverage exists, is active, is effective on the requested date, is not terminated before that date, and includes the requested service line. Usemissingfor no coverage andinvalidotherwise. - Add coverage reasons from the failing condition:
coverage_expired,coverage_pending, andexcluded_service_line. - Set prescription benefit
validwhen a PBM row exists, is active, has an approved/covered status, and its policy matches the active coverage policy. Usemissingfor no PBM,invalidfor inactive/rejected/pending/review rows, andpbm_policy_mismatchfor a policy mismatch. - Use the rank-1 preferred pharmacy. Map its pharmacy network to
in_networkorout_of_network; useunknownwhen no preferred pharmacy/network is available. - Add contact/demographic reasons when present: missing address, missing emergency contact, or unavailable preferred contact channel. Email/portal require an email; phone/sms require a phone.
- Assign lifestyle risk by strongest signal: high for current smoking, heavy alcohol use, no/missing exercise, or very short sleep; medium for former smoking, moderate alcohol, low exercise, or mildly short sleep; low when none apply.
- Assign overall risk high when high lifestyle risk or any hard blocker exists; medium for medium lifestyle or softer admin blockers; low only when clean.
- Registration status precedence:
rejectedfor non-covered/excluded service-line cases;clinical_reviewfor high overall risk, PBM failure, pharmacy out-of-network, or clinical blockers;holdfor admin-only or pending items;approvedonly when no blockers remain.
Referral Readiness And Activation
For referral batch tasks:
- Fetch referral rows by
batch_id, ICD metadata for everyicd10_code, patient/chart data when chart activation is requested, and documents when the template asks for support-document status. - Flag clinical code discrepancies when ICD service family does not match the referral service line, when the ICD chapter is not expected for the line, when referral reason/diagnosis narrative is incompatible with the code, or when laterality conflicts with referral text. Common expected chapters: orthopedics
M00-M99, pulmonaryJ00-J99. - Hard blockers are missing records, missing imaging, and authorization statuses such as denied, pending, or not submitted when authorization is required.
- Duplicate groups require strong identity overlap, usually the same patient plus repeated clinical/referring/insurance details. Keep the earliest or lowest referral ID as primary unless the portal marks another primary. A "possible duplicate" note alone is not enough; if the suspected rows are distinct patients/policies, clear duplicate review when the template asks.
- Shared insurance anomalies are repeated insurance IDs across different patient IDs; repeated insurance for the same patient is a duplicate signal instead.
- Readiness precedence: hard blockers ->
blocked; clinical code discrepancy, duplicate review, or already scheduled before clearance ->under_review; shared-insurance-only issues ->admin_followup; no issues ->ready. - Priority tiers: urgent clinical/code issues ->
tier_1_immediate; hard blockers, duplicate review, scheduling-before-clearance, and routine clinical/code issues ->tier_2_short_term; insurance-only admin follow-up ->tier_3_administrative; ready rows usually have null/no priority. - Map actions directly from issue codes: corrected ICD or clinical clarification for code discrepancies, confirm narrative/laterality for narrative/laterality mismatches, consolidate duplicate, verify insurance ID, request records, request imaging, resolve authorization, and review existing appointment.
- For correspondence queues, use clinical-code templates for code-only issues, auth/records templates for authorization or records blockers, duplicate templates for duplicate review, and appointment-hold templates when an uncleared referral is already scheduled.
- For ready referral chart work, inspect chart artifacts for
demographics,active_problems,medications,allergies,vitals,labs, andconsent. Include missing or stale artifacts. Usecreate_chartwhen no chart exists,update_chartwhen an existing chart needs artifacts, andno_chart_actionwhen nothing is needed.
Dialysis Transfer Review
For transfer batch tasks:
- Fetch transfer rows by
batch_id, all documents with matchingtransfer_id, andfacility_capacityrows for each requested start date and modality. - Required documents come from the answer template. A document counts as present only when it is final/finalized. Draft documents count as missing.
- Treat transportation as missing when the transfer has no transportation value or required transportation document.
- Packet completeness means all required documents are present; stale documents do not by themselves make
packet_completeness_statusincomplete. - Staleness is measured against the requested start date. Use these freshness limits unless the template overrides them:
hbsag,monthly_labs, andppd_or_cxrare 30 days;history_physicalandhep_b_antibody_coreare 365 days. - Sum
facility_capacity.open_chairsacross locations for the requested start date and modality. Capacity is available when the total is greater than zero. - Feasibility combines packet readiness and capacity: ready on requested start only when no documents are missing or stale and capacity is available; otherwise use the template value matching packet-not-ready and/or capacity-unavailable.
- Final decision: accept only when packet ready and capacity available; hold for capacity-only constraints; clinical review for missing or stale clinical packet items. Contact owner is usually clinical nurse for document/freshness work, scheduling coordinator for capacity-only work, intake coordinator for admin-only work, and none when accepted.
Chronic-Care Program Enrollment
For program candidate tasks:
- Fetch the program candidate list and include every current candidate returned for the program. Join patient, chart, and clinical history by patient ID.
- Derive eligibility from both candidate target condition and active clinical diagnoses. For diabetes/hypertension programs, require the candidate target condition and clinical history to include both diabetes and hypertension.
- Use portal/chart statuses for missing artifacts. Required chronic-care artifacts are active problems, vitals, labs, medications, and consent. Mark
chart_recordwhen the patient has no active chart, and mark individual artifacts when missing or stale. - Status precedence: reject wrong target condition, missing active program diagnosis, declined consent, or inactive chart that prevents enrollment; hold eligible candidates with missing consent or chart cleanup; enroll eligible candidates with signed consent and current required artifacts.
- Reason codes should be normalized from the cause: target mismatch, missing active diagnosis, consent declined/missing, chart not active, stale active problems, missing recent vitals/labs, missing medication list, and program-fit/high-touch reasons.
- High-touch weekly follow-up applies for recent hospitalization, low adherence, or recent ED flags. CKD without a high-touch trigger uses biweekly follow-up. Otherwise use monthly for clean enrollments, deferred for holds, and none for rejects.
- Monitoring packages: high-touch includes BP cuff, glucometer, labs, medication reconciliation, and care plan setup with first check-in in 7 days; standard includes BP cuff, glucometer, and labs, adding medication reconciliation for CKD/biweekly cases with first check-in in 14 or 30 days; deferred uses consent packet/chart update request; rejects are not applicable.
- Outreach should use the preferred outreach channel when usable. Portal requires portal access/active chart and email; email requires email; phone and SMS require phone. Fall back to the patient's usable preferred contact, then to another available allowed channel, else
none.
Final Checks
- Validate the final object against the template before answering: required keys, enum values, nullability, ordering, and integer counts.
- Recompute summaries from the final patient/referral/transfer rows rather than from intermediate notes.
- Do not include explanatory prose outside the JSON when the user asks for JSON only.