# 疾病管理
## 疾病列表
```url=
POST /disease/list
```
Request
| 欄位 | 型態 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
| pagination | json | | | 分頁 |
| - current | int | | 1 | 當前頁數 |
| - pageSize | int | | -2 | 每頁結果數量,-1 為顯示所有|
| sorter | json | | | 排序欄位, 預設是用更新時間降序排列 |
| - field | string | | update_time | 排序欄位 |
| - order | string | | desc | 生序或降序
```javascript
{
"query": {
"id": "DM",
"status": true
},
"pagination": {
"current": 1,
"pageSize": 10
},
"sorter": {
"field": "id",
"order": "asc"
}
}
```
Response
| 欄位 | 型態 | 說明 |
| -----| -----|-------- |
| id | string | 疾病名稱 |
| status | boolean | 狀態 |
| updateTime | int | 最後更新時間 |
```json
{
"httpCode": 200,
"result": {
"data": [
{
"id": "ECKD",
"i18n": "CASE.DISEASE_TYPE.ECKD",
"diseaseStage": [
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"i18n": "CASE.ECKD_STAGE_INDICATOR.STAGE_1",
"name": "Stage1",
"status": false
},
...
],
"status": false,
"updateTime": 1609833413337
},
{
"id": "DM",
"i18n": "CASE.DISEASE_TYPE.DM",
"diseaseStage": [],
"status": false,
"updateTime": 1609833413337
},
{
"id": "BC",
"i18n": "CASE.DISEASE_TYPE.BC",
"diseaseStage": [
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"i18n": "CASE.HEPATITIS_TYPE.B",
"name": "B",
"status": false
},
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"i18n": "CASE.HEPATITIS_TYPE.C",
"name": "C",
"status": false
},
...
],
"status": true,
"updateTime": 1609833413337
}
]
}
}
```
## 新增疾病
```url=
POST /disease/add
```
Request
| 欄位 | 型態 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
| id | string | * | | 科別名稱 |
| diseaseStage | json | | 疾病階段/類型
| status | bool | | true | 狀態(啟用停用) |
```javascript
{
"id": "BC",
"status": true,
"diseaseStage": [
{
"name" : "B",
"status" : true,
"order" : 1
},
{
"name" : "C",
"status" : true,
"order" : 2
},
{
"name" : "BC",
"status" : true,
"order" : 3
},
{
"name" : "Other",
"status" : true,
"order" : 4
}
]
}
```
Response
| 欄位 | 型態 | 說明 |
| -----| -----|-------- |
| id | string | * | | 科別名稱 |
| diseaseStage | json | | 疾病階段/類型
| status | bool | | true | 狀態(啟用停用) |
```json
{
"httpCode": 200,
"result": {
"data": {
"id": "BC",
"diseaseStage": [
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"i18n": "CASE.HEPATITIS_TYPE.B",
"name": "B",
"status": false
},
...
],
"status": true,
"createTime": 1609989027528,
"updateTime": 1609989027528
}
}
}
```
## 編輯疾病
```url=
POST /disease/update
```
Request
| 欄位 | 型態 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
| id | string | * | | 疾病id |
| name | string | * | 疾病名稱 |
| diseaseStage | json | | 疾病階段/類型
| status | bool | | true | 狀態(啟用停用) |
```javascript
{
"id": "BC",
"name":"BC2"
"status": true,
"diseaseStage": [
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"name" : "B",
"status" : true,
"order" : 1
},
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"name" : "C",
"status" : true,
"order" : 2
},
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"name" : "BC",
"status" : true,
"order" : 3
},
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"name" : "Other",
"status" : true,
"order" : 4
}
]
}
```
Response
| 欄位 | 型態 | 說明 |
| -----| -----|-------- |
| id | string | * | | 科別名稱 |
| diseaseStage | json | | 疾病階段/類型
| status | bool | | true | 狀態(啟用停用) |
```json
{
"httpCode": 200,
"result": {
"data": {
"id": "BC",
"i18n": "CASE.DISEASE_TYPE.BC",
"diseaseStage": [
{
"id" : "d5d579a2-9109-4cbf-bc3f-96600580ff3f",
"i18n": "CASE.HEPATITIS_TYPE.B",
"name": "B",
"status": false
},
...
],
"status": true,
"createTime": 1609989027528,
"updateTime": 1609989027528
}
}
}
```
## 啟用停用疾病
```url=
POST /disease/status
```
Request
| 欄位 | 型態 | 必填 | 預設 | 說明 |
|---|---|---|---|---|
| id | string | * | | 科別名稱 |
| activate | bool | * | | 啟用 |
```javascript
{
"id": "BC",
"activate": true
}
```
Response
| 欄位 | 型態 | 說明 |
| -----| -----|-------- |
| activate | bool | 啟用 |
```json
{
"httpCode": 200,
"result": {
"data": {
"id": "BC",
"status": true,
"createTime": 1609989027528,
"updateTime": 1609989027528
}
}
}
```