{
 "openapi": "3.1.0",
 "info": {
  "title": "Imaging Worklist (EHR)",
  "version": "20261030b",
  "description": "From order through acquisition to a signed report. A critical finding raises an alert."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "imaging-studies": {
    "type": "object",
    "required": [
     "patient_id",
     "procedure_id"
    ],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "accession_no": {
      "type": "string",
      "description": "Accession no",
      "readOnly": true
     },
     "patient_id": {
      "type": "string",
      "format": "uuid",
      "description": "Patient"
     },
     "encounter_id": {
      "type": "string",
      "format": "uuid",
      "description": "Encounter id"
     },
     "procedure_id": {
      "type": "string",
      "format": "uuid",
      "description": "Procedure"
     },
     "ordering_provider_id": {
      "type": "string",
      "format": "uuid",
      "description": "Ordering provider"
     },
     "performing_tech_id": {
      "type": "string",
      "format": "uuid",
      "description": "Performing tech id"
     },
     "radiologist_id": {
      "type": "string",
      "format": "uuid",
      "description": "Radiologist"
     },
     "priority": {
      "type": "string",
      "description": "Priority"
     },
     "clinical_indication": {
      "type": "string",
      "description": "Clinical indication"
     },
     "ordered_at": {
      "type": "string",
      "format": "date-time",
      "description": "Ordered at",
      "readOnly": true
     },
     "scheduled_at": {
      "type": "string",
      "format": "date-time",
      "description": "Scheduled"
     },
     "performed_at": {
      "type": "string",
      "format": "date-time",
      "description": "Performed at"
     },
     "reported_at": {
      "type": "string",
      "format": "date-time",
      "description": "Reported at",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status"
     },
     "study_uid": {
      "type": "string",
      "description": "Study uid"
     },
     "image_count": {
      "type": "integer",
      "description": "Image count",
      "readOnly": true
     },
     "storage_url": {
      "type": "string",
      "description": "Storage url"
     },
     "location_id": {
      "type": "string",
      "format": "uuid",
      "description": "Location id"
     },
     "room": {
      "type": "string",
      "description": "Room"
     },
     "radiation_dose": {
      "type": "string",
      "format": "decimal",
      "description": "Radiation dose"
     },
     "cost_center_id": {
      "type": "string",
      "format": "uuid",
      "description": "Cost center id"
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/ehr/imaging-studies": {
   "get": {
    "summary": "list imaging-studies",
    "operationId": "list_imaging_studies_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create imaging-studies",
    "operationId": "create_imaging_studies_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{id}": {
   "get": {
    "summary": "get imaging-studies",
    "operationId": "get_imaging_studies_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change imaging-studies",
    "operationId": "change_imaging_studies_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete imaging-studies",
    "operationId": "delete_imaging_studies_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_imaging_studies_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{parentId}/series": {
   "get": {
    "summary": "Series",
    "operationId": "action_imaging_studies_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Series",
    "operationId": "action_imaging_studies_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{parentId}/series/{lineId}": {
   "put": {
    "summary": "Series",
    "operationId": "action_imaging_studies_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Series",
    "operationId": "action_imaging_studies_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{parentId}/reports": {
   "get": {
    "summary": "Reports",
    "operationId": "action_imaging_studies_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Reports",
    "operationId": "action_imaging_studies_1_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{parentId}/reports/{lineId}": {
   "put": {
    "summary": "Reports",
    "operationId": "action_imaging_studies_0_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Reports",
    "operationId": "action_imaging_studies_1_7",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{id}/acquire": {
   "post": {
    "summary": "Acquire",
    "operationId": "action_imaging_studies_0_6",
    "description": "Body keys: imageCount, storageUrl, studyUid, radiationDose, techId; series: [{ uid, description, modality, imageCount, storageUrl }]",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/ehr/imaging-studies/{id}/report": {
   "post": {
    "summary": "Report",
    "operationId": "action_imaging_studies_0_6",
    "description": "Body keys: findings*, impression, technique, comparison, recommendation, radiologistId, reportType, criticalFinding; reportType one of preliminary|final|addendum",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}