imaging_api.routers.schemas =========================== .. py:module:: imaging_api.routers.schemas Attributes ---------- .. autoapisummary:: imaging_api.routers.schemas.PACS_ID imaging_api.routers.schemas.XNAT_PORT imaging_api.routers.schemas._XML_FORBIDDEN_CHARS Classes ------- .. autoapisummary:: imaging_api.routers.schemas.User imaging_api.routers.schemas.CreateUser imaging_api.routers.schemas.CreatedUser imaging_api.routers.schemas.UpdateUser imaging_api.routers.schemas.CentralHubUser imaging_api.routers.schemas.CreateProject imaging_api.routers.schemas.Project imaging_api.routers.schemas.CreatedProject imaging_api.routers.schemas.CentralHubProject imaging_api.routers.schemas.Subject imaging_api.routers.schemas.Experiment imaging_api.routers.schemas.PacsStatus imaging_api.routers.schemas.Patient imaging_api.routers.schemas.Study imaging_api.routers.schemas.StudyQuery imaging_api.routers.schemas.ImportStudy imaging_api.routers.schemas.ImportStudyRequest imaging_api.routers.schemas.ImportStudyResponse imaging_api.routers.schemas.ImportStatus imaging_api.routers.schemas.ImportStatusCount imaging_api.routers.schemas.ProjectRetrieval imaging_api.routers.schemas.DownloadImagesRequestData imaging_api.routers.schemas.DownloadImagesResponse imaging_api.routers.schemas.UploadDataRequest Module Contents --------------- .. py:data:: PACS_ID .. py:data:: XNAT_PORT .. py:data:: _XML_FORBIDDEN_CHARS :value: ('<', '>', '&') .. py:class:: User Bases: :py:obj:`pydantic.BaseModel` Represents a user profile on XNAT. .. py:attribute:: lastModified :type: int .. py:attribute:: username :type: str .. py:attribute:: enabled :type: bool .. py:attribute:: id :type: int .. py:attribute:: secured :type: bool .. py:attribute:: email :type: pydantic.EmailStr .. py:attribute:: verified :type: bool .. py:attribute:: firstName :type: str .. py:attribute:: lastName :type: str .. py:attribute:: lastSuccessfulLogin :type: int | None :value: None .. py:class:: CreateUser Bases: :py:obj:`pydantic.BaseModel` Represents a 'create user request' for XNAT. .. py:attribute:: username :type: str .. py:attribute:: password :type: str .. py:attribute:: email :type: pydantic.EmailStr .. py:attribute:: firstName :type: str .. py:attribute:: lastName :type: str .. py:attribute:: enabled :type: bool :value: True .. py:class:: CreatedUser Bases: :py:obj:`pydantic.BaseModel` Represents a user created on XNAT. .. py:attribute:: username :type: str .. py:attribute:: encrypted_password :type: str .. py:attribute:: email :type: pydantic.EmailStr .. py:class:: UpdateUser Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: email :type: pydantic.EmailStr .. py:attribute:: enabled :type: bool .. py:class:: CentralHubUser Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: id :type: uuid.UUID .. py:attribute:: email :type: pydantic.EmailStr .. py:attribute:: is_disabled :type: bool :value: False .. py:class:: CreateProject Bases: :py:obj:`pydantic.BaseModel` Represents a 'create project request' for XNAT. .. py:attribute:: id :type: str .. py:attribute:: secondary_id :type: str .. py:attribute:: name :type: str .. py:attribute:: description :type: str :value: '' .. py:class:: Project Bases: :py:obj:`pydantic.BaseModel` Represents a project on XNAT. .. py:attribute:: pi_firstname :type: str .. py:attribute:: secondary_ID :type: str .. py:attribute:: pi_lastname :type: str .. py:attribute:: name :type: str .. py:attribute:: description :type: str | None :value: None .. py:attribute:: ID :type: str .. py:attribute:: URI :type: str .. py:class:: CreatedProject Bases: :py:obj:`pydantic.BaseModel` Represents a project created on XNAT. .. py:attribute:: ID :type: uuid.UUID .. py:attribute:: name :type: str .. py:attribute:: created_users :type: list[CreatedUser] .. py:attribute:: added_users :type: list[User] .. py:class:: CentralHubProject Bases: :py:obj:`pydantic.BaseModel` Represents a project on the central hub from which an imaging project is created on XNAT. .. py:attribute:: project_id :type: uuid.UUID .. py:attribute:: trust_id :type: uuid.UUID .. py:attribute:: project_name :type: str .. py:attribute:: query :type: str .. py:attribute:: users :type: list[CentralHubUser] :value: [] .. py:attribute:: dicom_to_nifti :type: bool :value: True .. py:method:: _reject_xml_control_chars(v: str) -> str :classmethod: .. py:class:: Subject Bases: :py:obj:`pydantic.BaseModel` Short representation of a subject on XNAT, it is the result of the REST API call ``GET f"{XNAT_URL}/data/projects/{project_id}/subjects"`` .. py:attribute:: id :type: str .. py:attribute:: label :type: str .. py:attribute:: insert_date :type: str .. py:attribute:: project :type: str .. py:attribute:: insert_user :type: str .. py:attribute:: uri :type: str .. py:class:: Experiment Bases: :py:obj:`pydantic.BaseModel` Short representation of an experiment on XNAT, it is the result of the REST API call ``GET f"{XNAT_URL}/data/projects/{project_id}/experiments"`` .. py:attribute:: id :type: str .. py:attribute:: label :type: str .. py:attribute:: date :type: str .. py:attribute:: project :type: str .. py:attribute:: insert_date :type: str .. py:attribute:: xsiType :type: str .. py:attribute:: uri :type: str .. py:attribute:: subject_assessor_data_id :type: str | None .. py:class:: PacsStatus Bases: :py:obj:`pydantic.BaseModel` Represents the status of a PACS system. .. py:attribute:: pacs_id :type: int .. py:attribute:: successful :type: bool .. py:attribute:: ping_time :type: int .. py:attribute:: created :type: int .. py:attribute:: enabled :type: bool .. py:attribute:: timestamp :type: int .. py:attribute:: id :type: int .. py:attribute:: disabled :type: int .. py:class:: Patient Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: id :type: str .. py:attribute:: name :type: str .. py:attribute:: sex :type: str .. py:class:: Study Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: study_instance_uid :type: str .. py:attribute:: study_description :type: str .. py:attribute:: accession_number :type: str .. py:attribute:: study_date :type: str .. py:attribute:: modalities_in_study :type: list[str] .. py:attribute:: referring_physician_name :type: str .. py:attribute:: patient :type: Patient .. py:class:: StudyQuery Bases: :py:obj:`pydantic.BaseModel` Represents a study query for PACS through XNAT DQR. .. py:attribute:: accession_number :type: str .. py:attribute:: pacs_id :type: int .. py:attribute:: modality :type: str | None .. py:class:: ImportStudy(**data) Bases: :py:obj:`pydantic.BaseModel` Represents a study to be imported via DQR. .. py:attribute:: study_instance_uid :type: str .. py:attribute:: accession_number :type: str .. py:attribute:: relabel_map :type: dict[str, str] .. py:method:: set_relabel_map() Sets the relabel_map dictionary for subject and session. .. py:class:: ImportStudyRequest Bases: :py:obj:`pydantic.BaseModel` Represents an image import request for DQR. .. py:attribute:: pacs_id :type: int .. py:attribute:: ae_title :type: str .. py:attribute:: port :type: int .. py:attribute:: project_id :type: str .. py:attribute:: force_import :type: bool .. py:attribute:: studies :type: Annotated[list[ImportStudy], Field(..., min_length=1)] .. py:method:: deduplicate_and_parse_studies(data) :classmethod: Deduplicates and parses studies before validation. :param data: The raw input payload being validated. ``data["studies"]`` may contain ``dict`` entries or already-parsed ``ImportStudy`` instances. :type data: dict :returns: The same payload with ``studies`` replaced by a de-duplicated list of ``ImportStudy`` instances keyed by ``study_instance_uid``. :rtype: dict .. py:class:: ImportStudyResponse Bases: :py:obj:`pydantic.BaseModel` Represents the response from an import request. .. py:attribute:: id :type: int .. py:attribute:: pacs_id :type: int .. py:attribute:: status :type: str .. py:attribute:: accession_number :type: str .. py:attribute:: queued_time :type: int .. py:attribute:: created :type: int .. py:attribute:: priority :type: int .. py:class:: ImportStatus Bases: :py:obj:`pydantic.BaseModel` Tracks the status of imported studies. .. py:attribute:: successful :type: list[str] :value: [] .. py:attribute:: failed :type: list[str] :value: [] .. py:attribute:: processing :type: list[str] :value: [] .. py:attribute:: queued :type: list[str] :value: [] .. py:attribute:: queue_failed :type: list[str] :value: [] .. py:class:: ImportStatusCount Bases: :py:obj:`pydantic.BaseModel` Tracks the status of imported studies. .. py:attribute:: successful_count :type: int :value: 0 .. py:attribute:: failed_count :type: int :value: 0 .. py:attribute:: processing_count :type: int :value: 0 .. py:attribute:: queued_count :type: int :value: 0 .. py:attribute:: queue_failed_count :type: int :value: 0 .. py:class:: ProjectRetrieval Bases: :py:obj:`pydantic.BaseModel` Represents a project retrieval. .. py:attribute:: project_creation_completed :type: bool :value: False .. py:attribute:: import_status :type: ImportStatusCount .. py:class:: DownloadImagesRequestData Bases: :py:obj:`pydantic.BaseModel` Represents a request to download images. .. py:attribute:: encrypted_central_hub_project_id :type: str .. py:attribute:: accession_id :type: str .. py:class:: DownloadImagesResponse Bases: :py:obj:`pydantic.BaseModel` .. py:attribute:: path :type: str .. py:class:: UploadDataRequest Bases: :py:obj:`pydantic.BaseModel` Represents a request to upload data. .. py:attribute:: encrypted_central_hub_project_id :type: str .. py:attribute:: accession_id :type: str .. py:attribute:: scan_id :type: str .. py:attribute:: resource_id :type: str .. py:attribute:: files :type: list[str] .. py:attribute:: exist_ok :type: bool :value: False