503 lines
15 KiB
YAML
503 lines
15 KiB
YAML
/api/test:
|
|
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/tests.yaml#/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:
|
|
type: object
|
|
properties:
|
|
SiteID:
|
|
type: integer
|
|
description: Site ID (required)
|
|
TestSiteCode:
|
|
type: string
|
|
description: Test code (required)
|
|
TestSiteName:
|
|
type: string
|
|
description: Test name (required)
|
|
TestType:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
description: Test type (required)
|
|
Description:
|
|
type: string
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, RANGE, TEXT, VSET, NORES]
|
|
RefType:
|
|
type: string
|
|
enum: [RANGE, THOLD, VSET, TEXT, NOREF]
|
|
VSet:
|
|
type: integer
|
|
ReqQty:
|
|
type: number
|
|
format: decimal
|
|
ReqQtyUnit:
|
|
type: string
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
format: decimal
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
CollReq:
|
|
type: string
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
SeqScr:
|
|
type: integer
|
|
SeqRpt:
|
|
type: integer
|
|
IndentLeft:
|
|
type: integer
|
|
FontStyle:
|
|
type: string
|
|
VisibleScr:
|
|
type: integer
|
|
VisibleRpt:
|
|
type: integer
|
|
CountStat:
|
|
type: integer
|
|
details:
|
|
type: object
|
|
description: |
|
|
Type-specific details. For CALC and GROUP types, include members array.
|
|
|
|
**Important**: Members must use `TestSiteID` (the actual test ID), NOT `Member` or `SeqScr`.
|
|
Invalid TestSiteIDs will result in a 400 error.
|
|
properties:
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, RANGE, TEXT, VSET, NORES]
|
|
RefType:
|
|
type: string
|
|
enum: [RANGE, THOLD, VSET, TEXT, NOREF]
|
|
FormulaCode:
|
|
type: string
|
|
description: Formula expression for CALC type (e.g., "{TBIL} - {DBIL}")
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
default: 2
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
members:
|
|
type: array
|
|
description: |
|
|
Array of member tests for CALC and GROUP types.
|
|
Each member object must contain `TestSiteID` (the actual test ID).
|
|
Do NOT use `Member` or `SeqScr` - these will be rejected with validation error.
|
|
items:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: The actual TestSiteID of the member test (required)
|
|
required:
|
|
- TestSiteID
|
|
refnum:
|
|
type: array
|
|
items:
|
|
type: object
|
|
reftxt:
|
|
type: array
|
|
items:
|
|
type: object
|
|
testmap:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required:
|
|
- SiteID
|
|
- TestSiteCode
|
|
- TestSiteName
|
|
- TestType
|
|
examples:
|
|
CALC_test:
|
|
summary: Create calculated test with members
|
|
value:
|
|
SiteID: 1
|
|
TestSiteCode: IBIL
|
|
TestSiteName: Indirect Bilirubin
|
|
TestType: CALC
|
|
Description: Bilirubin Indirek
|
|
SeqScr: 210
|
|
SeqRpt: 210
|
|
VisibleScr: 1
|
|
VisibleRpt: 1
|
|
CountStat: 0
|
|
details:
|
|
DisciplineID: 2
|
|
DepartmentID: 2
|
|
FormulaCode: "{TBIL} - {DBIL}"
|
|
RefType: RANGE
|
|
Unit1: mg/dL
|
|
Decimal: 2
|
|
members:
|
|
- TestSiteID: 22
|
|
- TestSiteID: 23
|
|
responses:
|
|
'201':
|
|
description: Test definition created
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: created
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
'400':
|
|
description: Validation error (e.g., invalid member TestSiteID)
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: failed
|
|
message:
|
|
type: string
|
|
example: 'Invalid member TestSiteID(s): 185, 186. Make sure to use TestSiteID, not SeqScr or other values.'
|
|
|
|
patch:
|
|
tags: [Tests]
|
|
summary: Update test definition
|
|
security:
|
|
- bearerAuth: []
|
|
requestBody:
|
|
required: true
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: Test Site ID (required)
|
|
TestSiteCode:
|
|
type: string
|
|
TestSiteName:
|
|
type: string
|
|
TestType:
|
|
type: string
|
|
enum: [TEST, PARAM, CALC, GROUP, TITLE]
|
|
Description:
|
|
type: string
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, RANGE, TEXT, VSET, NORES]
|
|
RefType:
|
|
type: string
|
|
enum: [RANGE, THOLD, VSET, TEXT, NOREF]
|
|
VSet:
|
|
type: integer
|
|
ReqQty:
|
|
type: number
|
|
format: decimal
|
|
ReqQtyUnit:
|
|
type: string
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
format: decimal
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
CollReq:
|
|
type: string
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
SeqScr:
|
|
type: integer
|
|
SeqRpt:
|
|
type: integer
|
|
IndentLeft:
|
|
type: integer
|
|
FontStyle:
|
|
type: string
|
|
VisibleScr:
|
|
type: integer
|
|
VisibleRpt:
|
|
type: integer
|
|
CountStat:
|
|
type: integer
|
|
details:
|
|
type: object
|
|
description: |
|
|
Type-specific details. For CALC and GROUP types, include members array.
|
|
|
|
**Important**: Members must use `TestSiteID` (the actual test ID), NOT `Member` or `SeqScr`.
|
|
Invalid TestSiteIDs will result in a 400 error.
|
|
properties:
|
|
DisciplineID:
|
|
type: integer
|
|
DepartmentID:
|
|
type: integer
|
|
ResultType:
|
|
type: string
|
|
enum: [NMRIC, RANGE, TEXT, VSET, NORES]
|
|
RefType:
|
|
type: string
|
|
enum: [RANGE, THOLD, VSET, TEXT, NOREF]
|
|
FormulaCode:
|
|
type: string
|
|
description: Formula expression for CALC type (e.g., "{TBIL} - {DBIL}")
|
|
Unit1:
|
|
type: string
|
|
Factor:
|
|
type: number
|
|
Unit2:
|
|
type: string
|
|
Decimal:
|
|
type: integer
|
|
default: 2
|
|
Method:
|
|
type: string
|
|
ExpectedTAT:
|
|
type: integer
|
|
members:
|
|
type: array
|
|
description: |
|
|
Array of member tests for CALC and GROUP types.
|
|
Each member object must contain `TestSiteID` (the actual test ID).
|
|
Do NOT use `Member` or `SeqScr` - these will be rejected with validation error.
|
|
items:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: The actual TestSiteID of the member test (required)
|
|
required:
|
|
- TestSiteID
|
|
refnum:
|
|
type: array
|
|
items:
|
|
type: object
|
|
reftxt:
|
|
type: array
|
|
items:
|
|
type: object
|
|
testmap:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required:
|
|
- TestSiteID
|
|
responses:
|
|
'200':
|
|
description: Test definition updated
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
'400':
|
|
description: Validation error (e.g., invalid member TestSiteID)
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: failed
|
|
message:
|
|
type: string
|
|
example: 'Invalid member TestSiteID(s): 185, 186. Make sure to use TestSiteID, not SeqScr or other values.'
|
|
|
|
/api/test/{id}:
|
|
get:
|
|
tags: [Tests]
|
|
summary: Get test definition by ID
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Test Site ID
|
|
responses:
|
|
'200':
|
|
description: Test definition details
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
message:
|
|
type: string
|
|
data:
|
|
$ref: '../components/schemas/tests.yaml#/TestDefinition'
|
|
'404':
|
|
description: Test not found
|
|
|
|
delete:
|
|
tags: [Tests]
|
|
summary: Soft delete test definition
|
|
security:
|
|
- bearerAuth: []
|
|
parameters:
|
|
- name: id
|
|
in: path
|
|
required: true
|
|
schema:
|
|
type: integer
|
|
description: Test Site ID to delete
|
|
requestBody:
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
TestSiteID:
|
|
type: integer
|
|
description: Optional - can be provided in body instead of path
|
|
responses:
|
|
'200':
|
|
description: Test disabled successfully
|
|
content:
|
|
application/json:
|
|
schema:
|
|
type: object
|
|
properties:
|
|
status:
|
|
type: string
|
|
example: success
|
|
message:
|
|
type: string
|
|
data:
|
|
type: object
|
|
properties:
|
|
TestSiteId:
|
|
type: integer
|
|
EndDate:
|
|
type: string
|
|
format: date-time
|
|
'404':
|
|
description: Test not found
|
|
'422':
|
|
description: Test already disabled
|