clqms-be/public/paths/results.yaml
mahdahar fcaf9b74ea feat: Restructure OpenAPI documentation with modular components
- Add OpenApiDocs controller for serving bundled API docs

- Split monolithic api-docs.yaml into modular components/

- Add organized paths/ directory with endpoint definitions

- Create bundling scripts (JS, PHP, Python) for merging docs

- Add API_DOCS_README.md with documentation guidelines

- Update Routes.php for new API documentation endpoints

- Update swagger.php view and TestDefSiteModel
2026-02-16 14:20:52 +07:00

264 lines
7.0 KiB
YAML

/api/results:
get:
tags: [Results]
summary: Get patient results
description: Retrieve patient test results with optional filters
security:
- bearerAuth: []
parameters:
- name: InternalPID
in: query
schema:
type: integer
description: Filter by internal patient ID
- name: OrderID
in: query
schema:
type: string
description: Filter by order ID
- name: TestCode
in: query
schema:
type: string
description: Filter by test code
- name: date_from
in: query
schema:
type: string
format: date
description: Filter results from date (YYYY-MM-DD)
- name: date_to
in: query
schema:
type: string
format: date
description: Filter results to date (YYYY-MM-DD)
- name: verified_only
in: query
schema:
type: boolean
default: false
description: Return only verified results
responses:
'200':
description: List of patient results
content:
application/json:
schema:
type: object
properties:
status:
type: string
data:
type: array
items:
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
post:
tags: [Results]
summary: Create or update result
description: Create a new result or update an existing result entry
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- InternalPID
- TestID
- ResultValue
properties:
InternalPID:
type: integer
OrderID:
type: string
TestID:
type: integer
ResultValue:
type: string
Unit:
type: string
AbnormalFlag:
type: string
enum: [H, L, N, A, C]
description: H=High, L=Low, N=Normal, A=Abnormal, C=Critical
responses:
'201':
description: Result created successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
/api/results/{id}:
get:
tags: [Results]
summary: Get result by ID
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/common.yaml#/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/common.yaml#/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/common.yaml#/SuccessResponse'