clqms-be/public/paths/patients.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

164 lines
3.8 KiB
YAML

/api/patient:
get:
tags: [Patients]
summary: List patients
security:
- bearerAuth: []
parameters:
- name: page
in: query
schema:
type: integer
default: 1
- name: perPage
in: query
schema:
type: integer
default: 20
- name: InternalPID
in: query
schema:
type: integer
description: Filter by internal patient ID
- name: PatientID
in: query
schema:
type: string
description: Filter by patient ID
- name: Name
in: query
schema:
type: string
description: Search by patient name
- name: Birthdate
in: query
schema:
type: string
format: date
description: Filter by birthdate (YYYY-MM-DD)
responses:
'200':
description: List of patients
content:
application/json:
schema:
$ref: '../components/schemas/patient.yaml#/PatientListResponse'
post:
tags: [Patients]
summary: Create new patient
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/patient.yaml#/Patient'
responses:
'201':
description: Patient created successfully
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/SuccessResponse'
'422':
description: Validation error
content:
application/json:
schema:
$ref: '../components/schemas/common.yaml#/ErrorResponse'
patch:
tags: [Patients]
summary: Update patient
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '../components/schemas/patient.yaml#/Patient'
responses:
'200':
description: Patient updated successfully
delete:
tags: [Patients]
summary: Delete patient (soft delete)
security:
- bearerAuth: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- InternalPID
properties:
InternalPID:
type: integer
description: Internal patient record ID
responses:
'200':
description: Patient deleted successfully
/api/patient/check:
get:
tags: [Patients]
summary: Check if patient exists
security:
- bearerAuth: []
parameters:
- name: PatientID
in: query
schema:
type: string
description: Patient ID to check
- name: EmailAddress1
in: query
schema:
type: string
format: email
description: Email address to check
responses:
'200':
description: Patient check result
content:
application/json:
schema:
type: object
properties:
exists:
type: boolean
data:
$ref: '../components/schemas/patient.yaml#/Patient'
/api/patient/{id}:
get:
tags: [Patients]
summary: Get patient by ID
security:
- bearerAuth: []
parameters:
- name: id
in: path
required: true
schema:
type: integer
description: Internal patient record ID
responses:
'200':
description: Patient details
content:
application/json:
schema:
type: object
properties:
status:
type: string
data:
$ref: '../components/schemas/patient.yaml#/Patient'