---
# System prepended metadata

title: VPN Case Care History APIs

---

# VPN Case Care History APIs

## 個案照護歷程/關懷APIs

[TOC]

## API Require Headers:
```javascript
{
      Content-Type: 'application/json',
      Accept: 'application/json',
      Authorization: accessToken,
}
```


## [WEB] 取得照護歷程總覽 **POST /vpnCaseHistory/list**


### Request Body:

* query

| Parameter | Required |  format  |  desc   |
| --------- | -------- | -------- |-------- |
| cpiId | Y | String | case_pat_info id |
| startDate | N | Date | 檢查日期起始日 |
| endDate | N | Date | 檢查日期迄日 |
| diseaseType | N | String | 收案疾病, 空值或null表示查全部, 目前僅支援 DM, ECKD, BC |
| stageStatus | N | String | 疾病階段/類型, 空值或null表示查全部 <br> diseaseType為ECKD時, STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> diseaseType為BC時, B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| keyword | N | String | 查詢照護人員名字關鍵字 |


* sorter (sorter can be null, default sorter field: createTime desc)

| Parameter | Required |  format  |  desc   |
| --------- | -------- | -------- |-------- |
| field| N| String | 排序欄位，預設為 checkDate，可排序欄位: checkDate, diseaseType, stageStatus, careStatus, careStaffName |
| order| N| String | desc/asc，預設為 desc|

* pagination (pagination can be null. If null, it will return all data)

| Parameter | Required |  format  |  desc   |
| --------- | -------- | -------- |-------- |
| current| N| String | 目前頁數|
| pageSize| N| String |一頁幾筆 |

### Request Body Example:

```javascript
{
    "query": {
        "cpiId":"30dabdf5-d569-4336-bd59-e9ee77033b3e",
        "startDate": 1624147200000,
        "endDate": 1624579200000,
        "diseaseType": "",
        "stageStatus": "",
        "keyword": ""
    },
    "pagination": {
        "current": "1",
        "pageSize": "10"
    },
    "sorter": {
        "field": "checkDate",
        "order": "desc"
    }
}

```
### Response Body:
| Parameter  | format | desc |
|----------- |----------|--------|
| id | String | 照護歷程id |
| vpnCsiId | String | 收案id |
| checkDate | Date | 檢查日期 |
| yearMark | String | 作業年度 |
| vpnCaseCheckId | String | 檢核資料ID, 為空表示沒有檢驗資料 |
| diseaseType| String | 疾病類別, DM, ECKD, BC |
| stageStatus | String | 疾病階段/類型 <br> **DM:** N/A <br> **ECKD:** STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> **BC:** B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| careStatus | String | 照護階段 <br> **DM:** FIRST:新收案, REVIEW:追蹤, YEARREVIEW:年度評估階段, SECOND_REVIEW:二階追蹤, SECOND_YEARREVIEW:二階年度評估階段 <br> **ECKD:** FIRST:新收案, REVIEW:追蹤 <br> **BC:** FIRST:新收案, REVIEW:追蹤, TRANSFER_OUT:轉出 |
| careStaffId | String | 照護人員id |
| careStaffName | String | 照護人員姓名 |
| careStaffRoleName | String | 照護人員職稱/角色 |
| careStaffDivisionName | String | 照護人員科別 |


### Response Body Example:
```javascript
// 400 不存在此 收案id vpnCsiId
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}
// 200
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": "3f6fe1ff-3845-4ed0-9a88-0ab804013f1f",
                "vpnCsiId": "36267a43-ff57-4a42-a562-350dc60e1033",
                "checkDate": 1624550400000,
                "yearMark": "2",
                "stageStatus": "",
                "vpnCaseCheckId": "",
                "diseaseType": "DM",
                "createTime": 1626173447187,
                "careStatus": "FIRST",
                "careStaffId": "04398e47-e702-4290-a1c1-c4931404840e",
                "careStaffName": "陳醫生",
                "careStaffRoleName": "外科醫生",
                "careStaffDivisionName": "外科"
            },...
        ],
        "pagination": {
            "current": 1,
            "pageSize": 10,
            "total": 1
        },
        "sorter": {
            "field": "checkDate",
            "order": "desc"
        },
        "total": 1
    }
}

// no data
{
    "httpCode": 200,
    "result": {
        "data": []
     }
}
```

## [WEB] 新增照護歷程  **POST /vpnCaseHistory/add**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| vpnCsiId | Y | String | 收案ID |
| checkDate | Y | Date | 檢查日期 |
| yearMark | N | String | 作業年度 |
| diseaseType | N | String | 收案疾病, 目前僅支援 DM, ECKD, BC |
| stageStatus | N | String | 疾病階段/類型, <br> **DM:** null <br> **ECKD:** STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> **BC:** B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| careStatus  | N | String | 照護階段 <br> **DM:** FIRST:新收案, REVIEW:追蹤, YEARREVIEW:年度評估階段, SECOND_REVIEW:二階追蹤, SECOND_YEARREVIEW:二階年度評估階段 <br> **ECKD:** FIRST:新收案, REVIEW:追蹤 <br> **BC:** FIRST:新收案, REVIEW:追蹤, TRANSFER_OUT:轉出 |


