Create a new study
viewer.studies.create(StudyCreateParams**kwargs) -> StudyCreateResponse
/v1/viewer/studies
Creates a new study in the Viewer system with the specified DICOM Study Instance UID and metadata. The study can be optionally assigned to a user.
Parameters
study_description: str
Description of the study/scan (e.g., 'Brain MRI with Contrast', 'Chest CT')
minLength1
study_instance_uid: str
DICOM Study Instance UID. Must be a valid DICOM UID format (e.g., '1.2.840.10008.5.1.4.1.1.2')
minLength1
assigned_to: Optional[str]
User ID to assign the study to. Format: usr_{32-hex-chars}
metadata: Optional[Dict[str, str]]
Custom key-value metadata for the study. Maximum 50 pairs, keys up to 100 chars, values up to 1000 chars
org_id: Optional[str]
Organization ID for the study. Format: org_{32-hex-chars}
Returns
Create a new study
import os
from avara import Avara
client = Avara(
api_key=os.environ.get("AVARA_API_KEY"), # This is the default and can be omitted
)
study = client.viewer.studies.create(
severity="high",
study_description="CT Chest/Abdomen/Pelvis",
study_instance_uid="1.2.840.113619.2.55.3.604688119.868.1234567890.123",
)
print(study.study_instance_uid)
{
"cancelledAt": null,
"createdAt": "2024-03-15T10:30:00Z",
"isCancelled": false,
"severity": "high",
"studyDescription": "CT Chest/Abdomen/Pelvis",
"studyId": "stu_1234567890abcdef1234567890abcdef",
"studyInstanceUid": "1.2.840.113619.2.55.3.604688119.868.1234567890.123",
"studyViewerStatus": "incomplete",
"updatedAt": "2024-03-15T14:20:00Z",
"assignedTo": {
"email": "dr.smith@radiology.com",
"userId": "usr_1234567890abcdef1234567890abcdef",
"firstName": "John",
"lastName": "Smith",
"middleName": "Robert",
"suffix1": "MD",
"suffix2": "FACR"
},
"createdByApiKey": {
"apiKeyId": "550e8400-e29b-41d4-a716-446655440000",
"description": "Production API Key",
"isViewerEnabled": true
},
"createdByUser": {
"email": "dr.smith@radiology.com",
"userId": "usr_1234567890abcdef1234567890abcdef",
"firstName": "John",
"lastName": "Smith",
"middleName": "Robert",
"suffix1": "MD",
"suffix2": "FACR"
},
"metadata": {
"department": "radiology",
"priority": "urgent"
},
"org": {
"orgId": "org_1234567890abcdef1234567890abcdef",
"orgName": "City Medical Center"
}
}
Returns Examples
{
"cancelledAt": null,
"createdAt": "2024-03-15T10:30:00Z",
"isCancelled": false,
"severity": "high",
"studyDescription": "CT Chest/Abdomen/Pelvis",
"studyId": "stu_1234567890abcdef1234567890abcdef",
"studyInstanceUid": "1.2.840.113619.2.55.3.604688119.868.1234567890.123",
"studyViewerStatus": "incomplete",
"updatedAt": "2024-03-15T14:20:00Z",
"assignedTo": {
"email": "dr.smith@radiology.com",
"userId": "usr_1234567890abcdef1234567890abcdef",
"firstName": "John",
"lastName": "Smith",
"middleName": "Robert",
"suffix1": "MD",
"suffix2": "FACR"
},
"createdByApiKey": {
"apiKeyId": "550e8400-e29b-41d4-a716-446655440000",
"description": "Production API Key",
"isViewerEnabled": true
},
"createdByUser": {
"email": "dr.smith@radiology.com",
"userId": "usr_1234567890abcdef1234567890abcdef",
"firstName": "John",
"lastName": "Smith",
"middleName": "Robert",
"suffix1": "MD",
"suffix2": "FACR"
},
"metadata": {
"department": "radiology",
"priority": "urgent"
},
"org": {
"orgId": "org_1234567890abcdef1234567890abcdef",
"orgName": "City Medical Center"
}
}