# 異常通知設定 --- API 清單 * 生理量測 * [列表](#生理量測-列表) * [新增](#生理量測-新增) * [編輯資訊](#生理量測-編輯資訊) * [回復系統預設值](#生理量測-回復系統預設值) * [狀態切換](#生理量測-狀態切換) * 檢測項目 * [列表](#檢測項目-列表) * [新增](#檢測項目-新增) * [編輯資訊](#檢測項目-編輯資訊) * [回復系統預設值](#檢測項目-回復系統預設值) * [狀態切換](#檢測項目-狀態切換) --- ## 常數定義 ### 量測指標 | 欄位 | 型態 | 說明 | |----------|--------|----------------------------------------------------------------------------------------------------------------------------------------------| | itemName | String | BLOOD_PRESSURE 血壓<br/>BLOOD_SUGAR 血糖<br/> BMI BMI,<br/> BODY_WEIGHT 體重<br/>FAT 體脂<br/>HIPS 臀圍<br/>MUSCLE 肌肉量<br/>TEMPERATURE 體溫<br/>WAIST 腰圍 | ### 通知頻率 | 欄位 | 型態 | 說明 | |---------------|--------|---------------------------------------------------| | frequencyType | String | REAL_TIME 即時<br/> REACHED 達標<br/>PERIODIC 週期<br/> | ### 類型 | 欄位 | 型態 | 說明 | |---------------|--------|------------------------------| | conditionType | String | DEFAULT 系統預設值<br/> CUSTOM 自訂 | ### 週期 | 欄位 | 型態 | 說明 | |--------|--------|---------------------------------------| | period | String | DAILY 每日<br/>WEEKLY 每週<br/>MONTHLY 每月 | ### 星期 | 欄位 | 型態 | 說明 | |----------|--------|---------------------------------------------------------------------------------------------------------------| | weekDays | String | MONDAY 星期一<br/> TUESDAY 星期二<br/>WEDNESDAY 星期三<br/>THURSDAY 星期四<br/>FRIDAY 星期五<br/>SATURDAY 星期六<br/>SUNDAY 星期日 | ### 檢驗類型 | 欄位 | 型態 | 說明 | |-------------|--------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | subCategory | String | GENERAL_TEST 一般檢驗<br/>BLOOD_GENERAL_TEST 血液一般檢驗<br/>URINE_GENERAL_TEST 尿液一般檢驗<br/>URINE_SPECIAL_TEST 尿液特殊檢驗<br/>BIOCHEMICAL_TEST 生化檢驗<br/>DIABETES_INSPECTION 糖尿病檢查<br/>LIVER_FUNCTION_INSPECTION 肝功能檢查<br/>CARDIOVASCULAR_LIPID_INSPECTION 心臟血管與血脂肪檢查<br/>THYROID_FUNCTION_INSPECTION 甲狀腺功能檢查<br/>GENERAL_EXAM 一般檢查<br/>X_RAY_EXAM X光檢查<br/>PHYSIOTHERAPY_EXAM 理學檢查<br/>OTHER_EXAM 其他 | --- ## 生理量測-列表 ```url POST /abnormalNotification/measure/list ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----------|-----|----|----|----| | current | int | Y | | | | pageSize | int | Y | | | sorter | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------|--------|----|------------|------------------------------------------------------------------------------| | field | int | Y | updateTime | itemName、comparisonDescription、title、content、frequencyType、status、updateTime | | order | String | | desc | | ```json { "pagination": { "current": 1, "pageSize": 10 }, "sorter": { "field": "recordTime", "order": "desc" } } ``` #### Response | 欄位 | 型態 | 說明 | |-----------------------|---------|---------------| | id | String | | | itemName | String | [量測指標](#量測指標) | | comparisonDescription | String | 通知條件 | | title | String | 通知訊息提醒 | | content | String | 通知訊息內容 | | frequencyType | String | [通知頻率](#通知頻率) | | conditionType | String | [類型](#類型) | | status | boolean | 狀態 | ```json { "httpCode": 200, "result": { "data": [ { "id": "d54ac8c1-86e5-475c-a8e1-6616f28c1244", "itemName": "FAT", "comparisonDescription": "女性 30歲以上 體脂>=27", "title": "體脂量測異常", "content": "您的體脂肪率太高囉!表示您體脂肪儲存過量造成肥胖。即使體重(BMI)正常,體脂肪若超過標準也是肥胖。飲食控制熱量不過量,並搭配身體活動消耗熱量增加,才能真的達到減脂的效果,才能逐步擁有健康的體位。", "frequencyType": "REAL_TIME", "conditionType": "DEFAULT", "status": false }, { "id": "6f025b40-292b-49ce-a5af-62ee46eb3c35", "itemName": "FAT", "comparisonDescription": "男性 30歲以上 體脂>=23", "title": "體脂量測異常", "content": "您的體脂肪率太高囉!表示您體脂肪儲存過量造成肥胖。即使體重(BMI)正常,體脂肪若超過標準也是肥胖。飲食控制熱量不過量,並搭配身體活動消耗熱量增加,才能真的達到減脂的效果,才能逐步擁有健康的體位。", "frequencyType": "REAL_TIME", "conditionType": "DEFAULT", "status": false } ], "pagination": { "current": 1, "pageSize": 100, "total": 27 }, "sorter": { "field": "content", "order": "desc" }, "total": 27 } } ``` ## 生理量測-編輯資訊 ```url POST /abnormalNotification/measure/info ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----|--------|----|----|----| | id | String | Y | | | ```json { "id": "1f332787-a75f-4817-a8cb-2afaa6722053" } ``` #### Response | 欄位 | 型態 | 說明 | |------------------------|--------|-----------------------| | id | String | | | thresholdList | array | 閾值 | | comparisonOperatorList | array | 比較運算子 >, >=, <, <=, = | | title | String | 標題 | | content | String | 通知內容 | | frequencyType | String | [通知頻率](#通知頻率) | | reached | Object | | | periodic | Object | | reached | 欄位 | 型態 | 說明 | |-------|--------|----| | times | Number | | periodic | 欄位 | 型態 | 說明 | |-------------|--------|-----------| | periodType | String | [週期](#週期) | | weekDays | String | [星期](#星期) | | time | String | HH:mm | | daysOfMonth | Number | 1~31 | ```json { "httpCode": 200, "result": { "data": { "comparisonDescriptionTemplate": "收縮壓 ${comparisonOperator[0]}${threshold[0]} 或 舒張壓 ${comparisonOperator[1]}${threshold[1]}", "thresholdList": [ 130, 80 ], "comparisonOperatorList": [ ">=", ">=" ], "title": "血壓量測異常", "content": "您的血壓值高囉!對於罹患慢性病及銀髮族群,除落實良好生活型態外,更需持續規律服藥,切勿擅自停藥,讓病情得到妥善的控制。保持居家血壓722原則:「7」連續七天量測、「2」早上起床後、晚上睡覺前各量一次、「2」每次量兩遍。透過「定期血壓」清楚掌握血壓狀況,是做好血壓管理的重要關鍵。", "frequencyType": "REAL_TIME", "reached": { "times": 10 }, "periodic": { "periodType": "DAILY", "weekDays": "MONDAY", "time": "08:44", "daysOfMonth": 31 } } } } ``` ## 生理量測-新增 ```url POST /abnormalNotification/measure/add ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |------------------------|--------|----|----|-----------------------| | id | String | Y | | | | thresholdList | array | Y | | 閾值 | | comparisonOperatorList | array | Y | | 比較運算子 >, >=, <, <=, = | | title | String | Y | | @Size(max = 200) | | content | String | Y | | @Size(max = 500) | | frequencyType | String | Y | | [通知頻率](#通知頻率) | | reached | Object | N | | 達標 | | periodic | Object | N | | 週期 | reached | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------|--------|----|----|------| | times | Number | N | | 1~10 | periodic | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------------|--------|----|----|-----------| | periodType | String | N | | [週期](#週期) | | weekDays | String | N | | [星期](#星期) | | time | String | N | | HH:mm | | daysOfMonth | Number | N | | 1~31 | ```json { "id": "1f332787-a75f-4817-a8cb-2afaa6722053", "thresholdList": [ 20 ], "comparisonOperatorList": [ ">=" ], "title": "我是標題", "content": "我是通知內容", "frequencyType": "PERIODIC", "reached": { "times": 10 }, "periodic": { "periodType": "DAILY", "weekDays": "MONDAY", "time": "08:44", "daysOfMonth": 31 } } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "bce25f2b-af78-4d34-bcc3-55612b050afd" } } ``` ## 生理量測-回復系統預設值 ```url POST /abnormalNotification/measure/delete ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----|--------|----|----|----| | id | String | Y | | | ```json { "id": "67797fe0-791d-4d85-a4c6-09ca0a9f1481" } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "8a394696-6440-4722-a8e5-9a73f27c513e" } } ``` ## 生理量測-狀態切換 ```url POST /abnormalNotification/measure/update-status ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |--------|---------|----|----|----| | id | String | Y | | | | status | boolean | Y | | | ```json { "id": "67797fe0-791d-4d85-a4c6-09ca0a9f1481", "status": true } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "8a394696-6440-4722-a8e5-9a73f27c513e" } } ``` ----- ## 檢測項目-列表 ```url POST /abnormalNotification/indicator/list ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----------|-----|----|----|----| | current | int | Y | | | | pageSize | int | Y | | | sorter | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------|--------|----|------------|----------------------------------------------------------------------------------------------| | field | int | Y | updateTime | subCategory、description、itemName、title、comparisonDescription、frequencyType、status、updateTime | | order | String | | desc | | ```json { "pagination": { "current": 1, "pageSize": 10 }, "sorter": { "field": "recordTime", "order": "desc" } } ``` #### Response | 欄位 | 型態 | 說明 | |-----------------------|---------|---------------| | id | String | | | itemName | String | 名稱 | | subCategory | String | [檢驗類型](#檢驗類型) | | description | String | 檢驗項目 | | comparisonDescription | String | 通知條件 | | title | String | 通知訊息提醒 | | frequencyType | String | [通知頻率](#通知頻率) | | conditionType | String | [類型](#類型) | | status | boolean | 狀態 | ```json { "httpCode": 200, "result": { "data": [ { "id": "19015403-1b98-4a3a-bf42-f5b7e9a7d771", "itemName": "Sodium, Na", "subCategory": "BIOCHEMICAL_TEST", "description": "鈉", "comparisonDescription": "> 4.7 ", "title": "高納危險", "frequencyType": "REAL_TIME", "conditionType": "DEFAULT", "status": false }, { "id": "8ace07b9-af28-4d0c-ae37-585fe22a1a11", "itemName": "RBC", "subCategory": "GENERAL_TEST", "description": "紅血球", "comparisonDescription": "RBC < 2.5 或 RBC > 8 ", "title": "紅血球(RBC)數異常", "frequencyType": "REAL_TIME", "conditionType": "DEFAULT", "status": false } ], "pagination": { "current": 1, "pageSize": 100, "total": 27 }, "sorter": { "field": "content", "order": "desc" }, "total": 27 } } ``` ## 檢測項目-編輯資訊 ```url POST /abnormalNotification/indicator/info ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----|--------|----|----|----| | id | String | Y | | | ```json { "id": "1f332787-a75f-4817-a8cb-2afaa6722053" } ``` #### Response | 欄位 | 型態 | 說明 | |------------------------|--------|-----------------------| | comparisonOperatorList | array | 比較運算子 >, >=, <, <=, = | | thresholdList | array | 閾值 | | title | String | 標題 | | content | String | 通知內容 | | extraInstructions | String | 特別說明 | | frequencyType | String | [通知頻率](#通知頻率) | | reached | Object | | | periodic | Object | | reached | 欄位 | 型態 | 說明 | |-------|--------|----| | times | Number | | periodic | 欄位 | 型態 | 說明 | |-------------|--------|-----------| | periodType | String | [週期](#週期) | | weekDays | String | [星期](#星期) | | time | String | HH:mm | | daysOfMonth | Number | 1~31 | ```json { "httpCode": 200, "result": { "data": { "comparisonDescriptionTemplate": "${threshold[0]} ${comparisonOperator[0]} GFR ${comparisonOperator[1]} ${threshold[1]} & UPCR ${comparisonOperator[2]} ${threshold[2]} ", "thresholdList": [ 60, 89.9, 999 ], "comparisonOperatorList": [ "<=", "<=", ">=" ], "title": "第2期腎臟病", "content": "您檢驗檢查報告顯示您存在第2期腎臟病之風險,請盡快回診進行進一步腎臟檢查。", "extraInstructions": "我是特別說明", "frequencyType": "PERIODIC", "reached": { "times": 10 }, "periodic": { "periodType": "DAILY", "weekDays": "MONDAY", "time": "08:44", "daysOfMonth": 31 } } } } ``` ## 檢測項目-新增 ```url POST /abnormalNotification/indicator/add ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |------------------------|--------|----|----|-----------------------| | id | String | Y | | | | thresholdList | array | Y | | 閾值 | | comparisonOperatorList | array | Y | | 比較運算子 >, >=, <, <=, = | | title | String | Y | | @Size(max = 200) | | content | String | Y | | @Size(max = 500) | | extraInstructions | String | N | | @Size(max = 500) | | frequencyType | String | Y | | [通知頻率](#通知頻率) | | reached | Object | N | | 達標 | | periodic | Object | N | | 週期 | reached | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------|--------|----|----|------| | times | Number | N | | 1~10 | periodic | 欄位 | 型態 | 必填 | 預設 | 說明 | |-------------|--------|----|----|-----------| | periodType | String | N | | [週期](#週期) | | weekDays | String | N | | [星期](#星期) | | time | String | N | | HH:mm | | daysOfMonth | Number | N | | 1~31 | ```json { "id": "ef8c2b2b-7467-4953-8d0c-885f6c1c241e", "thresholdList": [ 400 ], "comparisonOperatorList": [ "<" ], "title": "我是標題", "content": "我是通知內容", "extraInstructions": "我是特別說明", "frequencyType": "REACHED", "reached": { "times": 10 }, "periodic": { "periodType": "DAILY", "weekDays": "MONDAY", "time": "08:44", "daysOfMonth": 31 } } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "bce25f2b-af78-4d34-bcc3-55612b050afd" } } ``` ## 檢測項目-回復系統預設值 ```url POST /abnormalNotification/indicator/delete ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |----|--------|----|----|----| | id | String | Y | | | ```json { "id": "67797fe0-791d-4d85-a4c6-09ca0a9f1481" } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "8a394696-6440-4722-a8e5-9a73f27c513e" } } ``` ## 檢測項目-狀態切換 ```url POST /abnormalNotification/indicator/update-status ``` #### Request pagination | 欄位 | 型態 | 必填 | 預設 | 說明 | |--------|---------|----|----|----| | id | String | Y | | | | status | boolean | Y | | | ```json { "id": "67797fe0-791d-4d85-a4c6-09ca0a9f1481", "status": true } ``` #### Response | 欄位 | 型態 | 說明 | |------|--------|------------------------------------| | data | String | abnormal_notification_condition_id | ```json { "httpCode": 200, "result": { "data": "8a394696-6440-4722-a8e5-9a73f27c513e" } } ```