---
# System prepended metadata

title: 傷口記錄

---

# 傷口記錄

[TOC]

## 查詢傷口子部位(鄰近部位)
```url
GET /{contextPath}/wound/wound-sub-parts
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundPartId|int|傷口部位ID|1|
|woundPartCode|string|傷口部位代碼|hb_f_head_c|
|woundPartDescription|string|傷口部位說明|頭部|
|woundSubParts|array of woundSubPart|傷口子部位||

*woundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundSubPartId|int|傷口子部位ID|1|
|woundSubPartCode|string|傷口子部位代碼|hb_f_head_c_1|
|woundSubPartDescription|string|傷口子部位說明|右上頭頂|
|equalWoundSubPartCode|string|相等的傷口子部位代碼|hb_b_head_c_1|
|nearWoundParts|array of nearWoundPart|鄰近傷口部位||
|nearWoundSubParts|array of nearWoundSubPart|鄰近傷口子部位||

*nearWoundPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|nearWoundPartCode|string|鄰近傷口部位代碼|hb_b_head_c|

*nearWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundSubPartCode|string|鄰近傷口子部位代碼|hb_b_head_c_2|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "woundPartId": 1,
                "woundPartCode": "hb_f_head_c",
                "woundPartDescription": "頭部",
                "woundSubParts": [
                    {
                        "woundSubPartId": 1,
                        "woundSubPartCode": "hb_f_head_c_1",
                        "woundSubPartDescription": "右上頭頂",
                        "equalWoundSubPartCode": "hb_b_head_c_1",
                        "nearWoundParts": [
                            {
                                "nearWoundPartCode": "hb_b_head_c"
                            }
                        ],
                        "nearWoundSubParts": [
                            {
                                "nearWoundSubPartCode": "hb_b_head_c_2"
                            },
                            {
                                "nearWoundSubPartCode": "hb_b_head_c_3"
                            },
                            ...
                        ]
                    },
                    {
                        "woundSubPartId": 2,
                        "woundSubPartCode": "hb_f_head_c_2",
                        "woundSubPartDescription": "左上頭頂",
                        "equalWoundSubPartCode": "hb_b_head_c_2",
                        "nearWoundParts": [
                            {
                                "nearWoundPartCode": "hb_b_head_c"
                            }
                        ],
                        "nearWoundSubParts": [
                            {
                                "nearWoundSubPartCode": "hb_b_head_c_1"
                            },
                            ...
                        ]
                    },
                    ...
                ]
            },
            ...
        ]
    }
}
```
<br>


## 取得上傳傷口照片URL
```url
POST /{contextPath}/wound/wound-image-upload-url
```

**Note**
App使用者在新增傷口記錄時, 必須帶入原始圖檔及縮圖的imagePath及imageName,
因此需要先呼叫此API,會取得用來上傳圖檔到contentService的URL後,將圖檔上傳到contentService,
再將此API回傳的imagePath, imageName填入到新增傷口記錄API裡request body內

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|fileName|string|檔名|ABCD1234-88asdfjekql.png|

```javascript
{
    "fileName": "ABCD1234-88asdfjekql.png"
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|uploadUrl|string|上傳檔案URL|http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/1d2db848-dc35-4aa1-aaed-427a722da87c.png?temp_url_sig=522b597bb25d8aa43943fa929ae5b83fd09ee684&temp_url_expires=1614767434|
|imagePath|string|上傳後的圖檔在contentService上的路徑, 新增傷口記錄時,需帶入此值|wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/|
|imageName|string|上傳後的圖檔在contentService上的檔名, 新增傷口記錄時,需帶入此值|1d2db848-dc35-4aa1-aaed-427a722da87c.png|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "uploadUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/1d2db848-dc35-4aa1-aaed-427a722da87c.png?temp_url_sig=522b597bb25d8aa43943fa929ae5b83fd09ee684&temp_url_expires=1614767434",
            "imagePath": "wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/",
            "imageName": "1d2db848-dc35-4aa1-aaed-427a722da87c.png"
        }
    }
}
```
<br>


## 查詢傷口紀錄列表
```url
POST /{contextPath}/wound/user-wounds/list
```

**Note**
- 未分類的資料UserWoundSubPartCombination=0，userWoundSubPartCombinationDescription=""
- 組合資料時，userWoundSubPartCombination將所有子部位組合起來，但是userWoundSubPartCombinationDescription會將中文名稱重複的過濾掉，例如"右大拇指"有分前後的ID，但是description都是"右大拇指"，這時候只要顯示一次，不要顯示成"右大拇指+右大拇指"
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序
- 查詢有包含這個部位的資料夾，非完全等於此部位的傷口資料夾

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|
|require|timeSpan|string|時間區間|all(全部)<br>today(今天)<br>yesterday(昨天)<br>last3day(3天內)<br>last4day(4天內)<br>last7day(7天內)<br>last30day(30天內)<br>last90day(90天內，預設)|
|option|userWoundPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|
|option|query|string|模糊查詢資料夾標題欄位的中文字(部位)|腹股溝|

