Skip to main content
Python
import requests

url = 'https://api.simplex.sh/get_clinical_questions'
headers = {
    'X-API-Key': 'your_api_key_here'
}
params = {
    'bin': '003858',
    'state': 'CA',
    'drug_name': 'wegovy',
    'icd_code': 'E66.01',
    'pcn': 'A4',
    'member_id': '4XS00000523646'
}

response = requests.get(url, headers=headers, params=params)
result = response.json()
print(f"LOB: {result['lob_id']} ({result['coverage_status']})")
if result['coverage_status'] == 'resolved':
    for q in result['questions']:
        print(f"{q['id']}: {q['prompt']} [{q['input_type']}]")
        if q.get('citation'):
            print(f"    source: {q['citation']['policy_id']} § {q['citation']['section']}")
        for opt in q.get('options', []):
            print(f"    - {opt}")
{
  "matched": true,
  "icd_code": "<string>",
  "coverage_status": "resolved",
  "questions": [
    {
      "id": "<string>",
      "prompt": "<string>",
      "input_type": "boolean",
      "required": true,
      "units": "<string>",
      "options": [
        "<string>"
      ],
      "depends_on": [
        "<string>"
      ],
      "source": "<string>",
      "citation": {
        "policy_url": "<string>",
        "policy_id": "<string>",
        "section": "<string>",
        "quote": "<string>",
        "effective_date": "<string>",
        "evidence_path": "<string>"
      }
    }
  ],
  "routing": {
    "pbm_name": "<string>",
    "line_of_business": "<string>",
    "plan_name_or_group": "<string>",
    "confidence": "high"
  },
  "drug": "<string>",
  "lob_id": "<string>",
  "rationale": "<string>",
  "sources": [
    {
      "source_name": "<string>",
      "source_url": "<string>",
      "fetch_timestamp": "<string>",
      "version": "<string>"
    }
  ]
}

Authorizations

X-API-Key
string
header
required

Simplex API Key

Query Parameters

bin
string
required

Pharmacy BIN from the patient's insurance card (e.g. "003858"). Required — drives LOB routing.

state
string
required

Two-letter state code where the prescription will be filled (e.g. "CA"). Required — drives state-DOI mandated forms and state-Medicaid / MCO routing.

drug_name
enum<string>
required

Drug brand or generic name. Required — drives which clinical schema is loaded. Matched case-insensitively on substring.

Available options:
wegovy,
ozempic,
zepbound,
mounjaro
icd_code
string
required

Exact ICD-10 diagnosis code (e.g. "E11.9"). Required — drives indication mapping and the specific question set returned.

pcn
string

Processor Control Number from the patient's insurance card (e.g. "A4"). Optional — tiebreaks shared-BIN plans.

group_id
string

NCPDP Group ID / group number from the patient's insurance card (e.g. "RXINN01"). Optional — tiebreaks when (BIN, PCN) hits multiple LOBs.

member_id
string

Full member ID from the patient's insurance card (e.g. "4XS00000523646"). Optional — the resolver uses the leading alpha prefix to tiebreak shared-processor BINs where one (BIN, PCN) pair spans multiple lines of business (e.g. BIN 003858 / PCN A4 hosts ESI Commercial and Humana Part D). PHI: do not log the full value downstream.

Response

200 - application/json

Get clinical questions response

matched
boolean
required

Whether the (BIN, PCN, state) tuple resolved to a known payer.

icd_code
string
required

The ICD-10 code the questions were resolved for (echoed from the request).

coverage_status
enum<string>
required

resolved: LOB identified, questions rendered. ambiguous: multiple LOBs match — supply more identifiers. not_covered: drug not covered by this LOB (see rationale — e.g. Part D statutory weight-loss exclusion). unknown_lob: drug has a schema but no matching LOB. not_attempted: drug_name didn't map to a drug with a clinical schema.

Available options:
resolved,
ambiguous,
not_covered,
unknown_lob,
not_attempted
questions
object[]
required

Rendered clinical questions in presentation order. Empty when coverage_status is not resolved.

routing
object

Payer routing resolved from the request identifiers.

drug
string

The drug name echoed from the request.

lob_id
string

Resolved line-of-business ID (e.g. "aetna_commercial_wegovy"). Null when coverage_status is not resolved.

rationale
string

Human-readable explanation of the resolution (which LOB won, or why one couldn't be chosen).

sources
object[]

Upstream data sources consulted during resolution (payer sheets, CMS Part D, Availity, etc.).