From 15ab7017a935d085e5d55f46eafbf75dc5708c49 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Mon, 26 Jan 2026 12:58:09 +0700 Subject: [PATCH] openapi yml creation --- .gitignore | 4 +- docs/openapi.yaml | 3287 +++++++++++++++++++++++++++++++++++++++++++ public/docs.html | 17 + public/openapi.yaml | 3287 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 6594 insertions(+), 1 deletion(-) create mode 100644 docs/openapi.yaml create mode 100644 public/docs.html create mode 100644 public/openapi.yaml diff --git a/.gitignore b/.gitignore index 69c748b..c3803be 100644 --- a/.gitignore +++ b/.gitignore @@ -126,4 +126,6 @@ _modules/* /phpunit*.xml /public/.htaccess -.serena/ \ No newline at end of file +.serena/ + +.claude/ \ No newline at end of file diff --git a/docs/openapi.yaml b/docs/openapi.yaml new file mode 100644 index 0000000..9000ef3 --- /dev/null +++ b/docs/openapi.yaml @@ -0,0 +1,3287 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "CLQMS API", + "description": "Clinical Laboratory Quality Management System REST API", + "version": "1.0.0", + "contact": { + "name": "CLQMS Development Team" + } + }, + "servers": [ + { + "url": "http://localhost/clqms01/", + "description": "Development server" + } + ], + "components": { + "securitySchemes": { + "jwtAuth": { + "type": "apiKey", + "in": "cookie", + "name": "token", + "description": "JWT token stored in HTTP-only cookie" + } + }, + "schemas": { + "ApiResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["success", "failed"], + "description": "Response status" + }, + "message": { + "type": "string", + "description": "Response message" + }, + "data": { + "type": "object", + "description": "Response data payload" + } + } + }, + "Patient": { + "type": "object", + "properties": { + "InternalPID": { + "type": "integer", + "description": "Internal patient ID" + }, + "PatientID": { + "type": "string", + "maxLength": 30, + "description": "Patient identifier" + }, + "AlternatePID": { + "type": "string", + "maxLength": 30, + "description": "Alternate patient ID" + }, + "Prefix": { + "type": "string", + "maxLength": 10, + "description": "Name prefix" + }, + "NameFirst": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "First name" + }, + "NameMiddle": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Middle name" + }, + "NameLast": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Last name" + }, + "NameMaiden": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Maiden name" + }, + "Suffix": { + "type": "string", + "maxLength": 10, + "description": "Name suffix" + }, + "Sex": { + "type": "string", + "description": "Gender (M/F)" + }, + "Birthdate": { + "type": "string", + "format": "date", + "description": "Date of birth" + }, + "PlaceOfBirth": { + "type": "string", + "maxLength": 100, + "description": "Place of birth" + }, + "Street_1": { + "type": "string", + "maxLength": 255, + "description": "Address line 1" + }, + "Street_2": { + "type": "string", + "maxLength": 255, + "description": "Address line 2" + }, + "Street_3": { + "type": "string", + "maxLength": 255, + "description": "Address line 3" + }, + "City": { + "type": "string", + "description": "City" + }, + "Province": { + "type": "string", + "description": "Province/State" + }, + "ZIP": { + "type": "string", + "maxLength": 10, + "description": "Postal code" + }, + "EmailAddress1": { + "type": "string", + "format": "email", + "maxLength": 100, + "description": "Primary email" + }, + "EmailAddress2": { + "type": "string", + "format": "email", + "maxLength": 100, + "description": "Secondary email" + }, + "Phone": { + "type": "string", + "pattern": "^\\+?[0-9]{8,15}$", + "description": "Phone number" + }, + "MobilePhone": { + "type": "string", + "pattern": "^\\+?[0-9]{8,15}$", + "description": "Mobile phone number" + }, + "PatIdt": { + "$ref": "#/components/schemas/PatientIdentifier" + }, + "PatAtt": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatientAttribute" + }, + "description": "Patient attributes/addresses" + } + } + }, + "PatientIdentifier": { + "type": "object", + "properties": { + "IdentifierType": { + "type": "string", + "description": "Identifier type (KTP, PASS, SSN, SIM, KTAS)" + }, + "Identifier": { + "type": "string", + "maxLength": 255, + "description": "Identifier value" + } + } + }, + "PatientAttribute": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Patient address" + } + } + }, + "PatVisit": { + "type": "object", + "properties": { + "PatVisitID": { + "type": "integer", + "description": "Patient visit ID" + }, + "InternalPID": { + "type": "integer", + "description": "Internal patient ID" + }, + "VisitDate": { + "type": "string", + "format": "date-time", + "description": "Visit date/time" + }, + "VisitType": { + "type": "string", + "description": "Type of visit" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "ProviderID": { + "type": "integer", + "description": "Provider/Doctor ID" + }, + "VisitStatus": { + "type": "string", + "description": "Visit status" + } + } + }, + "OrderTest": { + "type": "object", + "properties": { + "OrderID": { + "type": "integer", + "description": "Order ID" + }, + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "PatVisitID": { + "type": "integer", + "description": "Visit ID" + }, + "OrderDateTime": { + "type": "string", + "format": "date-time", + "description": "Order date/time" + }, + "Priority": { + "type": "string", + "description": "Order priority" + }, + "OrderStatus": { + "type": "string", + "enum": ["ORD", "SCH", "ANA", "VER", "REV", "REP"], + "description": "Order status" + }, + "OrderingProvider": { + "type": "string", + "description": "Ordering provider" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "WorkstationID": { + "type": "integer", + "description": "Workstation ID" + }, + "Tests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderTestItem" + } + } + } + }, + "OrderTestItem": { + "type": "object", + "properties": { + "TestID": { + "type": "integer", + "description": "Test ID" + }, + "TestCode": { + "type": "string", + "description": "Test code" + }, + "TestName": { + "type": "string", + "description": "Test name" + } + } + }, + "Specimen": { + "type": "object", + "properties": { + "SID": { + "type": "integer", + "description": "Specimen ID" + }, + "OrderID": { + "type": "integer", + "description": "Order ID" + }, + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "SpecimenType": { + "type": "string", + "description": "Specimen type" + }, + "ContainerCode": { + "type": "string", + "description": "Container code" + }, + "CollectionDateTime": { + "type": "string", + "format": "date-time", + "description": "Collection date/time" + }, + "ReceivedDateTime": { + "type": "string", + "format": "date-time", + "description": "Received date/time" + }, + "Status": { + "type": "string", + "description": "Specimen status" + } + } + }, + "TestDefinition": { + "type": "object", + "properties": { + "TestID": { + "type": "integer", + "description": "Test ID" + }, + "TestCode": { + "type": "string", + "description": "Test code" + }, + "TestName": { + "type": "string", + "description": "Test name" + }, + "SpecimenType": { + "type": "string", + "description": "Required specimen type" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "Category": { + "type": "string", + "description": "Test category" + } + } + }, + "ValueSet": { + "type": "object", + "properties": { + "ValueSetID": { + "type": "integer", + "description": "Value set ID" + }, + "ValueSetKey": { + "type": "string", + "description": "Value set key" + }, + "Name": { + "type": "string", + "description": "Value set name" + }, + "Description": { + "type": "string", + "description": "Value set description" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValueSetItem" + } + } + } + }, + "ValueSetItem": { + "type": "object", + "properties": { + "ItemID": { + "type": "integer", + "description": "Item ID" + }, + "Value": { + "type": "string", + "description": "Item value/code" + }, + "Label": { + "type": "string", + "description": "Item display label" + }, + "Sequence": { + "type": "integer", + "description": "Display order" + } + } + }, + "ValueSetDef": { + "type": "object", + "properties": { + "VSetDefID": { + "type": "integer", + "description": "Value set definition ID" + }, + "ValueSetKey": { + "type": "string", + "description": "Value set key" + }, + "Name": { + "type": "string", + "description": "Definition name" + } + } + }, + "Location": { + "type": "object", + "properties": { + "LocationID": { + "type": "integer", + "description": "Location ID" + }, + "Code": { + "type": "string", + "description": "Location code" + }, + "Name": { + "type": "string", + "description": "Location name" + }, + "Type": { + "type": "string", + "description": "Location type" + }, + "ParentID": { + "type": "integer", + "description": "Parent location ID" + } + } + }, + "Contact": { + "type": "object", + "properties": { + "ContactID": { + "type": "integer", + "description": "Contact ID" + }, + "Name": { + "type": "string", + "description": "Contact name" + }, + "Type": { + "type": "string", + "description": "Contact type" + }, + "Phone": { + "type": "string", + "description": "Phone number" + }, + "Email": { + "type": "string", + "format": "email", + "description": "Email address" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "AccountID": { + "type": "integer", + "description": "Account ID" + }, + "AccountCode": { + "type": "string", + "description": "Account code" + }, + "AccountName": { + "type": "string", + "description": "Account name" + } + } + }, + "Site": { + "type": "object", + "properties": { + "SiteID": { + "type": "integer", + "description": "Site ID" + }, + "SiteCode": { + "type": "string", + "description": "Site code" + }, + "SiteName": { + "type": "string", + "description": "Site name" + }, + "AccountID": { + "type": "integer", + "description": "Account ID" + } + } + }, + "Department": { + "type": "object", + "properties": { + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "DepartmentCode": { + "type": "string", + "description": "Department code" + }, + "DepartmentName": { + "type": "string", + "description": "Department name" + }, + "SiteID": { + "type": "integer", + "description": "Site ID" + } + } + }, + "Discipline": { + "type": "object", + "properties": { + "DisciplineID": { + "type": "integer", + "description": "Discipline ID" + }, + "DisciplineCode": { + "type": "string", + "description": "Discipline code" + }, + "DisciplineName": { + "type": "string", + "description": "Discipline name" + } + } + }, + "Workstation": { + "type": "object", + "properties": { + "WorkstationID": { + "type": "integer", + "description": "Workstation ID" + }, + "WorkstationCode": { + "type": "string", + "description": "Workstation code" + }, + "WorkstationName": { + "type": "string", + "description": "Workstation name" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + } + } + }, + "AreaGeo": { + "type": "object", + "properties": { + "AreaGeoID": { + "type": "integer", + "description": "Area ID" + }, + "ParentID": { + "type": "integer", + "description": "Parent area ID" + }, + "AreaName": { + "type": "string", + "description": "Area name" + }, + "Level": { + "type": "integer", + "description": "Geographic level" + } + } + }, + "SpecimenContainerDef": { + "type": "object", + "properties": { + "ContainerDefID": { + "type": "integer", + "description": "Container definition ID" + }, + "ContainerCode": { + "type": "string", + "description": "Container code" + }, + "ContainerName": { + "type": "string", + "description": "Container name" + }, + "Volume": { + "type": "string", + "description": "Required volume" + }, + "SpecimenType": { + "type": "string", + "description": "Specimen type" + } + } + }, + "SpecimenPrep": { + "type": "object", + "properties": { + "PrepID": { + "type": "integer", + "description": "Preparation ID" + }, + "PrepCode": { + "type": "string", + "description": "Preparation code" + }, + "PrepName": { + "type": "string", + "description": "Preparation name" + } + } + }, + "SpecimenStatus": { + "type": "object", + "properties": { + "StatusID": { + "type": "integer", + "description": "Status ID" + }, + "StatusCode": { + "type": "string", + "description": "Status code" + }, + "StatusName": { + "type": "string", + "description": "Status name" + } + } + }, + "Counter": { + "type": "object", + "properties": { + "CounterID": { + "type": "integer", + "description": "Counter ID" + }, + "CounterName": { + "type": "string", + "description": "Counter name" + }, + "CounterValue": { + "type": "integer", + "description": "Current counter value" + }, + "CounterPrefix": { + "type": "string", + "description": "Counter prefix" + }, + "CounterSuffix": { + "type": "string", + "description": "Counter suffix" + } + } + }, + "Error": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["failed"], + "description": "Error status" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "LoginRequest": { + "type": "object", + "required": ["username", "password"], + "properties": { + "username": { + "type": "string", + "description": "Username" + }, + "password": { + "type": "string", + "format": "password", + "description": "Password" + } + } + }, + "LoginResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["success"] + }, + "code": { + "type": "integer", + "description": "HTTP status code" + }, + "message": { + "type": "string", + "description": "Response message" + } + } + } + } + }, + "security": [ + { + "jwtAuth": [] + } + ], + "paths": { + "/v2/auth/login": { + "post": { + "tags": ["Authentication"], + "summary": "User login", + "description": "Authenticate user and receive JWT token in HTTP-only cookie", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Login successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "401": { + "description": "Invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v2/auth/logout": { + "post": { + "tags": ["Authentication"], + "summary": "User logout", + "description": "Clear JWT token cookie", + "responses": { + "200": { + "description": "Logout successful" + } + } + } + }, + "/v2/auth/check": { + "get": { + "tags": ["Authentication"], + "summary": "Check authentication status", + "description": "Verify if JWT token is valid", + "responses": { + "200": { + "description": "Authenticated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + }, + "401": { + "description": "Not authenticated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/api/auth/login": { + "post": { + "tags": ["Authentication"], + "summary": "User login (legacy)", + "description": "Authenticate user and receive JWT token in HTTP-only cookie", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Login successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "401": { + "description": "Invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/api/auth/register": { + "post": { + "tags": ["Authentication"], + "summary": "Register new user", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["username", "password"], + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "User created successfully" + }, + "409": { + "description": "Username already exists" + } + } + } + }, + "/api/patient": { + "get": { + "tags": ["Patient"], + "summary": "List patients", + "description": "Get list of patients with optional filtering", + "parameters": [ + { + "name": "InternalPID", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "PatientID", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "Name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "Birthdate", + "in": "query", + "schema": { + "type": "string", + "format": "date" + } + } + ], + "responses": { + "200": { + "description": "List of patients", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + } + } + }, + "post": { + "tags": ["Patient"], + "summary": "Create patient", + "description": "Create a new patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Patient" + } + } + } + }, + "responses": { + "201": { + "description": "Patient created successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "patch": { + "tags": ["Patient"], + "summary": "Update patient", + "description": "Update an existing patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Patient" + } + } + } + }, + "responses": { + "200": { + "description": "Patient updated successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "delete": { + "tags": ["Patient"], + "summary": "Delete patient (soft delete)", + "description": "Soft delete a patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["InternalPID"], + "properties": { + "InternalPID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Patient deleted successfully" + }, + "400": { + "description": "Invalid patient ID" + }, + "404": { + "description": "Patient not found" + } + } + } + }, + "/api/patient/{InternalPID}": { + "get": { + "tags": ["Patient"], + "summary": "Get patient by ID", + "parameters": [ + { + "name": "InternalPID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Patient details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + } + } + } + }, + "/api/patient/check": { + "get": { + "tags": ["Patient"], + "summary": "Check patient existence", + "parameters": [ + { + "name": "PatientID", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "EmailAddress1", + "in": "query", + "schema": { + "type": "string", + "format": "email" + } + } + ], + "responses": { + "200": { + "description": "Check result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "message": { + "type": "string" + }, + "data": { + "type": "boolean", + "description": "true if not exists (available), false if exists" + } + } + } + } + } + }, + "400": { + "description": "Missing required parameter" + } + } + } + }, + "/api/patvisit": { + "get": { + "tags": ["Patient Visit"], + "summary": "List patient visits", + "responses": { + "200": { + "description": "List of visits" + } + } + }, + "post": { + "tags": ["Patient Visit"], + "summary": "Create patient visit", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatVisit" + } + } + } + }, + "responses": { + "201": { + "description": "Visit created successfully" + } + } + }, + "patch": { + "tags": ["Patient Visit"], + "summary": "Update patient visit", + "responses": { + "200": { + "description": "Visit updated successfully" + } + } + }, + "delete": { + "tags": ["Patient Visit"], + "summary": "Delete patient visit (soft delete)", + "responses": { + "200": { + "description": "Visit deleted successfully" + } + } + } + }, + "/api/patvisit/patient/{InternalPID}": { + "get": { + "tags": ["Patient Visit"], + "summary": "Get visits by patient", + "parameters": [ + { + "name": "InternalPID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "List of patient visits" + } + } + } + }, + "/api/patvisit/{PatVisitID}": { + "get": { + "tags": ["Patient Visit"], + "summary": "Get visit by ID", + "parameters": [ + { + "name": "PatVisitID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Visit details" + } + } + } + }, + "/api/ordertest": { + "get": { + "tags": ["Order Test"], + "summary": "List test orders", + "parameters": [ + { + "name": "InternalPID", + "in": "query", + "schema": { + "type": "integer" + }, + "description": "Filter by patient ID" + } + ], + "responses": { + "200": { + "description": "List of orders" + } + } + }, + "post": { + "tags": ["Order Test"], + "summary": "Create test order", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["InternalPID"], + "properties": { + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "PatVisitID": { + "type": "integer", + "description": "Visit ID (optional)" + }, + "Priority": { + "type": "string", + "description": "Order priority" + }, + "Tests": { + "type": "array", + "items": { + "type": "integer", + "description": "Test IDs" + } + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Order created successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "patch": { + "tags": ["Order Test"], + "summary": "Update test order", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OrderID": { + "type": "integer" + }, + "Priority": { + "type": "string" + }, + "OrderStatus": { + "type": "string" + }, + "OrderingProvider": { + "type": "string" + }, + "DepartmentID": { + "type": "integer" + }, + "WorkstationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Order updated successfully" + } + } + }, + "delete": { + "tags": ["Order Test"], + "summary": "Delete test order (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["OrderID"], + "properties": { + "OrderID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Order deleted successfully" + } + } + } + }, + "/api/ordertest/{OrderID}": { + "get": { + "tags": ["Order Test"], + "summary": "Get order by ID", + "parameters": [ + { + "name": "OrderID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Order details" + } + } + } + }, + "/api/ordertest/status": { + "post": { + "tags": ["Order Test"], + "summary": "Update order status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["OrderID", "OrderStatus"], + "properties": { + "OrderID": { + "type": "integer" + }, + "OrderStatus": { + "type": "string", + "enum": ["ORD", "SCH", "ANA", "VER", "REV", "REP"], + "description": "Order status code" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Status updated successfully" + }, + "400": { + "description": "Invalid status" + } + } + } + }, + "/api/specimen": { + "get": { + "tags": ["Specimen"], + "summary": "List specimens", + "responses": { + "200": { + "description": "List of specimens" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Specimen" + } + } + } + }, + "responses": { + "201": { + "description": "Specimen created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Specimen" + } + } + } + }, + "responses": { + "200": { + "description": "Specimen updated successfully" + } + } + } + }, + "/api/specimen/{SID}": { + "get": { + "tags": ["Specimen"], + "summary": "Get specimen by ID", + "parameters": [ + { + "name": "SID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Specimen details" + } + } + } + }, + "/api/specimen/container": { + "get": { + "tags": ["Specimen"], + "summary": "List container definitions", + "responses": { + "200": { + "description": "List of containers" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create container definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenContainerDef" + } + } + } + }, + "responses": { + "201": { + "description": "Container created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update container definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenContainerDef" + } + } + } + }, + "responses": { + "200": { + "description": "Container updated successfully" + } + } + } + }, + "/api/specimen/container/{ContainerDefID}": { + "get": { + "tags": ["Specimen"], + "summary": "Get container definition by ID", + "parameters": [ + { + "name": "ContainerDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Container details" + } + } + } + }, + "/api/specimen/prep": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen preparations", + "responses": { + "200": { + "description": "List of preparations" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen preparation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenPrep" + } + } + } + }, + "responses": { + "201": { + "description": "Preparation created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen preparation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenPrep" + } + } + } + }, + "responses": { + "200": { + "description": "Preparation updated successfully" + } + } + } + }, + "/api/specimen/status": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen statuses", + "responses": { + "200": { + "description": "List of statuses" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenStatus" + } + } + } + }, + "responses": { + "201": { + "description": "Status created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenStatus" + } + } + } + }, + "responses": { + "200": { + "description": "Status updated successfully" + } + } + } + }, + "/api/specimen/collection": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen collections", + "responses": { + "200": { + "description": "List of collections" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen collection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "Collection created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen collection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Collection updated successfully" + } + } + } + }, + "/api/tests": { + "get": { + "tags": ["Tests"], + "summary": "List test definitions", + "responses": { + "200": { + "description": "List of tests" + } + } + }, + "post": { + "tags": ["Tests"], + "summary": "Create test definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDefinition" + } + } + } + }, + "responses": { + "201": { + "description": "Test created successfully" + } + } + }, + "patch": { + "tags": ["Tests"], + "summary": "Update test definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDefinition" + } + } + } + }, + "responses": { + "200": { + "description": "Test updated successfully" + } + } + } + }, + "/api/tests/{TestID}": { + "get": { + "tags": ["Tests"], + "summary": "Get test definition by ID", + "parameters": [ + { + "name": "TestID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Test details" + } + } + } + }, + "/api/location": { + "get": { + "tags": ["Location"], + "summary": "List locations", + "responses": { + "200": { + "description": "List of locations" + } + } + }, + "post": { + "tags": ["Location"], + "summary": "Create location", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Location" + } + } + } + }, + "responses": { + "201": { + "description": "Location created successfully" + } + } + }, + "patch": { + "tags": ["Location"], + "summary": "Update location", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Location" + } + } + } + }, + "responses": { + "200": { + "description": "Location updated successfully" + } + } + }, + "delete": { + "tags": ["Location"], + "summary": "Delete location (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["LocationID"], + "properties": { + "LocationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Location deleted successfully" + } + } + } + }, + "/api/location/{LocationID}": { + "get": { + "tags": ["Location"], + "summary": "Get location by ID", + "parameters": [ + { + "name": "LocationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Location details" + } + } + } + }, + "/api/contact": { + "get": { + "tags": ["Contact"], + "summary": "List contacts", + "responses": { + "200": { + "description": "List of contacts" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create contact", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contact" + } + } + } + }, + "responses": { + "201": { + "description": "Contact created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update contact", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contact" + } + } + } + }, + "responses": { + "200": { + "description": "Contact updated successfully" + } + } + }, + "delete": { + "tags": ["Contact"], + "summary": "Delete contact (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["ContactID"], + "properties": { + "ContactID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Contact deleted successfully" + } + } + } + }, + "/api/contact/{ContactID}": { + "get": { + "tags": ["Contact"], + "summary": "Get contact by ID", + "parameters": [ + { + "name": "ContactID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Contact details" + } + } + } + }, + "/api/occupation": { + "get": { + "tags": ["Contact"], + "summary": "List occupations", + "responses": { + "200": { + "description": "List of occupations" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create occupation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OccupationCode": { + "type": "string" + }, + "OccupationName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Occupation created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update occupation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OccupationID": { + "type": "integer" + }, + "OccupationCode": { + "type": "string" + }, + "OccupationName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Occupation updated successfully" + } + } + } + }, + "/api/occupation/{OccupationID}": { + "get": { + "tags": ["Contact"], + "summary": "Get occupation by ID", + "parameters": [ + { + "name": "OccupationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Occupation details" + } + } + } + }, + "/api/medicalspecialty": { + "get": { + "tags": ["Contact"], + "summary": "List medical specialties", + "responses": { + "200": { + "description": "List of specialties" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create medical specialty", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SpecialtyCode": { + "type": "string" + }, + "SpecialtyName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Specialty created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update medical specialty", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SpecialtyID": { + "type": "integer" + }, + "SpecialtyCode": { + "type": "string" + }, + "SpecialtyName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Specialty updated successfully" + } + } + } + }, + "/api/medicalspecialty/{SpecialtyID}": { + "get": { + "tags": ["Contact"], + "summary": "Get medical specialty by ID", + "parameters": [ + { + "name": "SpecialtyID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Specialty details" + } + } + } + }, + "/api/organization/account": { + "get": { + "tags": ["Organization"], + "summary": "List accounts", + "responses": { + "200": { + "description": "List of accounts" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create account", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "responses": { + "201": { + "description": "Account created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update account", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "responses": { + "200": { + "description": "Account updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete account (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["AccountID"], + "properties": { + "AccountID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Account deleted successfully" + } + } + } + }, + "/api/organization/account/{AccountID}": { + "get": { + "tags": ["Organization"], + "summary": "Get account by ID", + "parameters": [ + { + "name": "AccountID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Account details" + } + } + } + }, + "/api/organization/site": { + "get": { + "tags": ["Organization"], + "summary": "List sites", + "responses": { + "200": { + "description": "List of sites" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create site", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Site" + } + } + } + }, + "responses": { + "201": { + "description": "Site created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update site", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Site" + } + } + } + }, + "responses": { + "200": { + "description": "Site updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete site (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["SiteID"], + "properties": { + "SiteID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Site deleted successfully" + } + } + } + }, + "/api/organization/site/{SiteID}": { + "get": { + "tags": ["Organization"], + "summary": "Get site by ID", + "parameters": [ + { + "name": "SiteID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Site details" + } + } + } + }, + "/api/organization/discipline": { + "get": { + "tags": ["Organization"], + "summary": "List disciplines", + "responses": { + "200": { + "description": "List of disciplines" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create discipline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Discipline" + } + } + } + }, + "responses": { + "201": { + "description": "Discipline created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update discipline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Discipline" + } + } + } + }, + "responses": { + "200": { + "description": "Discipline updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete discipline (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["DisciplineID"], + "properties": { + "DisciplineID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Discipline deleted successfully" + } + } + } + }, + "/api/organization/discipline/{DisciplineID}": { + "get": { + "tags": ["Organization"], + "summary": "Get discipline by ID", + "parameters": [ + { + "name": "DisciplineID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Discipline details" + } + } + } + }, + "/api/organization/department": { + "get": { + "tags": ["Organization"], + "summary": "List departments", + "responses": { + "200": { + "description": "List of departments" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create department", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "201": { + "description": "Department created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update department", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "200": { + "description": "Department updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete department (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["DepartmentID"], + "properties": { + "DepartmentID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Department deleted successfully" + } + } + } + }, + "/api/organization/department/{DepartmentID}": { + "get": { + "tags": ["Organization"], + "summary": "Get department by ID", + "parameters": [ + { + "name": "DepartmentID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Department details" + } + } + } + }, + "/api/organization/workstation": { + "get": { + "tags": ["Organization"], + "summary": "List workstations", + "responses": { + "200": { + "description": "List of workstations" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create workstation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Workstation" + } + } + } + }, + "responses": { + "201": { + "description": "Workstation created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update workstation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Workstation" + } + } + } + }, + "responses": { + "200": { + "description": "Workstation updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete workstation (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["WorkstationID"], + "properties": { + "WorkstationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Workstation deleted successfully" + } + } + } + }, + "/api/organization/workstation/{WorkstationID}": { + "get": { + "tags": ["Organization"], + "summary": "Get workstation by ID", + "parameters": [ + { + "name": "WorkstationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Workstation details" + } + } + } + }, + "/api/valueset": { + "get": { + "tags": ["Value Set"], + "summary": "List value sets", + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "string" + }, + "description": "Filter by value set key" + } + ], + "responses": { + "200": { + "description": "List of value sets" + } + } + }, + "post": { + "tags": ["Value Set"], + "summary": "Refresh value sets", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Value set key to refresh" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Value sets refreshed" + } + } + } + }, + "/api/valueset/{key}": { + "get": { + "tags": ["Value Set"], + "summary": "Get value set by key", + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Value set details" + } + } + } + }, + "/api/valueset/items": { + "get": { + "tags": ["Value Set"], + "summary": "List value set items", + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "string" + }, + "description": "Filter by value set key" + } + ], + "responses": { + "200": { + "description": "List of value set items" + } + } + }, + "post": { + "tags": ["Value Set"], + "summary": "Create value set item", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ValueSetID": { + "type": "integer" + }, + "Value": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "Sequence": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Item created successfully" + } + } + } + }, + "/api/valueset/items/{ItemID}": { + "get": { + "tags": ["Value Set"], + "summary": "Get value set item by ID", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Item details" + } + } + }, + "put": { + "tags": ["Value Set"], + "summary": "Update value set item", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Value": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "Sequence": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Item updated successfully" + } + } + }, + "delete": { + "tags": ["Value Set"], + "summary": "Delete value set item", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Item deleted successfully" + } + } + } + }, + "/api/result/valueset": { + "get": { + "tags": ["Result Value Set"], + "summary": "List result value sets", + "description": "CRUD operations for result value sets", + "responses": { + "200": { + "description": "List of result value sets" + } + } + }, + "post": { + "tags": ["Result Value Set"], + "summary": "Create result value set", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSet" + } + } + } + }, + "responses": { + "201": { + "description": "Value set created successfully" + } + } + } + }, + "/api/result/valueset/{ValueSetID}": { + "get": { + "tags": ["Result Value Set"], + "summary": "Get result value set by ID", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Value set details" + } + } + }, + "put": { + "tags": ["Result Value Set"], + "summary": "Update result value set", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSet" + } + } + } + }, + "responses": { + "200": { + "description": "Value set updated successfully" + } + } + }, + "delete": { + "tags": ["Result Value Set"], + "summary": "Delete result value set", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Value set deleted successfully" + } + } + } + }, + "/api/result/valuesetdef": { + "get": { + "tags": ["Result Value Set Definition"], + "summary": "List value set definitions", + "description": "CRUD operations for value set definitions", + "responses": { + "200": { + "description": "List of value set definitions" + } + } + }, + "post": { + "tags": ["Result Value Set Definition"], + "summary": "Create value set definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSetDef" + } + } + } + }, + "responses": { + "201": { + "description": "Definition created successfully" + } + } + } + }, + "/api/result/valuesetdef/{VSetDefID}": { + "get": { + "tags": ["Result Value Set Definition"], + "summary": "Get value set definition by ID", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Definition details" + } + } + }, + "put": { + "tags": ["Result Value Set Definition"], + "summary": "Update value set definition", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSetDef" + } + } + } + }, + "responses": { + "200": { + "description": "Definition updated successfully" + } + } + }, + "delete": { + "tags": ["Result Value Set Definition"], + "summary": "Delete value set definition", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Definition deleted successfully" + } + } + } + }, + "/api/counter": { + "get": { + "tags": ["Counter"], + "summary": "List counters", + "responses": { + "200": { + "description": "List of counters" + } + } + }, + "post": { + "tags": ["Counter"], + "summary": "Create counter", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Counter" + } + } + } + }, + "responses": { + "201": { + "description": "Counter created successfully" + } + } + }, + "patch": { + "tags": ["Counter"], + "summary": "Update counter", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Counter" + } + } + } + }, + "responses": { + "200": { + "description": "Counter updated successfully" + } + } + }, + "delete": { + "tags": ["Counter"], + "summary": "Delete counter (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["CounterID"], + "properties": { + "CounterID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Counter deleted successfully" + } + } + } + }, + "/api/counter/{CounterID}": { + "get": { + "tags": ["Counter"], + "summary": "Get counter by ID", + "parameters": [ + { + "name": "CounterID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Counter details" + } + } + } + }, + "/api/areageo": { + "get": { + "tags": ["Area Geo"], + "summary": "List geographic areas", + "responses": { + "200": { + "description": "List of geographic areas" + } + } + } + }, + "/api/areageo/provinces": { + "get": { + "tags": ["Area Geo"], + "summary": "List provinces", + "responses": { + "200": { + "description": "List of provinces" + } + } + } + }, + "/api/areageo/cities": { + "get": { + "tags": ["Area Geo"], + "summary": "List cities", + "parameters": [ + { + "name": "province_id", + "in": "query", + "schema": { + "type": "integer" + }, + "description": "Filter by province ID" + } + ], + "responses": { + "200": { + "description": "List of cities" + } + } + } + }, + "/api/demo/order": { + "post": { + "tags": ["Demo"], + "summary": "Create demo order", + "description": "Create a demo test order (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "Demo order created" + } + } + } + }, + "/api/demo/orders": { + "get": { + "tags": ["Demo"], + "summary": "List demo orders", + "description": "List demo test orders (no auth required)", + "responses": { + "200": { + "description": "List of demo orders" + } + } + } + }, + "/api/edge/results": { + "post": { + "tags": ["Edge"], + "summary": "Receive instrument results", + "description": "Receive test results from tiny-edge middleware (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Results received" + } + } + } + }, + "/api/edge/orders": { + "get": { + "tags": ["Edge"], + "summary": "Get orders for edge", + "description": "Get orders for instrument integration (no auth required)", + "responses": { + "200": { + "description": "Orders for edge" + } + } + } + }, + "/api/edge/orders/{OrderID}/ack": { + "post": { + "tags": ["Edge"], + "summary": "Acknowledge order", + "description": "Acknowledge order receipt by edge (no auth required)", + "parameters": [ + { + "name": "OrderID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Order acknowledged" + } + } + } + }, + "/api/edge/status": { + "post": { + "tags": ["Edge"], + "summary": "Receive instrument status", + "description": "Receive status updates from instruments (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Status received" + } + } + } + } + }, + "tags": [ + { + "name": "Authentication", + "description": "User authentication endpoints" + }, + { + "name": "Patient", + "description": "Patient management endpoints" + }, + { + "name": "Patient Visit", + "description": "Patient visit management endpoints" + }, + { + "name": "Order Test", + "description": "Test order management endpoints" + }, + { + "name": "Specimen", + "description": "Specimen management endpoints" + }, + { + "name": "Tests", + "description": "Test definition endpoints" + }, + { + "name": "Location", + "description": "Location management endpoints" + }, + { + "name": "Contact", + "description": "Contact management endpoints" + }, + { + "name": "Organization", + "description": "Organization management endpoints" + }, + { + "name": "Value Set", + "description": "Value set library endpoints" + }, + { + "name": "Result Value Set", + "description": "Result-specific value set CRUD endpoints" + }, + { + "name": "Result Value Set Definition", + "description": "Value set definition CRUD endpoints" + }, + { + "name": "Counter", + "description": "Counter management endpoints" + }, + { + "name": "Area Geo", + "description": "Geographic area endpoints" + }, + { + "name": "Demo", + "description": "Demo/test endpoints (no auth)" + }, + { + "name": "Edge", + "description": "Instrument integration endpoints (no auth)" + } + ] +} diff --git a/public/docs.html b/public/docs.html new file mode 100644 index 0000000..0c24423 --- /dev/null +++ b/public/docs.html @@ -0,0 +1,17 @@ + + + + + + + Elements in HTML + + + + + + + + + + \ No newline at end of file diff --git a/public/openapi.yaml b/public/openapi.yaml new file mode 100644 index 0000000..9000ef3 --- /dev/null +++ b/public/openapi.yaml @@ -0,0 +1,3287 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "CLQMS API", + "description": "Clinical Laboratory Quality Management System REST API", + "version": "1.0.0", + "contact": { + "name": "CLQMS Development Team" + } + }, + "servers": [ + { + "url": "http://localhost/clqms01/", + "description": "Development server" + } + ], + "components": { + "securitySchemes": { + "jwtAuth": { + "type": "apiKey", + "in": "cookie", + "name": "token", + "description": "JWT token stored in HTTP-only cookie" + } + }, + "schemas": { + "ApiResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["success", "failed"], + "description": "Response status" + }, + "message": { + "type": "string", + "description": "Response message" + }, + "data": { + "type": "object", + "description": "Response data payload" + } + } + }, + "Patient": { + "type": "object", + "properties": { + "InternalPID": { + "type": "integer", + "description": "Internal patient ID" + }, + "PatientID": { + "type": "string", + "maxLength": 30, + "description": "Patient identifier" + }, + "AlternatePID": { + "type": "string", + "maxLength": 30, + "description": "Alternate patient ID" + }, + "Prefix": { + "type": "string", + "maxLength": 10, + "description": "Name prefix" + }, + "NameFirst": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "First name" + }, + "NameMiddle": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Middle name" + }, + "NameLast": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Last name" + }, + "NameMaiden": { + "type": "string", + "minLength": 1, + "maxLength": 60, + "description": "Maiden name" + }, + "Suffix": { + "type": "string", + "maxLength": 10, + "description": "Name suffix" + }, + "Sex": { + "type": "string", + "description": "Gender (M/F)" + }, + "Birthdate": { + "type": "string", + "format": "date", + "description": "Date of birth" + }, + "PlaceOfBirth": { + "type": "string", + "maxLength": 100, + "description": "Place of birth" + }, + "Street_1": { + "type": "string", + "maxLength": 255, + "description": "Address line 1" + }, + "Street_2": { + "type": "string", + "maxLength": 255, + "description": "Address line 2" + }, + "Street_3": { + "type": "string", + "maxLength": 255, + "description": "Address line 3" + }, + "City": { + "type": "string", + "description": "City" + }, + "Province": { + "type": "string", + "description": "Province/State" + }, + "ZIP": { + "type": "string", + "maxLength": 10, + "description": "Postal code" + }, + "EmailAddress1": { + "type": "string", + "format": "email", + "maxLength": 100, + "description": "Primary email" + }, + "EmailAddress2": { + "type": "string", + "format": "email", + "maxLength": 100, + "description": "Secondary email" + }, + "Phone": { + "type": "string", + "pattern": "^\\+?[0-9]{8,15}$", + "description": "Phone number" + }, + "MobilePhone": { + "type": "string", + "pattern": "^\\+?[0-9]{8,15}$", + "description": "Mobile phone number" + }, + "PatIdt": { + "$ref": "#/components/schemas/PatientIdentifier" + }, + "PatAtt": { + "type": "array", + "items": { + "$ref": "#/components/schemas/PatientAttribute" + }, + "description": "Patient attributes/addresses" + } + } + }, + "PatientIdentifier": { + "type": "object", + "properties": { + "IdentifierType": { + "type": "string", + "description": "Identifier type (KTP, PASS, SSN, SIM, KTAS)" + }, + "Identifier": { + "type": "string", + "maxLength": 255, + "description": "Identifier value" + } + } + }, + "PatientAttribute": { + "type": "object", + "properties": { + "Address": { + "type": "string", + "description": "Patient address" + } + } + }, + "PatVisit": { + "type": "object", + "properties": { + "PatVisitID": { + "type": "integer", + "description": "Patient visit ID" + }, + "InternalPID": { + "type": "integer", + "description": "Internal patient ID" + }, + "VisitDate": { + "type": "string", + "format": "date-time", + "description": "Visit date/time" + }, + "VisitType": { + "type": "string", + "description": "Type of visit" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "ProviderID": { + "type": "integer", + "description": "Provider/Doctor ID" + }, + "VisitStatus": { + "type": "string", + "description": "Visit status" + } + } + }, + "OrderTest": { + "type": "object", + "properties": { + "OrderID": { + "type": "integer", + "description": "Order ID" + }, + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "PatVisitID": { + "type": "integer", + "description": "Visit ID" + }, + "OrderDateTime": { + "type": "string", + "format": "date-time", + "description": "Order date/time" + }, + "Priority": { + "type": "string", + "description": "Order priority" + }, + "OrderStatus": { + "type": "string", + "enum": ["ORD", "SCH", "ANA", "VER", "REV", "REP"], + "description": "Order status" + }, + "OrderingProvider": { + "type": "string", + "description": "Ordering provider" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "WorkstationID": { + "type": "integer", + "description": "Workstation ID" + }, + "Tests": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OrderTestItem" + } + } + } + }, + "OrderTestItem": { + "type": "object", + "properties": { + "TestID": { + "type": "integer", + "description": "Test ID" + }, + "TestCode": { + "type": "string", + "description": "Test code" + }, + "TestName": { + "type": "string", + "description": "Test name" + } + } + }, + "Specimen": { + "type": "object", + "properties": { + "SID": { + "type": "integer", + "description": "Specimen ID" + }, + "OrderID": { + "type": "integer", + "description": "Order ID" + }, + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "SpecimenType": { + "type": "string", + "description": "Specimen type" + }, + "ContainerCode": { + "type": "string", + "description": "Container code" + }, + "CollectionDateTime": { + "type": "string", + "format": "date-time", + "description": "Collection date/time" + }, + "ReceivedDateTime": { + "type": "string", + "format": "date-time", + "description": "Received date/time" + }, + "Status": { + "type": "string", + "description": "Specimen status" + } + } + }, + "TestDefinition": { + "type": "object", + "properties": { + "TestID": { + "type": "integer", + "description": "Test ID" + }, + "TestCode": { + "type": "string", + "description": "Test code" + }, + "TestName": { + "type": "string", + "description": "Test name" + }, + "SpecimenType": { + "type": "string", + "description": "Required specimen type" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "Category": { + "type": "string", + "description": "Test category" + } + } + }, + "ValueSet": { + "type": "object", + "properties": { + "ValueSetID": { + "type": "integer", + "description": "Value set ID" + }, + "ValueSetKey": { + "type": "string", + "description": "Value set key" + }, + "Name": { + "type": "string", + "description": "Value set name" + }, + "Description": { + "type": "string", + "description": "Value set description" + }, + "Items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ValueSetItem" + } + } + } + }, + "ValueSetItem": { + "type": "object", + "properties": { + "ItemID": { + "type": "integer", + "description": "Item ID" + }, + "Value": { + "type": "string", + "description": "Item value/code" + }, + "Label": { + "type": "string", + "description": "Item display label" + }, + "Sequence": { + "type": "integer", + "description": "Display order" + } + } + }, + "ValueSetDef": { + "type": "object", + "properties": { + "VSetDefID": { + "type": "integer", + "description": "Value set definition ID" + }, + "ValueSetKey": { + "type": "string", + "description": "Value set key" + }, + "Name": { + "type": "string", + "description": "Definition name" + } + } + }, + "Location": { + "type": "object", + "properties": { + "LocationID": { + "type": "integer", + "description": "Location ID" + }, + "Code": { + "type": "string", + "description": "Location code" + }, + "Name": { + "type": "string", + "description": "Location name" + }, + "Type": { + "type": "string", + "description": "Location type" + }, + "ParentID": { + "type": "integer", + "description": "Parent location ID" + } + } + }, + "Contact": { + "type": "object", + "properties": { + "ContactID": { + "type": "integer", + "description": "Contact ID" + }, + "Name": { + "type": "string", + "description": "Contact name" + }, + "Type": { + "type": "string", + "description": "Contact type" + }, + "Phone": { + "type": "string", + "description": "Phone number" + }, + "Email": { + "type": "string", + "format": "email", + "description": "Email address" + } + } + }, + "Organization": { + "type": "object", + "properties": { + "AccountID": { + "type": "integer", + "description": "Account ID" + }, + "AccountCode": { + "type": "string", + "description": "Account code" + }, + "AccountName": { + "type": "string", + "description": "Account name" + } + } + }, + "Site": { + "type": "object", + "properties": { + "SiteID": { + "type": "integer", + "description": "Site ID" + }, + "SiteCode": { + "type": "string", + "description": "Site code" + }, + "SiteName": { + "type": "string", + "description": "Site name" + }, + "AccountID": { + "type": "integer", + "description": "Account ID" + } + } + }, + "Department": { + "type": "object", + "properties": { + "DepartmentID": { + "type": "integer", + "description": "Department ID" + }, + "DepartmentCode": { + "type": "string", + "description": "Department code" + }, + "DepartmentName": { + "type": "string", + "description": "Department name" + }, + "SiteID": { + "type": "integer", + "description": "Site ID" + } + } + }, + "Discipline": { + "type": "object", + "properties": { + "DisciplineID": { + "type": "integer", + "description": "Discipline ID" + }, + "DisciplineCode": { + "type": "string", + "description": "Discipline code" + }, + "DisciplineName": { + "type": "string", + "description": "Discipline name" + } + } + }, + "Workstation": { + "type": "object", + "properties": { + "WorkstationID": { + "type": "integer", + "description": "Workstation ID" + }, + "WorkstationCode": { + "type": "string", + "description": "Workstation code" + }, + "WorkstationName": { + "type": "string", + "description": "Workstation name" + }, + "DepartmentID": { + "type": "integer", + "description": "Department ID" + } + } + }, + "AreaGeo": { + "type": "object", + "properties": { + "AreaGeoID": { + "type": "integer", + "description": "Area ID" + }, + "ParentID": { + "type": "integer", + "description": "Parent area ID" + }, + "AreaName": { + "type": "string", + "description": "Area name" + }, + "Level": { + "type": "integer", + "description": "Geographic level" + } + } + }, + "SpecimenContainerDef": { + "type": "object", + "properties": { + "ContainerDefID": { + "type": "integer", + "description": "Container definition ID" + }, + "ContainerCode": { + "type": "string", + "description": "Container code" + }, + "ContainerName": { + "type": "string", + "description": "Container name" + }, + "Volume": { + "type": "string", + "description": "Required volume" + }, + "SpecimenType": { + "type": "string", + "description": "Specimen type" + } + } + }, + "SpecimenPrep": { + "type": "object", + "properties": { + "PrepID": { + "type": "integer", + "description": "Preparation ID" + }, + "PrepCode": { + "type": "string", + "description": "Preparation code" + }, + "PrepName": { + "type": "string", + "description": "Preparation name" + } + } + }, + "SpecimenStatus": { + "type": "object", + "properties": { + "StatusID": { + "type": "integer", + "description": "Status ID" + }, + "StatusCode": { + "type": "string", + "description": "Status code" + }, + "StatusName": { + "type": "string", + "description": "Status name" + } + } + }, + "Counter": { + "type": "object", + "properties": { + "CounterID": { + "type": "integer", + "description": "Counter ID" + }, + "CounterName": { + "type": "string", + "description": "Counter name" + }, + "CounterValue": { + "type": "integer", + "description": "Current counter value" + }, + "CounterPrefix": { + "type": "string", + "description": "Counter prefix" + }, + "CounterSuffix": { + "type": "string", + "description": "Counter suffix" + } + } + }, + "Error": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["failed"], + "description": "Error status" + }, + "message": { + "type": "string", + "description": "Error message" + } + } + }, + "LoginRequest": { + "type": "object", + "required": ["username", "password"], + "properties": { + "username": { + "type": "string", + "description": "Username" + }, + "password": { + "type": "string", + "format": "password", + "description": "Password" + } + } + }, + "LoginResponse": { + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": ["success"] + }, + "code": { + "type": "integer", + "description": "HTTP status code" + }, + "message": { + "type": "string", + "description": "Response message" + } + } + } + } + }, + "security": [ + { + "jwtAuth": [] + } + ], + "paths": { + "/v2/auth/login": { + "post": { + "tags": ["Authentication"], + "summary": "User login", + "description": "Authenticate user and receive JWT token in HTTP-only cookie", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Login successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "401": { + "description": "Invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/v2/auth/logout": { + "post": { + "tags": ["Authentication"], + "summary": "User logout", + "description": "Clear JWT token cookie", + "responses": { + "200": { + "description": "Logout successful" + } + } + } + }, + "/v2/auth/check": { + "get": { + "tags": ["Authentication"], + "summary": "Check authentication status", + "description": "Verify if JWT token is valid", + "responses": { + "200": { + "description": "Authenticated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + }, + "401": { + "description": "Not authenticated", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/api/auth/login": { + "post": { + "tags": ["Authentication"], + "summary": "User login (legacy)", + "description": "Authenticate user and receive JWT token in HTTP-only cookie", + "requestBody": { + "required": true, + "content": { + "application/x-www-form-urlencoded": { + "schema": { + "$ref": "#/components/schemas/LoginRequest" + } + } + } + }, + "responses": { + "200": { + "description": "Login successful", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LoginResponse" + } + } + } + }, + "401": { + "description": "Invalid credentials", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + } + } + } + }, + "/api/auth/register": { + "post": { + "tags": ["Authentication"], + "summary": "Register new user", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["username", "password"], + "properties": { + "username": { + "type": "string" + }, + "password": { + "type": "string", + "format": "password" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "User created successfully" + }, + "409": { + "description": "Username already exists" + } + } + } + }, + "/api/patient": { + "get": { + "tags": ["Patient"], + "summary": "List patients", + "description": "Get list of patients with optional filtering", + "parameters": [ + { + "name": "InternalPID", + "in": "query", + "schema": { + "type": "integer" + } + }, + { + "name": "PatientID", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "Name", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "Birthdate", + "in": "query", + "schema": { + "type": "string", + "format": "date" + } + } + ], + "responses": { + "200": { + "description": "List of patients", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + } + } + }, + "post": { + "tags": ["Patient"], + "summary": "Create patient", + "description": "Create a new patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Patient" + } + } + } + }, + "responses": { + "201": { + "description": "Patient created successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "patch": { + "tags": ["Patient"], + "summary": "Update patient", + "description": "Update an existing patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Patient" + } + } + } + }, + "responses": { + "200": { + "description": "Patient updated successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "delete": { + "tags": ["Patient"], + "summary": "Delete patient (soft delete)", + "description": "Soft delete a patient record", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["InternalPID"], + "properties": { + "InternalPID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Patient deleted successfully" + }, + "400": { + "description": "Invalid patient ID" + }, + "404": { + "description": "Patient not found" + } + } + } + }, + "/api/patient/{InternalPID}": { + "get": { + "tags": ["Patient"], + "summary": "Get patient by ID", + "parameters": [ + { + "name": "InternalPID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Patient details", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ApiResponse" + } + } + } + } + } + } + }, + "/api/patient/check": { + "get": { + "tags": ["Patient"], + "summary": "Check patient existence", + "parameters": [ + { + "name": "PatientID", + "in": "query", + "schema": { + "type": "string" + } + }, + { + "name": "EmailAddress1", + "in": "query", + "schema": { + "type": "string", + "format": "email" + } + } + ], + "responses": { + "200": { + "description": "Check result", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "status": { + "type": "string" + }, + "message": { + "type": "string" + }, + "data": { + "type": "boolean", + "description": "true if not exists (available), false if exists" + } + } + } + } + } + }, + "400": { + "description": "Missing required parameter" + } + } + } + }, + "/api/patvisit": { + "get": { + "tags": ["Patient Visit"], + "summary": "List patient visits", + "responses": { + "200": { + "description": "List of visits" + } + } + }, + "post": { + "tags": ["Patient Visit"], + "summary": "Create patient visit", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PatVisit" + } + } + } + }, + "responses": { + "201": { + "description": "Visit created successfully" + } + } + }, + "patch": { + "tags": ["Patient Visit"], + "summary": "Update patient visit", + "responses": { + "200": { + "description": "Visit updated successfully" + } + } + }, + "delete": { + "tags": ["Patient Visit"], + "summary": "Delete patient visit (soft delete)", + "responses": { + "200": { + "description": "Visit deleted successfully" + } + } + } + }, + "/api/patvisit/patient/{InternalPID}": { + "get": { + "tags": ["Patient Visit"], + "summary": "Get visits by patient", + "parameters": [ + { + "name": "InternalPID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "List of patient visits" + } + } + } + }, + "/api/patvisit/{PatVisitID}": { + "get": { + "tags": ["Patient Visit"], + "summary": "Get visit by ID", + "parameters": [ + { + "name": "PatVisitID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Visit details" + } + } + } + }, + "/api/ordertest": { + "get": { + "tags": ["Order Test"], + "summary": "List test orders", + "parameters": [ + { + "name": "InternalPID", + "in": "query", + "schema": { + "type": "integer" + }, + "description": "Filter by patient ID" + } + ], + "responses": { + "200": { + "description": "List of orders" + } + } + }, + "post": { + "tags": ["Order Test"], + "summary": "Create test order", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["InternalPID"], + "properties": { + "InternalPID": { + "type": "integer", + "description": "Patient ID" + }, + "PatVisitID": { + "type": "integer", + "description": "Visit ID (optional)" + }, + "Priority": { + "type": "string", + "description": "Order priority" + }, + "Tests": { + "type": "array", + "items": { + "type": "integer", + "description": "Test IDs" + } + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Order created successfully" + }, + "400": { + "description": "Validation error" + } + } + }, + "patch": { + "tags": ["Order Test"], + "summary": "Update test order", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OrderID": { + "type": "integer" + }, + "Priority": { + "type": "string" + }, + "OrderStatus": { + "type": "string" + }, + "OrderingProvider": { + "type": "string" + }, + "DepartmentID": { + "type": "integer" + }, + "WorkstationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Order updated successfully" + } + } + }, + "delete": { + "tags": ["Order Test"], + "summary": "Delete test order (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["OrderID"], + "properties": { + "OrderID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Order deleted successfully" + } + } + } + }, + "/api/ordertest/{OrderID}": { + "get": { + "tags": ["Order Test"], + "summary": "Get order by ID", + "parameters": [ + { + "name": "OrderID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Order details" + } + } + } + }, + "/api/ordertest/status": { + "post": { + "tags": ["Order Test"], + "summary": "Update order status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["OrderID", "OrderStatus"], + "properties": { + "OrderID": { + "type": "integer" + }, + "OrderStatus": { + "type": "string", + "enum": ["ORD", "SCH", "ANA", "VER", "REV", "REP"], + "description": "Order status code" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Status updated successfully" + }, + "400": { + "description": "Invalid status" + } + } + } + }, + "/api/specimen": { + "get": { + "tags": ["Specimen"], + "summary": "List specimens", + "responses": { + "200": { + "description": "List of specimens" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Specimen" + } + } + } + }, + "responses": { + "201": { + "description": "Specimen created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Specimen" + } + } + } + }, + "responses": { + "200": { + "description": "Specimen updated successfully" + } + } + } + }, + "/api/specimen/{SID}": { + "get": { + "tags": ["Specimen"], + "summary": "Get specimen by ID", + "parameters": [ + { + "name": "SID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Specimen details" + } + } + } + }, + "/api/specimen/container": { + "get": { + "tags": ["Specimen"], + "summary": "List container definitions", + "responses": { + "200": { + "description": "List of containers" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create container definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenContainerDef" + } + } + } + }, + "responses": { + "201": { + "description": "Container created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update container definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenContainerDef" + } + } + } + }, + "responses": { + "200": { + "description": "Container updated successfully" + } + } + } + }, + "/api/specimen/container/{ContainerDefID}": { + "get": { + "tags": ["Specimen"], + "summary": "Get container definition by ID", + "parameters": [ + { + "name": "ContainerDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Container details" + } + } + } + }, + "/api/specimen/prep": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen preparations", + "responses": { + "200": { + "description": "List of preparations" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen preparation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenPrep" + } + } + } + }, + "responses": { + "201": { + "description": "Preparation created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen preparation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenPrep" + } + } + } + }, + "responses": { + "200": { + "description": "Preparation updated successfully" + } + } + } + }, + "/api/specimen/status": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen statuses", + "responses": { + "200": { + "description": "List of statuses" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenStatus" + } + } + } + }, + "responses": { + "201": { + "description": "Status created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen status", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SpecimenStatus" + } + } + } + }, + "responses": { + "200": { + "description": "Status updated successfully" + } + } + } + }, + "/api/specimen/collection": { + "get": { + "tags": ["Specimen"], + "summary": "List specimen collections", + "responses": { + "200": { + "description": "List of collections" + } + } + }, + "post": { + "tags": ["Specimen"], + "summary": "Create specimen collection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "Collection created successfully" + } + } + }, + "patch": { + "tags": ["Specimen"], + "summary": "Update specimen collection", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Collection updated successfully" + } + } + } + }, + "/api/tests": { + "get": { + "tags": ["Tests"], + "summary": "List test definitions", + "responses": { + "200": { + "description": "List of tests" + } + } + }, + "post": { + "tags": ["Tests"], + "summary": "Create test definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDefinition" + } + } + } + }, + "responses": { + "201": { + "description": "Test created successfully" + } + } + }, + "patch": { + "tags": ["Tests"], + "summary": "Update test definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/TestDefinition" + } + } + } + }, + "responses": { + "200": { + "description": "Test updated successfully" + } + } + } + }, + "/api/tests/{TestID}": { + "get": { + "tags": ["Tests"], + "summary": "Get test definition by ID", + "parameters": [ + { + "name": "TestID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Test details" + } + } + } + }, + "/api/location": { + "get": { + "tags": ["Location"], + "summary": "List locations", + "responses": { + "200": { + "description": "List of locations" + } + } + }, + "post": { + "tags": ["Location"], + "summary": "Create location", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Location" + } + } + } + }, + "responses": { + "201": { + "description": "Location created successfully" + } + } + }, + "patch": { + "tags": ["Location"], + "summary": "Update location", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Location" + } + } + } + }, + "responses": { + "200": { + "description": "Location updated successfully" + } + } + }, + "delete": { + "tags": ["Location"], + "summary": "Delete location (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["LocationID"], + "properties": { + "LocationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Location deleted successfully" + } + } + } + }, + "/api/location/{LocationID}": { + "get": { + "tags": ["Location"], + "summary": "Get location by ID", + "parameters": [ + { + "name": "LocationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Location details" + } + } + } + }, + "/api/contact": { + "get": { + "tags": ["Contact"], + "summary": "List contacts", + "responses": { + "200": { + "description": "List of contacts" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create contact", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contact" + } + } + } + }, + "responses": { + "201": { + "description": "Contact created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update contact", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Contact" + } + } + } + }, + "responses": { + "200": { + "description": "Contact updated successfully" + } + } + }, + "delete": { + "tags": ["Contact"], + "summary": "Delete contact (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["ContactID"], + "properties": { + "ContactID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Contact deleted successfully" + } + } + } + }, + "/api/contact/{ContactID}": { + "get": { + "tags": ["Contact"], + "summary": "Get contact by ID", + "parameters": [ + { + "name": "ContactID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Contact details" + } + } + } + }, + "/api/occupation": { + "get": { + "tags": ["Contact"], + "summary": "List occupations", + "responses": { + "200": { + "description": "List of occupations" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create occupation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OccupationCode": { + "type": "string" + }, + "OccupationName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Occupation created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update occupation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "OccupationID": { + "type": "integer" + }, + "OccupationCode": { + "type": "string" + }, + "OccupationName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Occupation updated successfully" + } + } + } + }, + "/api/occupation/{OccupationID}": { + "get": { + "tags": ["Contact"], + "summary": "Get occupation by ID", + "parameters": [ + { + "name": "OccupationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Occupation details" + } + } + } + }, + "/api/medicalspecialty": { + "get": { + "tags": ["Contact"], + "summary": "List medical specialties", + "responses": { + "200": { + "description": "List of specialties" + } + } + }, + "post": { + "tags": ["Contact"], + "summary": "Create medical specialty", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SpecialtyCode": { + "type": "string" + }, + "SpecialtyName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Specialty created successfully" + } + } + }, + "patch": { + "tags": ["Contact"], + "summary": "Update medical specialty", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "SpecialtyID": { + "type": "integer" + }, + "SpecialtyCode": { + "type": "string" + }, + "SpecialtyName": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Specialty updated successfully" + } + } + } + }, + "/api/medicalspecialty/{SpecialtyID}": { + "get": { + "tags": ["Contact"], + "summary": "Get medical specialty by ID", + "parameters": [ + { + "name": "SpecialtyID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Specialty details" + } + } + } + }, + "/api/organization/account": { + "get": { + "tags": ["Organization"], + "summary": "List accounts", + "responses": { + "200": { + "description": "List of accounts" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create account", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "responses": { + "201": { + "description": "Account created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update account", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Organization" + } + } + } + }, + "responses": { + "200": { + "description": "Account updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete account (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["AccountID"], + "properties": { + "AccountID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Account deleted successfully" + } + } + } + }, + "/api/organization/account/{AccountID}": { + "get": { + "tags": ["Organization"], + "summary": "Get account by ID", + "parameters": [ + { + "name": "AccountID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Account details" + } + } + } + }, + "/api/organization/site": { + "get": { + "tags": ["Organization"], + "summary": "List sites", + "responses": { + "200": { + "description": "List of sites" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create site", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Site" + } + } + } + }, + "responses": { + "201": { + "description": "Site created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update site", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Site" + } + } + } + }, + "responses": { + "200": { + "description": "Site updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete site (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["SiteID"], + "properties": { + "SiteID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Site deleted successfully" + } + } + } + }, + "/api/organization/site/{SiteID}": { + "get": { + "tags": ["Organization"], + "summary": "Get site by ID", + "parameters": [ + { + "name": "SiteID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Site details" + } + } + } + }, + "/api/organization/discipline": { + "get": { + "tags": ["Organization"], + "summary": "List disciplines", + "responses": { + "200": { + "description": "List of disciplines" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create discipline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Discipline" + } + } + } + }, + "responses": { + "201": { + "description": "Discipline created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update discipline", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Discipline" + } + } + } + }, + "responses": { + "200": { + "description": "Discipline updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete discipline (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["DisciplineID"], + "properties": { + "DisciplineID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Discipline deleted successfully" + } + } + } + }, + "/api/organization/discipline/{DisciplineID}": { + "get": { + "tags": ["Organization"], + "summary": "Get discipline by ID", + "parameters": [ + { + "name": "DisciplineID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Discipline details" + } + } + } + }, + "/api/organization/department": { + "get": { + "tags": ["Organization"], + "summary": "List departments", + "responses": { + "200": { + "description": "List of departments" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create department", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "201": { + "description": "Department created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update department", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Department" + } + } + } + }, + "responses": { + "200": { + "description": "Department updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete department (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["DepartmentID"], + "properties": { + "DepartmentID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Department deleted successfully" + } + } + } + }, + "/api/organization/department/{DepartmentID}": { + "get": { + "tags": ["Organization"], + "summary": "Get department by ID", + "parameters": [ + { + "name": "DepartmentID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Department details" + } + } + } + }, + "/api/organization/workstation": { + "get": { + "tags": ["Organization"], + "summary": "List workstations", + "responses": { + "200": { + "description": "List of workstations" + } + } + }, + "post": { + "tags": ["Organization"], + "summary": "Create workstation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Workstation" + } + } + } + }, + "responses": { + "201": { + "description": "Workstation created successfully" + } + } + }, + "patch": { + "tags": ["Organization"], + "summary": "Update workstation", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Workstation" + } + } + } + }, + "responses": { + "200": { + "description": "Workstation updated successfully" + } + } + }, + "delete": { + "tags": ["Organization"], + "summary": "Delete workstation (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["WorkstationID"], + "properties": { + "WorkstationID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Workstation deleted successfully" + } + } + } + }, + "/api/organization/workstation/{WorkstationID}": { + "get": { + "tags": ["Organization"], + "summary": "Get workstation by ID", + "parameters": [ + { + "name": "WorkstationID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Workstation details" + } + } + } + }, + "/api/valueset": { + "get": { + "tags": ["Value Set"], + "summary": "List value sets", + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "string" + }, + "description": "Filter by value set key" + } + ], + "responses": { + "200": { + "description": "List of value sets" + } + } + }, + "post": { + "tags": ["Value Set"], + "summary": "Refresh value sets", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "key": { + "type": "string", + "description": "Value set key to refresh" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Value sets refreshed" + } + } + } + }, + "/api/valueset/{key}": { + "get": { + "tags": ["Value Set"], + "summary": "Get value set by key", + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Value set details" + } + } + } + }, + "/api/valueset/items": { + "get": { + "tags": ["Value Set"], + "summary": "List value set items", + "parameters": [ + { + "name": "key", + "in": "query", + "schema": { + "type": "string" + }, + "description": "Filter by value set key" + } + ], + "responses": { + "200": { + "description": "List of value set items" + } + } + }, + "post": { + "tags": ["Value Set"], + "summary": "Create value set item", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ValueSetID": { + "type": "integer" + }, + "Value": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "Sequence": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "201": { + "description": "Item created successfully" + } + } + } + }, + "/api/valueset/items/{ItemID}": { + "get": { + "tags": ["Value Set"], + "summary": "Get value set item by ID", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Item details" + } + } + }, + "put": { + "tags": ["Value Set"], + "summary": "Update value set item", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Value": { + "type": "string" + }, + "Label": { + "type": "string" + }, + "Sequence": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Item updated successfully" + } + } + }, + "delete": { + "tags": ["Value Set"], + "summary": "Delete value set item", + "parameters": [ + { + "name": "ItemID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Item deleted successfully" + } + } + } + }, + "/api/result/valueset": { + "get": { + "tags": ["Result Value Set"], + "summary": "List result value sets", + "description": "CRUD operations for result value sets", + "responses": { + "200": { + "description": "List of result value sets" + } + } + }, + "post": { + "tags": ["Result Value Set"], + "summary": "Create result value set", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSet" + } + } + } + }, + "responses": { + "201": { + "description": "Value set created successfully" + } + } + } + }, + "/api/result/valueset/{ValueSetID}": { + "get": { + "tags": ["Result Value Set"], + "summary": "Get result value set by ID", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Value set details" + } + } + }, + "put": { + "tags": ["Result Value Set"], + "summary": "Update result value set", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSet" + } + } + } + }, + "responses": { + "200": { + "description": "Value set updated successfully" + } + } + }, + "delete": { + "tags": ["Result Value Set"], + "summary": "Delete result value set", + "parameters": [ + { + "name": "ValueSetID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Value set deleted successfully" + } + } + } + }, + "/api/result/valuesetdef": { + "get": { + "tags": ["Result Value Set Definition"], + "summary": "List value set definitions", + "description": "CRUD operations for value set definitions", + "responses": { + "200": { + "description": "List of value set definitions" + } + } + }, + "post": { + "tags": ["Result Value Set Definition"], + "summary": "Create value set definition", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSetDef" + } + } + } + }, + "responses": { + "201": { + "description": "Definition created successfully" + } + } + } + }, + "/api/result/valuesetdef/{VSetDefID}": { + "get": { + "tags": ["Result Value Set Definition"], + "summary": "Get value set definition by ID", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Definition details" + } + } + }, + "put": { + "tags": ["Result Value Set Definition"], + "summary": "Update value set definition", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ValueSetDef" + } + } + } + }, + "responses": { + "200": { + "description": "Definition updated successfully" + } + } + }, + "delete": { + "tags": ["Result Value Set Definition"], + "summary": "Delete value set definition", + "parameters": [ + { + "name": "VSetDefID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Definition deleted successfully" + } + } + } + }, + "/api/counter": { + "get": { + "tags": ["Counter"], + "summary": "List counters", + "responses": { + "200": { + "description": "List of counters" + } + } + }, + "post": { + "tags": ["Counter"], + "summary": "Create counter", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Counter" + } + } + } + }, + "responses": { + "201": { + "description": "Counter created successfully" + } + } + }, + "patch": { + "tags": ["Counter"], + "summary": "Update counter", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Counter" + } + } + } + }, + "responses": { + "200": { + "description": "Counter updated successfully" + } + } + }, + "delete": { + "tags": ["Counter"], + "summary": "Delete counter (soft delete)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "required": ["CounterID"], + "properties": { + "CounterID": { + "type": "integer" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Counter deleted successfully" + } + } + } + }, + "/api/counter/{CounterID}": { + "get": { + "tags": ["Counter"], + "summary": "Get counter by ID", + "parameters": [ + { + "name": "CounterID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Counter details" + } + } + } + }, + "/api/areageo": { + "get": { + "tags": ["Area Geo"], + "summary": "List geographic areas", + "responses": { + "200": { + "description": "List of geographic areas" + } + } + } + }, + "/api/areageo/provinces": { + "get": { + "tags": ["Area Geo"], + "summary": "List provinces", + "responses": { + "200": { + "description": "List of provinces" + } + } + } + }, + "/api/areageo/cities": { + "get": { + "tags": ["Area Geo"], + "summary": "List cities", + "parameters": [ + { + "name": "province_id", + "in": "query", + "schema": { + "type": "integer" + }, + "description": "Filter by province ID" + } + ], + "responses": { + "200": { + "description": "List of cities" + } + } + } + }, + "/api/demo/order": { + "post": { + "tags": ["Demo"], + "summary": "Create demo order", + "description": "Create a demo test order (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "Demo order created" + } + } + } + }, + "/api/demo/orders": { + "get": { + "tags": ["Demo"], + "summary": "List demo orders", + "description": "List demo test orders (no auth required)", + "responses": { + "200": { + "description": "List of demo orders" + } + } + } + }, + "/api/edge/results": { + "post": { + "tags": ["Edge"], + "summary": "Receive instrument results", + "description": "Receive test results from tiny-edge middleware (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Results received" + } + } + } + }, + "/api/edge/orders": { + "get": { + "tags": ["Edge"], + "summary": "Get orders for edge", + "description": "Get orders for instrument integration (no auth required)", + "responses": { + "200": { + "description": "Orders for edge" + } + } + } + }, + "/api/edge/orders/{OrderID}/ack": { + "post": { + "tags": ["Edge"], + "summary": "Acknowledge order", + "description": "Acknowledge order receipt by edge (no auth required)", + "parameters": [ + { + "name": "OrderID", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Order acknowledged" + } + } + } + }, + "/api/edge/status": { + "post": { + "tags": ["Edge"], + "summary": "Receive instrument status", + "description": "Receive status updates from instruments (no auth required)", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Status received" + } + } + } + } + }, + "tags": [ + { + "name": "Authentication", + "description": "User authentication endpoints" + }, + { + "name": "Patient", + "description": "Patient management endpoints" + }, + { + "name": "Patient Visit", + "description": "Patient visit management endpoints" + }, + { + "name": "Order Test", + "description": "Test order management endpoints" + }, + { + "name": "Specimen", + "description": "Specimen management endpoints" + }, + { + "name": "Tests", + "description": "Test definition endpoints" + }, + { + "name": "Location", + "description": "Location management endpoints" + }, + { + "name": "Contact", + "description": "Contact management endpoints" + }, + { + "name": "Organization", + "description": "Organization management endpoints" + }, + { + "name": "Value Set", + "description": "Value set library endpoints" + }, + { + "name": "Result Value Set", + "description": "Result-specific value set CRUD endpoints" + }, + { + "name": "Result Value Set Definition", + "description": "Value set definition CRUD endpoints" + }, + { + "name": "Counter", + "description": "Counter management endpoints" + }, + { + "name": "Area Geo", + "description": "Geographic area endpoints" + }, + { + "name": "Demo", + "description": "Demo/test endpoints (no auth)" + }, + { + "name": "Edge", + "description": "Instrument integration endpoints (no auth)" + } + ] +}