QNSI

Build Pattern · Python

Build a HIPAA-Aligned PHI Records System

Source-linked PHI integration pattern spanning storage, search, tenant isolation, and audit contracts.

Evaluate PHI workflows against source-linked Vault, SSE-X, tenant-isolation, and Audit contracts. HIPAA alignment, de-identification, retention, exchange authentication, and end-to-end runtime behavior are NOT VERIFIED.

Verification boundary: The pattern is not a compliance attestation or deployment proof. PHI protection, policy enforcement, isolation, audit completeness, and runtime behavior remain NOT VERIFIED.

NOT VERIFIEDDeployment timing
PythonPrimary SDK
4Source surfaces

QNSI services used

Stack

Code

Published SDK calls

Snippets show source-linked SDK call shapes. Route reachability and deployment behavior remain NOT VERIFIED.

Vault a PHI record + cohort-level encrypted searchpython
from qnsi import QnsiClient
import os, base64, json

qnsp = QnsiClient(api_key=os.environ["QNSI_API_KEY"])

# Vault PHI under per-patient key (ML-KEM-768-wrapped AES-256-GCM)
secret = qnsp.vault.create_secret(
    name=f"phi:{patient_mrn}",
    payload_b64=base64.b64encode(json.dumps(phi_record).encode()).decode(),
    metadata={"pqcAlgorithm": "ml-kem-768"},
)

# Cohort search: index a de-identified embedding for cohort discovery
qnsp.search.upsert_vectors(
    index_name="cohorts",
    vectors=[{
        "id": patient_mrn,
        "vector": deidentified_embedding,
        "metadata": {"age_band": "60-70", "icd10_prefix": "E11"},
    }],
)

qnsp.audit.log_event(
    event_type="phi.created",
    payload={"mrn": patient_mrn, "secret_id": secret["id"]},
)

Evaluate

Inspect the source-linked integration surface