```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
    "timeSpan": "last90day", 
    "userWoundPartCombination": "",
    "query": "" 
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|30-101-49-50|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右髖部+左後大腿+左前足踝+左足背|
|userWoundSubParts|array of userWoundSubPart|傷口子部位||
|userWounds|array of userWound|傷口||
|userWoundLastUpdateTime|timestamp|更新日期<br>(此傷口部位底下的所有傷口的最後的更新時間)|1614328362975|

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundSubPartId|int|傷口子部位ID|30|
|woundSubPartCode|string|傷口子部位代碼|hb_f_groin_c_1|
|woundSubPartDescription|string|傷口子部位說明|右髖部|

*userWound*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄ID|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageThumbnailUrl|string|縮圖URL|http://xxx/zzz|
|lastUpdateTime|timestamp|更新日期|1614328362975|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "userWoundSubPartCombination": "30-101-49-50",
                "userWoundSubPartCombinationDescription": "右髖部+左後大腿+左前足踝+左足背",
                "userWoundSubParts": [
                    {
                        "woundSubPartId": 30,
                        "woundSubPartCode": "hb_f_groin_c_1",
                        "woundSubPartDescription": "右髖部"
                    },
                    {
                        "woundSubPartId": 49,
                        "woundSubPartCode": "hb_f_foot_l_2",
                        "woundSubPartDescription": "左前足踝"
                    },
                    {
                        "woundSubPartId": 50,
                        "woundSubPartCode": "hb_f_foot_l_3",
                        "woundSubPartDescription": "左足背"
                    },
                    {
                        "woundSubPartId": 101,
                        "woundSubPartCode": "hb_b_thigh_l_1",
                        "woundSubPartDescription": "左後大腿"
                    }
                ],
                "userWounds": [
                    {
                        "userWoundId": "153c671d-29d4-48f2-8ef0-a4b8598dd5d2",
                        "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=e0316013ff7bce2d4cfd2ab7cea1ac17653c1f8b&temp_url_expires=1614768786",
                        "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=7b6aa6e550bd499a79ccbf7ef7e74e66c5fe8b0e&temp_url_expires=1614768786",
                        "lastUpdateTime": 1614328362975
                    }
                ],
                "userWoundLastUpdateTime": 1614328362975
            }
        ]
    }
}
```
<br>

## 查詢最新(三筆)傷口紀錄列表
```url
POST /{contextPath}/wound/user-wounds/latest-list
```


***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|
|option|latestNum|int|查詢筆數(預設3筆)|3|


```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
    "latestNum": 3
}
```

***
**Response Body**


|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄ID|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageThumbnailUrl|string|縮圖URL|http://xxx/zzz|
|userWoundSubPartCombination|string|傷口組合部位代碼|xxx-xxx|
|userWoundSubPartCombinationDescription|string|傷口組合部位字串|xxx+xxx|
|lastUpdateTime|timestamp|更新日期|1614328362975|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "userWoundId": "e97bec74-aa9e-4687-ab2e-0b5c667a6fb4",
                "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/fdba6e30-ffda-47e4-b378-be7f9de7ba15/898da559-4114-4aa9-a8d4-daa13d4b07c9.jpg?temp_url_sig=d0aab5056e25f99f647b2b789496384e9730f9dd&temp_url_expires=1633354955",
                "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/fdba6e30-ffda-47e4-b378-be7f9de7ba15/a0922127-b169-4ae7-a516-f044280907bd.jpg?temp_url_sig=79cf962adea706c120b04b9df2ac073ae69c8780&temp_url_expires=1633354955",
                "userWoundSubPartCombination": "0",
                "userWoundSubPartCombinationDescription": "未分類",
                "lastUpdateTime": 1633071591269
            },
            {
                "userWoundId": "4d8c4b26-dc6d-466f-9aea-9b5f0aa2a528",
                "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/fdba6e30-ffda-47e4-b378-be7f9de7ba15/f5374022-41ca-4e12-bff0-61d11a83548f.jpg?temp_url_sig=7e5617d8a1a7d24bcfbfa046edfcad9989b9ba13&temp_url_expires=1633354955",
                "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/fdba6e30-ffda-47e4-b378-be7f9de7ba15/f69ea71f-36d2-41c3-a4c8-c18047862c99.jpg?temp_url_sig=7456ae5769dfc856543d3801807b9bfb973fc672&temp_url_expires=1633354955",
                "userWoundSubPartCombination": "27-29",
                "userWoundSubPartCombinationDescription": "左上腹+左下腹",
                "lastUpdateTime": 1632982811076
            },...
        ]
    }
}
```
<br>

## 查詢現存傷口分類API(進階搜尋)
```url
POST /{contextPath}/wound/user-wounds/part-types
```

**Note**

- select該病患userWoundSubParts內distinct過後的部位資料
- 並於第一筆增加未分類項目
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|

```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e"
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundSubPartId|int|傷口子部位ID|28|
|woundSubPartCode|string|傷口子部位代碼|hb_f_abdomen_c_1|
|woundSubPartDescription|string|傷口子部位說明|右上腹|
|index|int|傷口子部位排序|未分類=0<br>其他依據資料表顯示|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "woundSubPartId": 0,
                "woundSubPartCode": "",
                "woundSubPartDescription": "未分類",
                "index": 0
            },
            {
                "woundSubPartId": 30,
                "woundSubPartCode": "hb_f_groin_c_1",
                "woundSubPartDescription": "右髖部",
                "index": 72
            },
            {
                "woundSubPartId": 101,
                "woundSubPartCode": "hb_b_thigh_l_1",
                "woundSubPartDescription": "左後大腿",
                "index": 99
            },
            {
                "woundSubPartId": 49,
                "woundSubPartCode": "hb_f_foot_l_2",
                "woundSubPartDescription": "左前足踝",
                "index": 104
            },
            {
                "woundSubPartId": 50,
                "woundSubPartCode": "hb_f_foot_l_3",
                "woundSubPartDescription": "左足背",
                "index": 106
            }
        ]
    }
}
```
<br>


## 查詢傷口詳細資料
```url
POST /{contextPath}/wound/user-wounds/detail
```

**Note**
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|
|require|userWoundId|string|傷口記錄Id|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|

```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
    "userWoundId": "153c671d-29d4-48f2-8ef0-a4b8598dd5d2"
}

```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄Id|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|
|householdMemberId|string|householdMemberId|a72ccbc3-947d-467e-914e-3928dad3270e|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageWidth|int|原始圖片寬|1920|
|imageHeight|int|原始圖片高|1080|
|imageThumbnailUrl|string|縮圖URL|http://xxx/yyy|
|imageThumbnailWidth|int|縮圖寬|192|
|imageThumbnailHeight|int|縮圖高|108|
|woundLength|numeric|傷口長(mm)|105|
|woundWidth|numeric|傷口寬(mm)|50|
|woundDepth|numeric|傷口深(mm)|5|
|boundingBoxPosition|string|範圍框左上角位置|203,89|
|boundingBoxWidth|int|範圍框寬|310|
|boundingBoxHeight|int|範圍框高|150|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右上腹+右下腹|
|userWoundParts|array of userWoundPart|傷口部位||
|creator|string|建立者|bf7cc30d-42d1-48f0-b7b4-097e2817644f|
|createTime|timestamp|建立日期|1614327941805|

*userWoundPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundPartId|string|傷口記錄部位ID|01166ac4-7810-4d29-801e-f1dabe3a9a80|
|woundPartId|int|傷口部位ID|8|
|woundPartCode|string|傷口部位代碼|hb_f_foot_l|
|woundPartDescription|string|傷口部位說明|左小腿及足部|
|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartId|string|傷口記錄子部位ID|8b3ce769-814f-4752-a9b0-60693726d5f7|
|woundSubPartId|int|傷口子部位ID|49|
|woundSubPartCode|string|傷口子部位代碼|hb_f_foot_l_2|
|woundSubPartDescription|string|傷口子部位說明|左前足踝|


*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundId": "153c671d-29d4-48f2-8ef0-a4b8598dd5d2",
            "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
            "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=8ff25466ae5e3fb9dd7e1f941b294ef5d80ef76d&temp_url_expires=1614770982",
            "imageWidth": 1920,
            "imageHeight": 1080,
            "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=3814a9a3ffba398f949292a16ae46f318a4079ea&temp_url_expires=1614770982",
            "imageThumbnailWidth": 192,
            "imageThumbnailHeight": 108,
            "woundLength": 105,
            "woundWidth": 50,
            "woundDepth": 5,
            "boundingBoxPosition": "203,89",
            "boundingBoxWidth": 310,
            "boundingBoxHeight": 150,
            "userWoundSubPartCombination": "30-101-49-50",
            "userWoundSubPartCombinationDescription": "右髖部+左後大腿+左前足踝+左足背",
            "userWoundParts": [
                {
                    "woundPartId": 8,
                    "woundPartCode": "hb_f_foot_l",
                    "woundPartDescription": "左小腿及足部",
                    "userWoundPartId": "01166ac4-7810-4d29-801e-f1dabe3a9a80",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "8b3ce769-814f-4752-a9b0-60693726d5f7",
                            "woundSubPartId": 49,
                            "woundSubPartCode": "hb_f_foot_l_2",
                            "woundSubPartDescription": "左前足踝"
                        },
                        {
                            "userWoundSubPartId": "6246fbb2-4e67-4207-af16-8b41092ee865",
                            "woundSubPartId": 50,
                            "woundSubPartCode": "hb_f_foot_l_3",
                            "woundSubPartDescription": "左足背"
                        }
                    ]
                },
                {
                    "woundPartId": 4,
                    "woundPartCode": "hb_f_groin_c",
                    "woundPartDescription": "腹股溝及髖部",
                    "userWoundPartId": "77d635dc-82b5-4fdc-83bf-57423610ee73",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "a4974a79-432f-41d1-8458-503fe4788c9e",
                            "woundSubPartId": 30,
                            "woundSubPartCode": "hb_f_groin_c_1",
                            "woundSubPartDescription": "右髖部"
                        }
                    ]
                },
                {
                    "woundPartId": 18,
                    "woundPartCode": "hb_b_thigh_l",
                    "woundPartDescription": "左大腿",
                    "userWoundPartId": "e6e034e9-ef26-4681-ae3c-0870fb452d28",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "3f821cd5-8591-4096-aad1-4e676e08b207",
                            "woundSubPartId": 101,
                            "woundSubPartCode": "hb_b_thigh_l_1",
                            "woundSubPartDescription": "左後大腿"
                        }
                    ]
                }
            ],
            "creator": "bf7cc30d-42d1-48f0-b7b4-097e2817644f",
            "createTime": 1614327941805
        }
    }
}
```
<br>


## 新增傷口紀錄(儲存原圖/縮圖的path/name+儲存傷口尺寸)
```url
POST /{contextPath}/wound/user-wounds/add
```

**Note**

- 新增傷口紀錄。
- 須先呼叫上傳傷口照片原圖/縮圖API，這邊只儲存原圖/縮圖的path和name。
- 若有傳入部位資料userWoundSubPartCombination要存入組合好的資料，若沒有部位資料，則userWoundSubPartCombination存入0
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|imagePath|string|原始圖片檔案路徑|wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/|
|require|imageName|string|原始圖片檔名|c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg|
|require|imageWidth|numeric|原始圖片寬|1920|
|require|imageHeight|numeric|原始圖片高|1080|
|require|imageThumbnailPath|string|wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/|
|require|imageThumbnailName|string|縮圖檔名|04fa2f02-488c-421a-8ef3-c631d12f1845.jpg|
|require|imageThumbnailWidth|numeric|縮圖寬|192|
|require|imageThumbnailHeight|numeric|縮圖高|108|
|require|woundLength|numeric|傷口長(mm)|105|
|require|woundWidth|numeric|傷口寬(mm)|50|
|require|woundDepth|numeric|傷口深(mm)|5|
|require|boundingBoxPosition|string|範圍框左上角位置|203,89|
|require|boundingBoxWidth|int|範圍框寬|310|
|require|boundingBoxHeight|int|範圍框高|150|
|require|userWoundParts|array of userWoundPart|傷口部位|沒有選傷口部位時可以傳入空陣列|

*userWoundPart*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|woundPartId|int|傷口部位ID|4|
|require|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|woundSubPartId|int|傷口子部位ID|30|


```javascript
{
  "imagePath": "wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/",
  "imageName": "c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg",
  "imageWidth": 1920,
  "imageHeight": 1080,
  "imageThumbnailPath": "wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/",
  "imageThumbnailName": "04fa2f02-488c-421a-8ef3-c631d12f1845.jpg",
  "imageThumbnailWidth": 192,
  "imageThumbnailHeight": 108,
  "woundLength": 105,
  "woundWidth": 50,
  "woundDepth": 5,
  "boundingBoxPosition": "203,89",
  "boundingBoxWidth": 310,
  "boundingBoxHeight": 150,
  "userWoundParts": [
    {
      "woundPartId": 4,
      "userWoundSubParts": [
        {
          "woundSubPartId": 30
        }
      ]
    },
    {
      "woundPartId": 8,
      "userWoundSubParts": [
        {
          "woundSubPartId": 48
        },
        {
          "woundSubPartId": 49
        }
      ]
    }
  ]
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄ID|4e341b54-1cad-4fc3-ae18-42661da622ff|
|householdMemberId|string|householdMemberId|a72ccbc3-947d-467e-914e-3928dad3270e|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageWidth|int|原始圖片寬|1920|
|imageHeight|int|原始圖片高|1080|
|imageThumbnailUrl|string|縮圖URL|http://xxx/yyy|
|imageThumbnailWidth|int|縮圖寬|192|
|imageThumbnailHeight|int|縮圖高|108|
|woundLength|numeric|傷口長(mm)|105|
|woundWidth|numeric|傷口寬(mm)|50|
|woundDepth|numeric|傷口深(mm)|5|
|boundingBoxPosition|string|範圍框左上角位置|203,89|
|boundingBoxWidth|int|範圍框寬|310|
|boundingBoxHeight|int|範圍框高|150|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右上腹+右下腹|
|userWoundParts|array of userWoundPart|傷口部位||
|creator|string|建立者|81583525-9153-435d-b531-f8d128af8fb0|


*userWoundPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundPartId|string|傷口記錄部位ID|7bd6f925-f4fd-47c0-8dd3-2f477dc42086|
|woundPartId|int|傷口部位ID|4|
|woundPartCode|string|傷口部位代碼|hb_f_groin_c|
|woundPartDescription|string|傷口部位說明|腹股溝及髖部|
|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartId|string|傷口記錄子部位ID|cdcdb953-11b6-4eb1-a0f5-374883fa0c5b|
|woundSubPartId|int|傷口子部位ID|30|
|woundSubPartCode|string|傷口子部位代碼|hb_f_groin_c_1|
|woundSubPartDescription|string|傷口子部位說明|右髖部|


***
*HTTP 400 傷口部位找不到*
```javascript
{
    "errorMsg": "API_ERROR.NO_DATA",
    "errorDesc": "woundPart[50] not found",
    "httpCode": 400
}
```

*HTTP 400 傷口子部位找不到*
```javascript
{
    "errorMsg": "API_ERROR.NO_DATA",
    "errorDesc": "woundSubPart[200] not found",
    "httpCode": 400
}
```

*HTTP 400 指定傷口部位,但未指定傷口子部位*
```javascript
{
    "errorMsg": "API_ERROR.ARGUMENT_ERROR",
    "errorDesc": "[{\"userWoundParts[0].userWoundSubParts\":\"must not be empty\"}]",
    "httpCode": 400
}
```

*HTTP 200 沒有部位的狀態*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundId": "4e341b54-1cad-4fc3-ae18-42661da622ff",
            "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
            "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=4027fb18b59bf7c649e82afda24e3009eaf33ab3&temp_url_expires=1614772173",
            "imageWidth": 1920,
            "imageHeight": 1080,
            "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=68e03b7852e3e93436386160e2452e14c6897da7&temp_url_expires=1614772173",
            "imageThumbnailWidth": 192,
            "imageThumbnailHeight": 108,
            "woundLength": 105,
            "woundWidth": 50,
            "woundDepth": 5,
            "boundingBoxPosition": "203,89",
            "boundingBoxWidth": 310,
            "boundingBoxHeight": 150,
            "userWoundSubPartCombination": "0",
            "userWoundSubPartCombinationDescription": "",
            "userWoundParts": [],
            "creator": "bf7cc30d-42d1-48f0-b7b4-097e2817644f"
        }
    }
}
```

*HTTP 200 有部位的狀態*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundId": "4e341b54-1cad-4fc3-ae18-42661da622ff",
            "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
            "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=4027fb18b59bf7c649e82afda24e3009eaf33ab3&temp_url_expires=1614772173",
            "imageWidth": 1920,
            "imageHeight": 1080,
            "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=68e03b7852e3e93436386160e2452e14c6897da7&temp_url_expires=1614772173",
            "imageThumbnailWidth": 192,
            "imageThumbnailHeight": 108,
            "woundLength": 105,
            "woundWidth": 50,
            "woundDepth": 5,
            "boundingBoxPosition": "203,89",
            "boundingBoxWidth": 310,
            "boundingBoxHeight": 150,
            "userWoundSubPartCombination": "30-48-49",
            "userWoundSubPartCombinationDescription": "右髖部+左前小腿+左前足踝",
            "userWoundParts": [
                {
                    "userWoundPartId": "7bd6f925-f4fd-47c0-8dd3-2f477dc42086",
                    "woundPartId": 4,
                    "woundPartCode": "hb_f_groin_c",
                    "woundPartDescription": "腹股溝及髖部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "cdcdb953-11b6-4eb1-a0f5-374883fa0c5b",
                            "woundSubPartId": 30,
                            "woundSubPartCode": "hb_f_groin_c_1",
                            "woundSubPartDescription": "右髖部"
                        }
                    ]
                },
                {
                    "userWoundPartId": "cb786992-5556-4117-b89e-f70e6c039770",
                    "woundPartId": 8,
                    "woundPartCode": "hb_f_foot_l",
                    "woundPartDescription": "左小腿及足部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "d0828078-dd4c-4613-85c3-2a79a81efacd",
                            "woundSubPartId": 48,
                            "woundSubPartCode": "hb_f_foot_l_1",
                            "woundSubPartDescription": "左前小腿"
                        },
                        {
                            "userWoundSubPartId": "a304d019-a0f2-4a74-b1f9-ccfb9ce082b3",
                            "woundSubPartId": 49,
                            "woundSubPartCode": "hb_f_foot_l_2",
                            "woundSubPartDescription": "左前足踝"
                        }
                    ]
                }
            ],
            "creator": "bf7cc30d-42d1-48f0-b7b4-097e2817644f"
        }
    }
}
```
<br>


## 修改傷口尺寸
```url
POST /{contextPath}/wound/user-wounds/update-size
```

**Note**
- 需用token檢查，只有creator為該user的時候才可修改。
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|userWoundId|string|傷口記錄Id|ed7e0b7d-438e-4210-88e1-5b1cec1e4c6d|
|require|woundLength|numeric|傷口長(mm)|105|
|require|woundWidth|numeric|傷口寬(mm)|50|
|require|woundDepth|numeric|傷口深(mm)|5|

***
**Request Body**

```javascript
{
  "userWoundId": "ed7e0b7d-438e-4210-88e1-5b1cec1e4c6d",
  "woundLength": 105,
  "woundWidth": 50,
  "woundDepth": 5
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄ID|4e341b54-1cad-4fc3-ae18-42661da622ff|
|householdMemberId|string|householdMemberId|a72ccbc3-947d-467e-914e-3928dad3270e|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageWidth|int|原始圖片寬|1920|
|imageHeight|int|原始圖片高|1080|
|imageThumbnailUrl|string|縮圖URL|http://xxx/yyy|
|imageThumbnailWidth|int|縮圖寬|192|
|imageThumbnailHeight|int|縮圖高|108|
|woundLength|numeric|傷口長(mm)|105|
|woundWidth|numeric|傷口寬(mm)|50|
|woundDepth|numeric|傷口深(mm)|5|
|boundingBoxPosition|string|範圍框左上角位置|203,89|
|boundingBoxWidth|int|範圍框寬|310|
|boundingBoxHeight|int|範圍框高|150|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右上腹+右下腹|
|userWoundParts|array of userWoundPart|傷口部位||
|creator|string|建立者|81583525-9153-435d-b531-f8d128af8fb0|


*userWoundPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundPartId|string|傷口記錄部位ID|7bd6f925-f4fd-47c0-8dd3-2f477dc42086|
|woundPartId|int|傷口部位ID|4|
|woundPartCode|string|傷口部位代碼|hb_f_groin_c|
|woundPartDescription|string|傷口部位說明|腹股溝及髖部|
|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartId|string|傷口記錄子部位ID|cdcdb953-11b6-4eb1-a0f5-374883fa0c5b|
|woundSubPartId|int|傷口子部位ID|30|
|woundSubPartCode|string|傷口子部位代碼|hb_f_groin_c_1|
|woundSubPartDescription|string|傷口子部位說明|右髖部|


*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundId": "4e341b54-1cad-4fc3-ae18-42661da622ff",
            "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
            "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=4027fb18b59bf7c649e82afda24e3009eaf33ab3&temp_url_expires=1614772173",
            "imageWidth": 1920,
            "imageHeight": 1080,
            "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=68e03b7852e3e93436386160e2452e14c6897da7&temp_url_expires=1614772173",
            "imageThumbnailWidth": 192,
            "imageThumbnailHeight": 108,
            "woundLength": 105,
            "woundWidth": 50,
            "woundDepth": 5,
            "boundingBoxPosition": "203,89",
            "boundingBoxWidth": 310,
            "boundingBoxHeight": 150,
            "userWoundSubPartCombination": "30-48-49",
            "userWoundSubPartCombinationDescription": "右髖部+左前小腿+左前足踝",
            "userWoundParts": [
                {
                    "userWoundPartId": "7bd6f925-f4fd-47c0-8dd3-2f477dc42086",
                    "woundPartId": 4,
                    "woundPartCode": "hb_f_groin_c",
                    "woundPartDescription": "腹股溝及髖部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "cdcdb953-11b6-4eb1-a0f5-374883fa0c5b",
                            "woundSubPartId": 30,
                            "woundSubPartCode": "hb_f_groin_c_1",
                            "woundSubPartDescription": "右髖部"
                        }
                    ]
                },
                {
                    "userWoundPartId": "cb786992-5556-4117-b89e-f70e6c039770",
                    "woundPartId": 8,
                    "woundPartCode": "hb_f_foot_l",
                    "woundPartDescription": "左小腿及足部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "d0828078-dd4c-4613-85c3-2a79a81efacd",
                            "woundSubPartId": 48,
                            "woundSubPartCode": "hb_f_foot_l_1",
                            "woundSubPartDescription": "左前小腿"
                        },
                        {
                            "userWoundSubPartId": "a304d019-a0f2-4a74-b1f9-ccfb9ce082b3",
                            "woundSubPartId": 49,
                            "woundSubPartCode": "hb_f_foot_l_2",
                            "woundSubPartDescription": "左前足踝"
                        }
                    ]
                }
            ],
            "creator": "bf7cc30d-42d1-48f0-b7b4-097e2817644f"
        }
    }
}
```

*HTTP 422 傷口記錄不存在*
```javascript
{
    "errorMsg": "SERVICE_ERROR.USER_WOUND_NOT_EXISTS",
    "httpCode": 422
}
```
<br>


## 刪除病患傷口資料
```url
POST /{contextPath}/wound/user-wounds/delete
```

**Note**
- 需用token檢查，只有creator為該user的時候才可刪除。

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|userWoundId|string|傷口記錄ID|ed7e0b7d-438e-4210-88e1-5b1cec1e4c6d|

```javascript
{
  "userWoundId": "ed7e0b7d-438e-4210-88e1-5b1cec1e4c6d"
}
```

***
**Response Body**

*HTTP 200, 刪除成功*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": true
    }
}
```

*HTTP 422 傷口記錄不存在*
```javascript
{
    "errorMsg": "SERVICE_ERROR.USER_WOUND_NOT_EXISTS",
    "httpCode": 422
}
```

*HTTP 400*
```javascript
{
    "errorMsg": "API_ERROR.SYSTEM_ERROR",
    "httpCode": 400
}
```
<br>


## 修改傷口部位
```url
POST /{contextPath}/wound/user-wounds/update-parts
```

**Note**

- 需用token檢查，只有creator為該user的時候才可修改。
- 儲存完"傷口記錄部位(第一層)資料表"和"傷口記錄子部位(第二層)資料表"後，要回寫"傷口記錄資料"的"userWoundSubPartCombination"欄位，有多個組合時用"-"連接，ex:28-30。
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|userWoundId|string|傷口記錄Id|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|
|require|userWoundParts|array of userWoundPart|傷口部位||

*userWoundPart*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|woundPartId|int|傷口部位ID|4|
|require|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|woundSubPartId|int|傷口子部位ID|30|


```javascript
{
  "userWoundId": "153c671d-29d4-48f2-8ef0-a4b8598dd5d2",
  "userWoundParts": [
    {
      "woundPartId": 4,
      "userWoundSubParts": [
        {
          "woundSubPartId": 30
        }
      ]
    },
    {
      "woundPartId": 8,
      "userWoundSubParts": [
        {
          "woundSubPartId": 49
        },
        {
          "woundSubPartId": 50
        }
      ]
    },
    {
      "woundPartId": 18,
      "userWoundSubParts": [
        {
          "woundSubPartId": 101
        }
      ]
    }
  ]
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄ID|4e341b54-1cad-4fc3-ae18-42661da622ff|
|householdMemberId|string|householdMemberId|a72ccbc3-947d-467e-914e-3928dad3270e|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageWidth|int|原始圖片寬|1920|
|imageHeight|int|原始圖片高|1080|
|imageThumbnailUrl|string|縮圖URL|http://xxx/yyy|
|imageThumbnailWidth|int|縮圖寬|192|
|imageThumbnailHeight|int|縮圖高|108|
|woundLength|numeric|傷口長(mm)|105|
|woundWidth|numeric|傷口寬(mm)|50|
|woundDepth|numeric|傷口深(mm)|5|
|boundingBoxPosition|string|範圍框左上角位置|203,89|
|boundingBoxWidth|int|範圍框寬|310|
|boundingBoxHeight|int|範圍框高|150|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右上腹+右下腹|
|userWoundParts|array of userWoundPart|傷口部位||
|creator|string|建立者|81583525-9153-435d-b531-f8d128af8fb0|


*userWoundPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundPartId|string|傷口記錄部位ID|7bd6f925-f4fd-47c0-8dd3-2f477dc42086|
|woundPartId|int|傷口部位ID|4|
|woundPartCode|string|傷口部位代碼|hb_f_groin_c|
|woundPartDescription|string|傷口部位說明|腹股溝及髖部|
|userWoundSubParts|array of userWoundSubPart|傷口子部位||

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartId|string|傷口記錄子部位ID|cdcdb953-11b6-4eb1-a0f5-374883fa0c5b|
|woundSubPartId|int|傷口子部位ID|30|
|woundSubPartCode|string|傷口子部位代碼|hb_f_groin_c_1|
|woundSubPartDescription|string|傷口子部位說明|右髖部|


*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundId": "4e341b54-1cad-4fc3-ae18-42661da622ff",
            "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
            "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=4027fb18b59bf7c649e82afda24e3009eaf33ab3&temp_url_expires=1614772173",
            "imageWidth": 1920,
            "imageHeight": 1080,
            "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=68e03b7852e3e93436386160e2452e14c6897da7&temp_url_expires=1614772173",
            "imageThumbnailWidth": 192,
            "imageThumbnailHeight": 108,
            "woundLength": 105,
            "woundWidth": 50,
            "woundDepth": 5,
            "boundingBoxPosition": "203,89",
            "boundingBoxWidth": 310,
            "boundingBoxHeight": 150,
            "userWoundSubPartCombination": "30-48-49",
            "userWoundSubPartCombinationDescription": "右髖部+左前小腿+左前足踝",
            "userWoundParts": [
                {
                    "userWoundPartId": "7bd6f925-f4fd-47c0-8dd3-2f477dc42086",
                    "woundPartId": 4,
                    "woundPartCode": "hb_f_groin_c",
                    "woundPartDescription": "腹股溝及髖部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "cdcdb953-11b6-4eb1-a0f5-374883fa0c5b",
                            "woundSubPartId": 30,
                            "woundSubPartCode": "hb_f_groin_c_1",
                            "woundSubPartDescription": "右髖部"
                        }
                    ]
                },
                {
                    "userWoundPartId": "cb786992-5556-4117-b89e-f70e6c039770",
                    "woundPartId": 8,
                    "woundPartCode": "hb_f_foot_l",
                    "woundPartDescription": "左小腿及足部",
                    "userWoundSubParts": [
                        {
                            "userWoundSubPartId": "d0828078-dd4c-4613-85c3-2a79a81efacd",
                            "woundSubPartId": 48,
                            "woundSubPartCode": "hb_f_foot_l_1",
                            "woundSubPartDescription": "左前小腿"
                        },
                        {
                            "userWoundSubPartId": "a304d019-a0f2-4a74-b1f9-ccfb9ce082b3",
                            "woundSubPartId": 49,
                            "woundSubPartCode": "hb_f_foot_l_2",
                            "woundSubPartDescription": "左前足踝"
                        }
                    ]
                }
            ],
            "creator": "bf7cc30d-42d1-48f0-b7b4-097e2817644f"
        }
    }
}
```

