Metadata-Version: 2.4
Name: medfunnels
Version: 1.2.0
Summary: Run medFunnels patient questionnaires on your own platform: fetch, verify, host and validate them server-side.
Author: medFunnels
License-Expression: MIT
Project-URL: Homepage, https://www.medfunnels.app
Keywords: medfunnels,telehealth,questionnaire,intake,hipaa
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: verify
Requires-Dist: cryptography>=42; extra == "verify"
Dynamic: license-file

# medfunnels

Run [medFunnels](https://www.medfunnels.app) patient questionnaires on your own platform from Python: an
Integration API client, release verification, the sandboxed frame, and authoritative answer validation.
**Patient data never goes to medFunnels.**

```bash
pip install "medfunnels[verify]"
```

```python
from medfunnels.client import MedFunnelsClient
from medfunnels.contract import validate_response
from medfunnels.frame import build_frame
from medfunnels.verify import verify_release

client = MedFunnelsClient("https://www.medfunnels.app", CLIENT_ID, CLIENT_SECRET)  # server-side only
page = client.release_updates(cursor=cursor)
release_id = page["updates"][0]["id"]
envelope = client.get_manifest(release_id)
artifacts = {a["name"]: client.download_artifact(release_id, a["name"]) for a in envelope["manifest"]["artifacts"]}
release = verify_release(envelope, artifacts, trusted_keys=PINNED_KEYS, supported_kinds=SUPPORTED_KINDS,
                         expected_organization_id=ORGANIZATION_ID, expected_origin="https://intake.example.com")

html, headers = build_frame(release.bundle, title=release.manifest["questionnaire"]["name"])  # serve both unchanged
answers = validate_response(release.definition, submitted, questionnaire_id=release.questionnaire_id, release_id=release.release_id)
```

No required dependencies; the `verify` extra adds `cryptography` for signature checks. Python 3.10 or later.
The full guide, with your workspace's values filled in, is in medFunnels under **Integrations → Developer guide**.
Using Next.js? See [`@medfunnels/next`](https://www.npmjs.com/package/@medfunnels/next).
