clqms-be/public/api-docs.yaml
mahdahar 85c7e96405 feat: implement comprehensive result management and lab reporting system
- Add full CRUD operations for results (index, show, update, delete)
- Implement result validation with reference range checking (L/H flags)
- Add cumulative patient results retrieval across all orders
- Create ReportController for HTML lab report generation
- Add lab report view with patient info, order details, and test results
- Implement soft delete for results with transaction safety
- Update API routes with /api/results/* endpoints for CRUD
- Add /api/reports/{orderID} endpoint for report viewing
- Update OpenAPI docs with results and reports schemas/paths
- Add documentation for manual result entry and MVP plan
2026-03-04 16:48:12 +07:00

177 lines
5.9 KiB
YAML

openapi: 3.1.0
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.
**IMPORTANT:** For OpenAPI tools (Swagger UI, Redoc, Postman, etc.), use the bundled file:
`api-docs.bundled.yaml` which contains all paths and schemas merged into one file.
This file (api-docs.yaml) contains schema references and is meant for development.
The paths are defined in separate files in the `paths/` directory.
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 with auto-validation
- name: Reports
description: Lab report generation (HTML view)
- name: Edge API
description: Instrument integration endpoints
- name: Contacts
description: Contact management (doctors, practitioners, etc.)
- name: Locations
description: Location management (rooms, wards, buildings)
- name: ValueSets
description: Value set definitions and items
- name: Demo
description: Demo/test endpoints (no authentication)
- name: EquipmentList
description: Laboratory equipment and instrument management
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:
$ref: './components/schemas/common.yaml#/SuccessResponse'
ErrorResponse:
$ref: './components/schemas/common.yaml#/ErrorResponse'
DashboardSummary:
$ref: './components/schemas/common.yaml#/DashboardSummary'
# Authentication schemas
LoginRequest:
$ref: './components/schemas/authentication.yaml#/LoginRequest'
LoginResponse:
$ref: './components/schemas/authentication.yaml#/LoginResponse'
RegisterRequest:
$ref: './components/schemas/authentication.yaml#/RegisterRequest'
# Patient schemas
Patient:
$ref: './components/schemas/patient.yaml#/Patient'
PatientIdentifier:
$ref: './components/schemas/patient.yaml#/PatientIdentifier'
LinkedPatient:
$ref: './components/schemas/patient.yaml#/LinkedPatient'
Custodian:
$ref: './components/schemas/patient.yaml#/Custodian'
PatAttEntry:
$ref: './components/schemas/patient.yaml#/PatAttEntry'
PatientListResponse:
$ref: './components/schemas/patient.yaml#/PatientListResponse'
# Patient Visit schemas
PatientVisit:
$ref: './components/schemas/patient-visit.yaml#/PatientVisit'
PatVisitADT:
$ref: './components/schemas/patient-visit.yaml#/PatVisitADT'
# Organization schemas
Account:
$ref: './components/schemas/organization.yaml#/Account'
Site:
$ref: './components/schemas/organization.yaml#/Site'
Discipline:
$ref: './components/schemas/organization.yaml#/Discipline'
Department:
$ref: './components/schemas/organization.yaml#/Department'
Workstation:
$ref: './components/schemas/organization.yaml#/Workstation'
HostApp:
$ref: './components/schemas/organization.yaml#/HostApp'
HostComPara:
$ref: './components/schemas/organization.yaml#/HostComPara'
CodingSys:
$ref: './components/schemas/organization.yaml#/CodingSys'
# Specimen schemas
Specimen:
$ref: './components/schemas/specimen.yaml#/Specimen'
ContainerDef:
$ref: './components/schemas/specimen.yaml#/ContainerDef'
SpecimenPrep:
$ref: './components/schemas/specimen.yaml#/SpecimenPrep'
SpecimenStatus:
$ref: './components/schemas/specimen.yaml#/SpecimenStatus'
SpecimenCollection:
$ref: './components/schemas/specimen.yaml#/SpecimenCollection'
# Tests schemas
TestDefinition:
$ref: './components/schemas/tests.yaml#/TestDefinition'
TestMap:
$ref: './components/schemas/tests.yaml#/TestMap'
# Orders schemas
OrderTest:
$ref: './components/schemas/orders.yaml#/OrderTest'
OrderItem:
$ref: './components/schemas/orders.yaml#/OrderItem'
# Edge API schemas
EdgeResultRequest:
$ref: './components/schemas/edge-api.yaml#/EdgeResultRequest'
EdgeResultResponse:
$ref: './components/schemas/edge-api.yaml#/EdgeResultResponse'
EdgeOrder:
$ref: './components/schemas/edge-api.yaml#/EdgeOrder'
# ValueSets schemas
ValueSetLibItem:
$ref: './components/schemas/valuesets.yaml#/ValueSetLibItem'
ValueSetDef:
$ref: './components/schemas/valuesets.yaml#/ValueSetDef'
ValueSetItem:
$ref: './components/schemas/valuesets.yaml#/ValueSetItem'
# Locations schemas
Location:
$ref: './components/schemas/master-data.yaml#/Location'
# EquipmentList schemas
EquipmentList:
$ref: './components/schemas/equipmentlist.yaml#/EquipmentList'
# Paths are in separate files in the paths/ directory
# To view the complete API with all paths, use: api-docs.bundled.yaml
# To rebuild the bundle after changes: python bundle-api-docs.py
paths: {}