*HTTP 422 傷口記錄不存在*
```javascript
{
    "errorMsg": "SERVICE_ERROR.USER_WOUND_NOT_EXISTS",
    "httpCode": 422
}
```
<br>


## 查詢傷口紀錄之該部位傷口列表
```url
POST /{contextPath}/wound/user-wounds/sub-part-combination
```

**Note**
- 查詢傳入參數userWoundSubPartCombination同部位(完全相同)的傷口清單
- 組合Response
  - 未分類的資料UserWoundSubPartCombination=0，userWoundSubPartCombinationDescription=""
  - 組合資料時，userWoundSubPartCombination將所有子部位組合起來，但是userWoundSubPartCombinationDescription會將中文名稱重複的過濾掉，例如"右大拇指"有分前後的ID，但是description都是"右大拇指"，這時候只要顯示一次，不要顯示成"右大拇指+右大拇指"
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|
|require|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|

```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
    "userWoundSubPartCombination": "30-101-49-50"
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|30-101-49-50|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右髖部+左後大腿+左前足踝+左足背|
|userWoundSubParts|array of user_wound_sub_part|傷口子部位||
|userWounds|array of user_wound|傷口||
|userWoundLastUpdateTime|timestamp|更新日期<br>(此傷口部位底下的所有傷口的最後的更新時間)|1614766292727|

*userWoundSubPart*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|woundSubPartId|int|傷口子部位ID|30|
|woundSubPartCode|string|傷口子部位代碼|hb_f_groin_c_1|
|woundSubPartDescription|string|傷口子部位說明|右髖部|

*userWounds*

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundId|string|傷口記錄Id|153c671d-29d4-48f2-8ef0-a4b8598dd5d2|
|imageUrl|string|原始圖片URL|http://xxx/zz|
|imageThumbnailUrl|string|縮圖URL|http://xxx/zzz|
|createTime|timestamp|建立日期|1614327941805|
|lastUpdateTime|timestamp|更新日期|1614766292727|


*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": {
            "userWoundSubPartCombination": "30-101-49-50",
            "userWoundSubPartCombinationDescription": "右髖部+左後大腿+左前足踝+左足背",
            "userWoundSubParts": [
                {
                    "woundSubPartId": 30,
                    "woundSubPartCode": "hb_f_groin_c_1",
                    "woundSubPartDescription": "右髖部"
                },
                {
                    "woundSubPartId": 101,
                    "woundSubPartCode": "hb_b_thigh_l_1",
                    "woundSubPartDescription": "左後大腿"
                },
                {
                    "woundSubPartId": 49,
                    "woundSubPartCode": "hb_f_foot_l_2",
                    "woundSubPartDescription": "左前足踝"
                },
                {
                    "woundSubPartId": 50,
                    "woundSubPartCode": "hb_f_foot_l_3",
                    "woundSubPartDescription": "左足背"
                }
            ],
            "userWounds": [
                {
                    "userWoundId": "153c671d-29d4-48f2-8ef0-a4b8598dd5d2",
                    "imageUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/c1ee7f80-5137-414f-9fbc-f6c98b9c9ce6.jpg?temp_url_sig=77f3933ff5ded3170eb782b23ee12cd392a4546e&temp_url_expires=1614773917",
                    "imageThumbnailUrl": "http://192.168.101.120/swift/v1/AUTH_test/kmuh/wound_photo/a72ccbc3-947d-467e-914e-3928dad3270e/04fa2f02-488c-421a-8ef3-c631d12f1845.jpg?temp_url_sig=f66c9854e977109bb2145ebcb6f1bfaae726e9eb&temp_url_expires=1614773917",
                    "createTime": 1614327941805,
                    "lastUpdateTime": 1614766292727
                }
            ],
            "userWoundLastUpdateTime": 1614766292727
        }
    }
}
```
<br>