### Request Body Example:

```javascript
{
    "vpnCsiId": "36267a43-ff57-4a42-a562-350dc60e1033",
    "checkDate": 1625097600000,
    "yearMark": "1",
    "diseaseType": "DM",
    "stageStatus": null,
    "careStatus": "FIRST"
}

```

### Response Body:
| Parameter  | format | desc |
|----------- |----------|--------|
| id | String | 照護歷程id |
| vpnCsiId | String | 收案id |
| checkDate | Date | 檢查日期 |
| yearMark | String | 作業年度 |
| vpnCaseCheckId | String | 檢核資料ID, 為空表示沒有檢驗資料 |
| diseaseType| String | 疾病類別, DM, ECKD, BC |
| stageStatus | String | 疾病階段/類型 <br> **DM:** N/A <br> **ECKD:** STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> **BC:** B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| careStatus | String | 照護階段 <br> **DM:** FIRST:新收案, REVIEW:追蹤, YEARREVIEW:年度評估階段, SECOND_REVIEW:二階追蹤, SECOND_YEARREVIEW:二階年度評估階段 <br> **ECKD:** FIRST:新收案, REVIEW:追蹤 <br> **BC:** FIRST:新收案, REVIEW:追蹤, TRANSFER_OUT:轉出 |
| careStaffId | String | 照護人員id |
| careStaffName | String | 照護人員姓名 |
| careStaffRoleName | String | 照護人員職稱/角色 |
| careStaffDivisionName | String | 照護人員科別 |


### Response Body Example:
```javascript
// 400 不存在此 收案id vpnCsiId
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 422 個案照護歷程收案疾病不允許
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_DISEASE_NOT_ALLOWED",
    "httpCode": 422
}

// 422 個案照護歷程疾病階段/類型不允許 
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_STAGE_STATUS_NOT_ALLOWED",
    "httpCode": 422
}

// 422 個案照護歷程照護階段不允許
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_CARE_STATUS_NOT_ALLOWED",
    "httpCode": 422
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "da76f6ca-bd92-4ea6-9404-49e4f4f7d8ed",
            "vpnCsiId": "36267a43-ff57-4a42-a562-350dc60e1033",
            "checkDate": 1625068800000,
            "yearMark": "1",
            "stageStatus": "",
            "vpnCaseCheckId": "",
            "diseaseType": "DM",
            "createTime": 1626205611976,
            "careStatus": "FIRST",
            "careStaffId": "04398e47-e702-4290-a1c1-c4931404840e",
            "careStaffName": "陳醫生",
            "careStaffRoleName": "外科醫生",
            "careStaffDivisionName": "外科"
        }
    }
}
```

## [WEB] 編輯照護歷程  **POST /vpnCaseHistory/update**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程ID |
| checkDate | Y | Date | 檢查日期 |
| yearMark | N | String | 作業年度 |
| diseaseType | N | String | 收案疾病, 目前僅支援 DM, ECKD, BC |
| stageStatus | N | String | 疾病階段/類型, <br> **DM:** null <br> **ECKD:** STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> **BC:** B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| careStatus  | N | String | 照護階段 <br> **DM:** FIRST:新收案, REVIEW:追蹤, YEARREVIEW:年度評估階段, SECOND_REVIEW:二階追蹤, SECOND_YEARREVIEW:二階年度評估階段 <br> **ECKD:** FIRST:新收案, REVIEW:追蹤 <br> **BC:** FIRST:新收案, REVIEW:追蹤, TRANSFER_OUT:轉出 |


### Request Body Example:

```javascript
{
    "id":"3f6fe1ff-3845-4ed0-9a88-0ab804013f1f",
    "checkDate": 1624579200000,
    "yearMark": "2",
    "diseaseType": "DM",
    "stageStatus": null,
    "careStatus": "FIRST"
}

```

### Response Body:
| Parameter  | format | desc |
|----------- |----------|--------|
| id | String | 照護歷程id |
| vpnCsiId | String | 收案id |
| checkDate | Date | 檢查日期 |
| yearMark | String | 作業年度 |
| vpnCaseCheckId | String | 檢核資料ID, 為空表示沒有檢驗資料 |
| diseaseType| String | 疾病類別, DM, ECKD, BC |
| stageStatus | String | 疾病階段/類型 <br> **DM:** N/A <br> **ECKD:** STAGE0, STAGE1, STAGE2, STAGE3A, STAGE3B, STAGE4, STAGE5 <br> **BC:** B:B型肝炎, C:C型肝炎, BC:B+C型肝炎, OTHER:其他類型 |
| careStatus | String | 照護階段 <br> **DM:** FIRST:新收案, REVIEW:追蹤, YEARREVIEW:年度評估階段, SECOND_REVIEW:二階追蹤, SECOND_YEARREVIEW:二階年度評估階段 <br> **ECKD:** FIRST:新收案, REVIEW:追蹤 <br> **BC:** FIRST:新收案, REVIEW:追蹤, TRANSFER_OUT:轉出 |
| careStaffId | String | 照護人員id |
| careStaffName | String | 照護人員姓名 |
| careStaffRoleName | String | 照護人員職稱/角色 |
| careStaffDivisionName | String | 照護人員科別 |


### Response Body Example:
```javascript
// 400 不存在此 收案id vpnCsiId
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 422 個案照護歷程不存在
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_NOT_EXIST",
    "httpCode": 422
}

// 422 個案照護歷程已存在
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_EXIST",
    "httpCode": 422
}

// 422 個案照護歷程收案疾病不允許
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_DISEASE_NOT_ALLOWED",
    "httpCode": 422
}

// 422 個案照護歷程疾病階段/類型不允許 
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_STAGE_STATUS_NOT_ALLOWED",
    "httpCode": 422
}

// 422 個案照護歷程照護階段不允許
{
    "errorMsg": "SERVICE_ERROR.VPN_CASE_CARE_HISTORY_CARE_STATUS_NOT_ALLOWED",
    "httpCode": 422
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "da76f6ca-bd92-4ea6-9404-49e4f4f7d8ed",
            "vpnCsiId": "36267a43-ff57-4a42-a562-350dc60e1033",
            "checkDate": 1625068800000,
            "yearMark": "1",
            "stageStatus": "",
            "vpnCaseCheckId": "",
            "diseaseType": "DM",
            "createTime": 1626205611976,
            "careStatus": "FIRST",
            "careStaffId": "04398e47-e702-4290-a1c1-c4931404840e",
            "careStaffName": "陳醫生",
            "careStaffRoleName": "外科醫生",
            "careStaffDivisionName": "外科"
        }
    }
}
```

## [WEB] 刪除照護歷程  **GET /vpnCaseHistory/delete**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程Id |



### Request Body Example:

```javascript
GET /vpnCaseHistory/delete?id=5abaac9a-43c0-4e66-9dda-16c0a62c547

```
### Response Body:
* httpCode 200 - data

| Parameter | format | desc |
|-----------|--------|------|
| id | String | 回傳刪除成功的照護歷程id |
| count | int | 回傳刪除筆數 |

```javascript
// 400 不存在此 id
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "5abaac9a-43c0-4e66-9dda-16c0a62c547c",
            "count": 1
        }
    }
}

```


## [WEB] 取得檢驗資料  **POST /vpnCaseHistory/data**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程Id |
| diseaseType | Y | String | 收案疾病, 目前僅支援 DM, ECKD, BC |


### Request Body Example:

```javascript
{
    "id" : "0b4ce4d5-a62e-410f-a0e8-17865332bedb",
    "diseaseType" : "DM"
}
```

### Response Body:
* httpCode 200 - data

