{ "openapi": "3.0.0", "info": { "version": "4.3.2", "title": "Accounts API", "description": "These are all the APIs related to accounts", "contact": { "name": "ChilliPharm", "url": "https://www.chillipharm.com" }, "license": { "name": "UNLICENSED", "url": "https://www.chillipharm.com" } }, "servers": [ { "url": "http://chillipharm.test:3000/api/v1", "description": "Local development" }, { "url": "https://qa.chillipharm.dev/api/v1", "description": "QA" }, { "url": "https://chillipharm-staging.com/api/v1", "description": "Staging" }, { "url": "https://chillipharm-uat.com/api/v1", "description": "UAT" }, { "url": "https://www.chillipharm.com/api/v1", "description": "Production" } ], "tags": [ { "name": "Accounts", "description": "Endpoints for accounts" }, { "name": "Assets", "description": "Endpoints for assets" }, { "name": "Branding", "description": "Endpoints for account branding" }, { "name": "Chapter Definitions", "description": "Endpoints for chapter definitions" }, { "name": "Downloads", "description": "Endpoints for downloads" }, { "name": "Form Templates", "description": "Endpoints for form templates" }, { "name": "Study Arms", "description": "Endpoints for study arms" }, { "name": "Trial Configurations", "description": "Endpoints for trial configurations" } ], "paths": { "/accounts": { "get": { "summary": "Gets all accounts", "description": "Gets all accounts", "operationId": "getAccounts", "tags": [ "Accounts" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "description": "The account subdomain", "in": "query", "name": "subdomain", "required": false, "schema": { "type": "string", "example": "pfizer" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/BasicAccount" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}": { "get": { "summary": "Get an account", "description": "Get account", "operationId": "getAccount", "tags": [ "Accounts" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Account" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/assets/{asset_id}/location": { "get": { "summary": "Gets location for an asset", "description": "Gets location for an asset", "operationId": "getAssetLocation", "tags": [ "Assets" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "description": "The account id", "required": true, "schema": { "type": "string", "example": "1" } }, { "name": "asset_id", "in": "path", "description": "The asset id", "required": true, "schema": { "type": "string", "example": "1" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "description": "An asset location", "type": "object", "properties": { "account": { "type": "object", "description": "The account data", "properties": { "name": { "type": "string", "description": "The name of the account", "example": "Test Trial" } }, "additionalProperties": false, "required": [ "name" ] }, "site": { "type": "object", "description": "The site data", "properties": { "name": { "type": "string", "description": "The name of the site", "example": "0123 Hospital London St Thomas" }, "number": { "type": "string", "description": "The number of the site", "example": 1 } }, "additionalProperties": false, "required": [ "name", "number" ] }, "subject": { "type": "object", "description": "The subject data", "properties": { "number": { "type": "string", "description": "The serial number of the subject", "example": "E001004" } }, "additionalProperties": false, "required": [ "number" ] }, "study_event": { "type": "object", "description": "The study event data", "properties": { "display_name": { "type": "string", "description": "The display name of a study event", "example": "Visit 1" }, "identifier": { "type": "string", "description": "The identifier of a study event", "example": "VIS1" }, "label": { "$ref": "#/components/schemas/DisplayName" } }, "additionalProperties": false, "required": [ "display_name", "identifier", "label" ] }, "study_procedure": { "type": "object", "description": "The study procedure data", "properties": { "display_name": { "type": "string", "description": "The display name of a study procedure", "example": "North Star" }, "identifier": { "type": "string", "description": "The identifier of a study procedure", "example": "NSTAR" }, "label": { "$ref": "#/components/schemas/DisplayName" } }, "additionalProperties": false, "required": [ "display_name", "identifier", "label" ] } }, "additionalProperties": false, "required": [ "account", "site", "study_event", "study_procedure", "subject" ], "nullable": true } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/branding": { "get": { "summary": "Gets branding for an account", "description": "Gets branding for an account", "operationId": "getBranding", "tags": [ "Branding" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "description": "The account id", "required": true, "schema": { "type": "string", "example": "1" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Branding" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/chapter_definitions": { "get": { "summary": "Gets chapter definitions for an account to be used for an asset", "description": "Gets chapter definitions for an account", "operationId": "getChapterDefinitions", "tags": [ "Chapter Definitions" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "description": "The account id", "required": true, "schema": { "type": "string", "example": "1" } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/ChapterDefinition" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/downloads/{download_request_uuid}": { "get": { "summary": "Download requested resource", "description": "Download requested resource", "operationId": "downloadRequestedResource", "tags": [ "Downloads" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "download_request_uuid", "in": "path", "required": true, "schema": { "type": "string", "example": "c40a88fc-189e-4bbf-8606-9c7b57030e21" }, "description": "The download request uuid" } ], "responses": { "302": { "description": "Redirect to resource", "content": { "application/octet-stream": { "schema": { "type": "object", "format": "binary", "example": "data" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/form_templates/{form_template_id}": { "get": { "summary": "Get an account form template", "description": "Get account form template", "operationId": "getFormTemplate", "tags": [ "Form Templates" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "form_template_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The form template id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "type": "integer", "description": "The form template id", "example": 1 }, "title": { "type": "string", "description": "The form template title", "example": "Form template title" }, "fields": { "type": "array", "description": "The form template fields", "items": { "$ref": "#/components/schemas/FormTemplateField" } } }, "required": [ "id", "title", "fields" ], "additionalProperties": false } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/study_arms": { "get": { "summary": "Get account study arms", "description": "Get account study arms", "operationId": "getStudyArms", "tags": [ "Study Arms" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "trial_configuration_id", "in": "query", "required": false, "schema": { "type": "string", "example": "1" }, "description": "The trial configuration id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/StudyArm" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/trial_configurations/{trial_configuration_id}/study_procedure_definitions": { "get": { "summary": "Get the study procedure definitions of a trial configuration", "description": "Get the study procedure definitions of a trial configuration", "operationId": "getStudyProcedureDefinitions", "tags": [ "Trial Configurations" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "trial_configuration_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The trial configuration id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/StudyProcedureDefinition" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/trial_configurations": { "get": { "summary": "Get trial configurations", "description": "Get trial configurations", "operationId": "getTrialConfigurations", "tags": [ "Trial Configurations" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "array", "items": { "$ref": "#/components/schemas/TrialConfiguration" } } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/trial_configurations/{trial_configuration_id}/site_reporting": { "get": { "summary": "Get report for the trial configuration", "description": "Get trial configurations reporting", "operationId": "getTrialConfigurationsReporting", "tags": [ "Trial Configurations" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "trial_configuration_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The trial configuration id" }, { "name": "page", "in": "query", "description": "The page number", "required": false, "schema": { "type": "integer", "example": 1 } } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/TrialConfigurationsReporting" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } }, "/accounts/{account_id}/trial_configurations/{trial_configuration_id}/site_reporting/export": { "get": { "summary": "Get report export for the trial configuration", "description": "Get trial configurations reporting export", "operationId": "getTrialConfigurationsReportingExport", "tags": [ "Trial Configurations" ], "security": [ { "userSessionKey": [], "chillipharmSession": [] } ], "parameters": [ { "name": "account_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The account id" }, { "name": "trial_configuration_id", "in": "path", "required": true, "schema": { "type": "string", "example": "1" }, "description": "The trial configuration id" } ], "responses": { "200": { "description": "Successful export", "content": { "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { "schema": { "type": "string", "format": "binary", "example": "PK!�E�@J,[Content_Types].xml���" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/Unauthorized" }, "403": { "$ref": "#/components/responses/Forbidden" }, "404": { "$ref": "#/components/responses/NotFound" }, "409": { "$ref": "#/components/responses/Conflict" }, "500": { "$ref": "#/components/responses/InternalServerError" } } } } }, "components": { "securitySchemes": { "userSessionKey": { "type": "apiKey", "in": "cookie", "name": "user_session_key", "description": "User session key cookie" }, "chillipharmSession": { "type": "apiKey", "in": "cookie", "name": "_chillipharm_session", "description": "ChilliPharm session cookie" } }, "schemas": { "Account": { "description": "An account", "type": "object", "properties": { "id": { "type": "number", "description": "The id of account", "example": 1 }, "name": { "type": "string", "description": "The name of account", "example": "Test Trial" }, "permissions": { "$ref": "#/components/schemas/Permissions" }, "plan_options": { "$ref": "#/components/schemas/PlanOptions" }, "subject_number_requirements": { "$ref": "#/components/schemas/SubjectNumberSettings" }, "timezone": { "type": "string", "description": "The account timezone", "example": "Etc/UTC" } }, "additionalProperties": false, "required": [ "id", "name", "permissions", "plan_options", "subject_number_requirements", "timezone" ] }, "BasicAccount": { "description": "An account", "type": "object", "properties": { "id": { "type": "number", "description": "The id of account", "example": 1 }, "name": { "type": "string", "description": "The name of account", "example": "Test Trial" }, "suspended": { "type": "boolean", "description": "Whether the account is suspended", "example": true } }, "additionalProperties": false, "required": [ "id", "name" ] }, "Branding": { "description": "The branding of the account", "type": "object", "properties": { "id": { "type": "integer", "description": "The branding id", "example": 1, "nullable": true }, "presigned_url": { "type": "string", "description": "The presigned URL for the branding thumbnail", "example": "/branding/thumbnail/path", "nullable": true } }, "additionalProperties": false, "required": [ "id", "presigned_url" ] }, "ChapterDefinition": { "description": "A chapter definition", "type": "object", "properties": { "id": { "type": "number", "description": "The id of chapter definition", "example": 1 }, "name": { "type": "string", "description": "The name of chapter definition", "example": "pre" }, "color": { "type": "string", "description": "The color of chapter definition", "example": "#ccc" }, "position": { "type": "number", "description": "The position of chapter definition", "example": 1 } }, "additionalProperties": false, "required": [ "id", "name", "color" ] }, "CompletedForm": { "description": "Completed form", "type": "object", "properties": { "id": { "type": "number", "description": "The id of a form", "example": 1 }, "name": { "type": "string", "description": "The name of a form", "example": "Form 1" } }, "required": [ "id", "name" ], "additionalProperties": false }, "DisplayName": { "description": "Display name in both singular and plural format", "type": "object", "properties": { "singular": { "type": "string", "description": "The singular variant of the display name", "example": "refill visit" }, "plural": { "type": "string", "description": "The plural variant of the display name", "example": "refill visits" } }, "additionalProperties": false, "required": [ "singular", "plural" ] }, "Error": { "description": "An error", "type": "object", "properties": { "error": { "type": "string", "description": "The error message", "example": "Bad request. Missing or invalid input parameters." }, "errors": { "type": "object", "description": "The error object", "properties": { "message": { "type": "string", "description": "The error message", "example": "Validation failed." }, "fields": { "type": "object", "description": "The validation fields errors" } } } }, "additionalProperties": false, "required": [] }, "FlaggedTask": { "description": "A flagged task", "type": "object", "properties": { "reason_for_creation": { "type": "string", "description": "Action required", "example": "Please complete xyz" }, "created_at": { "type": "string", "description": "Created at date", "example": "October 15th, 2024" }, "reason_for_resolving": { "type": "string", "description": "Action resolved", "example": "Completed xyz", "nullable": true }, "resolved_at": { "type": "string", "description": "Resolved at date", "example": "October 15th, 2024", "nullable": true } }, "required": [ "reason_for_creation", "created_at" ], "additionalProperties": false }, "FormTemplate": { "description": "Form template field", "type": "object", "properties": { "id": { "type": "string", "description": "The field id", "example": "1" }, "title": { "type": "string", "description": "The field title", "example": "Field title" }, "version_number": { "type": "number", "description": "The version number of the form template", "example": 1 } }, "additionalProperties": false, "required": [ "id", "title", "version_number" ] }, "FormTemplateField": { "description": "Form template field", "type": "object", "properties": { "id": { "type": "string", "description": "The field id", "example": "1" }, "title": { "type": "string", "description": "The field title", "example": "Field title" }, "type": { "type": "string", "description": "The field type", "example": "single_line" }, "input_guidance": { "type": "string", "description": "The field input guidance", "example": "guidance", "nullable": true }, "enabled": { "type": "boolean", "description": "Whether the field is enabled", "example": true }, "other_enabled": { "type": "boolean", "description": "Whether other types are enabled", "example": false }, "other_field": { "type": "string", "description": "The other field label", "example": "Other" }, "value": { "oneOf": [ { "type": "string", "example": "" }, { "type": "array", "description": "The field value", "example": [] } ] }, "validations": { "type": "object", "properties": { "required": { "type": "boolean", "description": "Whether the field is required", "example": true }, "input_format": { "type": "string", "description": "regex format for input", "example": "[a-zA-Z]{1}[a-zA-Z]{1}-\\d{1}\\d{1}\\d{1}\\d{1}\\d{1}", "nullable": true }, "character_limit": { "type": "integer", "description": "The maximum characters", "example": 10, "nullable": true }, "character_restriction": { "type": "string", "description": "restricted character type", "example": "letters_and_numbers", "nullable": true } }, "required": [ "required", "input_format", "character_limit", "character_restriction" ], "additionalProperties": false }, "options": { "type": "array", "description": "The field options", "items": { "type": "string", "example": "option1" } }, "comments": { "type": "array", "description": "The field comments", "items": { "type": "string", "example": "comment1" }, "nullable": true } }, "required": [ "id", "title", "type", "enabled", "other_enabled", "other_field", "value", "validations", "options" ], "additionalProperties": false }, "Permissions": { "type": "object", "properties": { "admin": { "type": "boolean", "description": "Whether the user is an admin", "example": true }, "manager": { "type": "boolean", "description": "Whether the user is a manager", "example": false }, "reporting": { "type": "boolean", "description": "Whether the user has reporting permissions", "example": true }, "activity": { "type": "boolean", "description": "Whether the user has activity permissions", "example": true } }, "required": [ "admin", "manager", "reporting", "activity" ], "additionalProperties": false }, "PlanOptions": { "type": "object", "properties": { "admin_user_report_enabled": { "type": "boolean", "description": "Whether the account has user reporting enabled for administrators", "example": true }, "asset_chapters_enabled": { "type": "boolean", "description": "Whether the account has asset chapters enabled", "example": false }, "check_trial_name_on_upload_enabled": { "type": "boolean", "description": "Whether the account has trial name on upload checking enabled", "example": true }, "form_templates_enabled": { "type": "boolean", "description": "Whether the account has forms enabled", "example": true }, "hd_transcodes_enabled": { "type": "boolean", "description": "Whether the account has HD transcodes enabled", "example": true }, "pdf_previews_enabled": { "type": "boolean", "description": "Whether the account has PDF previews enabled", "example": true }, "reporting_enabled": { "type": "boolean", "description": "Whether the account has reporting enabled", "example": true }, "signatures_enabled": { "type": "boolean", "description": "Whether the account has signatures enabled", "example": true }, "sites_enabled": { "type": "boolean", "description": "Whether the account has sites enabled", "example": true }, "video_timecode_enabled": { "type": "boolean", "description": "Whether the account has video timecode enabled", "example": true } }, "required": [ "admin_user_report_enabled", "asset_chapters_enabled", "check_trial_name_on_upload_enabled", "form_templates_enabled", "hd_transcodes_enabled", "pdf_previews_enabled", "reporting_enabled", "signatures_enabled", "sites_enabled", "video_timecode_enabled" ], "additionalProperties": false }, "Role": { "description": "A role", "type": "object", "properties": { "id": { "type": "number", "description": "The id of role", "example": 1 }, "name": { "type": "string", "description": "The name of role", "example": "Guest" } }, "required": [ "id", "name" ], "additionalProperties": false }, "Rows": { "description": "Reporting row", "type": "object", "properties": { "id": { "type": "number", "description": "The id of the trial configuration", "example": 1 }, "created_at": { "type": "string", "description": "The date the row was created", "example": "2020-01-01T00:00:00.000Z" }, "identifier": { "type": "string", "description": "The indentifier of the trial configuration", "example": "NSTAR" }, "display_name": { "type": "string", "description": "The display name of the trial configuration", "example": "North Star" }, "date": { "type": "string", "description": "The trial configuration date", "example": "2020-01-01", "nullable": true }, "status": { "type": "string", "description": "The trial configuration status", "example": "completed" }, "status_change_date": { "type": "string", "description": "The trial configuration status change date", "example": "2022-08-10T10:00:00.000Z" }, "status_reason_for_change": { "type": "string", "description": "The reason for change of assessment status", "example": "Assessment finished", "nullable": true }, "clinical_evaluator": { "type": "string", "description": "The clinical evaluator", "example": "Mark Smith", "nullable": true }, "account_trial_name": { "type": "string", "description": "The account trial", "example": "Trial 1" }, "trial_configuration": { "type": "object", "properties": { "name": { "type": "string", "description": "The name of the trial configuration", "example": "Trial Configuration v1" }, "study_procedure_display_name": { "$ref": "#/components/schemas/DisplayName" }, "study_event_display_name": { "$ref": "#/components/schemas/DisplayName" } } }, "site": { "$ref": "#/components/schemas/Site" }, "subject": { "type": "object", "properties": { "number": { "type": "string", "description": "The subject number", "example": "1234" } } }, "study_arm": { "type": "string", "description": "The subject arm", "example": "Arm A", "nullable": true }, "study_event": { "$ref": "#/components/schemas/StudyEvent" }, "flagged_tasks_raised": { "type": "string", "description": "Flagged tasks raised", "example": "yes" }, "flagged_tasks": { "type": "array", "items": { "$ref": "#/components/schemas/FlaggedTask" } }, "tasks": { "type": "array", "items": { "$ref": "#/components/schemas/Task" } }, "completed_forms": { "type": "array", "items": { "$ref": "#/components/schemas/CompletedForm" } }, "assets": { "type": "array", "items": { "type": "integer", "example": 1 } } }, "required": [ "id", "created_at", "identifier", "display_name", "date", "status", "status_change_date", "clinical_evaluator", "account_trial_name", "site", "subject", "study_event", "flagged_tasks_raised", "flagged_tasks", "tasks", "completed_forms", "assets", "trial_configuration" ], "additionalProperties": false }, "Site": { "description": "A Site", "type": "object", "properties": { "id": { "type": "number", "description": "The id of site", "example": 1 }, "name": { "type": "string", "description": "The name of site", "example": "0123 Hospital London St Thomas" }, "identifier": { "type": "string", "description": "The identifier of the site", "example": "0123" }, "number": { "type": "string", "description": "The number of the site", "example": 1 }, "principal_investigator": { "type": "string", "description": "The name of principal investigator", "example": "Test Name", "nullable": true }, "country": { "type": "string", "description": "The country of the site", "example": "South Korea" } }, "required": [ "id", "name", "number", "principal_investigator", "country" ], "additionalProperties": false }, "StudyArm": { "description": "The study arm", "type": "object", "properties": { "display_name": { "type": "string", "description": "The display name of the study arm", "example": "Post-Treatment Monitoring Arm" }, "id": { "type": "number", "description": "The id of the study arm", "example": 1 } }, "required": [ "display_name", "id" ], "additionalProperties": false }, "StudyEvent": { "description": "A study event", "type": "object", "properties": { "status": { "type": "string", "description": "The status", "example": "in_progress" }, "date": { "type": "string", "description": "The date", "example": "2024-10-06" }, "identifier": { "type": "string", "description": "The identifier of a study event", "example": "VIS1" }, "display_name": { "type": "string", "description": "The display name of a study event", "example": "Visit 1" } }, "required": [ "status", "date", "identifier", "display_name" ], "additionalProperties": false }, "StudyProcedureDefinition": { "description": "An account", "type": "object", "properties": { "id": { "type": "number", "description": "The id of the study procedure definition", "example": 3 }, "display_name": { "type": "string", "description": "The display name of the study procedure definition", "example": "LoremB6H7E" }, "identifier": { "type": "string", "description": "The identifier of the study procedure definition", "example": "EXPROC" }, "position": { "type": "number", "description": "The position of the study procedure definition", "example": 1 }, "study_procedures_exist": { "type": "boolean", "description": "The study procedures exist of the study procedure definition", "example": true }, "required_form_templates": { "type": "array", "description": "The required form templates of the study procedure definition", "items": { "$ref": "#/components/schemas/FormTemplate" } } }, "additionalProperties": false, "required": [ "id", "display_name", "identifier", "position", "study_procedures_exist", "required_form_templates" ] }, "StudyProcedureTaskDefinition": { "description": "A study procedure task definition", "type": "object", "properties": { "display_name": { "type": "string", "description": "The display name of study procedure task definition", "example": "Please complete something first" }, "enabled": { "type": "boolean", "description": "The enabled status of study procedure task definition", "example": true }, "id": { "type": "number", "description": "The id of study procedure task definition", "example": 1 }, "roles": { "type": "array", "description": "The role ids of study procedure task definition", "items": { "$ref": "#/components/schemas/Role" } }, "study_procedure_tasks_exist": { "type": "boolean", "description": "The usage status of study procedure task definition", "example": false } }, "required": [ "display_name", "enabled", "id", "roles", "study_procedure_tasks_exist" ], "additionalProperties": false }, "StudySubjectNumberCharacter": { "description": "Subject requirements character for an account", "type": "object", "properties": { "character_type": { "type": "string", "description": "Character type", "example": "A" } }, "required": [ "character_type" ], "additionalProperties": false }, "SubjectNumberSettings": { "type": "object", "properties": { "characters": { "type": "array", "description": "The characters for subject number", "items": { "$ref": "#/components/schemas/StudySubjectNumberCharacter" } }, "include_site_prefix": { "type": "boolean", "description": "Whether the site prefix is included", "example": false } }, "required": [ "characters", "include_site_prefix" ], "additionalProperties": false }, "Task": { "description": "A task", "type": "object", "properties": { "definition": { "type": "string", "description": "Task definition", "example": "Complete something" }, "status": { "type": "string", "description": "Status", "example": "complete" }, "completed_date": { "type": "string", "description": "Completed date", "example": "October 15th, 2024", "nullable": true }, "completed_by": { "type": "string", "description": "Completed by", "example": "James Smith", "nullable": true } }, "required": [ "definition", "status", "completed_date", "completed_by" ], "additionalProperties": false }, "TrialConfiguration": { "description": "A trial configuration", "type": "object", "properties": { "id": { "type": "number", "description": "The id of the trial configuration", "example": 1 }, "name": { "type": "string", "description": "The name of the trial configuration", "example": "Trial Configuration v1" }, "number_of_study_procedures": { "type": "number", "description": "The number of study procedures in the trial configuration", "example": 2 }, "study_procedure_display_name": { "$ref": "#/components/schemas/DisplayName" }, "study_event_display_name": { "$ref": "#/components/schemas/DisplayName" } }, "additionalProperties": false, "required": [ "id", "name", "number_of_study_procedures" ] }, "TrialConfigurationsReporting": { "description": "Trial Configurations reporting", "type": "object", "properties": { "hits": { "type": "number", "description": "The total number of rows", "example": 100 }, "page": { "type": "number", "description": "The current page number", "example": 1 }, "per_page": { "type": "number", "description": "Numeber of rows per page", "example": 50 }, "results": { "type": "array", "items": { "$ref": "#/components/schemas/Rows" } }, "study_procedure_task_definitions": { "type": "array", "items": { "$ref": "#/components/schemas/StudyProcedureTaskDefinition" } }, "trial_configuration": { "$ref": "#/components/schemas/TrialConfiguration" } }, "required": [ "hits", "page", "per_page", "results", "study_procedure_task_definitions", "trial_configuration" ], "additionalProperties": false } }, "responses": { "BadRequest": { "description": "Bad request. Missing or invalid input parameters.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "Unauthorized": { "description": "Unauthorized. Missing or invalid authentication credentials.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "Forbidden": { "description": "Forbidden. Insufficient permissions to perform the operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "NotFound": { "description": "Not found. The requested resource was not found.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "Conflict": { "description": "Conflict. The request could not be completed due to a conflict with the current state of the resource.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "InternalServerError": { "description": "Internal server error. Please contact support.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } } } }