Clinical Trials · Python SDK

Release a protocol amendment to a site only once it’s cleared

A trial operations agent is ready to send an amendment to a site. The Python SDK checks the sponsor’s release rules first, using the approval and site facts your trial systems already track.

Approval and site status for each release

One release covers one amendment and one site. These are the fields the clinical trials simulator sends.

FactWhat it holds
protocol_idThe protocol the amendment belongs to.
protocol_versionThe amendment version being released.
amendment_statusapproved or draft.
ethics_approval_statusapproved or pending for this site.
site_activation_statusactive or pending.
site_training_completeTrue when the site team has finished training on this version.
authorized_reviewer_confirmedTrue when an authorized reviewer has signed off.

Released, referred, or held back

Each case is a sample site in the clinical trials simulator. Try the sample trial workflow

  1. Allowed

    When: The site is active, trained, and has ethics approval.

    Your code: The amendment is published, and the record keeps the version and the approvals as they stood at that moment.

    Who picks it up: The Business Owner sees release progress. Auditors read the record inside an engagement.

  2. Sent to a person

    When: Site training on the new version isn’t complete.

    Your code: The release waits for trial operations to decide.

    Who picks it up: The trial operations reviewer, in the VeriProof Inbox, by email, or in Slack or Microsoft Teams, with reminders and escalation.

  3. Stopped

    When: Final ethics approval is still pending.

    Your code: The release is blocked before the site receives anything.

    Who picks it up: The Governance Engineer sees the rule that held it back.

Python: match on the status

Pattern matching on GovernedStatus keeps each path explicit. reviews is the runtime from await vp.reviews(...).

Python · veriproof-sdk

from veriproof_sdk import GovernedStatus

result = await vp.govern(
    "amendment.release",
    {"protocolId": amendment.protocol_id, "siteId": site.id},
    lambda context: site_portal.publish(context.input),
    facts={
        "protocol_id": amendment.protocol_id,
        "protocol_version": amendment.version,
        "amendment_status": amendment.status,
        "ethics_approval_status": approvals.ethics_status(site.id),
        "site_activation_status": site.activation_status,
        "site_training_complete": training.is_complete(site.id, amendment.version),
        "authorized_reviewer_confirmed": amendment.reviewer_confirmed,
    },
)

match result.status:
    case GovernedStatus.COMPLETED | GovernedStatus.COMPLETED_WITH_WARNING | GovernedStatus.TRANSFORMED:
        notify_site(result.value)
    case GovernedStatus.REVIEW_REQUIRED:
        await reviews.save(result.review)
    case _:
        log.info("Release held: %s", result.reason_code)

site_portal.publish runs only when the rules allow the release. Everything else leaves the site on its current version.

Why Python here: Trial operations tooling and data work are commonly Python, and the SDK’s async client fits the jobs that push site updates.

Adding to the release rules

Developer fix request

If the sponsor adds a rule on translated consent forms, and your agent doesn’t send that status yet, the Developer gets a fix request naming the field.

Changing the rule

A change to who counts as an authorized reviewer can run in Shadow against real releases first. Once its tests pass, the governance engineer sends it to a compliance officer or administrator, who approves it for production.

See how the six role portals hand off work

Send the version every time

Include protocol_version on every call. When someone asks which sites received a version and when, each record answers with the version, the approval status at that moment, and the rule that allowed the release.

Related guides

Follow a release across roles

Open the demo portal as the reviewer who clears a held release, then as the Governance Engineer who owns the rule.