| Parameter | format | desc |
|-----------|--------|------|
| id | String | 照護歷程ID |
| diseaseType| String | 疾病類別, DM, ECKD, BC |
| check | Object | 檢核資料 (每個疾病的資料格式不同) <BR>[請參閱](#各疾病物件)|

### Request Body Example:
```javascript
// 400 不存在此 id
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "3f6fe1ff-3845-4ed0-9a88-0ab804013f1f",
            "diseaseType": "DM",
            "check": {
                "baseTall": "168",
                "baseWeight": "80",
                "baseSbp": "80",
                "baseEbp": "125",
                "bloodChkDate": 1624550400000,
                "bloodHba1c": "100",
                "bloodLdl": "101",
                "bloodAc": "102",
                "bloodPc": "103",
                "bloodTg": "104",
                "urineChkDate": 1624550400000,
                "urineMicro": "105",
                "urineRoutine": "NORMAL",
                "bloodCreat": "106",
                "egfr": "107",
                "smoking": "N"
            }
        }
    }
}

// no data
{
    "httpCode": 200,
    "result": {
        "data": {}
     }
}

```
## [WEB] 新增檢驗資料  **POST /vpnCaseHistory/data/add**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程Id |
| diseaseType | Y | String | 收案疾病, 目前僅支援 DM, ECKD, BC |
| check | N | Object | 檢驗資料詳細內容(每個疾病的資料格式不同) <BR> [請參閱](#各疾病物件)|


### Request Body Example:

```javascript
{
    "id": "0b4ce4d5-a62e-410f-a0e8-17865332bedb",
    "diseaseType": "DM",
    "check": {
         //每種疾病類資料內容不同
     }    
}
```

### Response Body:
* httpCode 200 - data

| Parameter | format | desc |
|-----------|--------|------|
| id | String | 回傳新增成功的照護歷程ID |


### Request Body Example:
```javascript
// 400 不存在此 id
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "43704172da6e48c3a849079392caadd8"
            }
        }
    }
}

```


## [WEB] 編輯檢驗資料  **POST /vpnCaseHistory/data/update**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程Id |
| diseaseType | Y | String | 收案疾病, 目前僅支援 DM, ECKD, BC |
| check | N | Object | 檢驗資料詳細內容(每個疾病的資料格式不同) <BR> [請參閱](#各疾病物件)|


### Request Body Example:

```javascript
{
    "id": "0b4ce4d5-a62e-410f-a0e8-17865332bedb",
    "diseaseType": "DM",
    "check": {
         //每種疾病類資料內容不同
     }
}

//無檢驗資料
{
    "id": "0b4ce4d5-a62e-410f-a0e8-17865332bedb",
    "diseaseType": "DM" 
}

```

### Response Body:
* httpCode 200 - data

| Parameter | format | desc |
|-----------|--------|------|
| id | String | 回傳編輯成功的照護歷程ID |


### Request Body Example:

```javascript
// 400 不存在此 id
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": "0b4ce4d5-a62e-410f-a0e8-17865332bedb"
            }
        }
    }
}

```

## [WEB] 刪除檢驗資料  **POST /vpnCaseHistory/data/delete**

### Request Body:

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
| id | Y | String | 照護歷程Id |
| diseaseType | Y | String | 收案疾病, 目前僅支援 DM, ECKD, BC |
| vpnCaseCheckId| N | String| 檢驗資料Id|


### Request Body Example:

```javascript
{
    "id": "0b4ce4d5-a62e-410f-a0e8-17865332bedb",
    "diseaseType": "DM",
    "vpnCaseCheckId" : "143a5fa7-d8b0-48b9-add2-697db9d40a45"
}

```

### Response Body:
* httpCode 200 - data

| Parameter | format | desc |
|-----------|--------|------|
| count| String | 回傳刪除成功的筆數 |


### Request Body Example:

```javascript
// 400 不存在此 id
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 1
            }
        }
    }
}

```

## 量測值異常 POST /caseCareRecord/measureAbnormal/list

Measure Abnormal List Data 
```url
POST /caseCareRecord/measureAbnormal/list
```

取得指定日期區間的量測值異常列表

- 將回傳accessToken（JWT）帶入呼叫API的header中
- 依照accessToken（JWT）的areaCode帶入requestVO中

API require headers:
```javascript
{
      Content-Type: 'application/json',
      Accept: 'application/json',
      Authorization: accessToken,
}
```

### Request Body:
* query

| Parameter    |  format  | required |  desc        |
| ------------ | -------- | -------- | -------------|
| startDate    | Date     | true     | 查詢起始日期  |
| endDate      | Date     | true     | 查詢結束日期  |
| physiolItems  | String[]   | true     | 異常值項目 |
| status       | String   | false     | 處理狀態 Y:已處理, N: 待處理, P: 處理中 |
| patName      | String   | false     | 個案姓名   |

### Request Body Example:

```javascript
{
    "query":{
        "startDate":"2020-11-01",
        "endDate":"2020-11-30",
        "physiolItems": ["bloodPressure", "bloodSugar", "heartBeat"],
        "status": "N",
        "patName":"杜小月"
    },
    "pagination":{
        "current": "1",
        "pageSize": "10"
    },
    "sorter":{
        "field": "recordTime",
        "order": "desc"
    }
}
```

### Response Body:

| Parameter    |  format  |  desc       |
| ------------ | -------- |-------------|
| id           | int      | 個案關懷Id   |
| measureDate   | Timestamp  |  測量時間 UTC+0 milliseconds    |
| houseHoldMemberId   | String   | houseHoldMemberId   |
| cpiId        | String   | cpiId       |
| detail       | Json     | 所有生理資料，第一層key代表異常項目     |
| normal       | Json     | 正常的生理資料項目     |
| status       | String   | 處理狀態 Y:已處理, N: 待處理, P: 處理中 |
| remark       | String   | 處理備註     |
| updateUserName | String | 處理人員     |
| updateTime     | Timestamp | 測量時間 UTC+0 milliseconds   |

```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": 1,
                "recordTime": '2020-11-15',
                "houseHoldMemberId": '12b2f6bf-e121-4b49-9eba-166407affbb6',
                "cpiId": '207fa97b-5eb5-4b22-96cb-7192e8761689',
                "detail": {
                  "bloodPressure": {
                    "measureDate": 1605543000000,
                    "resource": "MANUAL",
                    "systolic": 100,
                    "diastolic": 88
    							},
                 	"bloodSugar": {
                    "measureDate": 1605543000000,
                    "resource": "MANUAL",
                    "value": 309,
                    "periodType": "BEFORE_LUNCH"
                   },
                  "normal": {
                    "heartBeat": {
                    	"measureDate": 1605543000000,
                    	"resource": "MANUAL",
                    	"value": 120
    								}
                  }
								},
                "status": 'N',
                "remark": '',
                "updateUserName": '衛生所管理員',
                "updateTime": 1605003618545,
                "measureDate": 1605543000000
            }
        ],
        "pagination":{
            "current":1,
            "pageSize":10,
            "total":1
        },
        "sorter":{
        }
    }
}
```

## [WEB]近一小時量測值異常 POST /caseCareRecord/measureAbnormal/nearlyHour/list

Measure Abnormal Nearly Hour List 
```url
POST /caseCareRecord/measureAbnormal/nearlyHour/list
```
- 用於個案總覽Dashboard
- 取得近一小時內量測值異常的人員列表
- 單人有多筆異常資料，只取最後一筆
- 依照量測時間，由新至舊依序排列
- 依照Token的areaCode帶入requestVO中

***Request Headers***
```url
      Authorization: accessToken
```

***Request Body***
- None

***Response***
| Parameter    |  Data Type  |  Comment       |
| ------------ | -------- |-------------|
| id           | int      | 個案關懷Id   |
| houseHoldMemberId   | String   | houseHoldMemberId   |
| patName       | String   | 個案姓名       |
| patTel | String | 電話
| detail       | Json     | 所有生理資料，第一層key代表異常項目     |
| status       | String   | 處理狀態 Y:已處理, N: 待處理, P: 處理中 |
| remark       | String   | 處理備註     |
| updateUserName | String | 處理人員     |
| kind | String | 紀錄類別  (B: 量測異常)|
| measureDate   | Timestamp  |  測量時間 milliseconds    |
| gender | Integer | 性別 (性別: 1男, 2女)|
| birthDate | TimeStamp | 生日 milliseconds|
| show | string | 是否顯示於dashboard Y:顯示, N:隱藏 |

***Response Example***
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "id": 14,
                "houseHoldMemberId": "a3a9e792-ad4d-4139-a54e-82fd1ec6fb18",
                "patName": "更新個人5",
                "patTel": "09123456789",
                "detail": "{\"bloodPressure\":{\"systolic\":250,\"diastolic\":71,\"measureDate\":1613730000000,\"resource\":\"MANUAL\"},\"normal\":{\"heartBeat\":{}}}",
                "status": "N",
                "remark": "",
                "updateUserName": "",
                "kind": "B",
                "updateTime": null,
                "measureDate": 1648459128000,
                "gender": 1,
                "birthDate": 1613491200000,
                "show": "Y"
            },
            {
                "id": 20,
                "houseHoldMemberId": "e9a3042a-7ae1-4069-a2f6-fef3bb69b50a",
                "patName": "test1",
                "patTel": "",
                "detail": "{\"bloodSugar\":{\"periodType\":\"BEFORE_BREAKFAST\",\"measureDate\":1612184400000,\"resource\":\"MANUAL\",\"value\":57}}",
                "status": "N",
                "remark": "",
                "updateUserName": "",
                "kind": "B",
                "updateTime": null,
                "measureDate": 1648458048000,
                "gender": 1,
                "birthDate": 1611763200000,
                "show": "N"
            }
        ]
    }
}
```

## Dashboard量測異常 - 撥出 POST /caseCareRecord/callOut

```url
POST /caseCareRecord/callOut
```


***Request***

 欄位 | 型態  | 必填 | 預設 | 說明 
 ---|---|---|---|---
 id | Integer | Y | | 個案關懷id
 

```javascript
{
    "id": 886
}
```

***Response***
 
 | 欄位 | 型態 | 說明 
 | ---  | --- | ---
 | id | Integer | 關懷記錄id 
 | recordTime | timestamp | 關懷紀錄時間
 | kind | String | 紀錄類別  (B: 量測異常)|
 | status | String | 處理狀態, Y:已處理, N:未處理, P:處理中
 | meetingId | Long | 會議室id
 | show | String | 是否顯示在dashboard, Y:顯示, N:不顯示


```javascript
// HttpStatus:422, 已在處理中
{
    "errorMsg": "SERVICE_ERROR.CASE_CARE_RECORD_IS_PROCESSING",
    "httpCode": 422
}

