Skip to content

Phase 4: Add prior-auth drafting, Billing page, and PhenoML code search - #18

Draft
goelalex wants to merge 1 commit into
mainfrom
prior-auth-fhir2summary
Draft

Phase 4: Add prior-auth drafting, Billing page, and PhenoML code search#18
goelalex wants to merge 1 commit into
mainfrom
prior-auth-fhir2summary

Conversation

@goelalex

@goelalex goelalex commented Jul 8, 2026

Copy link
Copy Markdown

Adds a payer-rule-aware prior authorization flow: a new prior-auth-draft bot generates a narrative via PhenoML fhir2summary, surfaced through DraftPriorAuthModal in the encounter Details & Billing tab and saved as an inline-base64 DocumentReference. A new patient-level Billing page (route + nav tab) lists those documents and renders their narratives, and a Maya Chen demo bundle ships with a Get Started import button. Separately, a new phenoml-code-search bot backs CPT and ICD-10 autocompletes (charge items and conditions) via PhenoML Construe, replacing the ValueSet pickers. Finally, lang2fhir-create and the new bots now require a PHENOML_BASE_URL secret instead of a hardcoded URL, and both new bots are registered in deploy-bots and example-bots.json.

🤖 Generated with Claude Code

Prompt

Phase 4 — Prior-auth draft via fhir2summary

Goal: draft a prior-authorization from payer-rule-aware templates. (You preferred fhir2summary over the agent.)

  • One-time setup: create narrative template(s) via POST /fhir2summary/templateseeded with payer/procedure prior-auth structure; capture the template_id.
  • Bot: use similar approach with TS SDK https://github.com/PhenoML/phenoml-ts-sdk
  • UI: “Draft prior auth” action from the encounter/billing area → render the returned narrative for clinician edit → save as DocumentReference/Communication.
  • Manufacture the prior auth ruleset for our patient maya chen and create a fake payor.

Verify: for a patient with a coded condition + planned procedure, generate a prior-auth narrative referencing payer rules; editable and savable.

Example prior auth python code demo: https://github.com/PhenoML/phenoml-demos/tree/main/tms-prior-auth

flowchart TD
A["Referral note / PDF"]

subgraph S1["Step 1 · Intake & evidence"]
    A --> B["FHIR transaction Bundle"]
    B --> C["IPS narrative"]
    C --> D["Referral agent reviews IPS,<br/>asks follow-ups"]
    D --> E["Write Patient + follow-up<br/>answers to the EHR"]
end

subgraph S2["Step 2 · Evaluate prior auth"]
    E --> F["BCBS-MA policy agent<br/>system prompt = Policy #297"]
    F --> G["Evaluate case against<br/>policy criteria"]
end

subgraph S3["Step 3 · Adjudicate & submit"]
    G --> H["Assemble submission<br/>+ CPT codes"]
    H --> I{"Meets Policy #297?"}
end

I -->|yes| J(["APPROVED<br/>covered codes + limits"])
I -->|no| K(["DENIED<br/>rationale + citations"])

Prior authorization: new prior-auth-draft bot drafts a payer-rule-aware
narrative via PhenoML fhir2summary, surfaced through DraftPriorAuthModal in
the encounter Details & Billing tab and saved as an inline-base64
DocumentReference. Adds a patient-level Billing page (route + nav tab) that
lists those documents and renders their narratives, and a Maya Chen demo
bundle with a Get Started import button.

Code search: new phenoml-code-search bot backs CPT (charge items) and ICD-10
(conditions) autocompletes via PhenoML Construe, replacing the ValueSet
pickers. lang2fhir-create and the new bots now require the PHENOML_BASE_URL
secret instead of a hardcoded URL. Registers both bots in deploy-bots and
example-bots.json.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@goelalex goelalex changed the title Add prior-auth drafting, Billing page, and PhenoML code search Phase 4Add prior-auth drafting, Billing page, and PhenoML code search Jul 8, 2026
@goelalex goelalex changed the title Phase 4Add prior-auth drafting, Billing page, and PhenoML code search Phase 4: Add prior-auth drafting, Billing page, and PhenoML code search Jul 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant