From 796dc94286472517833b8e5a0ae54c76030a06d9 Mon Sep 17 00:00:00 2001 From: mahdahar <89adham@gmail.com> Date: Thu, 23 Apr 2026 16:30:06 +0700 Subject: [PATCH] docs(api): add DepartmentID query filter to tests endpoints Add DepartmentID as optional query parameter in tests path spec. Regenerate bundled OpenAPI so bundled contract matches source docs and includes latest wording updates. --- public/api-docs.bundled.yaml | 9 +- public/paths/tests.yaml | 585 ++++++++++++++++++----------------- 2 files changed, 302 insertions(+), 292 deletions(-) diff --git a/public/api-docs.bundled.yaml b/public/api-docs.bundled.yaml index 73ecf5c..23a0a1f 100755 --- a/public/api-docs.bundled.yaml +++ b/public/api-docs.bundled.yaml @@ -1505,9 +1505,9 @@ paths: Tests: type: object properties: - added: + created: type: array - description: New tests to add to this order + description: New tests to create for this order items: type: object properties: @@ -4696,6 +4696,11 @@ paths: schema: type: integer description: Filter by site ID + - name: DepartmentID + in: query + schema: + type: integer + description: Filter by department ID - name: TestType in: query schema: diff --git a/public/paths/tests.yaml b/public/paths/tests.yaml index 22dccde..950c395 100755 --- a/public/paths/tests.yaml +++ b/public/paths/tests.yaml @@ -22,6 +22,11 @@ schema: type: integer description: Filter by site ID + - name: DepartmentID + in: query + schema: + type: integer + description: Filter by department ID - name: TestType in: query schema: @@ -185,21 +190,21 @@ FormulaCode: type: string description: Formula expression for calculated tests (e.g., "{TBIL} - {DBIL}") - testdefgrp: - type: object - description: Group definition wrapper for CALC/GROUP member assignments. - properties: - members: - type: array - description: Array of member TestSiteIDs for CALC/GROUP definitions. - items: - type: object - properties: - TestSiteID: - type: integer - description: Foreign key referencing the member test's TestSiteID. - required: - - TestSiteID + testdefgrp: + type: object + description: Group definition wrapper for CALC/GROUP member assignments. + properties: + members: + type: array + description: Array of member TestSiteIDs for CALC/GROUP definitions. + items: + type: object + properties: + TestSiteID: + type: integer + description: Foreign key referencing the member test's TestSiteID. + required: + - TestSiteID refnum: type: array items: @@ -208,32 +213,32 @@ type: array items: type: object - testmap: - type: array - items: - type: object - properties: - HostType: - type: string - HostID: - type: string - HostTestCode: - type: string - HostTestName: - type: string - ClientType: - type: string - ClientID: - type: string - ClientTestCode: - type: string - ClientTestName: - type: string - ConDefID: - type: integer - nullable: true - required: - - SiteID + testmap: + type: array + items: + type: object + properties: + HostType: + type: string + HostID: + type: string + HostTestCode: + type: string + HostTestName: + type: string + ClientType: + type: string + ClientID: + type: string + ClientTestCode: + type: string + ClientTestName: + type: string + ConDefID: + type: integer + nullable: true + required: + - SiteID - TestSiteCode - TestSiteName - TestType @@ -290,8 +295,8 @@ Low: 70 HighSign: LE High: 100 - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 Flag: N DisciplineID: 2 DepartmentID: 2 @@ -319,8 +324,8 @@ Low: 70 HighSign: LE High: 100 - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 Flag: N - NumRefType: NMRC RangeType: REF @@ -329,37 +334,37 @@ Low: 75 HighSign: < High: 105 - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 Flag: N - testmap: - - HostType: SITE - HostID: '1' - HostTestCode: GLU - HostTestName: Glucose - ClientType: WST - ClientID: '1' - ClientTestCode: GLU_C - ClientTestName: Glucose Client - ConDefID: 1 - - HostType: SITE - HostID: '1' - HostTestCode: CREA - HostTestName: Creatinine - ClientType: WST - ClientID: '1' - ClientTestCode: CREA_C - ClientTestName: Creatinine Client - ConDefID: 2 - - HostType: WST - HostID: '3' - HostTestCode: HB - HostTestName: Hemoglobin - ClientType: INST - ClientID: '2' - ClientTestCode: HB_C - ClientTestName: Hemoglobin Client - ConDefID: 3 + testmap: + - HostType: SITE + HostID: '1' + HostTestCode: GLU + HostTestName: Glucose + ClientType: WST + ClientID: '1' + ClientTestCode: GLU_C + ClientTestName: Glucose Client + ConDefID: 1 + - HostType: SITE + HostID: '1' + HostTestCode: CREA + HostTestName: Creatinine + ClientType: WST + ClientID: '1' + ClientTestCode: CREA_C + ClientTestName: Creatinine Client + ConDefID: 2 + - HostType: WST + HostID: '3' + HostTestCode: HB + HostTestName: Hemoglobin + ClientType: INST + ClientID: '2' + ClientTestCode: HB_C + ClientTestName: Hemoglobin Client + ConDefID: 3 DisciplineID: 2 DepartmentID: 2 ResultType: NMRIC @@ -385,7 +390,7 @@ LowSign: LT Low: 120 AgeStart: 0 - AgeEnd: 45625 + AgeEnd: 45625 Flag: H DisciplineID: 2 DepartmentID: 2 @@ -412,7 +417,7 @@ LowSign: LT Low: 120 AgeStart: 0 - AgeEnd: 45625 + AgeEnd: 45625 Flag: H - NumRefType: THOLD RangeType: PANIC @@ -420,7 +425,7 @@ LowSign: < Low: 121 AgeStart: 0 - AgeEnd: 45625 + AgeEnd: 45625 Flag: H testmap: - HostType: SITE @@ -460,8 +465,8 @@ - SpcType: GEN TxtRefType: TEXT Sex: '2' - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 RefTxt: NORM=Normal;HIGH=High Flag: N DisciplineID: 1 @@ -485,15 +490,15 @@ - SpcType: GEN TxtRefType: TEXT Sex: '2' - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 RefTxt: NORM=Normal Flag: N - SpcType: GEN TxtRefType: TEXT Sex: '1' - AgeStart: 6570 - AgeEnd: 36135 + AgeStart: 6570 + AgeEnd: 36135 RefTxt: ABN=Abnormal Flag: N testmap: @@ -528,7 +533,7 @@ TxtRefType: VSET Sex: '2' AgeStart: 0 - AgeEnd: 43800 + AgeEnd: 43800 RefTxt: NORM=Normal;MACRO=Macro Flag: N DisciplineID: 4 @@ -553,7 +558,7 @@ TxtRefType: VSET Sex: '2' AgeStart: 0 - AgeEnd: 43800 + AgeEnd: 43800 RefTxt: NORM=Normal;ABN=Abnormal Flag: N testmap: @@ -612,12 +617,12 @@ isCountStat: 0 DisciplineID: 2 DepartmentID: 2 - testdefcal: - FormulaCode: CKD_EPI(CREA,AGE,GENDER) - testdefgrp: - members: - - TestSiteID: 21 - - TestSiteID: 22 + testdefcal: + FormulaCode: CKD_EPI(CREA,AGE,GENDER) + testdefgrp: + members: + - TestSiteID: 21 + - TestSiteID: 22 CALC_full: summary: Calculated test with numeric reference ranges and map value: @@ -638,8 +643,8 @@ Low: 10 HighSign: LE High: 20 - AgeStart: 6570 - AgeEnd: 43800 + AgeStart: 6570 + AgeEnd: 43800 Flag: N testmap: - HostType: SITE @@ -654,12 +659,12 @@ ClientTestName: eGFR Client DisciplineID: 2 DepartmentID: 2 - testdefcal: - FormulaCode: CKD_EPI(CREA,AGE,GENDER) - testdefgrp: - members: - - TestSiteID: 21 - - TestSiteID: 22 + testdefcal: + FormulaCode: CKD_EPI(CREA,AGE,GENDER) + testdefgrp: + members: + - TestSiteID: 21 + - TestSiteID: 22 GROUP_with_members: summary: Group/profile test with members and mapping value: @@ -683,10 +688,10 @@ ConDefID: 1 ClientTestCode: LIPID_C ClientTestName: Lipid Client - testdefgrp: - members: - - TestSiteID: 169 - - TestSiteID: 170 + testdefgrp: + members: + - TestSiteID: 169 + - TestSiteID: 170 responses: '201': @@ -720,10 +725,10 @@ type: string example: 'Invalid member TestSiteID(s): 185, 186. Make sure to use TestSiteID, not SeqScr or other values.' -/api/test/{id}: - get: - tags: [Test] - summary: Get test definition by ID +/api/test/{id}: + get: + tags: [Test] + summary: Get test definition by ID security: - bearerAuth: [] parameters: @@ -734,188 +739,188 @@ 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 - - patch: - tags: [Test] - summary: Update test definition - security: - - bearerAuth: [] - parameters: - - name: id - in: path - required: true - schema: - type: integer - description: Test Site ID - 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 - isVisibleScr: - type: integer - isVisibleRpt: - type: integer - isCountStat: - type: integer - testdefcal: - type: object - description: Calculated test metadata persisted in the `testdefcal` table. - properties: - FormulaCode: - type: string - description: Formula expression for calculated tests (e.g., "{TBIL} - {DBIL}") - testdefgrp: - type: object - description: Group definition wrapper for CALC/GROUP member assignments. - properties: - members: - type: array - description: Array of member TestSiteIDs for CALC/GROUP definitions. - items: - type: object - properties: - TestSiteID: - type: integer - description: Foreign key referencing the member test's TestSiteID. - required: - - TestSiteID - refnum: - type: array - items: - type: object - reftxt: - type: array - items: - type: object - testmap: - type: array - items: - type: object - properties: - HostType: - type: string - HostID: - type: string - HostTestCode: - type: string - HostTestName: - type: string - ClientType: - type: string - ClientID: - type: string - ClientTestCode: - type: string - ClientTestName: - type: string - ConDefID: - type: integer - nullable: true - 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 - '400': - description: Validation error (e.g., invalid member TestSiteID) - content: - application/json: - schema: - type: object - properties: - status: - type: string - example: failed - message: - type: string - example: 'Invalid member TestSiteID(s): 185, 186. Make sure to use TestSiteID, not SeqScr or other values.' - - delete: + '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 + + patch: + tags: [Test] + summary: Update test definition + security: + - bearerAuth: [] + parameters: + - name: id + in: path + required: true + schema: + type: integer + description: Test Site ID + 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 + isVisibleScr: + type: integer + isVisibleRpt: + type: integer + isCountStat: + type: integer + testdefcal: + type: object + description: Calculated test metadata persisted in the `testdefcal` table. + properties: + FormulaCode: + type: string + description: Formula expression for calculated tests (e.g., "{TBIL} - {DBIL}") + testdefgrp: + type: object + description: Group definition wrapper for CALC/GROUP member assignments. + properties: + members: + type: array + description: Array of member TestSiteIDs for CALC/GROUP definitions. + items: + type: object + properties: + TestSiteID: + type: integer + description: Foreign key referencing the member test's TestSiteID. + required: + - TestSiteID + refnum: + type: array + items: + type: object + reftxt: + type: array + items: + type: object + testmap: + type: array + items: + type: object + properties: + HostType: + type: string + HostID: + type: string + HostTestCode: + type: string + HostTestName: + type: string + ClientType: + type: string + ClientID: + type: string + ClientTestCode: + type: string + ClientTestName: + type: string + ConDefID: + type: integer + nullable: true + 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 + '400': + description: Validation error (e.g., invalid member TestSiteID) + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: failed + message: + type: string + example: 'Invalid member TestSiteID(s): 185, 186. Make sure to use TestSiteID, not SeqScr or other values.' + + delete: tags: [Test] summary: Soft delete test definition security: