Documentation Index
Fetch the complete documentation index at: https://simplex.sh/docs/llms.txt
Use this file to discover all available pages before exploring further.
The Prior Auth SDK is a high-level wrapper around the Simplex Prior Auth API. It resolves payer clinical question sets, fills fax PA forms, and transmits them — all without you having to know which line of business a patient’s BIN/PCN maps to.
Installation
Quick Start
The minimal fax-PA workflow is two calls: resolve the canonical drug string, then pull the payer-specific clinical question set for that drug and diagnosis.
1. Search drugs
Resolve a free-text query (e.g. "wegovy 1mg") into the canonical Brand Strength Form string expected by drug_info.medication_strength on Fill Prior Authorization. The supported catalog currently covers Wegovy, Ozempic, Zepbound, and Mounjaro (all SKUs).
from simplex import SimplexClient
client = SimplexClient()
matches = client.search_drugs(query="wegovy 1mg")
for m in matches:
print(m["full_name"])
import { SimplexClient } from "simplex-ts";
const client = new SimplexClient();
const matches = await client.searchDrugs({ query: "wegovy 1mg" });
for (const m of matches) {
console.log(m.fullName);
}
2. Get clinical questions
Pass the pharmacy claim’s (bin, state, drug_name, icd_code) tuple to pin down the line of business and indication. pcn, group_id, and member_id are optional tiebreakers for shared-processor BINs (e.g. BIN 003858 / PCN A4 hosts both ESI Commercial and Humana Part D — the leading alpha prefix of member_id disambiguates).
Each returned question carries a structured citation back to the underlying payer policy (URL, policy ID, section, verbatim quote), so you can show reviewers the source.
from simplex import SimplexClient, SimplexError
client = SimplexClient()
try:
response = client.get_clinical_questions(
bin="003858",
state="CA",
drug_name="wegovy",
icd_code="E66.01",
pcn="A4",
member_id="4XS1234567",
)
print("matched:", response.get("matched"))
print("coverage_status:", response.get("coverage_status"))
print("lob_id:", response.get("lob_id"))
routing = response.get("routing") or {}
print(f"PBM: {routing.get('pbm_name')}")
print(f"LOB: {routing.get('line_of_business')}")
print(f"Plan/Group: {routing.get('plan_name_or_group')}")
print(f"Confidence: {routing.get('confidence')}")
for i, q in enumerate(response.get("questions") or [], 1):
req = "required" if q.get("required") else "optional"
print(f"{i}. [{q.get('input_type')}, {req}] {q.get('prompt')}")
citation = q.get("citation")
if citation:
print(
f" ↳ {citation.get('policy_id')} "
f"§{citation.get('section')} "
f"({citation.get('effective_date')})"
)
except SimplexError as e:
print(f"Simplex error: {e}")
import { SimplexClient, SimplexError } from "simplex-ts";
const client = new SimplexClient();
try {
const response = await client.getClinicalQuestions({
bin: "003858",
state: "CA",
drugName: "wegovy",
icdCode: "E66.01",
pcn: "A4",
memberId: "4XS1234567",
});
console.log("matched:", response.matched);
console.log("coverage_status:", response.coverageStatus);
console.log("lob_id:", response.lobId);
const { routing } = response;
console.log(`PBM: ${routing?.pbmName}`);
console.log(`LOB: ${routing?.lineOfBusiness}`);
console.log(`Plan/Group: ${routing?.planNameOrGroup}`);
console.log(`Confidence: ${routing?.confidence}`);
(response.questions ?? []).forEach((q, i) => {
const req = q.required ? "required" : "optional";
console.log(`${i + 1}. [${q.inputType}, ${req}] ${q.prompt}`);
if (q.citation) {
console.log(
` ↳ ${q.citation.policyId} §${q.citation.section} ` +
`(${q.citation.effectiveDate})`
);
}
});
} catch (e) {
if (e instanceof SimplexError) {
console.error(`Simplex error: ${e.message}`);
}
}
Next steps