Skip to main content

models

What the site decided.

The review in force for a patient and trial, the collection of them a patient's detail view reads, a reviewed patient as the trial's own list serves them, and the body a review is written with.

Classes​

NoteRequest​

class NoteRequest(**data: Any):

Body of a request to add a note to a patient for a trial.

A note added this way stands on its own: it is not a review's note, so adding one changes nothing about the review in force.

Arguments

  • note: The note's text. It may contain PII, and never leaves the site. It has to hold something: a request to add a note with none is refused, where a review's own note is optional and a blank one is no note.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static note : str

PatientReviewList​

class PatientReviewList(**data: Any):

Envelope for a patient's reviews in force, one per reviewed trial.

A review is per patient and trial, and a newer one supersedes the one before it rather than joining the list, so this is not paginated: items holds every review in force and total counts them.

Arguments

  • items: The reviews in force, ascending by trial id.
  • total: The number of reviews in force.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static total : int

PatientReviewSummary​

class PatientReviewSummary(**data: Any):

One of a patient's reviews in force, as the collection serves it.

Only what a reviewer's own buckets need: which trial, the stage the site recorded for it, and when. Who reviewed, and the analysis verdict the review overrode, are served by the single-review endpoint instead.

Arguments

  • project_id: The trial (project) ID.
  • review_status: The stage the site recorded, in the review vocabulary rather than the analysis verdict it stands in for.
  • reviewed_at: When the review in force was made (aware UTC).

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static project_id : str
  • static review_status : bitfount.cache.types._review_shared.ReviewStatus

ReviewRequest​

class ReviewRequest(**data: Any):

Body of a request to review a patient for a trial.

Arguments

  • review_status: The site's verdict: suitable_for_screening, screening or enrolled for a patient still in the running, or rejected for one ruled out. Removing a review is a separate operation, so withdrawn is not accepted.
  • note: An optional note to record with the review. A blank one is no note.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static note : str | None
  • static review_status : Literal[<ReviewStatus.SUITABLE_FOR_SCREENING: 'suitable_for_screening'>, <ReviewStatus.SCREENING: 'screening'>, <ReviewStatus.ENROLLED: 'enrolled'>, <ReviewStatus.REJECTED: 'rejected'>]

ReviewTimeline​

class ReviewTimeline(**data: Any):

Envelope for a patient's history of reviews and notes for one trial.

Served whole, deliberately: a patient's history for one trial is a review per decision and per removal, each with at most one note, which is the sort of handful a site reads as a timeline rather than a set to page through. total counts the whole history, so it is items' length until there is ever a reason to page.

Arguments

  • items: The entries, newest first.
  • total: The number of entries in the history.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static total : int

ReviewTimelineEntry​

class ReviewTimelineEntry(**data: Any):

One entry in the history of a patient's reviews for a trial.

Either a review — a decision, or its removal, which is recorded as withdrawn — or a note. A note written with a review is served as one entry with it, because the site shows the two as one; a note written on its own carries no review_status, there being no review it belongs to.

Arguments

  • id: The entry's ID: the review event's, or the note's for one written on its own. Unique, so a client can key on it.
  • note_id: The note's own ID, when the entry has one — the id to delete it by. None for a review written without a note, and None for a note that has since been deleted, since a deleted one is not served.
  • created_at: When the review was made, or the note written (aware UTC).
  • username: Who made it: the reviewer, or the note's author.
  • review_status: What the review recorded, or None for a note written on its own.
  • note: The note's text, or None for a review written without one.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static id : str
  • static model_config
  • static note : str | None
  • static note_id : str | None
  • static review_status : bitfount.cache.types._review_shared.ReviewStatus | None
  • static username : str

ReviewedPatient​

class ReviewedPatient(**data: Any):

A patient's current site review for one trial.

Arguments

  • bitfount_patient_id: The Bitfount patient ID.
  • ehr_patient_id: The EHR patient ID, if known.
  • name: The patient's display name, as PatientSummary.name serves it.
  • review_status: The verdict the site recorded, in the review vocabulary (suitable_for_screening / screening / enrolled / rejected) rather than the analysis verdict it maps to, so a consumer can show the site's own wording.
  • reviewed_by_username: The reviewer's username when they reviewed.
  • reviewed_at: When the review was made.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static bitfount_patient_id : str
  • static ehr_patient_id : str | None
  • static model_config
  • static name : str
  • static review_status : bitfount.cache.types._review_shared.ReviewStatus
  • static reviewed_by_username : str

ReviewedPatientList​

class ReviewedPatientList(**data: Any):

Envelope for one trial's reviews.

Paginated as PatientList is: items holds the requested page, newest review first, and total is the count of all admitted reviews before pagination.

Arguments

  • items: The reviewed patients on the requested page.
  • total: The number of admitted reviews before pagination.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static model_config
  • static total : int

TrialReview​

class TrialReview(**data: Any):

The review a site user has in force for a patient and a trial.

A review overrides the Bitfount verdict in PatientSummary.trial_statuses, so the verdict the analysis reached is carried here: the two may disagree, and a client shows the review first and the verdict as secondary evidence.

Arguments

  • project_id: The trial (project) ID.
  • review_event_id: The review's ID. Each review is an immutable event; reviewing again produces a new one.
  • review_status: The site's verdict.
  • reviewed_by_username: The reviewer's username.
  • reviewed_at: When the review was made (aware UTC).
  • note: The note recorded with the review, or None when the reviewer wrote none.
  • bitfount_verdict: What the analysis concluded for this trial, or None if the patient has not been analysed for it.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Variables​

  • static bitfount_verdict : bitfount.cache.types._eligibility_shared.EligibilityStatus | None
  • static model_config
  • static note : str | None
  • static project_id : str
  • static review_event_id : str
  • static review_status : bitfount.cache.types._review_shared.ReviewStatus
  • static reviewed_by_username : str