description:Retrieve a specific result entry by its ID
security:
- bearerAuth:[]
parameters:
- name:id
in:path
required:true
schema:
type:integer
description:Result ID
responses:
'200':
description:Result details
content:
application/json:
schema:
type:object
properties:
status:
type:string
data:
type:object
properties:
ResultID:
type:integer
InternalPID:
type:integer
OrderID:
type:string
TestID:
type:integer
TestCode:
type:string
TestName:
type:string
ResultValue:
type:string
Unit:
type:string
ReferenceRange:
type:string
AbnormalFlag:
type:string
Verified:
type:boolean
VerifiedBy:
type:string
VerifiedDate:
type:string
format:date-time
ResultDate:
type:string
format:date-time
patch:
tags:
- Results
summary:Update result
description:Update an existing result entry
security:
- bearerAuth:[]
parameters:
- name:id
in:path
required:true
schema:
type:integer
description:Result ID
requestBody:
required:true
content:
application/json:
schema:
type:object
properties:
ResultValue:
type:string
Unit:
type:string
AbnormalFlag:
type:string
enum:
- H
- L
- 'N'
- A
- C
Verified:
type:boolean
responses:
'200':
description:Result updated successfully
content:
application/json:
schema:
$ref:'#/components/schemas/SuccessResponse'
delete:
tags:
- Results
summary:Delete result
description:Soft delete a result entry
security:
- bearerAuth:[]
parameters:
- name:id
in:path
required:true
schema:
type:integer
description:Result ID
responses:
'200':
description:Result deleted successfully
content:
application/json:
schema:
$ref:'#/components/schemas/SuccessResponse'
/api/results/{id}/verify:
post:
tags:
- Results
summary:Verify result
description:Mark a result as verified by the current user
security:
- bearerAuth:[]
parameters:
- name:id
in:path
required:true
schema:
type:integer
description:Result ID
responses:
'200':
description:Result verified successfully
content:
application/json:
schema:
$ref:'#/components/schemas/SuccessResponse'
/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:[]
requestBody:
required:true
content:
application/json:
schema:
$ref:'#/components/schemas/Specimen'
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/containerdef:
get:
tags:
- Specimen
summary:List container definitions (alias)
security:
- bearerAuth:[]
responses:
'200':
description:List of container definitions
post:
tags:
- Specimen
summary:Create container definition (alias)
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 (alias)
security:
- bearerAuth:[]
responses:
'200':
description:Container definition updated
/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
/api/tests:
get:
tags:
- Tests
summary:List test definitions
security:
- bearerAuth:[]
parameters:
- name:page
in:query
schema:
type:integer
default:1
description:Page number for pagination
- name:perPage
in:query
schema:
type:integer
default:20
description:Number of items per page
- name:SiteID
in:query
schema:
type:integer
description:Filter by site ID
- name:TestType
in:query
schema:
type:string
enum:
- TEST
- PARAM
- CALC
- GROUP
- TITLE
description:Filter by test type
- name:VisibleScr
in:query
schema:
type:integer
enum:
- 0
- 1
description:Filter by screen visibility (0=hidden, 1=visible)
- name:VisibleRpt
in:query
schema:
type:integer
enum:
- 0
- 1
description:Filter by report visibility (0=hidden, 1=visible)
- name:search
in:query
schema:
type:string
description:Search by test code or name
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'
pagination:
type:object
properties:
total:
type:integer
description:Total number of records matching the query
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
/api/valueset:
get:
tags:
- ValueSets
summary:List lib value sets
description:List all library/system value sets from JSON files with item counts. Returns an object where keys are value set names and values are item counts.
security:
- bearerAuth:[]
parameters:
- name:search
in:query
schema:
type:string
description:Optional search term to filter value set names
responses:
'200':
description:List of lib value sets with item counts
content:
application/json:
schema:
type:object
properties:
status:
type:string
example:success
data:
type:object
additionalProperties:
type:integer
description:Number of items in each value set
example:
sex:3
marital_status:6
order_status:6
/api/valueset/{key}:
get:
tags:
- ValueSets
summary:Get lib value set by key
description:|
Get a specific library/system value set from JSON files.
**Availablevalue set keys:**
- `activity_result` - Activity Result
- `additive` - Additive
- `adt_event` - ADT Event
- `area_class` - Area Class
- `body_site` - Body Site
- `collection_method` - Collection Method
- `container_cap_color` - Container Cap Color
- `container_class` - Container Class
- `container_size` - Container Size
- `country` - Country
- `death_indicator` - Death Indicator
- `did_type` - DID Type
- `enable_disable` - Enable/Disable
- `entity_type` - Entity Type
- `ethnic` - Ethnic
- `fasting_status` - Fasting Status
- `formula_language` - Formula Language
- `generate_by` - Generate By
- `identifier_type` - Identifier Type
- `location_type` - Location Type
- `marital_status` - Marital Status
- `math_sign` - Math Sign
- `numeric_ref_type` - Numeric Reference Type
- `operation` - Operation (CRUD)
- `order_priority` - Order Priority
- `order_status` - Order Status
- `race` - Race (Ethnicity)
- `range_type` - Range Type
- `reference_type` - Reference Type
- `religion` - Religion
- `requested_entity` - Requested Entity
- `result_type` - Result Type
- `result_unit` - Result Unit
- `sex` - Sex
- `site_class` - Site Class
- `site_type` - Site Type
- `specimen_activity` - Specimen Activity
- `specimen_condition` - Specimen Condition
- `specimen_role` - Specimen Role
- `specimen_status` - Specimen Status
- `specimen_type` - Specimen Type
- `test_activity` - Test Activity
- `test_type` - Test Type
- `text_ref_type` - Text Reference Type
- `unit` - Unit
- `v_category` - VCategory
- `ws_type` - Workstation Type
security:
- bearerAuth:[]
parameters:
- name:key
in:path
required:true
schema:
type:string
enum:
- activity_result
- additive
- adt_event
- area_class
- body_site
- collection_method
- container_cap_color
- container_class
- container_size
- country
- death_indicator
- did_type
- enable_disable
- entity_type
- ethnic
- fasting_status
- formula_language
- generate_by
- identifier_type
- location_type
- marital_status
- math_sign
- numeric_ref_type
- operation
- order_priority
- order_status
- race
- range_type
- reference_type
- religion
- requested_entity
- result_type
- result_unit
- sex
- site_class
- site_type
- specimen_activity
- specimen_condition
- specimen_role
- specimen_status
- specimen_type
- test_activity
- test_type
- text_ref_type
- unit
- v_category
- ws_type
description:Value set key name
responses:
'200':
description:Lib value set details
content:
application/json:
schema:
type:object
properties:
status:
type:string
data:
type:array
items:
$ref:'#/components/schemas/ValueSetLibItem'
/api/valueset/refresh:
post:
tags:
- ValueSets
summary:Refresh lib ValueSet cache
description:Clear and reload the library/system ValueSet cache from JSON files. Call this after modifying JSON files in app/Libraries/Data/.
security:
- bearerAuth:[]
responses:
'200':
description:Lib ValueSet cache refreshed
content:
application/json:
schema:
type:object
properties:
status:
type:string
example:success
message:
type:string
example:Cache cleared
/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
- name:search
in:query
schema:
type:string
description:Search term to filter by VValue, VDesc, or VSName
- name:param
in:query
schema:
type:string
description:Alternative search parameter (alias for search)
responses:
'200':
description:List of user value set items
content:
application/json:
schema:
type:object
properties:
status:
type:string
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:
type:object
required:
- VSetID
properties:
SiteID:
type:integer
description:Site reference (default 1)
VSetID:
type:integer
description:Reference to value set definition (required)
VOrder:
type:integer
description:Display order (default 0)
VValue:
type:string
description:The value code
VDesc:
type:string
description:The display description/label
responses:
'201':
description:User value set item created
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
data:
$ref:'#/components/schemas/ValueSetItem'
/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
content:
application/json:
schema:
type:object
properties:
status:
type:string
data:
$ref:'#/components/schemas/ValueSetItem'
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:
type:object
properties:
SiteID:
type:integer
description:Site reference
VSetID:
type:integer
description:Reference to value set definition
VOrder:
type:integer
description:Display order
VValue:
type:string
description:The value code
VDesc:
type:string
description:The display description/label
responses:
'200':
description:User value set item updated
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
data:
$ref:'#/components/schemas/ValueSetItem'
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
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
/api/valueset/user/def:
get:
tags:
- ValueSets
summary:List user value set definitions
description:List value set definitions from database (user-defined)
security:
- bearerAuth:[]
parameters:
- name:search
in:query
schema:
type:string
description:Optional search term to filter definitions
- name:page
in:query
schema:
type:integer
default:1
description:Page number for pagination
- name:limit
in:query
schema:
type:integer
default:100
description:Number of items per page
responses:
'200':
description:List of user value set definitions
content:
application/json:
schema:
type:object
properties:
status:
type:string
data:
type:array
items:
$ref:'#/components/schemas/ValueSetDef'
meta:
type:object
properties:
total:
type:integer
page:
type:integer
limit:
type:integer
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:
type:object
properties:
SiteID:
type:integer
description:Site reference (default 1)
VSName:
type:string
description:Value set name
VSDesc:
type:string
description:Value set description
responses:
'201':
description:User value set definition created
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
data:
$ref:'#/components/schemas/ValueSetDef'
/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
content:
application/json:
schema:
type:object
properties:
status:
type:string
data:
$ref:'#/components/schemas/ValueSetDef'
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:
type:object
properties:
SiteID:
type:integer
description:Site reference
VSName:
type:string
description:Value set name
VSDesc:
type:string
description:Value set description
responses:
'200':
description:User value set definition updated
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
data:
$ref:'#/components/schemas/ValueSetDef'
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
content:
application/json:
schema:
type:object
properties:
status:
type:string
message:
type:string
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:
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
DashboardSummary:
type:object
properties:
pendingOrders:
type:integer
todayResults:
type:integer
criticalResults:
type:integer
activePatients:
type:integer
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:
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:integer
description:Province AreaGeoID (foreign key to areageo table)
ProvinceLabel:
type:string
description:Province name (resolved from areageo)
City:
type:integer
description:City AreaGeoID (foreign key to areageo table)
CityLabel:
type:string
description:City name (resolved from areageo)
Country:
type:string
maxLength:10
description:Country ISO 3-letter code (e.g., IDN, USA)