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

279 lines
6.6 KiB
YAML

TestDefinition:
type: object
properties:
id:
type: integer
TestCode:
type: string
TestName:
type: string
TestType:
type: string
enum: [TEST, PARAM, CALC, GROUP, TITLE]
description: |
TEST: Technical test
PARAM: Parameter
CALC: Calculated
GROUP: Panel/Profile
TITLE: Section header
DisciplineID:
type: integer
DisciplineName:
type: string
DepartmentID:
type: integer
DepartmentName:
type: string
Unit:
type: string
Formula:
type: string
refnum:
type: array
description: Numeric reference ranges (optional). Mutually exclusive with reftxt - a test can only have ONE reference type.
items:
type: object
properties:
RefNumID:
type: integer
NumRefType:
type: string
enum: [NMRC, THOLD]
description: NMRC=Numeric range, THOLD=Threshold
NumRefTypeLabel:
type: string
RangeType:
type: string
RangeTypeLabel:
type: string
Sex:
type: string
SexLabel:
type: string
LowSign:
type: string
LowSignLabel:
type: string
HighSign:
type: string
HighSignLabel:
type: string
High:
type: number
format: float
Low:
type: number
format: float
AgeStart:
type: integer
AgeEnd:
type: integer
Flag:
type: string
Interpretation:
type: string
reftxt:
type: array
description: Text reference ranges (optional). Mutually exclusive with refnum - a test can only have ONE reference type.
items:
type: object
properties:
RefTxtID:
type: integer
TxtRefType:
type: string
enum: [TEXT, VSET]
description: TEXT=Free text, VSET=Value set
TxtRefTypeLabel:
type: string
Sex:
type: string
SexLabel:
type: string
AgeStart:
type: integer
AgeEnd:
type: integer
RefTxt:
type: string
Flag:
type: string
examples:
$1:
Unit: mg/dL
refnum:
- RefNumID: 1
NumRefType: NMRC
NumRefTypeLabel: Numeric
RangeType: REF
RangeTypeLabel: Reference Range
Sex: '2'
SexLabel: Male
LowSign: GE
LowSignLabel: ">="
HighSign: LE
HighSignLabel: "<="
Low: 70
High: 100
AgeStart: 18
AgeEnd: 99
Flag: N
Interpretation: Normal
TEST_numeric_thold:
summary: Technical test - threshold reference (THOLD)
value:
id: 1
TestCode: GLU
TestName: Glucose
TestType: TEST
DisciplineID: 1
DepartmentID: 1
Unit: mg/dL
refnum:
- RefNumID: 2
NumRefType: THOLD
NumRefTypeLabel: Threshold
RangeType: PANIC
RangeTypeLabel: Panic Range
Sex: '1'
SexLabel: Female
LowSign: LT
LowSignLabel: "<"
High: 40
AgeStart: 0
AgeEnd: 120
Flag: L
Interpretation: Critical Low
$2:
Unit: null
reftxt:
- RefTxtID: 1
TxtRefType: TEXT
TxtRefTypeLabel: Text
Sex: '2'
SexLabel: Male
AgeStart: 18
AgeEnd: 99
RefTxt: 'NORM=Normal;HYPO=Hypochromic;MACRO=Macrocytic'
Flag: N
TEST_text_vset:
summary: Technical test - text reference (VSET)
value:
id: 1
TestCode: STAGE
TestName: Disease Stage
TestType: TEST
DisciplineID: 1
DepartmentID: 1
Unit: null
reftxt:
- RefTxtID: 2
TxtRefType: VSET
TxtRefTypeLabel: Value Set
Sex: '1'
SexLabel: Female
AgeStart: 0
AgeEnd: 120
RefTxt: 'STG1=Stage 1;STG2=Stage 2;STG3=Stage 3;STG4=Stage 4'
Flag: N
PARAM:
summary: Parameter - no reference range allowed
value:
id: 2
TestCode: GLU_FAST
TestName: Fasting Glucose
TestType: PARAM
DisciplineID: 1
DepartmentID: 1
Unit: mg/dL
$3:
Unit: null
Formula: "BUN / Creatinine"
refnum:
- RefNumID: 5
NumRefType: NMRC
NumRefTypeLabel: Numeric
RangeType: REF
RangeTypeLabel: Reference Range
Sex: '1'
SexLabel: Female
LowSign: GE
LowSignLabel: ">="
HighSign: LE
HighSignLabel: "<="
Low: 10
High: 20
AgeStart: 18
AgeEnd: 120
Flag: N
Interpretation: Normal
$4:
Unit: null
Formula: "BUN / Creatinine"
refnum:
- RefNumID: 6
NumRefType: THOLD
NumRefTypeLabel: Threshold
RangeType: PANIC
RangeTypeLabel: Panic Range
Sex: '1'
SexLabel: Female
LowSign: GT
LowSignLabel: ">"
Low: 20
AgeStart: 18
AgeEnd: 120
Flag: H
Interpretation: Elevated - possible prerenal cause
GROUP:
summary: Panel/Profile - no reference range allowed
value:
id: 4
TestCode: LIPID
TestName: Lipid Panel
TestType: GROUP
DisciplineID: 1
DepartmentID: 1
Unit: null
TITLE:
summary: Section header - no reference range allowed
value:
id: 5
TestCode: CHEM_HEADER
TestName: '--- CHEMISTRY ---'
TestType: TITLE
DisciplineID: 1
DepartmentID: 1
Unit: null
TestMap:
type: object
properties:
id:
type: integer
TestMapID:
type: integer
TestCode:
type: string
HostCode:
type: string
HostName:
type: string
ClientCode:
type: string
ClientName:
type: string
HostType:
type: string
description: Host type code
HostTypeLabel:
type: string
description: Host type display text
ClientType:
type: string
description: Client type code
ClientTypeLabel:
type: string
description: Client type display text