// HttpStatus: 200
{
    "httpCode": 200,
    "result": {
        "data": {
            "id": 14,
            "recordTime": 1648569600000,
            "householdMemberId": "a3a9e792-ad4d-4139-a54e-82fd1ec6fb18",
            "cpiId": "dcf35965-b21f-4394-9cfa-b8a5b2572735",
            "kind": "B",
            "detail": "{\"bloodPressure\":{\"systolic\":250,\"diastolic\":71,\"measureDate\":1613730000000,\"resource\":\"MANUAL\"},\"normal\":{\"heartBeat\":{}}}",
            "status": "P",
            "meetingId": 1648794240151,
            "show": "Y"
        }
    }
}
```

## Dashboard量測異常 - 從Dashboard移除 POST /caseCareRecord/moveOut

```url
POST /caseCareRecord/moveOut
```
- 移除後，此個案的量測值異常卡片不會顯示於dashboard上

***Request***
 欄位 | 型態  | 必填 | 預設 | 說明  
 ---|---|---|---|---
 id | Integer | Y | | 個案關懷id
 
```javascript
{
    "id": 888
}
```

***Response***
 欄位 | 型態 | 說明 
 ---  | --- | ---
 count | int | 更新資料筆數, > 0表示更新成功

```javascript
// HttpStatus:400, 資料不存在
{
    "errorMsg": "API_ERROR.NOT_EXIST",
    "httpCode": 400
}

