Northstar Payer-Operations Determination
You are answering a single Northstar Health Plan payer-operations work item. The
task gives you a target business id (a case / appeal / claim / P2P / queue id)
and a strict JSON answer_template. Every answer is derived from records already
present in the environment — the environment pre-stages criteria results,
recommended authorizations, appeal packets, benchmarks, and margin rows. Your job is
to find the right records for the exact target, apply light operational logic, and
render them into the template's exact shape — including the shared basis_audit
audit trail that every template requires.
Do not invent facts. If a value is not derivable from the environment, re-query
before guessing.
1. Read the task contract first
Read all three input files before touching the network:
input/prompt.txt — the narrative ask, the requester role, and any special rules
(e.g. "180-day internal appeal window", "use null for absent modifiers", "do not
inspect database/source files directly", "JSON only").
input/payloads/task_context.json — the machine-readable target: target_business_id
(and sometimes target_appeal_id), reporting_date/as-of date, service domain or
work type, environment connection block, and often a local_memo/finance_memo
with the operative definitions (thresholds, row ids, cost formulas, deadlines).
input/payloads/answer_template.json — the authority on output shape. It lists
the required top-level keys, per-field types, enum choices, list ordering rules,
numeric precision, date format, and whether extra fields are allowed
(additional_fields_allowed / additional_properties). Build your answer to this
file, not to your memory of a prior task — future tasks may add or drop fields.
Extract and hold onto: the target id, the as-of date, every required key, every enum
choice list, every ordering rule, numeric precision, and the additional_* flag.
2. Reach the environment (read-only)
Connection details come from environment_access.md and the environment block of
task_context.json — read them from there rather than hardcoding (base URL / port /
token may differ per deployment). As observed:
- Base URL: the value of
<TASK_ENV_BASE_URL> (e.g. http://task-env:9014/).
- SQL:
POST /sql/query, header Authorization: Bearer <token> (e.g.
pa-review-token-014), JSON body {"sql": "SELECT ..."}. Only SELECT, WITH,
and PRAGMA table_info are accepted; results cap at 500 rows.
- Business GET endpoints (see
reference/environment.md) return JSON and, in practice,
do not require the token — but sending it is harmless.
Safety / rules that appear in prompts: use only the network environment. Never
read the environment's source files, generated data files, SQLite files, manifests, or
setup scripts directly, even if present. Treat the environment as read-only — non-SELECT
SQL is rejected anyway.
Start by confirming the schema with GET /api/tables (or PRAGMA table_info). The full
table/column catalog and endpoint list are in reference/environment.md.
3. Gather records for the EXACT target only
The environment holds hundreds of distractor rows (≈160 cases, decoy rate schedules
named "…Distractor Schedule", and benchmark rows belonging to other task namespaces).
Always filter to your exact target business id, and when several records look eligible,
disambiguate by the operative keys (payer + plan_type + service_domain + cpt + modifier
- effective date window, or the explicit row-id list in the memo). Never let a distractor
into the answer.
Fastest paths:
- Case-linked work (nurse review, appeal, P2P):
GET /api/cases/{case_id} returns a
single case object that bundles member, provider, plan, criteria (joined with the
policy criteria + result_if_missing), documents, document_facts, request_lines,
authorizations, appeals, assistance_screen, drug_trials, p2p_events, and
claims. This is usually all you need for one case.
- Claims / benchmarks: query
claims, claim_lines, and payment_benchmarks by id;
use GET /api/rate-schedules to see benchmark sources.
- Margin queue: query
service_margin for the exact month_ids the memo lists.
- Appeals:
GET /api/appeals or query appeals, drug_trials, assistance_screen.
4. Identify the task family and derive each field
Recognize the family from the answer_template's required keys / criterion-id prefixes /
enums, then follow the matching recipe in reference/task_patterns.md:
| Signal in the template |
Family |
Core sources |
recommendation, authorization, PT-* criteria, evidence_documents |
UM nurse prior-auth determination |
cases, case_criteria, documents(is_current), authorizations |
appeal_path, documented_failures, assistance, DRUG-* criteria |
Pharmacy appeal + assistance intake |
appeals, drug_trials(documented), case_criteria, assistance_screen |
benchmark_source, lines, recovery_amount, paid_total |
Payment-integrity claim repricing |
claims, claim_lines, payment_benchmarks |
p2p_outcome, PET-* criteria, missing_pet_factors, internal_appeal_deadline |
Peer-to-peer closure |
p2p_events, case_criteria, documents, authorizations |
revenue_to_cost_ratio, below_threshold_segments, gap_to_120pct |
UM-finance margin queue |
service_margin |
The environment usually pre-stages the outcome: case_criteria.result,
authorizations.status (recommended_approval/denied), appeals.appeal_path/.owner,
p2p_events.outcome/.final_status. Read those signals; apply only the small computations
the template demands (ratios, date arithmetic, current-vs-stale filtering, sorting,
mapping to the template's enums). Full formulas are in reference/task_patterns.md.
5. Build basis_audit (required by every template)
Every answer_template contains a basis_audit object with the same four keys. It is a
business audit trail, not free text:
source_precedence — pick the one enum choice matching the family (each family maps to
exactly one; see the table in reference/task_patterns.md).
controlling_record_ids — the environment record ids that directly drive the result,
in operational evidence order (e.g. the current evidence docs; the appeal + documented
trials; the claim lines then the current benchmarks; the P2P event + clinical note; the
queue rows in listed order).
exception_record_ids — the gap/exclusion records that explain what was set aside:
criteria/route gaps before stale/excluded records when both appear (e.g. the stale
export; the undocumented trial + missing packet field; the stale benchmark; the unmet
criterion + missing factors; the below-threshold row).
precedence_record_order — the controlling records then the exception records, listed
highest-priority-first under the chosen precedence rule (the "what superseded what"
trail; it may be a curated subset — e.g. the winning benchmarks then the stale one,
not every claim line).
Use the real environment ids for records, and the template's own enum tokens (e.g.
household_income_proof, PET-FACTOR, prior_equivocal_spect) where the driver is a
requirement/criterion rather than a stored row.
6. Format, validate, and emit JSON only
Before returning, verify against the template:
- Output is exactly one JSON object, no prose/markdown/comments outside it.
- The top-level key set matches
required_top_level_fields exactly. If
additional_fields_allowed is false, include no extra keys; if extras are
"allowed but not evaluated," still prefer the minimal exact set.
- Every enum value is one of the template's
choices; every criterion map has exactly
the required_keys.
- Lists obey their stated
ordering (ascending id, alphabetical, claim-line order,
the memo's row-id order, or "order shown in choices"). Empty list vs null: use what
the field says (e.g. modifiers → null, not ""; "empty list only if none").
- Numbers use the stated precision — currency rounded to 2 decimals (as JSON numbers,
dollars), ratios to 4 decimals. Recovery/underpayment = corrected − paid.
- Dates are
YYYY-MM-DD. Date windows are counted from the record date the rule names
(e.g. an internal-appeal deadline is N days from the final adverse determination /
P2P date, not from the reporting date).
- Recompute derived numbers from source rows; re-check that no distractor id slipped in.
See reference/task_patterns.md for the per-family derivation details and
reference/environment.md for the schema and endpoint catalog.
1---2name: northstar-payer-ops-determination-63description: Produce a structured JSON determination for a Northstar Health Plan payer-operations work item (UM prior-auth nurse review, pharmacy coverage appeal + manufacturer assistance intake, payment-integrity claim repricing, peer-to-peer closure, or UM-finance margin-queue review) by reading the task's own answer_template, querying the shared read-only payer-operations environment, and mapping the environment records into the exact output contract. Use whenever a task hands you a prompt.txt + payloads/task_context.json + payloads/answer_template.json referencing a Northstar / payer-operations environment reachable at <TASK_ENV_BASE_URL> with a POST /sql/query endpoint.4---56# Northstar Payer-Operations Determination78You are answering a single Northstar Health Plan payer-operations work item. The9task gives you a target **business id** (a case / appeal / claim / P2P / queue id)10and a strict JSON **answer_template**. Every answer is *derived from records already11present in the environment* — the environment pre-stages criteria results,12recommended authorizations, appeal packets, benchmarks, and margin rows. Your job is13to **find the right records for the exact target, apply light operational logic, and14render them into the template's exact shape** — including the shared `basis_audit`15audit trail that every template requires.1617Do not invent facts. If a value is not derivable from the environment, re-query18before guessing.1920## 1. Read the task contract first2122Read all three input files before touching the network:2324- `input/prompt.txt` — the narrative ask, the requester role, and any special rules25 (e.g. "180-day internal appeal window", "use null for absent modifiers", "do not26 inspect database/source files directly", "JSON only").27- `input/payloads/task_context.json` — the machine-readable target: `target_business_id`28 (and sometimes `target_appeal_id`), `reporting_date`/as-of date, service domain or29 work type, environment connection block, and often a `local_memo`/`finance_memo`30 with the operative definitions (thresholds, row ids, cost formulas, deadlines).31- `input/payloads/answer_template.json` — **the authority on output shape.** It lists32 the required top-level keys, per-field types, enum `choices`, list `ordering` rules,33 numeric precision, date format, and whether extra fields are allowed34 (`additional_fields_allowed` / `additional_properties`). Build your answer to this35 file, not to your memory of a prior task — future tasks may add or drop fields.3637Extract and hold onto: the target id, the as-of date, every required key, every enum38choice list, every ordering rule, numeric precision, and the `additional_*` flag.3940## 2. Reach the environment (read-only)4142Connection details come from `environment_access.md` and the `environment` block of43`task_context.json` — read them from there rather than hardcoding (base URL / port /44token may differ per deployment). As observed:4546- Base URL: the value of `<TASK_ENV_BASE_URL>` (e.g. `http://task-env:9014/`).47- SQL: `POST /sql/query`, header `Authorization: Bearer <token>` (e.g.48 `pa-review-token-014`), JSON body `{"sql": "SELECT ..."}`. Only `SELECT`, `WITH`,49 and `PRAGMA table_info` are accepted; results cap at 500 rows.50- Business GET endpoints (see `reference/environment.md`) return JSON and, in practice,51 do not require the token — but sending it is harmless.5253**Safety / rules that appear in prompts:** use *only* the network environment. Never54read the environment's source files, generated data files, SQLite files, manifests, or55setup scripts directly, even if present. Treat the environment as read-only — non-SELECT56SQL is rejected anyway.5758Start by confirming the schema with `GET /api/tables` (or `PRAGMA table_info`). The full59table/column catalog and endpoint list are in **`reference/environment.md`**.6061## 3. Gather records for the EXACT target only6263The environment holds hundreds of distractor rows (≈160 cases, decoy rate schedules64named "…Distractor Schedule", and benchmark rows belonging to *other* task namespaces).65Always filter to your exact target business id, and when several records look eligible,66disambiguate by the operative keys (payer + plan_type + service_domain + cpt + modifier67+ effective date window, or the explicit row-id list in the memo). Never let a distractor68into the answer.6970Fastest paths:7172- **Case-linked work** (nurse review, appeal, P2P): `GET /api/cases/{case_id}` returns a73 single `case` object that bundles member, provider, plan, `criteria` (joined with the74 policy criteria + `result_if_missing`), `documents`, `document_facts`, `request_lines`,75 `authorizations`, `appeals`, `assistance_screen`, `drug_trials`, `p2p_events`, and76 `claims`. This is usually all you need for one case.77- **Claims / benchmarks:** query `claims`, `claim_lines`, and `payment_benchmarks` by id;78 use `GET /api/rate-schedules` to see benchmark sources.79- **Margin queue:** query `service_margin` for the exact `month_id`s the memo lists.80- **Appeals:** `GET /api/appeals` or query `appeals`, `drug_trials`, `assistance_screen`.8182## 4. Identify the task family and derive each field8384Recognize the family from the answer_template's required keys / criterion-id prefixes /85enums, then follow the matching recipe in **`reference/task_patterns.md`**:8687| Signal in the template | Family | Core sources |88|---|---|---|89| `recommendation`, `authorization`, `PT-*` criteria, `evidence_documents` | UM nurse prior-auth determination | cases, case_criteria, documents(`is_current`), authorizations |90| `appeal_path`, `documented_failures`, `assistance`, `DRUG-*` criteria | Pharmacy appeal + assistance intake | appeals, drug_trials(`documented`), case_criteria, assistance_screen |91| `benchmark_source`, `lines`, `recovery_amount`, `paid_total` | Payment-integrity claim repricing | claims, claim_lines, payment_benchmarks |92| `p2p_outcome`, `PET-*` criteria, `missing_pet_factors`, `internal_appeal_deadline` | Peer-to-peer closure | p2p_events, case_criteria, documents, authorizations |93| `revenue_to_cost_ratio`, `below_threshold_segments`, `gap_to_120pct` | UM-finance margin queue | service_margin |9495The environment usually pre-stages the outcome: `case_criteria.result`,96`authorizations.status` (`recommended_approval`/`denied`), `appeals.appeal_path`/`.owner`,97`p2p_events.outcome`/`.final_status`. Read those signals; apply only the small computations98the template demands (ratios, date arithmetic, current-vs-stale filtering, sorting,99mapping to the template's enums). Full formulas are in `reference/task_patterns.md`.100101## 5. Build `basis_audit` (required by every template)102103Every answer_template contains a `basis_audit` object with the same four keys. It is a104business audit trail, not free text:105106- `source_precedence` — pick the one enum choice matching the family (each family maps to107 exactly one; see the table in `reference/task_patterns.md`).108- `controlling_record_ids` — the environment record ids that *directly drive* the result,109 in operational evidence order (e.g. the current evidence docs; the appeal + documented110 trials; the claim lines then the current benchmarks; the P2P event + clinical note; the111 queue rows in listed order).112- `exception_record_ids` — the gap/exclusion records that explain what was set aside:113 criteria/route gaps *before* stale/excluded records when both appear (e.g. the stale114 export; the undocumented trial + missing packet field; the stale benchmark; the unmet115 criterion + missing factors; the below-threshold row).116- `precedence_record_order` — the controlling records then the exception records, listed117 highest-priority-first under the chosen precedence rule (the "what superseded what"118 trail; it may be a curated subset — e.g. the winning benchmarks then the stale one,119 not every claim line).120121Use the real environment ids for records, and the template's own enum tokens (e.g.122`household_income_proof`, `PET-FACTOR`, `prior_equivocal_spect`) where the driver is a123requirement/criterion rather than a stored row.124125## 6. Format, validate, and emit JSON only126127Before returning, verify against the template:128129- Output is **exactly one JSON object, no prose/markdown/comments** outside it.130- The top-level key set matches `required_top_level_fields` exactly. If131 `additional_fields_allowed` is `false`, include **no** extra keys; if extras are132 "allowed but not evaluated," still prefer the minimal exact set.133- Every enum value is one of the template's `choices`; every criterion map has exactly134 the `required_keys`.135- Lists obey their stated `ordering` (ascending id, alphabetical, claim-line order,136 the memo's row-id order, or "order shown in choices"). Empty list vs `null`: use what137 the field says (e.g. modifiers → `null`, not `""`; "empty list only if none").138- Numbers use the stated precision — currency rounded to 2 decimals (as JSON numbers,139 dollars), ratios to 4 decimals. Recovery/underpayment = corrected − paid.140- Dates are `YYYY-MM-DD`. Date windows are counted from the record date the rule names141 (e.g. an internal-appeal deadline is *N days from the final adverse determination /142 P2P date*, not from the reporting date).143- Recompute derived numbers from source rows; re-check that no distractor id slipped in.144145See `reference/task_patterns.md` for the per-family derivation details and146`reference/environment.md` for the schema and endpoint catalog.