---
# System prepended metadata

title: 生理資料

---

# 生理資料

## 更新記錄

| 日期 | 說明 |
| -------- | -------- |
| 2020/12/18 | 建立生理資料 API 初版 |
| 2020/12/23 | 修改生理資料 API 輸出格式 |
| 2021/02/19 | 修改查詢喝水量 API 輸出格式 |
| 2021/06/04 | 修改新增生理資料API, 加上GPS資料 |
| 2022/01/06 | 修改新增生理資料API, 加上時段, 餐別欄位<br/>修改查詢血糖胰島素API, 加上時段, 餐別欄位<br/>新增血糖各餐前後比較API |
| 2022/01/17 | 修改新增生理資料API, 加上設備資訊欄位<br/>修改查詢API, 增加設備資訊欄位 |
| 2022/04/13 | 修改新增生理資料API, 加上肌肉量欄位<br/>修改查詢API, 增加肌肉量欄位 |
| 2022/04/18 | 修改查詢最近量測-含異常資訊API, 加上資料來源、量測裝置<br/> |
| 2023/07/10 | 修改新增生理資料API, 加上腰圍, 臀圍欄位<br/>修改查詢API, 增加腰圍, 臀圍欄位 |

* [新增生理資料](#新增生理資料)
* [刪除生理資料](#刪除生理資料)
* [查詢最近量測](#查詢最近量測)
* [查詢最近量測-含異常資訊](#查詢最近量測-含異常資訊)
* [查詢體重BMI體脂](#查詢體重BMI體脂)
* [查詢血壓心律](#查詢血壓心律)
* [查詢血糖胰島素](#查詢血糖胰島素)
* [查詢體溫血氧](#查詢體溫血氧)
* [查詢喝水量](#查詢喝水量)
* [查詢血氧](#查詢血氧)
* [查詢體溫](#查詢體溫)

---
## 新增生理資料

### 新增或更新
```url
POST /phy/bulkUpdate
```
### Query Params
| 欄位 | Required | 型態  | 預設 | 說明 |
|--- |--- |--- |--- |--- |
| temperature | N | String | | 體溫 |
| systolic | N | String | | 舒張壓 |
| diastolic | N | String | | 縮收壓 |
| heartRate | N | String | | 脈搏 |
| oxygen | N | String | | 血氧 |
| bodyWeight | N | String | | 體重, 體重和BMI需一起上傳，否則視為無效 |
| bmi | N | String | | BMI, 體重和BMI需一起上傳，否則視為無效 |
| fat | N | String | | 體脂 |
| insulin | N | String | | 胰島素劑量, insulin和insulinId需一起上傳，否則視為無效 |
| insulinId | N | String | | 胰島素編號, insulin和insulinId需一起上傳，否則視為無效|
| beforeMeals | N | String | | 空腹血糖值 |
| afterMeals | N | String | | 飯後血糖值 |
| waterVolume | N | String | | 喝水量 |
| measureDate | Y | String | | 測量時間 UTC+0 milliseconds |
| deviceId | N | String | | 有帶表示 設備上傳，否之，手動輸入,最長50字,若dataList裡的json沒有帶deviceId,則會帶入外層json的deviceId |
| devicePairId | N | String | | 配對裝置device(後端)的Id |
| lat | N | float | | 緯度 |
| lng | N | float | | 經度 |
| timePeriod | N | int | | 血糖記錄時段 enum: [1: “早上”, 2: “中午”, 3: “晚上”, 4: “睡前”] |
| timePeriodType | N | int | | 血糖記錄餐別 enum: [10: “早餐”, 11: “早午餐”, 20: “午餐”, 21: “下午茶”, 30: “晚餐”, 31: “點心”, 40: “宵夜”] |
| deviceName | N | String | | 設備名稱,最長200字,若dataList裡的json沒有帶deviceName,則會帶入外層json的deviceName |
| muscle | N | String | | 肌肉量 |
| waist | N | String | | 腰圍(cm) |
| hips | N | String | | 臀圍(cm) |


### Request Body Example
```javascript
{
  "deviceId":"my_device_id",
  "deviceName":"my_device_name",
  "devicePairId": "a081310a-575e-4095-8f7c-786fe1e391c9",
  "dataList": [
    {
      "temperature": "36.7",
      "systolic": "110",
      "diastolic": "78",
      "heartRate": "80",
      "oxygen": "98",
      "bodyWeight": "70.1",
      "bmi": "22.5",
      "fat": "32",
      "insulinId": "1",
      "insulin": "50",
      "beforeMeals": "50",
      "afterMeals": "90",
      "waterVolume": "1800",
      "measureDate": "1550628000000",
      "lat":22.357741,
      "lng":120.901022,
      "timePeriod": 1,
      "timePeriodType": 10,
      "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
      "deviceName": "Osmile",
      "muscle": "32",
      "waist": "90",
      "hips": "100"
    }, ...
  ]
}
```

### Response Body Param
|  欄位 | 型態   | 說明  |
| -----| -----|-------- |
| setOxygen| boolean | 成功設定血氧 |
| setTemperature| boolean | 成功設定體溫 |
| setBloodPressure| boolean | 成功設定血壓/心跳 |
| setBody| boolean | 成功設定 體重,BMI / FAT |
| setInsulin| boolean | 成功設定胰島素 |
| setSugar| boolean | 成功設定血糖 |
| setWater| boolean | 成功設定喝水量 |

### Response Body Example
```javascript
{
  "httpCode": 200,
  "result": {
    "data": [
      {
        "setSpo2": true,
        "setBloodPressure": true,
        "setTemperature": true,
        "setBody": true,
        "setInsulin": true,
        "setSugar": true,
        "setWater":true
    	}, ...
    ]
  }
}
```

---
## 刪除生理資料
### 指定時間/類型的生理量測數值
```url
POST /phy/delete
```
### Query Params
| 欄位 | 型態  | 預設   | 說明  |
| --------- | -------- | -------- |-------- |
| measureDate | Y | String | 測量時間 UTC+0 milliseconds |
| physiolMeasType | String | Y | 要刪除的數值類型. e.g.: OXYGEN/WEIGHT/WATER/HEART/INSULIN

### Request Body Example
```javascript
{
    "measureDate": 1617154391047,
    "physiolMeasType": "OXYGEN"
}
```

### Response Body Param
|  欄位 | 型態   | 說明  |
| -----| -----|-------- |
| data| int | 成功刪除筆數 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": 0
    }
}
```

---
## 查詢最近量測

### 查詢
```url
GET /phy/recent
```

### Request Params
- 手機使用者

none

- 網頁使用者

| 欄位 | 型態  | 預設   | 說明  |
| --------- | -------- | -------- |-------- |
| householdMemberId | Y | String | householdMemberId |


### Response Body Param
|  欄位 | 型態   | 說明  |
|---|---|---|
|bodyWeight | number  | 最新一筆體重資訊|
|bmi | number |  最新一筆 bmi 資訊|
|fat  | number | 最新一筆體脂資訊|
|systolic | number  | 最新一筆收縮壓資訊|
|diastolic | number |  最新一筆舒張壓資訊|
|heartRate  | number | 最新一筆心跳資訊|
|beforeMeals | number  | 最新一筆飯前血糖資訊|
|afterMeals | number |  最新一筆飯後血糖資訊|
|insulin  | number | 最新一筆胰島素資訊|
|temperature  | number | 最新一筆體溫資訊|
|oxygen  | number | 最新一筆血氧資訊|
|waterVolume  | number | 最新一筆有記錄的當天喝水量資訊|
|muscle  | number | 最新一筆肌肉量資訊|
|waist  | number | 最新一筆腰圍資訊|
|hips  | number | 最新一筆臀圍資訊|

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "bodyWeight": 82.4,
            "bodyWeightDate": 1642492308534,
            "bmi": 27.5,
            "bmiDate": 1642492308534,
            "fat": 25.0,
            "fatDate": 1642492308534,
            "systolic": 138,
            "systolicDate": 1646115780163,
            "diastolic": 87,
            "diastolicDate": 1646115780163,
            "heartRate": 73,
            "heartRateDate": 1646115780163,
            "beforeMeals": 31,
            "beforeMealsDate": 1642495022144,
            "afterMeals": 31,
            "afterMealsDate": 1642495587173,
            "insulin": 8,
            "insulinDate": 1642491561000,
            "temperature": 36.2,
            "temperatureDate": 1642492155764,
            "oxygen": 99,
            "oxygenDate": 1642492175239,
            "waterVolume": 500,
            "waterVolumeDate": 1642492227061,
            "hasPdHistoryRecords": false,
            "muscle": 32.27,
            "muscleDate": 1642492308534,
            "waist": 90,
            "waistDate": 1642492308534,
            "hips": 110,
            "hipsDate": 1642492308534
        }
    }
}
```

---
## 查詢最近量測-含異常資訊
<!-- 
須同步修改 更新最近一次生理量測資料(for openVidu)
https://hackmd.io/2SAcKmt9SRyDV3WYWmRZ9g#%E6%9B%B4%E6%96%B0%E6%9C%80%E8%BF%91%E4%B8%80%E6%AC%A1%E7%94%9F%E7%90%86%E9%87%8F%E6%B8%AC%E8%B3%87%E6%96%99
-->
### 查詢
```url
GET /phy/recentDetail
```

### Response Body Param
|  欄位 | 型態   | 說明  |
|---|---|---|
|bodyWeight | number  | 最新一筆體重資訊|
|bmi | number |  最新一筆 bmi 資訊|
|fat  | number | 最新一筆體脂資訊|
|systolic | number  | 最新一筆收縮壓資訊|
|diastolic | number |  最新一筆舒張壓資訊|
|heartRate  | number | 最新一筆心跳資訊|
|beforeMeals | number  | 最新一筆飯前血糖資訊|
|afterMeals | number |  最新一筆飯後血糖資訊|
|insulin  | number | 最新一筆胰島素資訊|
|temperature  | number | 最新一筆體溫資訊|
|oxygen  | number | 最新一筆血氧資訊|
|waterVolume  | number | 最新一筆有記錄的當天喝水量資訊|
|dailyDehydration|number|今日脫水量|
|hasPdHistoryRecords|boolean| 往前一個月內是否有上傳腹膜透析紀錄|
|abnormalNum  | number | 量測值異常的數量|
|value | number  | 量測值|
|isNormal | boolean  | 量測值是否異常|
|unit | string  | 量測值單位|
|measureData | number  | 量測時間|
|resource | String | 資料來源，<br/>MANUAL: 手動輸入<br/>DEVICE: App測量上傳<br/>ALL_IN_ONE: ALL_IN_ONE|
|deviceName | String | 量測裝置|
|name | String | 姓名|
|gender | Integer | 性別|
|age | Integer | 年齡|
|mobile | String | 電話|
|muscle  | number | 最新一筆肌肉量資訊|
|waist  | number | 最新一筆腰圍資訊|
|hips  | number | 最新一筆臀圍資訊|


### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userInfo": {
                "name": "蘇凱文",
                "gender": 1,
                "age": 33,
                "mobile": "0925309365"
            },
            "bodyWeight": {
                "value": "100.0",
                "isNormal": false,
                "unit": "%",
                "measureDate": 1622785318397,
                "resource": "MANUAL",
                "deviceName": "MMA-1"                
            },
            "bmi": {
                "value": "32.0",
                "isNormal": false,
                "measureDate": 1622785318397,
                "resource": "MANUAL",
                "deviceName": "MMA-1"       
            },
            "fat": {
                "value": "34.0",
                "isNormal": false,
                "unit": "%",
                "measureDate": 1622785318397,
                "resource": "MANUAL",
                "deviceName": "MMA-1"       
            },
            "systolic": {
                "value": "210",
                "isNormal": false,
                "unit": "mmHg",
                "measureDate": 1622522397833,
                "resource": "MANUAL"
            },
            "diastolic": {
                "value": "210",
                "isNormal": false,
                "unit": "mmHg",
                "measureDate": 1622522397833,
                "resource": "MANUAL"
            },
            "heartRate": {
                "value": "89",
                "isNormal": true,
                "unit": "次/分鐘",
                "measureDate": 1622522397833,
                "resource": "MANUAL"
            },
            "insulin": {
                "isNormal": true,
                "measureDate": 1617154484047
            },
            "temperature": {
                "value": "37.6",
                "isNormal": false,
                "unit": "度",
                "measureDate": 1622624296291,
                "resource": "MANUAL"       
            },
            "oxygen": {
                "value": "99",
                "isNormal": true,
                "unit": "%",
                "measureDate": 1617154391047,
                "resource": "MANUAL"
            },
            "waterVolume": {
                "value": "55",
                "isNormal": true,
                "unit": "ml",
                "measureDate": 1617154391047,
                "resource": "MANUAL"
            },
            "muscle": {
                "value": "32.27",
                "isNormal": true,
                "unit": "kg",
                "measureData": 1622785318397,
                "resource": "MANUAL"
            },
            "waist": {
                "value": "90",
                "isNormal": true,
                "unit": "cm",
                "measureData": 1622785318397,
                "resource": "MANUAL"
            },
            "hips": {
                "value": "110",
                "isNormal": true,
                "unit": "cm",
                "measureData": 1622785318397,
                "resource": "MANUAL"
            },
            "hasPdHistoryRecords": false,
            "abnormalNum": 6
        }
    }
}
```

---
## 查詢體重BMI體脂肌肉量

### 查詢
```url
POST /phy/weight
```
### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態   | 說明  |
|---|---|---|
|bodyWeightAvg | number  | 日/月平均體重|
|bmiAvg | number |  日/月平均BMI|
|fatAvg  | number | 日/月平均體脂|
|bodyWeightMax | number  | 日/月最高體重|
|bmiMax | number |  日/月最高BMI|
|fatMax  | number | 日/月最高體脂|
|bodyWeightMin | number  | 日/月最低體重|
|bmiMin | number |  日/月最低BMI|
|fatMin  | number | 日/月最低體脂|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |
|muscleAvg  | number | 日/月平均肌肉量|
|muscleMax  | number | 日/月最高肌肉量|
|muscleMin  | number | 日/月最低肌肉量|
|waistAvg  | number | 日/月平均腰圍|
|waistMax  | number | 日/月最高腰圍|
|waistMin  | number | 日/月最低腰圍|
|hipsAvg  | number | 日/月平均臀圍|
|hipsMax  | number | 日/月最高臀圍|
|hipsMin  | number | 日/月最低臀圍|

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "bodyWeightAvg": 71.2,
            "bodyWeightMax": 71.2,
            "bodyWeightMin": 71.2,
            "bmiAvg": 25.5,
            "bmiMax": 25.5,
            "bmiMin": 25.5,
            "fatAvg": 34.0,
            "fatMax": 34.0,
            "fatMin": 34.0,
            "muscleAvg": 32.27,
            "muscleMax": 32.27,
            "muscleMin": 32.27,
            "dataList": [
                {
                    "fatMin": 34.0,
                    "bodyWeight": 71.2,
                    "bmi": 25.5,
                    "fat": 34.0,
                    "muscle": 32.27,
                    "waist": 90,
                    "hips": 110,
                    "dateTime": 1607529600000,
                    "resource": "MANUAL",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 1
        }
    }
}
```

---
## 查詢血壓心律

### 查詢
```url
POST /phy/heart
```
### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態  | 說明  |
|---|---|---|
|systolicAvg | number | 日/月平均收縮壓|
|diastolicAvg | number | 日/月平均舒張壓|
|heartRateAvg | number | 日/月平均心律|
|systolicMax | number | 日/月最高收縮壓|
|diastolicMax | number | 日/月最高舒張壓|
|heartRateMax | number | 日/月最高心律|
|systolicMin | number | 日/月最低收縮壓|
|diastolicMin | number | 日/月最低舒張壓|
|heartRateMin | number |  日/月最低心律|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "systolicAvg": 139.8,
            "systolicMax": 142.5,
            "systolicMin": 138.5,
            "diastolicAvg": 85.3,
            "diastolicMax": 86.0,
            "diastolicMin": 83.8,
            "heartRateAvg": 78.4,
            "heartRateMax": 80.0,
            "heartRateMin": 75.9,
            "dataList": [
                {
                    "systolic": 142.5,
                    "diastolic": 83.8,
                    "heartRate": 75.9,
                    "dateTime": 1606752000000,
                    "resource": "MANUAL",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 3
        }
    }
}
```

---
## 查詢血糖胰島素

### 查詢
```url
POST /phy/insulin
```
### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|beforeMealsAvg | number | 日/月平均餐前血糖|
|afterMealsAvg | number |  日/月平均餐後血糖|
|insulinAvg | number |  日/月平均胰島素|
|beforeMealsMax | number | 日/月最高餐前血糖|
|afterMealsMax  | number |  日/月最高餐後血糖|
|insulinMax  | number |  日/月最高胰島素|
|beforeMealsMin | number | 日/月最低餐前血糖|
|afterMealsMin | number |  日/月最低餐後血糖|
|insulinMin | number |  日/月最低胰島素|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|timePeriod | int | 血糖記錄時段 enum: [1: “早上”, 2: “中午”, 3: “晚上”, 4: “睡前”] |
|timePeriodType | int | 血糖記錄餐別 enum: [10: “早餐”, 11: “早午餐”, 20: “午餐”, 21: “下午茶”, 30: “晚餐”, 31: “點心”, 40: “宵夜”] |
|mealPeriodType | string | 血糖量測類型, AC: 空腹, PC: 飯後 |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "beforeMealsAvg": 64.5,
            "beforeMealsMax": 75.0,
            "beforeMealsMin": 54.0,
            "afterMealsAvg": 58.2,
            "afterMealsMax": 111.4,
            "afterMealsMin": 5.0,
            "insulinAvg": 83.0,
            "insulinMax": 90.6,
            "insulinMin": 75.3,
            "dataList": [
                {
                    "dateTime": 1606752000000,
                    "afterMeals": 111.42857,
                    "insulin": 75.3,
                    "resource": "MANUAL",
                    "timePeriod": 1,
                    "timePeriodType": 10,
                    "mealPeriodType": "PC",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                },
                {
                    "dateTime": 1604160000000,
                    "beforeMeals": 54.0,
                    "insulin": 90.6,
                    "resource": "MANUAL",
                    "timePeriod": 2,
                    "timePeriodType": 20,
                    "mealPeriodType": "AC",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 2
        }
    }
}
```

---
## 查詢體溫血氧

### 查詢
```url
POST /phy/oxygen
```

### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|temperatureAvg | number | 日/月平均體溫|
|oxygenAvg | number |  日/月平均血氧|
|temperatureMax | number | 日/月最高體溫|
|oxygenMax | number |  日/月最高血氧|
|temperatureMin | number | 日/月最低體溫|
|oxygenMin | number |  日/月最低血氧|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "temperatureAvg": 36.7,
            "temperatureMax": 38.7,
            "temperatureMin": 34.5,
            "oxygenAvg": 96.9,
            "oxygenMax": 97.6,
            "oxygenMin": 96.1,
            "dataList": [
                {
                    "dateTime": 1606752000000,
                    "temperature": 36.7,
                    "oxygen": 96.14286,
                    "resource": "MANUAL",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 5
        }
    }
}
```

---
## 查詢喝水量

### 查詢
```url
POST /phy/water
```
### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位，預設是用 dateTime 以降序排列，排序支援 asc 和 desc 兩種方式，目前只支援 dateTime 排序|

### Request Body Example
```javascript
{
  "query": {
    "startAt": "1550448000000",
    "endAt": "1550799654741",
    "householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
    "avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "dateTime",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|waterAvg | number | 日/月平均喝水量|
|waterMax | number | 日/月最高喝水量|
|waterMin | number | 日/月最低喝水量|
|waterTotal | number | 日/月累計喝水量|
|dataList |  | 詳細資料列表|
|dateTime | number | 紀錄時間|
|waterVolume | number | 喝水量|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "waterAvg": 1270.0,
            "waterMax": 5760,
            "waterMin": 100,
            "waterTotal": 7620,
            "dataList": [
                {
                    "dateTime": 1606752000000,
                    "waterVolume": 5760,
                    "resource": "MANUAL"
                },
                {
                    "dateTime": 1604160000000,
                    "waterVolume": 240,
                    "resource": "MANUAL"
                }
            ]
        },
        "pagination": {
            "current": 3,
            "pageSize": 10,
            "total": 75
        },
        "sorter": {
            "field": "dateTime",
            "order": "asc"
        }
    }
}
```
---
## 查詢體溫

### 查詢
```url
POST /phy/temperature
```

### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|temperatureAvg | number | 日/月平均體溫|
|temperatureMax | number | 日/月最高體溫|
|temperatureMin | number | 日/月最低體溫|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "temperatureAvg": 36.7,
            "temperatureMax": 38.7,
            "temperatureMin": 34.5,
            "dataList": [
                {
                    "dateTime": 1606752000000,
                    "temperature": 36.7,
                    "resource": "MANUAL",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 1
        }
    }
}
```

---

## 查詢血氧

### 查詢
```url
POST /phy/oxygenOnly
```

### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |
| pagination | JSON | false | 分頁 |
| current | Int | false | 當前頁數|
| pageSize | Int | false | 每頁結果數量，-1 為顯示所有|
| sorter | JSON | false | 排序欄位, 預設是用 measureDate 以降序排列 |

### Request Body Example
```javascript
{
  "query": {
		"startAt": "1550448000000",
		"endAt": "1550799654741",
		"householdMemberId": "7890bcfd11724a36a7077dc9ade21611",
		"avg": 1
  },
  "pagination": {
    "current": "1",
    "pageSize": "10"
  },
  "sorter": {
    "field": "measureDate",
    "order": "desc"
  }
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|oxygenAvg | number |  日/月平均血氧|
|oxygenMax | number |  日/月最高血氧|
|oxygenMin | number |  日/月最低血氧|
|resource  | string | 資料來源, 僅查詢當日紀錄會回傳.(MANUAL/DEVICE) |
|deviceId | string | 設備id |
|deviceName | string | 設備名稱 |

### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "oxygenAvg": 96.9,
            "oxygenMax": 97.6,
            "oxygenMin": 96.1,
            "dataList": [
                {
                    "dateTime": 1606752000000,
                    "oxygen": 96.14286,
                    "resource": "MANUAL",
                    "deviceId": "56E09AE1-DAC1-0C7F-671B-7F31D3FB48C3",
                    "deviceName": "Osmile"
                }
            ]
        },
        "pagination": {
            "total": 1
        }
    }
}
```

---
## 查詢血糖各餐前後比較

### 查詢
```url
POST /phy/sugar-delta
```
### Query Params
|  欄位 | 型態  | 必填   | 說明  |
|---|---|---|---|
| startAt | timestamp | true | 從(測量時間)|
| endAt | timestamp | true | 結束(測量時間)|
| householdMemberId | String | false | 若不填則以 Token 為準 |
| avg | Int | true | 0:當日 1:日計算 2:月計算 |


### Request Body Example
```javascript
{
    "startAt": "1609430400000",
    "endAt": "1612108799000",
    "householdMemberId": null,
    "avg": 2
}
```

### Response Body Param
|  欄位 | 型態 | 說明  |
|---|---|---|
|timePeriodType | int | 血糖記錄餐別 enum: [10: “早餐”, 11: “早午餐”, 20: “午餐”, 21: “下午茶”, 30: “晚餐”, 31: “點心”, 40: “宵夜”] |
|beforeMeals | number | 餐前血糖|
|afterMeals | number |  餐後血糖|
|delta | number | 餐後-餐前差異值,若為null表示此餐別缺少餐前或餐後記錄而無法比較 |


### Response Body Example
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "timePeriodType": 10,
                "beforeMeals": 78.6,
                "afterMeals": 105.6,
                "delta": 27.0
            },
            {
                "timePeriodType": 20,
                "beforeMeals": 85.4,
                "afterMeals": 121.1,
                "delta": 35.7
            },
            {
                "timePeriodType": 30,
                "beforeMeals": 81.4,
                "afterMeals": 87.3,
                "delta": 5.9
            }
        ]
    }
}
```