2919 lines
69 KiB
YAML
2919 lines
69 KiB
YAML
openapi: 3.0.3
|
|
info:
|
|
title: CLQMS - Clinical Laboratory Quality Management System API
|
|
description: |
|
|
API for Clinical Laboratory Quality Management System supporting patient management,
|
|
specimen tracking, test ordering, instrument integration, and laboratory operations.
|
|
version: 1.0.0
|
|
contact:
|
|
name: CLQMS API Support
|
|
license:
|
|
name: Proprietary
|
|
|
|
servers:
|
|
- url: http://localhost/clqms01/
|
|
description: Local development server
|
|
- url: https://clqms01-api.services-summit.my.id/
|
|
description: Production server
|
|
|
|
tags:
|
|
- name: Authentication
|
|
description: User authentication and session management
|
|
- name: Patients
|
|
description: Patient registration and management
|
|
- name: Patient Visits
|
|
description: Patient visit/encounter management
|
|
- name: Organization
|
|
description: Organization structure (accounts, sites, disciplines, departments, workstations)
|
|
- name: Specimen
|
|
description: Specimen and container management
|
|
- name: Tests
|
|
description: Test definitions and test catalog
|
|
- name: Orders
|
|
description: Laboratory order management
|
|
- name: Results
|
|
description: Patient results reporting
|
|
- name: Edge API
|
|
description: Instrument integration endpoints
|
|
- name: Master Data
|
|
description: Lookup and reference data
|
|
- name: ValueSets
|
|
description: Value set definitions and items
|
|
- name: Demo
|
|
description: Demo/test endpoints (no authentication)
|
|
|
|
components:
|
|
securitySchemes:
|
|
bearerAuth:
|
|
type: http
|
|
scheme: bearer
|
|
bearerFormat: JWT
|
|
description: JWT token from login endpoint
|
|
cookieAuth:
|
|
type: apiKey
|
|
in: cookie
|
|
name: token
|
|
description: JWT token stored in HTTP-only cookie
|
|
|
|
schemas:
|
|
# Common Schemas
|
|
SuccessResponse:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
code:
|
|
type: integer
|
|
example: 200
|
|
|
|
ErrorResponse:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: error
|
|
message:
|
|
type: string
|
|
errors:
|
|
type: object
|
|
|
|
# Authentication
|
|
LoginRequest:
|
|
type: object
|
|
required:
|
|
- username
|
|
- password
|
|
properties:
|
|
username:
|
|
type: string
|
|
example: labuser01
|
|
password:
|
|
type: string
|
|
format: password
|
|
example: secret123
|
|
|
|
LoginResponse:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
code:
|
|
type: integer
|
|
example: 200
|
|
message:
|
|
type: string
|
|
example: Login successful
|
|
|
|
RegisterRequest:
|
|
type: object
|
|
required:
|
|
- username
|
|
- password
|
|
- email
|
|
properties:
|
|
username:
|
|
type: string
|
|
password:
|
|
type: string
|
|
format: password
|
|
email:
|
|
type: string
|
|
format: email
|
|
full_name:
|
|
type: string
|
|
|
|
# Patient
|
|
PatientIdentifier:
|
|
type: object
|
|
properties:
|
|
IdentifierType:
|
|
type: string
|
|
enum: [KTP, PASS, SSN, SIM, KTAS]
|
|
description: |
|
|
KTP: 16 digit numeric
|
|
PASS: alphanumeric max 9
|
|
SSN: 9 digit numeric
|
|
SIM: 19-20 digit numeric
|
|
KTAS: 11 digit numeric
|
|
Identifier:
|
|
type: string
|
|
maxLength: 255
|
|
|
|
LinkedPatient:
|
|
type: object
|
|
description: Linked patient reference
|
|
properties:
|
|
InternalPID:
|
|
type: integer
|
|
description: Internal patient ID of the linked patient
|
|
PatientID:
|
|
type: string
|
|
description: Patient ID of the linked patient
|
|
|
|
Custodian:
|
|
type: object
|
|
description: Patient custodian/guardian
|
|
properties:
|
|
InternalPID:
|
|
type: integer
|
|
description: Internal patient ID of the custodian
|
|
PatientID:
|
|
type: string
|
|
description: Patient ID of the custodian
|
|
|
|
PatAttEntry:
|
|
type: object
|
|
description: Patient address/attorney entry
|
|
properties:
|
|
Address:
|
|
type: string
|
|
description: Address text
|
|
|
|
Patient:
|
|
type: object
|
|
required:
|
|
- PatientID
|
|
- Sex
|
|
- NameFirst
|
|
- Birthdate
|
|
properties:
|
|
PatientID:
|
|
type: string
|
|
maxLength: 30
|
|
pattern: '^[A-Za-z0-9]+$'
|
|
description: Internal patient identifier
|
|
AlternatePID:
|
|
type: string
|
|
maxLength: 30
|
|
pattern: '^[A-Za-z0-9]+$'
|
|
Prefix:
|
|
type: string
|
|
maxLength: 10
|
|
enum: [Mr, Mrs, Ms, Dr, Prof]
|
|
Sex:
|
|
type: string
|
|
enum: ['1', '2']
|
|
description: '1: Female, 2: Male'
|
|
NameFirst:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 60
|
|
pattern: "^[A-Za-z'\\. ]+$"
|
|
NameMiddle:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 60
|
|
NameMaiden:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 60
|
|
NameLast:
|
|
type: string
|
|
minLength: 1
|
|
maxLength: 60
|
|
Suffix:
|
|
type: string
|
|
maxLength: 10
|
|
Birthdate:
|
|
type: string
|
|
format: date-time
|
|
description: ISO 8601 UTC datetime
|
|
PlaceOfBirth:
|
|
type: string
|
|
maxLength: 100
|
|
Citizenship:
|
|
type: string
|
|
maxLength: 100
|
|
Street_1:
|
|
type: string
|
|
maxLength: 255
|
|
Street_2:
|
|
type: string
|
|
maxLength: 255
|
|
Street_3:
|
|
type: string
|
|
maxLength: 255
|
|
ZIP:
|
|
type: string
|
|
maxLength: 10
|
|
pattern: '^[0-9]+$'
|
|
Phone:
|
|
type: string
|
|
pattern: "^\\+?[0-9]{8,15}$"
|
|
MobilePhone:
|
|
type: string
|
|
pattern: "^\\+?[0-9]{8,15}$"
|
|
EmailAddress1:
|
|
type: string
|
|
format: email
|
|
maxLength: 100
|
|
EmailAddress2:
|
|
type: string
|
|
format: email
|
|
maxLength: 100
|
|
PatIdt:
|
|
$ref: '#/components/schemas/PatientIdentifier'
|
|
LinkTo:
|
|
type: array
|
|
description: Array of linked patient references
|
|
items:
|
|
$ref: '#/components/schemas/LinkedPatient'
|
|
Custodian:
|
|
$ref: '#/components/schemas/Custodian'
|
|
DeathIndicator:
|
|
type: string
|
|
enum: [Y, N]
|
|
description: 'Y: Yes (deceased), N: No (alive)'
|
|
TimeOfDeath:
|
|
type: string
|
|
format: date-time
|
|
description: ISO 8601 UTC datetime of death
|
|
PatCom:
|
|
type: string
|
|
description: Patient comment/notes
|
|
PatAtt:
|
|
type: array
|
|
description: Patient address entries
|
|
items:
|
|
$ref: '#/components/schemas/PatAttEntry'
|
|
Province:
|
|
type: string
|
|
description: Province area code
|
|
City:
|
|
type: string
|
|
description: City area code
|
|
Country:
|
|
type: string
|
|
maxLength: 100
|
|
Race:
|
|
type: string
|
|
maxLength: 100
|
|
MaritalStatus:
|
|
type: string
|
|
enum: [A, B, D, M, S, W]
|
|
description: 'A: Annulled, B: Separated, D: Divorced, M: Married, S: Single, W: Widowed'
|
|
Religion:
|
|
type: string
|
|
maxLength: 100
|
|
Ethnic:
|
|
type: string
|
|
maxLength: 100
|
|
|
|
PatientListResponse:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Patient'
|
|
pagination:
|
|
type: object
|
|
properties:
|
|
page:
|
|
type: integer
|
|
perPage:
|
|
type: integer
|
|
total:
|
|
type: integer
|
|
|
|
# Patient Visit
|
|
PatientVisit:
|
|
type: object
|
|
properties:
|
|
VisitID:
|
|
type: string
|
|
PatientID:
|
|
type: string
|
|
VisitDate:
|
|
type: string
|
|
format: date-time
|
|
VisitType:
|
|
type: string
|
|
SiteID:
|
|
type: integer
|
|
LocationID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
AttendingPhysician:
|
|
type: string
|
|
ReferringPhysician:
|
|
type: string
|
|
|
|
# Organization
|
|
Account:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
AccountName:
|
|
type: string
|
|
AccountCode:
|
|
type: string
|
|
AccountType:
|
|
type: string
|
|
|
|
Site:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
SiteName:
|
|
type: string
|
|
SiteCode:
|
|
type: string
|
|
AccountID:
|
|
type: integer
|
|
|
|
Discipline:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
DisciplineName:
|
|
type: string
|
|
DisciplineCode:
|
|
type: string
|
|
|
|
Department:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
DeptName:
|
|
type: string
|
|
DeptCode:
|
|
type: string
|
|
SiteID:
|
|
type: integer
|
|
|
|
Workstation:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
WorkstationName:
|
|
type: string
|
|
WorkstationCode:
|
|
type: string
|
|
SiteID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
|
|
# Specimen
|
|
Specimen:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
SpecimenID:
|
|
type: string
|
|
PatientID:
|
|
type: string
|
|
SpecimenType:
|
|
type: string
|
|
description: Specimen type code
|
|
SpecimenTypeLabel:
|
|
type: string
|
|
description: Specimen type display text
|
|
CollectionDate:
|
|
type: string
|
|
format: date-time
|
|
CollectionMethod:
|
|
type: string
|
|
description: Collection method code
|
|
CollectionMethodLabel:
|
|
type: string
|
|
description: Collection method display text
|
|
ContainerID:
|
|
type: integer
|
|
SpecimenStatus:
|
|
type: string
|
|
description: Specimen status code
|
|
SpecimenStatusLabel:
|
|
type: string
|
|
description: Specimen status display text
|
|
BodySite:
|
|
type: string
|
|
description: Body site code
|
|
BodySiteLabel:
|
|
type: string
|
|
description: Body site display text
|
|
|
|
ContainerDef:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
ContainerCode:
|
|
type: string
|
|
ContainerName:
|
|
type: string
|
|
ConCategory:
|
|
type: string
|
|
description: Container category code
|
|
ConCategoryLabel:
|
|
type: string
|
|
description: Container category display text
|
|
ConSize:
|
|
type: string
|
|
description: Container size code
|
|
ConSizeLabel:
|
|
type: string
|
|
description: Container size display text
|
|
CapColor:
|
|
type: string
|
|
description: Cap color code
|
|
CapColorLabel:
|
|
type: string
|
|
description: Cap color display text
|
|
|
|
SpecimenPrep:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
PrepCode:
|
|
type: string
|
|
PrepName:
|
|
type: string
|
|
Description:
|
|
type: string
|
|
|
|
SpecimenStatus:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
StatusCode:
|
|
type: string
|
|
StatusName:
|
|
type: string
|
|
Description:
|
|
type: string
|
|
Status:
|
|
type: string
|
|
description: Status code
|
|
StatusLabel:
|
|
type: string
|
|
description: Status display text
|
|
Activity:
|
|
type: string
|
|
description: Activity code
|
|
ActivityLabel:
|
|
type: string
|
|
description: Activity display text
|
|
|
|
SpecimenCollection:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
CollectionCode:
|
|
type: string
|
|
CollectionName:
|
|
type: string
|
|
Description:
|
|
type: string
|
|
CollectionMethod:
|
|
type: string
|
|
description: Collection method code
|
|
CollectionMethodLabel:
|
|
type: string
|
|
description: Collection method display text
|
|
Additive:
|
|
type: string
|
|
description: Additive code
|
|
AdditiveLabel:
|
|
type: string
|
|
description: Additive display text
|
|
SpecimenRole:
|
|
type: string
|
|
description: Specimen role code
|
|
SpecimenRoleLabel:
|
|
type: string
|
|
description: Specimen role display text
|
|
|
|
# Tests
|
|
TestDefinition:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
TestCode:
|
|
type: string
|
|
TestName:
|
|
type: string
|
|
TestType:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
description: |
|
|
TEST: Technical test
|
|
PARAM: Parameter
|
|
CALC: Calculated
|
|
GROUP: Panel/Profile
|
|
TITLE: Section header
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
SpecimenType:
|
|
type: string
|
|
Unit:
|
|
type: string
|
|
Formula:
|
|
type: string
|
|
|
|
TestMap:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
TestMapID:
|
|
type: integer
|
|
TestCode:
|
|
type: string
|
|
HostCode:
|
|
type: string
|
|
HostName:
|
|
type: string
|
|
ClientCode:
|
|
type: string
|
|
ClientName:
|
|
type: string
|
|
HostType:
|
|
type: string
|
|
description: Host type code
|
|
HostTypeLabel:
|
|
type: string
|
|
description: Host type display text
|
|
ClientType:
|
|
type: string
|
|
description: Client type code
|
|
ClientTypeLabel:
|
|
type: string
|
|
description: Client type display text
|
|
|
|
# Orders
|
|
OrderTest:
|
|
type: object
|
|
properties:
|
|
OrderID:
|
|
type: string
|
|
PatientID:
|
|
type: string
|
|
VisitID:
|
|
type: string
|
|
OrderDate:
|
|
type: string
|
|
format: date-time
|
|
OrderStatus:
|
|
type: string
|
|
description: Order status code
|
|
OrderStatusLabel:
|
|
type: string
|
|
description: Order status display text
|
|
Priority:
|
|
type: string
|
|
description: Priority code
|
|
PriorityLabel:
|
|
type: string
|
|
description: Priority display text
|
|
SiteID:
|
|
type: integer
|
|
RequestingPhysician:
|
|
type: string
|
|
|
|
OrderItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
OrderID:
|
|
type: string
|
|
TestID:
|
|
type: integer
|
|
SpecimenID:
|
|
type: string
|
|
Status:
|
|
type: string
|
|
|
|
# Edge API
|
|
EdgeResultRequest:
|
|
type: object
|
|
required:
|
|
- sample_id
|
|
- instrument_id
|
|
properties:
|
|
sample_id:
|
|
type: string
|
|
description: Sample barcode/identifier
|
|
instrument_id:
|
|
type: string
|
|
description: Instrument identifier
|
|
patient_id:
|
|
type: string
|
|
description: Patient identifier (optional)
|
|
results:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
test_code:
|
|
type: string
|
|
result_value:
|
|
type: string
|
|
unit:
|
|
type: string
|
|
flags:
|
|
type: string
|
|
enum: [H, L, N, A]
|
|
description: H=High, L=Low, N=Normal, A=Abnormal
|
|
|
|
EdgeResultResponse:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
example: Result received and queued
|
|
data:
|
|
type: object
|
|
properties:
|
|
edge_res_id:
|
|
type: integer
|
|
sample_id:
|
|
type: string
|
|
instrument_id:
|
|
type: string
|
|
|
|
EdgeOrder:
|
|
type: object
|
|
properties:
|
|
OrderID:
|
|
type: string
|
|
PatientID:
|
|
type: string
|
|
SampleID:
|
|
type: string
|
|
Tests:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
TestCode:
|
|
type: string
|
|
TestName:
|
|
type: string
|
|
SpecimenType:
|
|
type: string
|
|
Priority:
|
|
type: string
|
|
DueDateTime:
|
|
type: string
|
|
format: date-time
|
|
|
|
# ValueSets
|
|
ValueSetDef:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
VSetCode:
|
|
type: string
|
|
VSetName:
|
|
type: string
|
|
Description:
|
|
type: string
|
|
Category:
|
|
type: string
|
|
|
|
ValueSetItem:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
VSetID:
|
|
type: integer
|
|
VValue:
|
|
type: string
|
|
VLabel:
|
|
type: string
|
|
VSeq:
|
|
type: integer
|
|
IsActive:
|
|
type: boolean
|
|
|
|
# Master Data
|
|
Location:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
LocationCode:
|
|
type: string
|
|
LocationName:
|
|
type: string
|
|
LocationType:
|
|
type: string
|
|
SiteID:
|
|
type: integer
|
|
|
|
Contact:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
ContactName:
|
|
type: string
|
|
ContactType:
|
|
type: string
|
|
Phone:
|
|
type: string
|
|
Email:
|
|
type: string
|
|
Address:
|
|
type: string
|
|
Specialty:
|
|
type: string
|
|
description: Specialty code
|
|
SpecialtyLabel:
|
|
type: string
|
|
description: Specialty display text
|
|
Occupation:
|
|
type: string
|
|
description: Occupation code
|
|
OccupationLabel:
|
|
type: string
|
|
description: Occupation display text
|
|
|
|
Occupation:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
OccupationCode:
|
|
type: string
|
|
OccupationName:
|
|
type: string
|
|
|
|
MedicalSpecialty:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
SpecialtyCode:
|
|
type: string
|
|
SpecialtyName:
|
|
type: string
|
|
|
|
Counter:
|
|
type: object
|
|
properties:
|
|
id:
|
|
type: integer
|
|
CounterName:
|
|
type: string
|
|
Prefix:
|
|
type: string
|
|
CurrentValue:
|
|
type: integer
|
|
SiteID:
|
|
type: integer
|
|
|
|
# Dashboard
|
|
DashboardSummary:
|
|
type: object
|
|
properties:
|
|
pendingOrders:
|
|
type: integer
|
|
todayResults:
|
|
type: integer
|
|
criticalResults:
|
|
type: integer
|
|
activePatients:
|
|
type: integer
|
|
|
|
paths:
|
|
# ========================================
|
|
# Authentication Routes
|
|
# ========================================
|
|
/api/auth/login:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: User login
|
|
description: Authenticate user and receive JWT token via HTTP-only cookie
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
application/x-www-form-urlencoded:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
responses:
|
|
'200':
|
|
description: Login successful
|
|
headers:
|
|
Set-Cookie:
|
|
description: JWT token in HTTP-only cookie
|
|
schema:
|
|
type: string
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginResponse'
|
|
'400':
|
|
description: Missing username
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ErrorResponse'
|
|
'401':
|
|
description: Invalid credentials
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ErrorResponse'
|
|
|
|
/api/auth/logout:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: User logout
|
|
description: Clear JWT token cookie
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Logout successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SuccessResponse'
|
|
|
|
/api/auth/check:
|
|
get:
|
|
tags: [Authentication]
|
|
summary: Check authentication status
|
|
security:
|
|
- bearerAuth: []
|
|
- cookieAuth: []
|
|
responses:
|
|
'200':
|
|
description: Authenticated
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
authenticated:
|
|
type: boolean
|
|
user:
|
|
type: object
|
|
'401':
|
|
description: Not authenticated
|
|
|
|
/api/auth/register:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: Register new user
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RegisterRequest'
|
|
responses:
|
|
'201':
|
|
description: User created
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SuccessResponse'
|
|
|
|
/api/auth/change_pass:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: Change password
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- current_password
|
|
- new_password
|
|
properties:
|
|
current_password:
|
|
type: string
|
|
format: password
|
|
new_password:
|
|
type: string
|
|
format: password
|
|
responses:
|
|
'200':
|
|
description: Password changed successfully
|
|
|
|
# ========================================
|
|
# V2 Authentication Routes
|
|
# ========================================
|
|
/v2/auth/login:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: V2 User login
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginRequest'
|
|
responses:
|
|
'200':
|
|
description: Login successful
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/LoginResponse'
|
|
|
|
/v2/auth/logout:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: V2 User logout
|
|
responses:
|
|
'200':
|
|
description: Logout successful
|
|
|
|
/v2/auth/check:
|
|
get:
|
|
tags: [Authentication]
|
|
summary: V2 Check authentication
|
|
responses:
|
|
'200':
|
|
description: Auth check result
|
|
|
|
/v2/auth/register:
|
|
post:
|
|
tags: [Authentication]
|
|
summary: V2 Register new user
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/RegisterRequest'
|
|
responses:
|
|
'201':
|
|
description: User created
|
|
|
|
# ========================================
|
|
# Patient Routes
|
|
# ========================================
|
|
/api/patient:
|
|
get:
|
|
tags: [Patients]
|
|
summary: List patients
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 1
|
|
- name: perPage
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
default: 20
|
|
- name: search
|
|
in: query
|
|
schema:
|
|
type: string
|
|
description: Search by PatientID or name
|
|
responses:
|
|
'200':
|
|
description: List of patients
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PatientListResponse'
|
|
|
|
post:
|
|
tags: [Patients]
|
|
summary: Create new patient
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Patient'
|
|
responses:
|
|
'201':
|
|
description: Patient created successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SuccessResponse'
|
|
'422':
|
|
description: Validation error
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ErrorResponse'
|
|
|
|
patch:
|
|
tags: [Patients]
|
|
summary: Update patient
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Patient'
|
|
responses:
|
|
'200':
|
|
description: Patient updated successfully
|
|
|
|
delete:
|
|
tags: [Patients]
|
|
summary: Delete patient
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: PatientID
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Patient deleted successfully
|
|
|
|
/api/patient/check:
|
|
get:
|
|
tags: [Patients]
|
|
summary: Check if patient exists
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: PatientID
|
|
in: query
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Patient check result
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
exists:
|
|
type: boolean
|
|
data:
|
|
$ref: '#/components/schemas/Patient'
|
|
|
|
/api/patient/{id}:
|
|
get:
|
|
tags: [Patients]
|
|
summary: Get patient by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Internal patient record ID
|
|
responses:
|
|
'200':
|
|
description: Patient details
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
$ref: '#/components/schemas/Patient'
|
|
|
|
# ========================================
|
|
# Patient Visit Routes
|
|
# ========================================
|
|
/api/patvisit:
|
|
get:
|
|
tags: [Patient Visits]
|
|
summary: List patient visits
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
- name: perPage
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: List of patient visits
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/PatientVisit'
|
|
|
|
post:
|
|
tags: [Patient Visits]
|
|
summary: Create patient visit
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PatientVisit'
|
|
responses:
|
|
'201':
|
|
description: Visit created successfully
|
|
|
|
patch:
|
|
tags: [Patient Visits]
|
|
summary: Update patient visit
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/PatientVisit'
|
|
responses:
|
|
'200':
|
|
description: Visit updated successfully
|
|
|
|
delete:
|
|
tags: [Patient Visits]
|
|
summary: Delete patient visit
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Visit deleted successfully
|
|
|
|
/api/patvisit/{id}:
|
|
get:
|
|
tags: [Patient Visits]
|
|
summary: Get visit by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Visit details
|
|
|
|
/api/patvisit/patient/{patientId}:
|
|
get:
|
|
tags: [Patient Visits]
|
|
summary: Get visits by patient ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: patientId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Patient visits list
|
|
|
|
/api/patvisitadt:
|
|
post:
|
|
tags: [Patient Visits]
|
|
summary: Create ADT visit (Admission/Discharge/Transfer)
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- InternalPVID
|
|
- ADTCode
|
|
properties:
|
|
InternalPVID:
|
|
type: integer
|
|
description: Internal Visit ID from patvisit table
|
|
ADTCode:
|
|
type: string
|
|
enum: [A01, A02, A03, A04, A08]
|
|
description: |
|
|
A01: Admit
|
|
A02: Transfer
|
|
A03: Discharge
|
|
A04: Register
|
|
A08: Update
|
|
LocationID:
|
|
type: integer
|
|
description: Location/ward ID
|
|
AttDoc:
|
|
type: string
|
|
description: Attending physician
|
|
RefDoc:
|
|
type: string
|
|
description: Referring physician
|
|
AdmDoc:
|
|
type: string
|
|
description: Admitting physician
|
|
CnsDoc:
|
|
type: string
|
|
description: Consulting physician
|
|
responses:
|
|
'201':
|
|
description: ADT visit created
|
|
|
|
patch:
|
|
tags: [Patient Visits]
|
|
summary: Update ADT visit
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- PVADTID
|
|
properties:
|
|
PVADTID:
|
|
type: integer
|
|
description: ADT record ID
|
|
ADTCode:
|
|
type: string
|
|
enum: [A01, A02, A03, A04, A08]
|
|
description: |
|
|
A01: Admit
|
|
A02: Transfer
|
|
A03: Discharge
|
|
A04: Register
|
|
A08: Update
|
|
LocationID:
|
|
type: integer
|
|
description: Location/ward ID
|
|
AttDoc:
|
|
type: string
|
|
description: Attending physician
|
|
RefDoc:
|
|
type: string
|
|
description: Referring physician
|
|
AdmDoc:
|
|
type: string
|
|
description: Admitting physician
|
|
CnsDoc:
|
|
type: string
|
|
description: Consulting physician
|
|
responses:
|
|
'200':
|
|
description: ADT visit updated
|
|
|
|
# ========================================
|
|
# Organization - Account Routes
|
|
# ========================================
|
|
/api/organization/account:
|
|
get:
|
|
tags: [Organization]
|
|
summary: List accounts
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of accounts
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/Account'
|
|
|
|
post:
|
|
tags: [Organization]
|
|
summary: Create account
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Account'
|
|
responses:
|
|
'201':
|
|
description: Account created
|
|
|
|
patch:
|
|
tags: [Organization]
|
|
summary: Update account
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Account'
|
|
responses:
|
|
'200':
|
|
description: Account updated
|
|
|
|
delete:
|
|
tags: [Organization]
|
|
summary: Delete account
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Account deleted
|
|
|
|
/api/organization/account/{id}:
|
|
get:
|
|
tags: [Organization]
|
|
summary: Get account by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Account details
|
|
|
|
# ========================================
|
|
# Organization - Site Routes
|
|
# ========================================
|
|
/api/organization/site:
|
|
get:
|
|
tags: [Organization]
|
|
summary: List sites
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of sites
|
|
|
|
post:
|
|
tags: [Organization]
|
|
summary: Create site
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Site'
|
|
responses:
|
|
'201':
|
|
description: Site created
|
|
|
|
patch:
|
|
tags: [Organization]
|
|
summary: Update site
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Site'
|
|
responses:
|
|
'200':
|
|
description: Site updated
|
|
|
|
delete:
|
|
tags: [Organization]
|
|
summary: Delete site
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Site deleted
|
|
|
|
/api/organization/site/{id}:
|
|
get:
|
|
tags: [Organization]
|
|
summary: Get site by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Site details
|
|
|
|
# ========================================
|
|
# Organization - Discipline Routes
|
|
# ========================================
|
|
/api/organization/discipline:
|
|
get:
|
|
tags: [Organization]
|
|
summary: List disciplines
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of disciplines
|
|
|
|
post:
|
|
tags: [Organization]
|
|
summary: Create discipline
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Discipline'
|
|
responses:
|
|
'201':
|
|
description: Discipline created
|
|
|
|
patch:
|
|
tags: [Organization]
|
|
summary: Update discipline
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Discipline updated
|
|
|
|
delete:
|
|
tags: [Organization]
|
|
summary: Delete discipline
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Discipline deleted
|
|
|
|
/api/organization/discipline/{id}:
|
|
get:
|
|
tags: [Organization]
|
|
summary: Get discipline by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Discipline details
|
|
|
|
# ========================================
|
|
# Organization - Department Routes
|
|
# ========================================
|
|
/api/organization/department:
|
|
get:
|
|
tags: [Organization]
|
|
summary: List departments
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of departments
|
|
|
|
post:
|
|
tags: [Organization]
|
|
summary: Create department
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Department'
|
|
responses:
|
|
'201':
|
|
description: Department created
|
|
|
|
patch:
|
|
tags: [Organization]
|
|
summary: Update department
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Department updated
|
|
|
|
delete:
|
|
tags: [Organization]
|
|
summary: Delete department
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Department deleted
|
|
|
|
/api/organization/department/{id}:
|
|
get:
|
|
tags: [Organization]
|
|
summary: Get department by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Department details
|
|
|
|
# ========================================
|
|
# Organization - Workstation Routes
|
|
# ========================================
|
|
/api/organization/workstation:
|
|
get:
|
|
tags: [Organization]
|
|
summary: List workstations
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of workstations
|
|
|
|
post:
|
|
tags: [Organization]
|
|
summary: Create workstation
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Workstation'
|
|
responses:
|
|
'201':
|
|
description: Workstation created
|
|
|
|
patch:
|
|
tags: [Organization]
|
|
summary: Update workstation
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Workstation updated
|
|
|
|
delete:
|
|
tags: [Organization]
|
|
summary: Delete workstation
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Workstation deleted
|
|
|
|
/api/organization/workstation/{id}:
|
|
get:
|
|
tags: [Organization]
|
|
summary: Get workstation by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Workstation details
|
|
|
|
# ========================================
|
|
# Specimen Routes
|
|
# ========================================
|
|
/api/specimen:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: List specimens
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of specimens
|
|
|
|
post:
|
|
tags: [Specimen]
|
|
summary: Create specimen
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Specimen'
|
|
responses:
|
|
'201':
|
|
description: Specimen created
|
|
|
|
patch:
|
|
tags: [Specimen]
|
|
summary: Update specimen
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Specimen updated
|
|
|
|
/api/specimen/{id}:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get specimen by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Specimen details
|
|
|
|
/api/specimen/container:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: List container definitions
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of container definitions
|
|
|
|
post:
|
|
tags: [Specimen]
|
|
summary: Create container definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ContainerDef'
|
|
responses:
|
|
'201':
|
|
description: Container definition created
|
|
|
|
patch:
|
|
tags: [Specimen]
|
|
summary: Update container definition
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Container definition updated
|
|
|
|
/api/specimen/container/{id}:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get container definition by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Container definition details
|
|
|
|
/api/specimen/prep:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: List specimen preparations
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of specimen preparations
|
|
|
|
post:
|
|
tags: [Specimen]
|
|
summary: Create specimen preparation
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SpecimenPrep'
|
|
responses:
|
|
'201':
|
|
description: Specimen preparation created
|
|
|
|
patch:
|
|
tags: [Specimen]
|
|
summary: Update specimen preparation
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Specimen preparation updated
|
|
|
|
/api/specimen/prep/{id}:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get specimen preparation by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Specimen preparation details
|
|
|
|
/api/specimen/status:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: List specimen statuses
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of specimen statuses
|
|
|
|
post:
|
|
tags: [Specimen]
|
|
summary: Create specimen status
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SpecimenStatus'
|
|
responses:
|
|
'201':
|
|
description: Specimen status created
|
|
|
|
patch:
|
|
tags: [Specimen]
|
|
summary: Update specimen status
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Specimen status updated
|
|
|
|
/api/specimen/status/{id}:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get specimen status by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Specimen status details
|
|
|
|
/api/specimen/collection:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: List specimen collection methods
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of collection methods
|
|
|
|
post:
|
|
tags: [Specimen]
|
|
summary: Create specimen collection method
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SpecimenCollection'
|
|
responses:
|
|
'201':
|
|
description: Collection method created
|
|
|
|
patch:
|
|
tags: [Specimen]
|
|
summary: Update specimen collection method
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Collection method updated
|
|
|
|
/api/specimen/collection/{id}:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get specimen collection method by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Collection method details
|
|
|
|
# ========================================
|
|
# Tests Routes
|
|
# ========================================
|
|
/api/tests:
|
|
get:
|
|
tags: [Tests]
|
|
summary: List test definitions
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
- name: perPage
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
- name: TestType
|
|
in: query
|
|
schema:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
description: Filter by test type
|
|
responses:
|
|
'200':
|
|
description: List of test definitions
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/TestDefinition'
|
|
|
|
post:
|
|
tags: [Tests]
|
|
summary: Create test definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TestDefinition'
|
|
responses:
|
|
'201':
|
|
description: Test definition created
|
|
|
|
patch:
|
|
tags: [Tests]
|
|
summary: Update test definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/TestDefinition'
|
|
responses:
|
|
'200':
|
|
description: Test definition updated
|
|
|
|
/api/tests/{id}:
|
|
get:
|
|
tags: [Tests]
|
|
summary: Get test definition by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Test definition details
|
|
|
|
# ========================================
|
|
# Orders Routes
|
|
# ========================================
|
|
/api/ordertest:
|
|
get:
|
|
tags: [Orders]
|
|
summary: List orders
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
- name: OrderStatus
|
|
in: query
|
|
schema:
|
|
type: string
|
|
enum: [pending, in-progress, completed, cancelled]
|
|
- name: PatientID
|
|
in: query
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: List of orders
|
|
|
|
post:
|
|
tags: [Orders]
|
|
summary: Create order
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- PatientID
|
|
- Tests
|
|
properties:
|
|
PatientID:
|
|
type: string
|
|
VisitID:
|
|
type: string
|
|
Priority:
|
|
type: string
|
|
enum: [routine, stat, urgent]
|
|
SiteID:
|
|
type: integer
|
|
RequestingPhysician:
|
|
type: string
|
|
Tests:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
TestID:
|
|
type: integer
|
|
SpecimenType:
|
|
type: string
|
|
responses:
|
|
'201':
|
|
description: Order created successfully
|
|
|
|
patch:
|
|
tags: [Orders]
|
|
summary: Update order
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/OrderTest'
|
|
responses:
|
|
'200':
|
|
description: Order updated
|
|
|
|
delete:
|
|
tags: [Orders]
|
|
summary: Delete order
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Order deleted
|
|
|
|
/api/ordertest/status:
|
|
post:
|
|
tags: [Orders]
|
|
summary: Update order status
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- OrderID
|
|
- OrderStatus
|
|
properties:
|
|
OrderID:
|
|
type: string
|
|
OrderStatus:
|
|
type: string
|
|
enum: [pending, in-progress, completed, cancelled]
|
|
responses:
|
|
'200':
|
|
description: Order status updated
|
|
|
|
/api/ordertest/{id}:
|
|
get:
|
|
tags: [Orders]
|
|
summary: Get order by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: Order details
|
|
|
|
# ========================================
|
|
# Edge API Routes
|
|
# ========================================
|
|
/api/edge/results:
|
|
post:
|
|
tags: [Edge API]
|
|
summary: Receive results from instrument (tiny-edge)
|
|
description: |
|
|
Receives instrument results and stores them in the edgeres table for processing.
|
|
This endpoint is typically called by the tiny-edge middleware connected to laboratory analyzers.
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeResultRequest'
|
|
responses:
|
|
'201':
|
|
description: Result received and queued
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/EdgeResultResponse'
|
|
'400':
|
|
description: Invalid JSON payload
|
|
|
|
/api/edge/orders:
|
|
get:
|
|
tags: [Edge API]
|
|
summary: Fetch pending orders for instruments
|
|
description: Returns orders that need to be sent to laboratory instruments for testing
|
|
parameters:
|
|
- name: instrument_id
|
|
in: query
|
|
schema:
|
|
type: string
|
|
description: Filter by instrument
|
|
- name: status
|
|
in: query
|
|
schema:
|
|
type: string
|
|
enum: [pending, acknowledged]
|
|
description: Filter by status
|
|
responses:
|
|
'200':
|
|
description: List of orders
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/EdgeOrder'
|
|
|
|
/api/edge/orders/{orderId}/ack:
|
|
post:
|
|
tags: [Edge API]
|
|
summary: Acknowledge order delivery
|
|
description: Mark order as acknowledged by the instrument
|
|
parameters:
|
|
- name: orderId
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Edge order ID
|
|
responses:
|
|
'200':
|
|
description: Order acknowledged
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/SuccessResponse'
|
|
|
|
/api/edge/status:
|
|
post:
|
|
tags: [Edge API]
|
|
summary: Log instrument status update
|
|
description: Receive status updates from laboratory instruments
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
required:
|
|
- instrument_id
|
|
- status
|
|
properties:
|
|
instrument_id:
|
|
type: string
|
|
status:
|
|
type: string
|
|
enum: [online, offline, error, maintenance]
|
|
message:
|
|
type: string
|
|
timestamp:
|
|
type: string
|
|
format: date-time
|
|
responses:
|
|
'200':
|
|
description: Status logged
|
|
|
|
# ========================================
|
|
# ValueSet Routes
|
|
# ========================================
|
|
/api/valueset:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: List lib value sets
|
|
description: List all library/system value sets from JSON files
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: search
|
|
in: query
|
|
schema:
|
|
type: string
|
|
description: Optional search term to filter value sets
|
|
responses:
|
|
'200':
|
|
description: List of lib value sets with item counts
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: object
|
|
additionalProperties:
|
|
type: integer
|
|
description: Number of items in each value set
|
|
|
|
/api/valueset/{key}:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: Get lib value set by key
|
|
description: Get a specific library/system value set from JSON files
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: key
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: string
|
|
description: Value set key (e.g., marital_status, sex)
|
|
responses:
|
|
'200':
|
|
description: Lib value set details
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
data:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
value:
|
|
type: string
|
|
label:
|
|
type: string
|
|
|
|
/api/valueset/refresh:
|
|
post:
|
|
tags: [ValueSets]
|
|
summary: Refresh lib ValueSet cache
|
|
description: Clear and reload the library/system ValueSet cache from JSON files
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Lib ValueSet cache refreshed
|
|
|
|
/api/valueset/user/items:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: List user value set items
|
|
description: List value set items from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: VSetID
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
description: Filter by ValueSet ID
|
|
responses:
|
|
'200':
|
|
description: List of user value set items
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
data:
|
|
type: array
|
|
items:
|
|
$ref: '#/components/schemas/ValueSetItem'
|
|
|
|
post:
|
|
tags: [ValueSets]
|
|
summary: Create user value set item
|
|
description: Create value set item in database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ValueSetItem'
|
|
responses:
|
|
'201':
|
|
description: User value set item created
|
|
|
|
/api/valueset/user/items/{id}:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: Get user value set item by ID
|
|
description: Get value set item from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: User value set item details
|
|
|
|
put:
|
|
tags: [ValueSets]
|
|
summary: Update user value set item
|
|
description: Update value set item in database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ValueSetItem'
|
|
responses:
|
|
'200':
|
|
description: User value set item updated
|
|
|
|
delete:
|
|
tags: [ValueSets]
|
|
summary: Delete user value set item
|
|
description: Delete value set item from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: User value set item deleted
|
|
|
|
/api/valueset/user/def:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: List user value set definitions
|
|
description: List value set definitions from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of user value set definitions
|
|
|
|
post:
|
|
tags: [ValueSets]
|
|
summary: Create user value set definition
|
|
description: Create value set definition in database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ValueSetDef'
|
|
responses:
|
|
'201':
|
|
description: User value set definition created
|
|
|
|
/api/valueset/user/def/{id}:
|
|
get:
|
|
tags: [ValueSets]
|
|
summary: Get user value set definition by ID
|
|
description: Get value set definition from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: User value set definition details
|
|
|
|
put:
|
|
tags: [ValueSets]
|
|
summary: Update user value set definition
|
|
description: Update value set definition in database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/ValueSetDef'
|
|
responses:
|
|
'200':
|
|
description: User value set definition updated
|
|
|
|
delete:
|
|
tags: [ValueSets]
|
|
summary: Delete user value set definition
|
|
description: Delete value set definition from database (user-defined)
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: User value set definition deleted
|
|
|
|
# ========================================
|
|
# Master Data Routes
|
|
# ========================================
|
|
/api/location:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List locations
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of locations
|
|
|
|
post:
|
|
tags: [Master Data]
|
|
summary: Create location
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Location'
|
|
responses:
|
|
'201':
|
|
description: Location created
|
|
|
|
patch:
|
|
tags: [Master Data]
|
|
summary: Update location
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Location updated
|
|
|
|
delete:
|
|
tags: [Master Data]
|
|
summary: Delete location
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Location deleted
|
|
|
|
/api/location/{id}:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get location by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Location details
|
|
|
|
/api/contact:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List contacts
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of contacts
|
|
|
|
post:
|
|
tags: [Master Data]
|
|
summary: Create contact
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Contact'
|
|
responses:
|
|
'201':
|
|
description: Contact created
|
|
|
|
patch:
|
|
tags: [Master Data]
|
|
summary: Update contact
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Contact updated
|
|
|
|
delete:
|
|
tags: [Master Data]
|
|
summary: Delete contact
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Contact deleted
|
|
|
|
/api/contact/{id}:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get contact by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Contact details
|
|
|
|
/api/occupation:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List occupations
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of occupations
|
|
|
|
post:
|
|
tags: [Master Data]
|
|
summary: Create occupation
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Occupation'
|
|
responses:
|
|
'201':
|
|
description: Occupation created
|
|
|
|
patch:
|
|
tags: [Master Data]
|
|
summary: Update occupation
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Occupation updated
|
|
|
|
/api/occupation/{id}:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get occupation by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Occupation details
|
|
|
|
/api/medicalspecialty:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List medical specialties
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of medical specialties
|
|
|
|
post:
|
|
tags: [Master Data]
|
|
summary: Create medical specialty
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/MedicalSpecialty'
|
|
responses:
|
|
'201':
|
|
description: Medical specialty created
|
|
|
|
patch:
|
|
tags: [Master Data]
|
|
summary: Update medical specialty
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Medical specialty updated
|
|
|
|
/api/medicalspecialty/{id}:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get medical specialty by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Medical specialty details
|
|
|
|
/api/counter:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List counters
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of counters
|
|
|
|
post:
|
|
tags: [Master Data]
|
|
summary: Create counter
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/Counter'
|
|
responses:
|
|
'201':
|
|
description: Counter created
|
|
|
|
patch:
|
|
tags: [Master Data]
|
|
summary: Update counter
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Counter updated
|
|
|
|
delete:
|
|
tags: [Master Data]
|
|
summary: Delete counter
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Counter deleted
|
|
|
|
/api/counter/{id}:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get counter by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: Counter details
|
|
|
|
/api/areageo:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: List geographical areas
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of geographical areas
|
|
|
|
/api/areageo/provinces:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get list of provinces
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: List of provinces
|
|
|
|
/api/areageo/cities:
|
|
get:
|
|
tags: [Master Data]
|
|
summary: Get list of cities
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: province_id
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: List of cities
|
|
|
|
# ========================================
|
|
# Dashboard & Results (Protected)
|
|
# ========================================
|
|
/api/dashboard:
|
|
get:
|
|
tags: [Dashboard]
|
|
summary: Get dashboard summary
|
|
security:
|
|
- bearerAuth: []
|
|
responses:
|
|
'200':
|
|
description: Dashboard summary data
|
|
content:
|
|
application/json:
|
|
schema:
|
|
$ref: '#/components/schemas/DashboardSummary'
|
|
|
|
/api/result:
|
|
get:
|
|
tags: [Results]
|
|
summary: Get patient results
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: PatientID
|
|
in: query
|
|
schema:
|
|
type: string
|
|
- name: page
|
|
in: query
|
|
schema:
|
|
type: integer
|
|
responses:
|
|
'200':
|
|
description: List of results
|
|
|
|
/api/sample:
|
|
get:
|
|
tags: [Specimen]
|
|
summary: Get samples
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: status
|
|
in: query
|
|
schema:
|
|
type: string
|
|
responses:
|
|
'200':
|
|
description: List of samples
|
|
|
|
# ========================================
|
|
# Demo Routes (No Auth)
|
|
# ========================================
|
|
/api/demo/order:
|
|
post:
|
|
tags: [Demo]
|
|
summary: Create demo order (no authentication)
|
|
description: Test endpoint for creating orders without authentication
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
PatientID:
|
|
type: string
|
|
Tests:
|
|
type: array
|
|
items:
|
|
type: object
|
|
responses:
|
|
'201':
|
|
description: Demo order created
|
|
|
|
/api/demo/orders:
|
|
get:
|
|
tags: [Demo]
|
|
summary: List demo orders (no authentication)
|
|
responses:
|
|
'200':
|
|
description: List of demo orders |