// HttpStatus:200
{
    "httpCode": 200,
    "result": {
        "data": {
            "count": 1
        }
    }
}
```


## 紀錄更新 POST /caseCareRecord/latest-measure-list

取得最新量測更新紀錄
 
```url
POST /caseCareRecord/latest-measure-list
```

取得指定日期區間的最新量測更新紀錄

- 將回傳accessToken（JWT）帶入呼叫API的header中
- 依照accessToken（JWT）的areaCode帶入requestVO中

API require headers:
```javascript
{
      Content-Type: 'application/json',
      Accept: 'application/json',
      Authorization: accessToken,
}
```

### Request Body:
* query

| Parameter    |  format  | required |  desc        |
| ------------ | -------- | -------- | -------------|
| startDate    | Date     | true     | 查詢起始日期  |
| endDate      | Date     | true     | 查詢結束日期  |
| physiolItems  | String[]   | true     | 異常值項目列表, bloodPressure:血壓, heartBeat:心跳, bloodSugar:血糖, insulin:胰島素, spo2:血氧濃度, temperature:體溫, weight:體重, bmi:BMI, fat:體脂, waist:腰圍, hips:臀圍, water:喝水量, diet:飲食記錄 |
| patName      | String   | false     | 個案姓名   |

### Request Body Example:

```javascript
{
    "query": {
        "startDate": "2023-05-01",
        "endDate": "2023-07-26",
        "physiolItems": [
            "bloodPressure",
            "heartBeat",
            "bloodSugar",
            "insulin",
            "spo2",
            "temperature",
            "weight",
            "bmi",
            "fat",
            "waist",
            "hips",
            "water",
            "diet"
        ],
        "patName": null
    },
    "pagination": {
        "current": 1,
        "pageSize": 10,
        "total": 0
    },
    "sorter": {
        "field": "latestMeasureDate",
        "order": "desc"
    }
}
```

### Response Body:

 Parameter    |  format  |  desc       
 ------------ | -------- |-------------
 houseHoldMemberId   | String  | houseHoldMemberId
 cpiId | String | case_pat_info id
 patName | String | 個案姓名
 patTel | String | 個案電話
 gender | int | 個案性別, 1: 男, 2:女
 age | int | 個案年齡 
 latestMeasureDate   | Timestamp  |  最新測量時間 UTC+0 milliseconds
 systolicPressure | int | 收縮壓
 diastolicPressure | int | 舒張壓
 heartbeat | int | 心跳
 bloodSugar | int | 血糖
 insulinDose | double | 胰島素
 spo2 | int | 血氧濃度
 temperature | double | 體溫
 bodyWeight | double | 體重
 bmi | double | BMI
 fat | double | 體脂 
 waist | double | 腰圍
 hips | double | 臀圍
 waterVolume | double | 喝水量
 dietTimePeriodType | int | 飲食記錄餐別, 參閱 [用餐餐別](https://hackmd.io/9-h8HBMyRFGs3_2q6d1gtQ#%E7%94%A8%E9%A4%90%E9%A4%90%E5%88%A5)
  

```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "houseHoldMemberId": "150b53f5-7126-4900-9fb0-87a08b45e06b",
                "cpiId": "e8ebdf9a-23db-44e2-9935-623429d5449c",
                "patName": "呂學霖",
                "patTel": "0973621449",
                "gender": 1,
                "age": 27,
                "latestMeasureDate": 1689922612723,
                "systolicPressure": 100,
                "diastolicPressure": 90,
                "bloodPressureMeasureDate": 1689833422643,
                "heartbeat": 75,
                "heartbeatMeasureDate": 1689833422643,
                "spo2": 85,
                "spo2MeasureDate": 1689833540435,
                "bodyWeight": 70.9000015258789,
                "bodyWeightMeasureDate": 1689922612723,
                "bmi": 22.759191238475204,
                "bmiMeasureDate": 1689922612723,
                "fat": 20.0,
                "fatMeasureDate": 1689834161770,
                "waist": 100.0,
                "waistMeasureDate": 1689834161770,
                "hips": 85.0,
                "hipsMeasureDate": 1689834884047
            },
            {
                "houseHoldMemberId": "c0fbb6d5-53c4-4962-bc17-1591e4903b2f",
                "cpiId": "498c5ed0-c183-4186-95ca-d88d642b1bc6",
                "patName": "becca",
                "patTel": "0933816312",
                "gender": 2,
                "age": 30,
                "latestMeasureDate": 1689906083450,
                "systolicPressure": 70,
                "diastolicPressure": 80,
                "bloodPressureMeasureDate": 1689900404285,
                "heartbeat": 90,
                "heartbeatMeasureDate": 1689900404285,
                "bloodSugar": 88,
                "bloodSugarMeasureDate": 1689900422496,
                "temperature": 36.0,
                "temperatureMeasureDate": 1684801879787,
                "bodyWeight": 48.0,
                "bodyWeightMeasureDate": 1689906083450,
                "bmi": 19.0,
                "bmiMeasureDate": 1689906083450,
                "fat": 13.0,
                "fatMeasureDate": 1689906083450,
                "waterVolume": 240,
                "waterMeasureDate": 1684801892650,
                "dietTimePeriodType": 20,
                "dietMeasureDate": 1684812480000
            }
        ],
        "pagination": {
            "current": 1,
            "pageSize": 10,
            "total": 4
        },
        "sorter": {
            "field": "latestMeasureDate",
            "order": "desc"
        },
        "total": 4
    }
}
```


==================--   MEMO   --==================

## 各疾病物件:
#### ECKD 檢驗資料 check object

| Parameter | Required |  format  |  desc|
| --------- | -------- |-------- |-------|
| baseTall | Y | String | 身高 |
| baseWeight | Y | String | 體重 |
| baseSbp | Y | String | 血壓-收縮壓 (mmHg) |
| baseEbp | Y | String | 血壓-舒張壓 (mmHg) |
| egfr | Y | String | 腎絲球濾過率值, eGFR |
| bloodHba1c | Y | String | 糖化血色素 (%), HbA1c(mg/dl) |
| bloodLdl | Y | String | 低密度脂蛋白 (mg/dl), LDL(mg/dl) |
| upcr | Y | String | 尿蛋白及尿液肌酸酐比值, Urine PCR(mg/gm) |
| bloodCreat | Y | String | 肌酸酐(mg/dl), Serum creatinine(mg/dl) |
| smoking | Y | String | 抽煙, 1:無, 2:有 |
| baseWaist | N | String | 腰圍 |
| baseHips | N | String | 臀圍 |
| bmi | N | String | BMI |
| urineProtein | N | String | 尿液試紙(蛋白質) |
| urineGlucose | N | String | 尿液試紙(尿糖) |
| urineOb | N | String | 尿液試紙(潛血) |
| urineMicro | N | String | 尿液微量白蛋(ACR), Urine ACR(mg/dl) |
| uricAcid | N | String | 尿酸, Uric acid |
| chol | N | String | 總膽固醇, CHOL |
| bloodAc | N | String | 飯前血糖值 (mg/dl), Sugar AC(mg/dl) |
| drugHypertensives | N | String | 降血壓藥, 可勾選項目: ACEI, ARB, CCB, DRI, OTHER <br> 將勾選的選項以','串接, 勾選OTHER時,將填入的值以':'串接在OTHER後 <br> ex: ACEI,ARB,OTHER:藥物abc |
| drugInsulin | N | String | 胰島素, Y:是, N:否 |
| drugHypoglycemic | N | String | 降血糖藥, Y:是, N:否 |
| drugHypolipidemics | N | String | 降血脂藥, Y:是, N:否 |
| drugHyperuricemia | N | String | 降血酸藥, Y:是, N:否 |
| drugNsaid | N | String | NSAID, Y:是, N:否 |
| drugChinese | N | String | 中草藥, Y:是, N:否 |
| heRecord | N | String | 護理營業衛教紀錄, Y:是, N:否 |
| heTarget | N | String | 衛教對象, 可勾選項目: SELF:本人, FAMILY:家屬, OTHER:其他 <br> 將勾選的選項以','串接, 勾選OTHER時,將填入的值以':'串接在OTHER後 <br> ex: SELF,FAMILY,OTHER:路人甲 |
| heMethod | N | String | 衛教方式, 可勾選項目: ONE:個別衛教, TEL:電訪, GROUP:團體, OTHER:其他 <br> 將勾選的選項以','串接, 勾選OTHER時,將填入的值以':'串接在OTHER後 <br> ex: TEL,GROUP,OTHER:心電感應  |


#### ECKD Object Example:

```javascript
// ECKD檢驗資料
check: {
    "baseTall": "966",
    "baseWeight": "83",
    "baseSbp": "338",
    "baseEbp": "054",
    "egfr": "083",
    "bloodHba1c": "478",
    "bloodLdl": "453",
    "upcr": "736",
    "bloodCreat": "432",
    "smoking": "1",
    "baseWaist": "90",
    "baseHips": "90",
    "bmi": "30",
    "urineProtein": null,
    "urineGlucose": null,
    "urineOb": null,
    "urineMicro": "2",
    "uricAcid": "123",
    "chol": "123",
    "bloodAc": "123",
    "drugHypertensives": "ACEI,ARB,OTHER:藥物abc",
    "drugInsulin": "N",
    "drugHypoglycemic": "N",
    "drugHypolipidemics": "N",
    "drugHyperuricemia": "N",
    "drugNsaid": "N",
    "drugChinese": "N",
    "heRecord": "Y",
    "heTarget": "SELF,FAMILY,OTHER:路人甲",
    "heMethod": "TEL,GROUP,OTHER:心電感應"
}
```

#### DM 檢驗資料  check object

| Parameter | Required | format | desc |
|-----------|----------|--------|------|
FIRST、YEARREVIEW、SECOND_YEARREVIEW
| baseTall| **Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段) | String | 身高 |
| baseWeight| **Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段) | String | 體重|
| baseSbp | **Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|收縮壓|
| baseEbp| **Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|舒張壓|
| bloodChkDate|**Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|血液檢驗日期|
| bloodHba1c|**Y** (照護階段**FIRST, SECOND_REVIEW, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|糖化血色素|
| bloodLdl|**Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|低密度脂蛋白 (mg/dl)|
| bloodAc|**Y** (照護階段**FIRST, SECOND_REVIEW, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|飯前血糖值 (mg/dl)|
| bloodPc|**Y** (照護階段**FIRST, SECOND_REVIEW, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|飯後血糖值 (mg/dl)|
| bloodTg|**Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|三酸甘油酯 (mg/dl)|
| urineChkDate|**Y** (照護階段**FIRST, SECOND_REVIEW, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|尿液檢查日期|
| urineMicro | **Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段) | String |尿液微量白蛋白(ACR)|
| urineRoutine| **Y** (照護階段**FIRST**)、<br>**N** (其他照護階段) | String | 尿液常規檢查: NORMAL(正常),ABNORMAL(異常)|
| bloodCreat|**Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|肌酸酐|
| egfr|**Y** (照護階段**FIRST, SECOND_YEARREVIEW**)、<br>**N** (其他照護階段)|String|腎絲球濾過率值|


#### DM Object Example:

```javascript
// DM 檢驗資料
check: {
   "baseTall":"285",
   "baseWeight":"19",
   "baseSbp":"182",
   "baseEbp":"244",
   "bloodAc":"059",
   "bloodPc":"943",
   "bloodChkDate":1552869286893,
   "bloodHba1c":"417",
   "bloodLdl":"682",
   "bloodTg":"823",
   "urineChkDate":1552869286893,
   "urineMicro":"0",
   "urineRoutine":"ABNORMAL",
   "bloodCreat":"50",
   "egfr":"60"
}
```


#### B/C肝炎 檢驗資料 check object:
| Parameter | Required |  format  |  desc   |
| --------- | -------- | -------- |-------- |
|hbsag |Y (**肝炎類型**為 **B**/**BC**)、<br>N (肝炎類型:**C**/**OTHER**)| int|HBsAg 1陽性/2陰性|
|hbeag |Y (**肝炎類型**為 **B**/**BC**)、<br>N (肝炎類型:**C**/**OTHER**)|int |HBeAg 1陽性/2陰性|
|antiHcv |Y(**肝炎類型**為 **C**/**BC**)、<br>N (肝炎類型:**B**/**OTHER**)|int| Anti-HCV  1陽性/2陰性|
|got |Y (**肝炎類型**為 **B**/**C**/**BC**/**OTHER**)|int | GOT, 0~9999正整數|
|gpt |Y (**肝炎類型**為 **B**/**C**/**BC**/**OTHER**)|int |GPT, 0~9999正整數|
|abdominalUltrasound |Y (**肝炎類型**為 **B**/**C**/**BC**/**OTHER**)| int|腹部超音波檢查結果  (0:正常, 1:異常)|


#### B/C 肝炎 Object Example:

```javascript
// BC肝炎 檢驗資料
check: {
    "hbsag": 1,
    "hbeag": 2,
    "antiHcv": 1,
    "got": 500,
    "gpt": 450,
    "abdominalUltrasound": 0
}
```

