Northstar Payer Operations — Structured Determination Skill
Purpose
Produce a structured JSON determination for a Northstar Health Plan payer-operations task by querying the shared read-only environment. Every task follows the same flow: read the input dossier, navigate the environment to collect evidence, apply the correct source-precedence rule for the work type, and return one JSON object matching the supplied answer template.
When to Use
Invoke this skill when the task:
- Mentions Northstar Health Plan, the shared payer operations environment, or
<TASK_ENV_BASE_URL>. - Involves utilization management (UM), prior authorization, appeals, payment integrity / claim repricing, peer-to-peer (P2P) closure, or finance-queue margin analysis.
- Supplies a
prompt.txt, atask_context.jsonpayload, and ananswer_template.jsonschema. - Requires an environment query via REST endpoints or
POST /sql/query, and a structured JSON-only response.
Environment
All tasks use the same read-only payer-operations environment.
Base URL
<TASK_ENV_BASE_URL>
Resolve <TASK_ENV_BASE_URL> from task_context.json → environment.base_url, or from environment_access.md → base_url. The canonical training value is http://task-env:9014/.
SQL Endpoint
POST /sql/query
Headers:
Authorization: Bearer pa-review-token-014Content-Type: application/json
Body: {"sql": "<query>"}
The endpoint accepts standard SQL (SQLite dialect). All tables are read-only.
Available REST Endpoints
| Endpoint | Description |
|---|---|
GET / |
Portal home page (HTML) |
GET /portal |
Same portal page |
GET /api/tables |
Full table catalog with column definitions |
GET /api/cases |
All cases (paginated) |
GET /api/cases/{case_id} |
Denormalized case with embedded criteria, authorizations, documents, claims, appeals, drug trials, assistance screen, request lines, members, and providers |
GET /api/policies |
All policies with criteria |
GET /api/policies/{policy_id} |
Single policy detail |
GET /api/documents/{document_id} |
Single document detail |
GET /api/rate-schedules |
All rate-schedule benchmarks |
GET /api/appeals |
All appeals |
Prefer /api/cases/{case_id} for the target case. It returns an enriched, denormalized view with embedded authorizations, criteria, documents, claims, request lines, drug trials, and member/provider data — often reducing the need for multiple SQL queries.
Database Schema
Major tables (queryable via SQL):
| Table | Key columns | Purpose |
|---|---|---|
cases |
case_id, member_id, policy_id, request_type, service_domain, current_stage, current_status | Case master |
members |
member_id, patient_name, dob, plan_id, plan_type | Member demographics |
providers |
provider_id, provider_name, specialty, npi | Provider directory |
plans |
plan_id, payer_name, plan_type, state, network | Plan contracts |
policies |
policy_id, policy_name, version, precedence | Clinical / payment policies |
policy_criteria |
criterion_id, policy_id, criterion_key, approval_required, result_if_missing | Policy criteria definitions |
case_criteria |
case_id, criterion_id, result, evidence_fact_ids, gap_description | Criteria results per case |
authorizations |
auth_id, case_id, auth_number, status, approved_units, approved_cpt | Authorization records |
request_lines |
line_id, case_id, cpt_code, modifier, requested_units, diagnosis_codes | Requested service lines |
documents |
document_id, case_id, document_type, is_current, source_system | Clinical / admin documents |
document_facts |
fact_id, document_id, case_id, fact_key, fact_value, supports_criteria | Extracted document facts |
drug_trials |
trial_id, case_id, medication, outcome, documented | Medication trial history |
appeals |
appeal_id, case_id, denial_date, appeal_path, expedited_attestation, outcome | Appeal records |
claims |
claim_id, case_id, payer, auth_number, paid_total | Claim master |
claim_lines |
claim_line_id, claim_id, cpt_code, modifier, units, paid_amount | Claim line detail |
payment_benchmarks |
benchmark_id, payer, plan_type, cpt_code, modifier, allowed_amount, source_name, source_version | Rate benchmarks |
p2p_events |
p2p_id, case_id, provider_argument, new_information, outcome, final_status | Peer-to-peer events |
assistance_screen |
case_id, program_name, income_percent_fpl, assistance_status, missing_fields | Manufacturer assistance |
service_margin |
month_id, period, payer_segment, cpt_code, net_revenue, variable_cost, fixed_cost_allocated, charge_sensitive | Finance margin data |
Input Dossier
Every task provides three files inside input/:
1. prompt.txt
The natural-language task description. It names:
- The business role (UM nurse, pharmacy appeals coordinator, payment integrity analyst, P2P coordinator, UM-finance analyst).
- The target identifier (case, appeal, claim, or queue ID).
- The expected output reference (
input/payloads/answer_template.json). - Any special rules (e.g., "do not inspect construction files directly").
2. payloads/task_context.json
Structured metadata. Key fields:
| Field | Meaning |
|---|---|
task_id |
Task identifier |
target_business_id / business_id / target.claim_id |
The primary lookup key |
target_appeal_id |
Appeal ID when present |
requester_role |
Who is asking |
reporting_date / request_date |
As-of date for the determination |
environment |
Base URL, SQL endpoint, bearer token |
local_memo / finance_memo |
Business rules, definitions, threshold values, row-IDs |
work_item / work_type |
Describes the work type |
Always read task_context.json first — it tells you the target ID(s), the as-of date, and any business rules (thresholds, definitions, row-IDs, deadlines) that the answer template alone does not convey.
3. payloads/answer_template.json
The required output schema. It specifies:
required_top_level_fields— every key that must appear.- Per-field types, enum choices, ordering rules, and precision.
basis_audit— always required withsource_precedence,precedence_record_order,controlling_record_ids,exception_record_ids.
Never add fields not listed unless additional_fields_allowed is explicitly true. The template's required_top_level_fields is authoritative.
Workflow
Step 1 — Orient
- Read
prompt.txtto understand the business ask. - Read
payloads/task_context.jsonto extract the target ID, as-of date, requester role, and any finance/clinical business rules. - Read
payloads/answer_template.jsonto internalize the output shape, enums, ordering rules, and precision requirements.
Step 2 — Collect Evidence
Gather all relevant data from the environment:
- Start with the denormalized case endpoint:
GET /api/cases/{target_id}. This often returns the case, member, provider, criteria results, authorization records, documents, claims, appeals, drug trials, and assistance screen in one call. - Fill gaps with SQL. Use
POST /sql/querywhen you need:- Cross-table joins (e.g., claim lines joined to benchmarks).
- Filtered lookups (e.g., rate schedules matching a specific CPT/modifier/plan/date).
- Aggregate queries (e.g., margin calculations).
- Tables not embedded in the case response (e.g.,
service_margin,payment_benchmarks).
- Resolve references. When a case references a
policy_id, confirm the policy and its criteria via/api/policies/{policy_id}or SQL onpolicy_criteria. - Check document currency. Every document has an
is_currentflag (0 = stale, 1 = current). Stale documents must not control the determination. - Check effective dates. Rate benchmarks, policies, and plans have
effective_start/effective_endranges. Only records effective on the as-of date apply.
Step 3 — Apply Source Precedence
Every determination uses exactly one source-precedence rule. Choose based on work type:
| Work type | Source precedence rule | Meaning |
|---|---|---|
| UM nurse prior-authorization review | current_clinical_records_over_stale_export |
Current clinical documents (is_current=1) control; stale exports are excluded. |
| Pharmacy / drug coverage appeal | payer_appeal_before_manufacturer_assistance |
Appeal evidence (denial, authorization, prescriber letter, formulary failure records) is primary; manufacturer assistance screening is secondary. |
| Payment integrity / claim repricing | effective_benchmark_by_plan_modifier_and_date |
Use the benchmark whose effective date range covers the service date, matching plan type, CPT, and modifier. Reject stale schedules. |
| Peer-to-peer closure | new_patient_specific_p2p_information |
The P2P event's new patient-specific information takes precedence over the pre-P2P review. |
| Finance margin / queue analysis | margin_threshold_then_charge_sensitivity |
Revenue-to-cost ratio against the threshold is the primary signal; charge-sensitivity flag is the secondary signal. |
Step 4 — Distinguish Controlling vs. Exception Records
For every basis_audit:
- Controlling records are the environment records (document IDs, auth IDs, benchmark IDs, P2P IDs, policy IDs, criteria IDs, margin row IDs) that directly determine the result.
- Exception records are records that explain exclusions, gaps, denials, missing information, or route priority — stale documents, missing criteria, incomplete packets, distractor records.
Ordering rule for precedence_record_order: controlling records first, then exception records, reflecting the source-precedence priority (highest-priority record first).
Ordering rule for exception_record_ids: criteria/route gaps before stale or excluded records when both appear.
Step 5 — Apply Precision and Formatting Rules
- Currency: All dollar amounts as JSON numbers rounded to 2 decimal places.
- Dates: ISO 8601
YYYY-MM-DDformat. Usenullonly when the template explicitly allows it (e.g., "Use null only when no internal appeal deadline applies"). - Modifiers on claim lines: Use
null(not empty string) when no modifier is present. - Lists: Follow the ordering rule stated in the answer template for each list field (ascending ID, alphabetical, claim-line order, operational packet order, etc.).
- Enums: Use exactly the string values listed in each field's
choicesarray. Do not invent or approximate. - Units:
approved_unitsand claim-lineunitsare integers.
Step 6 — Return JSON Only
- Return exactly one JSON object.
- No markdown fences, no prose, no comments outside the JSON.
- Every key in
required_top_level_fieldsmust be present. - No keys beyond those listed, unless
additional_fields_allowedoradditional_propertiesis explicitly true.
Data-Quality Rules
- is_current flag: Documents with
is_current = 0are stale. They appear inexcluded_documents/exception_record_ids, never in controlling evidence. - Effective date windows: A benchmark, policy, or plan whose
effective_endis before the service/as-of date, or whoseeffective_startis after it, does not apply. - Distractor records: The environment may contain records with similar but non-matching identifiers (e.g.,
CASE-D-*prefix, unrelated CPTs, different service domains). Query by exact target ID. If a record with a different ID surfaces, verify relevance before using it. - SQL parameterization: Always use the exact target ID, date, and business keys from
task_context.json. Never hardcode values from the training examples. - Null handling:
nullin JSON means absent. Use it only where the answer template explicitly permits it (modifiers, appeal deadline when not applicable). Do not use empty strings or"none"unless those are listed enum choices.
Common Patterns by Work Type
Prior Authorization (UM Nurse Review)
- Look up the case at
/api/cases/{case_id}. - Evaluate each criterion listed in
case_criteriaagainst the policy's required criteria. - Current clinical documents (eval, plan of care) are controlling; stale exports are excluded.
- The authorization record (
authorizationsarray) holds the recommended units, dates, CPTs. criteria_resultsmap each relevantcriterion_idtomet/not_met/unclear/not_applicable.
Pharmacy Appeal Disposition
- Look up the case and appeal records.
- Check
drug_trialsfor documented vs. undocumented medication failures. - Evaluate
case_criteriaagainst the drug policy (POL-DRUG-EXC-*). - Check
assistance_screenfor manufacturer program eligibility. - Required appeal packet items are listed in the drug policy; compare against documents on file.
- Missing items go in
missing_packet_items. - Source precedence: payer appeal evidence before manufacturer assistance.
Payment Integrity / Claim Repricing
- Look up the claim and its claim lines.
- Query
payment_benchmarksfor the effective schedule matching the claim's payer, plan type, CPT, and modifier on the service date. - Reject stale benchmarks (expired effective ranges, or
Legacy Imaging Exportsource). - Calculate
correct_allowed_amount= benchmark'sallowed_amount× units. recovery_amount=paid_amount−correct_allowed_amount(negative = underpayment).- Line disposition:
correct_upward,correct_downward,no_change,deny_line.
Peer-to-Peer Closure
- Look up the case and the
p2p_eventsrecord. - The P2P
outcomedeterminesp2p_outcome(overturn_to_approvaloruphold_intended_adverse_decision). new_information_changed_reviewistrueonly if the P2P record hasnew_informationthat materially altered the criteria evaluation.- Unresolved criteria are those that remain
unclearafter the P2P. - PET MPI:
missing_pet_factorslists PET-over-SPECT factors (prior equivocal SPECT, BMI limitation, attenuation artifact) that remain unsupported. - Internal appeal deadline (when adverse):
final_adverse_determination_date + 180 days, per the plan's 180-day internal appeal window.
Finance Margin Queue
- Query
service_marginrows by the exactmonth_idvalues fromtask_context.json→finance_memo.queue_row_ids. total_cost=variable_cost + fixed_cost_allocated(or the definition given intask_context.json).margin=net_revenue − total_cost.revenue_to_cost_ratio=net_revenue / total_cost.below_thresholdistruewhenrevenue_to_cost_ratio < threshold(from task_context).charge_sensitiveistruewhen thecharge_sensitivecolumn equals 1.- Segregate below-threshold segments from charge-sensitive segments.
gap_to_120pct: dollar gap =(threshold × total_cost) − net_revenuefor the top below-threshold issue.
Error Recovery
- If an endpoint returns
{"error": "not_found"}, the target ID may need an alternate lookup path — try SQL or a different endpoint. - If the SQL endpoint returns
{"error": "invalid_sql", "message": "sql must be a non-empty string"}, thesqlkey (notquery) is expected in the POST body. - If a case endpoint returns unexpected fields, re-check the table catalog at
/api/tablesfor the current schema. - If distractor records appear, tighten the query with exact ID matching.
Output Checklist
Before returning the JSON:
- Every
required_top_level_fieldis present. - Every enum value matches an allowed choice.
- All currency values are rounded to 2 decimal places.
- All dates are
YYYY-MM-DD. nullis used only for explicitly nullable fields (modifiers, non-applicable deadlines).- Lists follow the stated ordering rule.
basis_audit.source_precedencematches the work type.basis_audit.precedence_record_orderlists controlling then exception records in priority order.basis_audit.controlling_record_idscontains only records that directly determine the result.basis_audit.exception_record_idscontains only gap/stale/excluded records.- No markdown, prose, or comments surround the JSON.