clqms-be/public/paths/tests.yaml
mahdahar d173098652 feat: implement audit logging and test management enhancements
Major Features:
- Add comprehensive audit logging system with AuditService
- Create AuditLogs database migration for tracking changes
- Implement TestValidationService for test data validation
- Add FRONTEND_TEST_MANAGEMENT_PROMPT.md documentation

Controllers:
- Update TestsController with improved test management

Models:
- Enhance PatientModel with additional functionality
- Update TestDefSiteModel for better site management

Database:
- Add CreateAuditLogs migration (2026-02-20-000011)
- Update TestSeeder with new test data

Services:
- Add AuditService for comprehensive audit trail logging

Documentation:
- Update AGENTS.md with improved guidelines
- Update audit-logging-plan.md with implementation details
- Add FRONTEND_TEST_MANAGEMENT_PROMPT.md for frontend guidance

API Documentation:
- Update api-docs.bundled.yaml
- Update tests.yaml schema definitions
- Update tests.yaml paths

Testing:
- Enhance TestsControllerTest with new test cases
- Update TestDefModelsTest for model coverage
2026-02-20 13:47:47 +07:00

363 lines
9.5 KiB
YAML

/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/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
refnum:
type: array
items:
type: object
reftxt:
type: array
items:
type: object
testmap:
type: array
items:
type: object
required:
- SiteID
- TestSiteCode
- TestSiteName
- TestType
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
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
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
/api/tests/{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