## 查詢已建立部位
```url
POST /{contextPath}/wound/user-wounds/exist-parts
```

**Note**

- 病患所有傷口的部位組合分類
- 組合Response
  - 組合資料時，userWoundSubPartCombination將所有子部位組合起來，但是userWoundSubPartCombinationDescription會將中文名稱重複的過濾掉，例如"右大拇指"有分前後的ID，但是description都是"右大拇指"，這時候只要顯示一次，不要顯示成"右大拇指+右大拇指"
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序

***
**Request Body**

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|householdMemberId|string|householdMemberId, App User可以不用帶,後端會從token取得|a72ccbc3-947d-467e-914e-3928dad3270e|
|require|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|28-30|

```javascript
{
    "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e"
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|userWoundSubPartCombination|string|傷口子部位組合(第二層)<br>有多個組合時用"-"連接|30-101-49-50|
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右髖部+左後大腿+左前足踝+左足背|

*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "userWoundSubPartCombination": "30-101-49-50",
                "userWoundSubPartCombinationDescription": "右髖部+左後大腿+左前足踝+左足背"
            }
        ]
    }
}
```
<br>


## 傷口照顧列表
```url
POST /{contextPath}/wound/patient/list
```

**Note**
- 此API為Web使用
- 未分類的資料UserWoundSubPartCombination=0，userWoundSubPartCombinationDescription=""
- 組合資料時，userWoundSubPartCombination將所有子部位組合起來，但是userWoundSubPartCombinationDescription會將中文名稱重複的過濾掉，例如"右大拇指"有分前後的ID，但是description都是"右大拇指"，這時候只要顯示一次，不要顯示成"右大拇指+右大拇指"
- 組合資料時，依據woundSubParts的index欄位，決定userWoundSubPartCombination和userWoundSubPartCombinationDescription的組合順序
- 查詢有包含這個部位的資料夾，非完全等於此部位的傷口資料夾

***
**Request Body**

*query*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|tenantId|string|租戶Id|858b7fbb-3ba0-4d49-9882-c893a1ef07dc|
|require|timeSpan|string|時間區間|all(全部)<br>today(今天)<br>yesterday(昨天)<br>last3day(3天內)<br>last4day(4天內)<br>last7day(7天內)<br>last30day(30天內)<br>last90day(90天內，預設)|
|option|query|string|模糊查詢資料夾標題欄位的中文字(部位), 姓名, 身份證字號|腹股溝|

*pagination*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|current|int|當前頁數|1|
|require|pageSize|int|每頁結果數量,預設為10|10|


*sorter*

|Require|Name|Data Type|Description|Example|
|:---|:---|:---|:---|:---|
|require|field|string|排序欄位, 預設為lastUpdateTime, 可排序欄位:name, gender, idCardNo, userWoundSubPartCombinationDescription, lastUpdateTime|lastUpdateTime|
|require|order|string|升序或降序, 預設為desc|desc|


```javascript
{
    "query": {
        "tenantId": "858b7fbb-3ba0-4d49-9882-c893a1ef07dc",
        "timeSpan": "last90day",
        "query": "" 
    },
    "pagination": {
        "current": 1,
        "pageSize": 10
    },
    "sorter": {
        "field": "lastUpdateTime",
        "order": "desc"
    }
}
```

***
**Response Body**

|Name|Data Type|Description|Example|
|:---|:---|:---|:---|
|cpiId|string|個案cpiId||
|householdMemberId|string|householdMemberId||
|name|string|姓名||
|gender|string|性別, 1:男, 2:女||
|idCardNo|string|身份證字號||
|userWoundSubPartCombinationDescription|string|傷口子部位組合說明|未分類<br>右上腹<br>右髖部、左後大腿、左前足踝、左足背|
|lastUpdateTime|timestamp|更新日期|1614328362975|


*HTTP 200*
```javascript
{
    "httpCode": 200,
    "result": {
        "data": [
            {
                "cpiId": "430b3080-58df-4c27-a5d2-f3314e5a4a1b",
                "householdMemberId": "a72ccbc3-947d-467e-914e-3928dad3270e",
                "name": "林安平",
                "gender": "1",
                "idCardNo": "S100200334",
                "userWoundSubPartCombinationDescription": "右髖部、左後大腿、左前足踝、左足背",
                "lastUpdateTime": 1614328362975
            },
            ...
        ],
         "pagination": {
             "current": 1,
             "pageSize": 10,
             "total": 2
         },
         "sorter": {
             "field": "lastUpdateTime",
             "order": "desc"
         },
         "total": 2
    }
}
```
<br>