Northstar Health Plan Payer Operations Skill
Purpose
Execute structured payer-operations tasks for Northstar Health Plan using the shared
payer-operations environment. Each task requires reading a task context, gathering
records from the environment, applying business rules, and returning a single JSON
object that conforms to a supplied answer template.
When to Use
Invoke this skill when the task involves:
- A Northstar Health Plan business identifier (case, appeal, claim, queue, P2P event)
- A shared payer-operations environment accessed over HTTP
- A structured JSON output conforming to an
answer_template.json schema
- A
task_context.json payload with business parameters
Input Files
Three input files are present for every task. Read all three before querying the
environment:
| File |
Purpose |
prompt.txt |
Natural-language task description, role, target, and deadline |
task_context.json |
Structured business parameters — target IDs, environment config, finance definitions, local memos |
answer_template.json |
Required output JSON schema with field definitions, enum choices, and ordering rules |
Environment Access
The payer-operations environment is accessed exclusively over HTTP. Read
environment_access.md in the working directory (when present) for the base URL and
credentials. The task context may also carry an environment or environment_access
block with the same information.
Endpoints
| Method |
Path |
Use |
| GET |
/ |
Environment health / root |
| GET |
/portal |
Portal landing page |
| GET |
/api/tables |
List available database tables |
| GET |
/api/cases |
List case records |
| GET |
/api/cases/{case_id} |
Single case record |
| GET |
/api/policies |
List policy records |
| GET |
/api/policies/{policy_id} |
Single policy record |
| GET |
/api/documents/{document_id} |
Single clinical or administrative document |
| GET |
/api/rate-schedules |
List rate schedules |
| GET |
/api/appeals |
List appeal records |
| POST |
/sql/query |
Run a SQL query against the environment database |
SQL Endpoint
POST {base_url}/sql/query
Authorization: Bearer {token}
Content-Type: application/json
{"query": "<SQL statement>"}
The token is supplied in environment_access.md as sql_authorization_header or in
the task context as sql_bearer_token / authorization_header. Use the SQL endpoint
for cross-entity queries and for retrieving records not exposed through a dedicated
REST endpoint.
Rules
- Never inspect local files (SQLite databases, JSON fixtures, manifests, or
setup scripts) — all data lives in the remote environment.
- Use business endpoints first for single-entity lookups (
/api/cases/{id},
/api/policies/{id}, /api/documents/{id}); use SQL for joins, filtered lists,
or cross-entity retrieval.
- The
GET /api/tables endpoint returns the environment's table catalog — use
it to discover table names and column schemas before writing SQL.
Workflow
Phase 1 — Orient
- Read
prompt.txt to understand the business question.
- Read
task_context.json to extract the target business ID, requester role,
reporting date, and any domain-specific parameters (queue row IDs, cost
definitions, thresholds, etc.).
- Read
answer_template.json to understand every required field, its type, its
enum choices, and its ordering rules. Pay special attention to:
required_top_level_keys — every one must appear in the output.
required_keys inside nested objects.
- Enum constraints and list ordering rules.
- Numeric precision and date format requirements.
Phase 2 — Gather Records
Query the environment for all records relevant to the target business ID. Typical
information needs include:
- Case / claim / appeal record — the primary entity.
- Member and plan context — who the member is, what plan they hold.
- Requested service or therapy lines — CPT codes, units, modifiers.
- Policy or clinical criteria — the applicable medical or pharmacy policy,
including criterion IDs and their requirements.
- Clinical documents — evaluation notes, plans of care, imaging reports,
specialist consults, trial/failure records.
- Authorization records — prior auth numbers, approved units, date ranges.
- Rate schedules / benchmarks — for payment integrity and repricing tasks.
- P2P event records — for peer-to-peer tasks.
- Appeal records — for coverage appeal tasks.
- Margin / finance rows — for queue-analysis tasks.
Use GET /api/tables to discover schema, then query with SQL where a dedicated
endpoint does not cover the need.
Phase 3 — Apply Business Rules
Business rules are domain-specific. The sections below describe the rules for each
domain observed in training. Apply the rules that match the current task's service
domain.
Prior Authorization (Physical Therapy)
- Evaluate each criterion listed in the answer template's
criteria_results required
keys against the clinical evidence.
- Classify documents as evidence (directly support the determination) or
excluded (stale, irrelevant, or superseded).
- Determine the authorization window (start/end dates) from the plan of care or
policy.
- CPT codes and modifier come from the requested service line.
- The route follows from the recommendation: all criteria met → nurse_approval;
criteria gaps → pend_for_information or escalate_to_md.
Pharmacy Coverage Appeal + Manufacturer Assistance
- Identify the drug from the case/appeal context.
- Classify prior medication trials into documented failures (evidence of trial
and failure/intolerance exists) and undocumented or insufficient failures
(mentioned but unsubstantiated).
- Evaluate drug-specific criteria (authorization, denial, rationale, failures)
against the appeal and clinical records.
- Determine the appeal path (standard vs expedited) and compute the deadline from
the appeal record's filed date plus the plan's appeal window.
- Build the packet: required items are the set the plan needs for the appeal
and any assistance application; missing items are those absent from the
environment records. Order appeal evidence gaps before assistance information gaps.
- Screen manufacturer assistance by checking the program's required fields against
available member data.
Claim Repricing / Payment Integrity
- Retrieve the target claim and its claim lines (in claim-line order).
- Identify the applicable rate schedule by checking plan type, modifier, CPT code,
and effective date — reject stale or legacy schedules.
- For each claim line, compute the correct allowed amount by applying the benchmark
rate × units. Compare against the paid amount to determine the line disposition
(
correct_upward, correct_downward, no_change, deny_line).
- Sum paid totals, corrected totals, and recovery amounts across all lines.
- Currency values are in USD rounded to two decimal places.
- Use
null (not empty string) for absent modifiers.
Peer-to-Peer (P2P) Final Summary
- Review the case, requested CPT, policy criteria, clinical evidence, and P2P event.
- Determine whether the P2P discussion brought new patient-specific information
that materially changed the review.
- Classify the P2P outcome:
overturn_to_approval (new information resolves prior
concerns) or uphold_intended_adverse_decision (concerns remain unresolved).
- List any criteria that remain unresolved after the P2P.
- For PET MPI cases, identify which PET-over-SPECT factors (prior equivocal SPECT,
BMI limitation, attenuation artifact) remain unsupported/missing.
- If the final determination is adverse, compute the internal appeal deadline
as: final adverse determination date + 180 calendar days.
- Recommend an alternative modality when the requested service is denied.
Therapy Margin Queue
- Process only the queue row IDs listed in the task context.
- For each row, compute
total_cost = variable_cost + fixed_cost_allocated.
- Compute
revenue_to_cost_ratio = (total_cost + margin) / total_cost.
- Classify each row:
below_threshold = true when revenue_to_cost_ratio < the
threshold (default 1.2); charge_sensitive comes from the environment data.
- Recommend actions: rows below threshold →
payer_contract_review; rows that
are charge-sensitive but not below threshold → monitor_charge_sensitive;
otherwise → monitor_no_action.
- Aggregate
below_threshold_segments and charge_sensitive_segments from the
classified rows, deduplicated and sorted alphabetically.
- The
top_issue is the below-threshold row with the largest absolute gap; format
as {segment}_{cpt}.
gap_to_120pct = (total_cost × threshold) − (total_cost + margin) for the top
issue, rounded to two decimal places. Use a positive value representing the
shortfall.
Phase 4 — Construct the Basis Audit
Every answer requires a basis_audit object with four keys. This is the structured
audit trail that explains why the result was reached.
source_precedence
Choose the single precedence rule that best describes the controlling business logic
for this task. The six available rules are:
| Rule |
When to Use |
current_clinical_records_over_stale_export |
The determination relies on current environment clinical records while rejecting a stale or exported data source. Use when older documents or exports exist alongside fresher clinical data. |
payer_appeal_before_manufacturer_assistance |
The workflow processes payer-side appeal requirements before manufacturer assistance program screening. Use for pharmacy appeal + assistance tasks. |
effective_benchmark_by_plan_modifier_and_date |
The repricing uses the effective rate schedule selected by matching plan type, modifier, CPT code, and effective date — rejecting a stale schedule. Use for claim repricing / payment integrity tasks. |
new_patient_specific_p2p_information |
The P2P discussion is the decisive event — either it brought new patient-specific information that changed the review, or it confirmed the absence of such information. Use for P2P tasks. |
margin_threshold_then_charge_sensitivity |
Rows are evaluated first against the revenue-to-cost threshold; charge sensitivity is checked secondarily. Use for margin-queue tasks. |
appeal_deadline_then_clinical_then_payment_integrity |
Priority ordering: appeal deadline urgency first, then clinical merit, then payment integrity concerns. Use for multi-factor appeal tasks. |
controlling_record_ids
The environment record IDs that directly control the result. These are the
records whose content drives the determination: the case or appeal record itself,
the clinical documents that satisfy criteria, the benchmark records that set rates,
the P2P event that resolves or confirms the outcome, and the queue rows that
determine margin classifications.
List them in the order defined by the answer template's ordering_rule for this
field — typically the operational evidence order.
exception_record_ids
Records that explain exclusions, gaps, denials, or missing information:
- Stale or superseded records that were considered but rejected.
- Criteria IDs that were not met or remain unresolved.
- Missing packet items or assistance fields (use the field ID, not a document ID).
- Records that document why a requirement could not be satisfied.
List them in the order defined by the answer template's ordering_rule — typically
criteria/route gaps before stale/excluded records when both appear.
precedence_record_order
The combined list of controlling and exception records ordered by source precedence,
highest priority first. This is the full audit trail showing the decision chain
in priority order.
Phase 5 — Validate and Return
- Check required keys: Every key in
answer_template.required_top_level_keys
must be present. Every nested required_keys must be satisfied.
- Check enum values: Every enum field must use one of the allowed choices.
- Check ordering rules: Lists must follow the specified ordering (ascending
document ID, alphabetical, claim-line order, operational packet order, etc.).
- Check numeric precision: Currency in USD rounded to two decimal places;
ratios to four decimal places; integers for units.
- Check date format: All dates in
YYYY-MM-DD format.
- Check modifier handling: Use
null (JSON null, not the string "null") for
absent modifiers.
- Return JSON only: No markdown, no prose outside the JSON object. The output
must parse as a single JSON object.
Common Enumeration Tables
Recommendation / Status / Route (Prior Auth)
| Recommendation |
final_status |
route |
determination_letter |
next_action |
| approve |
approved |
nurse_approval |
approval |
issue_approval |
| pend_for_information |
pended |
pending_information |
information_request |
request_more_information |
| escalate_to_md |
md_review_required |
medical_director_review |
adverse_determination |
route_md_review |
| deny |
denied |
peer_to_peer |
adverse_determination |
issue_denial |
| partial_approval |
partially_approved |
appeal_unit |
partial_approval |
resubmit_corrected_claim |
Criteria Value Options
| Value |
Meaning |
met |
The criterion is satisfied by the evidence. |
not_met |
The criterion is clearly not satisfied. |
partial |
Partially satisfied (drug failure criteria only). |
unclear |
The evidence is ambiguous or insufficient to decide. |
not_applicable |
The criterion does not apply to this case. |
Basis Audit Source Precedence Rules (Full Reference)
current_clinical_records_over_stale_export — Prefer records retrieved live
from the clinical environment over previously exported or batch-generated data
that may be out of date.
payer_appeal_before_manufacturer_assistance — The payer's internal appeal
process takes operational precedence over external manufacturer assistance
programs. Resolve appeal requirements first, then screen assistance.
effective_benchmark_by_plan_modifier_and_date — Select the rate schedule
that matches the plan type, line modifier, CPT code, and effective date
quarter. Stale schedules or schedules with non-matching modifiers are rejected.
new_patient_specific_p2p_information — The peer-to-peer discussion is the
controlling event. New patient-specific clinical information shared during P2P
takes precedence over the pre-P2P record.
margin_threshold_then_charge_sensitivity — Evaluate each service row
against the revenue-to-cost threshold first. Charge sensitivity is a secondary
classification applied after the threshold check.
appeal_deadline_then_clinical_then_payment_integrity — Multi-factor
priority: the appeal's statutory/contractual deadline is the dominant concern,
followed by clinical merit review, followed by payment integrity checks.
Cross-Cutting Rules
Document Classification
When the answer template asks for evidence vs. excluded documents:
- Evidence documents: Clinical or administrative records whose content directly
supports the determination — evaluation notes, plans of care, imaging reports,
lab results, specialist consults, trial/failure documentation.
- Excluded documents: Records that are stale (superseded by newer versions),
irrelevant to the current request, or belong to a different case/member.
Stale Record Detection
A record is stale when:
- A newer version of the same record type exists in the environment (e.g., an
updated evaluation supersedes the initial one).
- The record's date predates a more recent clinical event that would make it
obsolete.
- For rate schedules: the schedule's effective date range does not cover the
claim's date of service, or a newer quarterly version exists.
Ordering Conventions
| Context |
Order |
| Evidence documents |
Ascending by document_id |
| Excluded documents |
Ascending by document_id |
| Medication names |
Alphabetical, lowercase |
| Claim lines |
Claim-line order from the source claim |
| Criteria IDs |
Ascending criterion ID order |
| Packet items (required) |
Operational packet order: payer appeal items before assistance items |
| Packet items (missing) |
Appeal evidence gaps before assistance information gaps |
| Assistance missing fields |
Alphabetical by field ID |
| Below-threshold segments |
Alphabetical by enum value |
| Charge-sensitive segments |
Alphabetical by enum value |
| Queue rows |
Same order as task_context row IDs |
| CPT codes in auth |
Ascending CPT code |
Error Handling
- If a required record is not found in the environment, note it as a gap (in
exception_record_ids or missing_packet_items) rather than guessing.
- If the environment returns an error, retry once with the same request before
treating it as unavailable.
- If a criterion cannot be evaluated due to missing evidence, mark it
unclear
rather than not_met — unclear means the evidence is insufficient, while
not_met means the evidence clearly contradicts the requirement.
Step-by-Step Execution Template
1. Read prompt.txt, task_context.json, answer_template.json
2. Read environment_access.md for base URL and credentials
3. GET {base_url}/api/tables to discover the schema
4. Query the primary entity (case/claim/appeal/queue)
5. Query related entities (member, plan, policy, documents, rate schedules)
6. Run SQL queries for cross-entity or filtered retrievals
7. Apply domain business rules (see Phase 3 sections above)
8. Classify documents as evidence or excluded
9. Select the source_precedence rule that best explains the logic
10. Build controlling_record_ids, exception_record_ids, precedence_record_order
11. Construct the full JSON answer following every constraint in answer_template.json
12. Validate: required keys present, enums correct, ordering rules followed,
numeric precision met, dates in YYYY-MM-DD, JSON parseable
13. Return the JSON object — no markdown wrapping, no prose
1---2name: fewshot-attempt-02-403description: Northstar Health Plan Payer Operations Skill4---5# Northstar Health Plan Payer Operations Skill67## Purpose89Execute structured payer-operations tasks for Northstar Health Plan using the shared10payer-operations environment. Each task requires reading a task context, gathering11records from the environment, applying business rules, and returning a single JSON12object that conforms to a supplied answer template.1314## When to Use1516Invoke this skill when the task involves:17- A Northstar Health Plan business identifier (case, appeal, claim, queue, P2P event)18- A shared payer-operations environment accessed over HTTP19- A structured JSON output conforming to an `answer_template.json` schema20- A `task_context.json` payload with business parameters2122## Input Files2324Three input files are present for every task. Read all three before querying the25environment:2627| File | Purpose |28|------|---------|29| `prompt.txt` | Natural-language task description, role, target, and deadline |30| `task_context.json` | Structured business parameters — target IDs, environment config, finance definitions, local memos |31| `answer_template.json` | Required output JSON schema with field definitions, enum choices, and ordering rules |3233## Environment Access3435The payer-operations environment is accessed exclusively over HTTP. Read36`environment_access.md` in the working directory (when present) for the base URL and37credentials. The task context may also carry an `environment` or `environment_access`38block with the same information.3940### Endpoints4142| Method | Path | Use |43|--------|------|-----|44| GET | `/` | Environment health / root |45| GET | `/portal` | Portal landing page |46| GET | `/api/tables` | List available database tables |47| GET | `/api/cases` | List case records |48| GET | `/api/cases/{case_id}` | Single case record |49| GET | `/api/policies` | List policy records |50| GET | `/api/policies/{policy_id}` | Single policy record |51| GET | `/api/documents/{document_id}` | Single clinical or administrative document |52| GET | `/api/rate-schedules` | List rate schedules |53| GET | `/api/appeals` | List appeal records |54| POST | `/sql/query` | Run a SQL query against the environment database |5556### SQL Endpoint5758```59POST {base_url}/sql/query60Authorization: Bearer {token}61Content-Type: application/json6263{"query": "<SQL statement>"}64```6566The token is supplied in `environment_access.md` as `sql_authorization_header` or in67the task context as `sql_bearer_token` / `authorization_header`. Use the SQL endpoint68for cross-entity queries and for retrieving records not exposed through a dedicated69REST endpoint.7071### Rules7273- **Never inspect local files** (SQLite databases, JSON fixtures, manifests, or74 setup scripts) — all data lives in the remote environment.75- **Use business endpoints first** for single-entity lookups (`/api/cases/{id}`,76 `/api/policies/{id}`, `/api/documents/{id}`); use SQL for joins, filtered lists,77 or cross-entity retrieval.78- **The `GET /api/tables` endpoint** returns the environment's table catalog — use79 it to discover table names and column schemas before writing SQL.8081## Workflow8283### Phase 1 — Orient84851. Read `prompt.txt` to understand the business question.862. Read `task_context.json` to extract the target business ID, requester role,87 reporting date, and any domain-specific parameters (queue row IDs, cost88 definitions, thresholds, etc.).893. Read `answer_template.json` to understand every required field, its type, its90 enum choices, and its ordering rules. Pay special attention to:91 - `required_top_level_keys` — every one must appear in the output.92 - `required_keys` inside nested objects.93 - Enum constraints and list ordering rules.94 - Numeric precision and date format requirements.9596### Phase 2 — Gather Records9798Query the environment for all records relevant to the target business ID. Typical99information needs include:100101- **Case / claim / appeal record** — the primary entity.102- **Member and plan context** — who the member is, what plan they hold.103- **Requested service or therapy lines** — CPT codes, units, modifiers.104- **Policy or clinical criteria** — the applicable medical or pharmacy policy,105 including criterion IDs and their requirements.106- **Clinical documents** — evaluation notes, plans of care, imaging reports,107 specialist consults, trial/failure records.108- **Authorization records** — prior auth numbers, approved units, date ranges.109- **Rate schedules / benchmarks** — for payment integrity and repricing tasks.110- **P2P event records** — for peer-to-peer tasks.111- **Appeal records** — for coverage appeal tasks.112- **Margin / finance rows** — for queue-analysis tasks.113114Use `GET /api/tables` to discover schema, then query with SQL where a dedicated115endpoint does not cover the need.116117### Phase 3 — Apply Business Rules118119Business rules are domain-specific. The sections below describe the rules for each120domain observed in training. Apply the rules that match the current task's service121domain.122123#### Prior Authorization (Physical Therapy)124125- Evaluate each criterion listed in the answer template's `criteria_results` required126 keys against the clinical evidence.127- Classify documents as **evidence** (directly support the determination) or128 **excluded** (stale, irrelevant, or superseded).129- Determine the authorization window (start/end dates) from the plan of care or130 policy.131- CPT codes and modifier come from the requested service line.132- The route follows from the recommendation: all criteria met → nurse_approval;133 criteria gaps → pend_for_information or escalate_to_md.134135#### Pharmacy Coverage Appeal + Manufacturer Assistance136137- Identify the drug from the case/appeal context.138- Classify prior medication trials into **documented failures** (evidence of trial139 and failure/intolerance exists) and **undocumented or insufficient failures**140 (mentioned but unsubstantiated).141- Evaluate drug-specific criteria (authorization, denial, rationale, failures)142 against the appeal and clinical records.143- Determine the appeal path (standard vs expedited) and compute the deadline from144 the appeal record's filed date plus the plan's appeal window.145- Build the packet: **required items** are the set the plan needs for the appeal146 and any assistance application; **missing items** are those absent from the147 environment records. Order appeal evidence gaps before assistance information gaps.148- Screen manufacturer assistance by checking the program's required fields against149 available member data.150151#### Claim Repricing / Payment Integrity152153- Retrieve the target claim and its claim lines (in claim-line order).154- Identify the applicable rate schedule by checking plan type, modifier, CPT code,155 and effective date — reject stale or legacy schedules.156- For each claim line, compute the correct allowed amount by applying the benchmark157 rate × units. Compare against the paid amount to determine the line disposition158 (`correct_upward`, `correct_downward`, `no_change`, `deny_line`).159- Sum paid totals, corrected totals, and recovery amounts across all lines.160- Currency values are in USD rounded to two decimal places.161- Use `null` (not empty string) for absent modifiers.162163#### Peer-to-Peer (P2P) Final Summary164165- Review the case, requested CPT, policy criteria, clinical evidence, and P2P event.166- Determine whether the P2P discussion brought **new patient-specific information**167 that materially changed the review.168- Classify the P2P outcome: `overturn_to_approval` (new information resolves prior169 concerns) or `uphold_intended_adverse_decision` (concerns remain unresolved).170- List any criteria that remain **unresolved** after the P2P.171- For PET MPI cases, identify which PET-over-SPECT factors (prior equivocal SPECT,172 BMI limitation, attenuation artifact) remain **unsupported/missing**.173- If the final determination is adverse, compute the **internal appeal deadline**174 as: final adverse determination date + 180 calendar days.175- Recommend an alternative modality when the requested service is denied.176177#### Therapy Margin Queue178179- Process only the queue row IDs listed in the task context.180- For each row, compute `total_cost` = variable_cost + fixed_cost_allocated.181- Compute `revenue_to_cost_ratio` = (total_cost + margin) / total_cost.182- Classify each row: `below_threshold` = true when revenue_to_cost_ratio < the183 threshold (default 1.2); `charge_sensitive` comes from the environment data.184- Recommend actions: rows below threshold → `payer_contract_review`; rows that185 are charge-sensitive but not below threshold → `monitor_charge_sensitive`;186 otherwise → `monitor_no_action`.187- Aggregate `below_threshold_segments` and `charge_sensitive_segments` from the188 classified rows, deduplicated and sorted alphabetically.189- The `top_issue` is the below-threshold row with the largest absolute gap; format190 as `{segment}_{cpt}`.191- `gap_to_120pct` = (total_cost × threshold) − (total_cost + margin) for the top192 issue, rounded to two decimal places. Use a positive value representing the193 shortfall.194195### Phase 4 — Construct the Basis Audit196197Every answer requires a `basis_audit` object with four keys. This is the structured198audit trail that explains *why* the result was reached.199200#### source_precedence201202Choose the single precedence rule that best describes the controlling business logic203for this task. The six available rules are:204205| Rule | When to Use |206|------|-------------|207| `current_clinical_records_over_stale_export` | The determination relies on current environment clinical records while rejecting a stale or exported data source. Use when older documents or exports exist alongside fresher clinical data. |208| `payer_appeal_before_manufacturer_assistance` | The workflow processes payer-side appeal requirements before manufacturer assistance program screening. Use for pharmacy appeal + assistance tasks. |209| `effective_benchmark_by_plan_modifier_and_date` | The repricing uses the effective rate schedule selected by matching plan type, modifier, CPT code, and effective date — rejecting a stale schedule. Use for claim repricing / payment integrity tasks. |210| `new_patient_specific_p2p_information` | The P2P discussion is the decisive event — either it brought new patient-specific information that changed the review, or it confirmed the absence of such information. Use for P2P tasks. |211| `margin_threshold_then_charge_sensitivity` | Rows are evaluated first against the revenue-to-cost threshold; charge sensitivity is checked secondarily. Use for margin-queue tasks. |212| `appeal_deadline_then_clinical_then_payment_integrity` | Priority ordering: appeal deadline urgency first, then clinical merit, then payment integrity concerns. Use for multi-factor appeal tasks. |213214#### controlling_record_ids215216The environment record IDs that **directly control** the result. These are the217records whose content drives the determination: the case or appeal record itself,218the clinical documents that satisfy criteria, the benchmark records that set rates,219the P2P event that resolves or confirms the outcome, and the queue rows that220determine margin classifications.221222List them in the order defined by the answer template's `ordering_rule` for this223field — typically the operational evidence order.224225#### exception_record_ids226227Records that explain **exclusions, gaps, denials, or missing information**:228- Stale or superseded records that were considered but rejected.229- Criteria IDs that were not met or remain unresolved.230- Missing packet items or assistance fields (use the field ID, not a document ID).231- Records that document why a requirement could not be satisfied.232233List them in the order defined by the answer template's `ordering_rule` — typically234criteria/route gaps before stale/excluded records when both appear.235236#### precedence_record_order237238The combined list of controlling and exception records ordered by source precedence,239**highest priority first**. This is the full audit trail showing the decision chain240in priority order.241242### Phase 5 — Validate and Return2432441. **Check required keys**: Every key in `answer_template.required_top_level_keys`245 must be present. Every nested `required_keys` must be satisfied.2462. **Check enum values**: Every enum field must use one of the allowed choices.2473. **Check ordering rules**: Lists must follow the specified ordering (ascending248 document ID, alphabetical, claim-line order, operational packet order, etc.).2494. **Check numeric precision**: Currency in USD rounded to two decimal places;250 ratios to four decimal places; integers for units.2515. **Check date format**: All dates in `YYYY-MM-DD` format.2526. **Check modifier handling**: Use `null` (JSON null, not the string "null") for253 absent modifiers.2547. **Return JSON only**: No markdown, no prose outside the JSON object. The output255 must parse as a single JSON object.256257## Common Enumeration Tables258259### Recommendation / Status / Route (Prior Auth)260261| Recommendation | final_status | route | determination_letter | next_action |262|---|---|---|---|---|263| approve | approved | nurse_approval | approval | issue_approval |264| pend_for_information | pended | pending_information | information_request | request_more_information |265| escalate_to_md | md_review_required | medical_director_review | adverse_determination | route_md_review |266| deny | denied | peer_to_peer | adverse_determination | issue_denial |267| partial_approval | partially_approved | appeal_unit | partial_approval | resubmit_corrected_claim |268269### Criteria Value Options270271| Value | Meaning |272|-------|---------|273| `met` | The criterion is satisfied by the evidence. |274| `not_met` | The criterion is clearly not satisfied. |275| `partial` | Partially satisfied (drug failure criteria only). |276| `unclear` | The evidence is ambiguous or insufficient to decide. |277| `not_applicable` | The criterion does not apply to this case. |278279### Basis Audit Source Precedence Rules (Full Reference)2802811. **current_clinical_records_over_stale_export** — Prefer records retrieved live282 from the clinical environment over previously exported or batch-generated data283 that may be out of date.2842852. **payer_appeal_before_manufacturer_assistance** — The payer's internal appeal286 process takes operational precedence over external manufacturer assistance287 programs. Resolve appeal requirements first, then screen assistance.2882893. **effective_benchmark_by_plan_modifier_and_date** — Select the rate schedule290 that matches the plan type, line modifier, CPT code, and effective date291 quarter. Stale schedules or schedules with non-matching modifiers are rejected.2922934. **new_patient_specific_p2p_information** — The peer-to-peer discussion is the294 controlling event. New patient-specific clinical information shared during P2P295 takes precedence over the pre-P2P record.2962975. **margin_threshold_then_charge_sensitivity** — Evaluate each service row298 against the revenue-to-cost threshold first. Charge sensitivity is a secondary299 classification applied after the threshold check.3003016. **appeal_deadline_then_clinical_then_payment_integrity** — Multi-factor302 priority: the appeal's statutory/contractual deadline is the dominant concern,303 followed by clinical merit review, followed by payment integrity checks.304305## Cross-Cutting Rules306307### Document Classification308309When the answer template asks for evidence vs. excluded documents:310- **Evidence documents**: Clinical or administrative records whose content directly311 supports the determination — evaluation notes, plans of care, imaging reports,312 lab results, specialist consults, trial/failure documentation.313- **Excluded documents**: Records that are stale (superseded by newer versions),314 irrelevant to the current request, or belong to a different case/member.315316### Stale Record Detection317318A record is stale when:319- A newer version of the same record type exists in the environment (e.g., an320 updated evaluation supersedes the initial one).321- The record's date predates a more recent clinical event that would make it322 obsolete.323- For rate schedules: the schedule's effective date range does not cover the324 claim's date of service, or a newer quarterly version exists.325326### Ordering Conventions327328| Context | Order |329|---------|-------|330| Evidence documents | Ascending by document_id |331| Excluded documents | Ascending by document_id |332| Medication names | Alphabetical, lowercase |333| Claim lines | Claim-line order from the source claim |334| Criteria IDs | Ascending criterion ID order |335| Packet items (required) | Operational packet order: payer appeal items before assistance items |336| Packet items (missing) | Appeal evidence gaps before assistance information gaps |337| Assistance missing fields | Alphabetical by field ID |338| Below-threshold segments | Alphabetical by enum value |339| Charge-sensitive segments | Alphabetical by enum value |340| Queue rows | Same order as task_context row IDs |341| CPT codes in auth | Ascending CPT code |342343### Error Handling344345- If a required record is not found in the environment, note it as a gap (in346 exception_record_ids or missing_packet_items) rather than guessing.347- If the environment returns an error, retry once with the same request before348 treating it as unavailable.349- If a criterion cannot be evaluated due to missing evidence, mark it `unclear`350 rather than `not_met` — `unclear` means the evidence is insufficient, while351 `not_met` means the evidence clearly contradicts the requirement.352353## Step-by-Step Execution Template354355```3561. Read prompt.txt, task_context.json, answer_template.json3572. Read environment_access.md for base URL and credentials3583. GET {base_url}/api/tables to discover the schema3594. Query the primary entity (case/claim/appeal/queue)3605. Query related entities (member, plan, policy, documents, rate schedules)3616. Run SQL queries for cross-entity or filtered retrievals3627. Apply domain business rules (see Phase 3 sections above)3638. Classify documents as evidence or excluded3649. Select the source_precedence rule that best explains the logic36510. Build controlling_record_ids, exception_record_ids, precedence_record_order36611. Construct the full JSON answer following every constraint in answer_template.json36712. Validate: required keys present, enums correct, ordering rules followed,368 numeric precision met, dates in YYYY-MM-DD, JSON parseable36913. Return the JSON object — no markdown wrapping, no prose370```