# 診所後台-病患管理API ==標籤列表== ## 取得病例標籤列表(ok) ::: success ::: spoiler GET /api/v1/patients/labels ### Description: 取得所有病例標籤清單(ok) ### Request: + Header ```json= { "Authorization": "Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==" //可能還缺什麼資訊?? } ``` + QuertString ```json { } ``` + Path ```json ``` + body ```json ``` ### Response: ```json { "data": [ { "id": 8, "title": "DM" }, { "id": 9, "title": "HT" }, { "id": 10, "title": "AA" }, { "id": 11, "title": "BBC" }, { "id": 12, "title": "ZZ" }, { "id": 13, "title": "XD" }, { "id": 14, "title": "PPPP" }, { "id": 21, "title": "XYZ" } ], "message": "成功。" } ``` :::success ::: ==病患列表== ## 取得病患列表(ok) ::: success ::: spoiler GET /api/v1/clinic/patients?page=1&size=10&medicalRecordNumber&name&gender&idNumber&birthday&phoneNumber&id=&sortBy=id&descending=desc ### Description: 取得所有病患列表 分頁 ### Request: + Header ```json= ``` + QuertString ```json { "page": 1, "size": 10, "medicalRecordNumber": "A32432", "name": "王大娘", "gender": 2, "idNumber": "R12397602", "birthday": "1990/08/20", "phoneNumber": "0933868973", "id": 3, "sortBy": "id", // 病例標籤id "descending": "asc", // asc || desc } ``` + Path ```json ``` + body ```json ``` ### Response: ```json { "data": { "size": "10", "page": "1", "total": 2, "list": [ { "id": 11, "name": "王母娘娘", "phoneNumber": "[\"066587895\",\"0935778469\"]", "idType": 1, "idNumber": "R123587888", "birthday": "1986/12/11 12:00:00", "gender": 1, "countryNote": "null", "allergy": "[\"Penicllin\",\"Glutin\"]", "height": "170", "weight": "70", "note": "值夜班,請勿打電話", "profession": "建築師", "betelNut": "有", "smoking": "有", "drinking": "無", "medicalHistory": "糖尿病", "residenceAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "mailingAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "phoneNumber": "0954778745", "relationship": "監護人" }, { "name": "王大人", "phoneNumber": "0954548745", "relationship": "監護人" } ], "medicalRecordNumber": "0023112", "labels": [ { "id": 10, "title": "AA" }, { "id": 11, "title": "BBC" }, { "id": 8, "title": "DM" }, { "id": 9, "title": "HT" } ] }, { "id": 10, "name": "王大娘", "phoneNumber": "[\"066587895\",\"0935778469\"]", "idType": 1, "idNumber": "R123587888", "birthday": "1972/12/11 12:00:00", "gender": 1, "countryNote": "null", "allergy": "[\"Penicllin\",\"Glutin\"]", "height": "170", "weight": "70", "note": "值夜班,請勿打電話", "profession": "建築師", "betelNut": "有", "smoking": "有", "drinking": "無", "medicalHistory": "糖尿病", "residenceAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "mailingAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "phoneNumber": "0954778745", "relationship": "監護人" }, { "name": "王大人", "phoneNumber": "0954548745", "relationship": "監護人" } ], "medicalRecordNumber": "0023112", "labels": [ { "id": 10, "title": "AA" }, { "id": 11, "title": "BBC" }, { "id": 8, "title": "DM" }, { "id": 9, "title": "HT" } ] } ] }, "message": "成功。" } ``` :::success ::: ## 批次匯入病患資料(ok) ::: info ::: spoiler POST /api/v1/patients/batch ### Description: 批次匯入病患的基本資料 ### Request: + Header ```json= ``` + Path + body ```json [ { "name": "王母娘娘", "gender": 1, "birthday": "1986/12/11", "idNumber": "R123587880", "medicalRecordNumber": "0023112", "idType": 1, "allergy": ["Penicllin","Glutin"], "phoneNumber": ["066587895","0935778469"], "mailingAddr": { "zipCode": "73542", "country": "台南市", "area": "北區", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "relationship": "監護人", "phoneNumber": "0954778745" }, { "name": "王大人", "relationship": "監護人", "phoneNumber": "0954548745" } ] }, { "name": "陳武", "gender": 2, "birthday": "1990/08/01", "idNumber": "R122086884", "medicalRecordNumber": "A9009", "idType": 1, "allergy": ["Penicllin","Glutin"], "phoneNumber": ["066587895","0935778469"], "mailingAddr": { "zipCode": "73542", "country": "高雄市", "area": "三民", "restAddr": "九如路一段20號" }, "emergencyContact": [ { "name": "陳津津", "relationship": "監護人", "phoneNumber": "0954778745" }, { "name": "王大人", "relationship": "監護人", "phoneNumber": "0954548745" } ] } ] ``` ### Response: ```json= { "data": null, "message": "成功。" } ``` :::info ::: ==一般資料== ## 取得病患資料(ok) ::: success ::: spoiler GET /api/v1/patients/{patientId} ### Description: 取得特定病患的基本資料 ### Request: + Header ```json= { "Authorization": "Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==" //可能還缺什麼資訊?? } ``` + Path + "accountId": 1 ### Response: | key | type | value | description | |:------------------- |:------------------------------------------------------------- |:-------------------------- |:------------------------- | | id | Int | 1 | 病患id | | name | String | "王大中" | 病患姓名 | | phoneNumbers | Array\<String> | ["066587895","0935778469"] | 連絡電話 | | idType | Int | 1 | 國籍 1: 台灣籍, 2: 外國籍 | | idNumber | String | "R123587888" | 身分證字號 | | birthday | Date | "1972/12/11" | 生日 | | gender | Int | 1 | 性別 ,1: 女性 , 2: 男性 | | countryNote | String | "null" | 國籍補充說明 | | allergy | Array\<String> | ["Penicllin","Glutin"] | 藥物過敏 | | height | String | "170" | 身高 | | weight | String | "70" | 體重 | | note | String | "值夜班,請勿打電話" | 備註 | | profession | String | "建築師" | 職業 | | betelNut | String | 有 | 檳榔: 有/無 | | smoking | String | 有 | 抽菸: 有/無 | | drinking | String | 無 | 喝酒: 有/無 | | medicalHistory | String | "糖尿病" | 病史 | | residenceAddr | [資料格式 - Address](/veRVYnKmT3Ky9nTkjxarfQ) | ----- | 戶籍地址 | | mailingAddr | [資料格式 - Address](/veRVYnKmT3Ky9nTkjxarfQ) | ----- | 通訊地址 | | emergencyContact | Array<[資料格式 - EmergencyContact](/hnwdePIcRL6o9c-VyQX30g)> | ----- | 緊急連絡人 | | medicalRecordNumber | String | "0023112" | 病歷號碼 | | labels | Array\<String> | ["DM","HIT"] | 標籤,都用大寫標示 | | families | Array<[資料格式 - Family](/x3GJSmoXRMKmJRgpKYCVVQ)> | ----- | 家庭成員 | ```json= { "data": { "id": 11, "name": "王母娘娘", "phoneNumber": "[\"066587895\",\"0935778469\"]", "idType": 1, "idNumber": "R123587888", "birthday": "1986/12/11 12:00:00", "gender": 1, "countryNote": "null", "allergy": "[\"Penicllin\",\"Glutin\"]", "height": "170", "weight": "70", "note": "值夜班,請勿打電話", "profession": "建築師", "betelNut": "有", "smoking": "有", "drinking": "無", "medicalHistory": "糖尿病", "residenceAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "mailingAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "phoneNumber": "0954778745", "relationship": "監護人" }, { "name": "王大人", "phoneNumber": "0954548745", "relationship": "監護人" } ], "medicalRecordNumber": "0023112", "labels": [ { "id": 10, "title": "AA" }, { "id": 11, "title": "BBC" }, { "id": 8, "title": "DM" }, { "id": 9, "title": "HT" } ], "families": [ { "id": 6, "name": "王大中", "idNumber": "R123587888", "relationship": "父子" }, { "id": 4, "name": "王大中", "idNumber": "R123587888", "relationship": "父女" }, { "id": 10, "name": "王大娘", "idNumber": "R123587888", "relationship": "監護人" } ] }, "message": "成功。" } ``` :::success ::: ## 建立單筆病患資料(ok) ::: info ::: spoiler POST /api/v1/patients ### Description: 建立單筆病患的基本資料 ### Request: + Header ```json= { "Authorization": "Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==" //可能還缺什麼資訊?? } ``` + Path + body ```json { "name": "王母娘娘", "gender": 1, "birthday": "1986/12/11", "idNumber": "R123587888", "medicalRecordNumber": "0023112", "idType": 1, "countryNote": "null", "allergy": ["Penicllin","Glutin"], "height": "170", "weight": "70", "label": ["dm","HT","aa","bbc"], "note": "值夜班,請勿打電話", "profession": "建築師", "betelNut": "有", "smoking": "有", "drinking": "無", "medicalHistory": "糖尿病", "phoneNumber": ["066587895","0935778469"], "residenceAddr": { "zipCode": "73542", "country": "台南市", "area": "北區", "restAddr": "北門路一段20號" }, "mailingAddr": { "zipCode": "73542", "country": "台南市", "area": "北區", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "relationship": "監護人", "phoneNumber": "0954778745" }, { "name": "王大人", "relationship": "監護人", "phoneNumber": "0954548745" } ], "families": [ { "id": 6, "name": "王大中", "idNumber": "R123587888", "relationship": "父子" }, { "id": 4, "name": "王大中", "idNumber": "R123587888", "relationship": "父女" }, { "id": 10, "name": "王大娘", "idNumber": "R123587888", "relationship": "監護人" } ] } ``` ### Response: ```json= "data": { "null" }, "message": "建立成功" ``` :::info ::: ## 更新病患資料(ok) ::: success ::: spoiler PUT /api/v1/patients/{patientId} ### Description: 更新特定病患的基本資料 ### Request: + Header ```json= { "Authorization": "Bearer QWxhZGRpbjpvcGVuIHNlc2FtZQ==" //可能還缺什麼資訊?? } ``` + Path + "patientId": 1 + body ```json { "name": "王大中", "phoneNumber": ["066587895"], "idType": 1, "idNumber": "R123587888", "birthday": "1972-12-10", "gender": 1, "countryNote": "null", "allergy": ["Penicllin","Glutin"], "height": "170", "weight": "70", "note": "值夜班,請勿打電話", "profession": "建築師", "betelNut": "有", "smoking": "有", "drinking": "無", "medicalHistory": "糖尿病", "lineId":"@78999", "residenceAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "mailingAddr": { "area": "北區", "country": "台南市", "zipCode": "73542", "restAddr": "北門路一段20號" }, "emergencyContact": [ { "name": "陳津津", "phoneNumber": "0954778745", "relationship": "監護人" }, { "name": "王大人", "phoneNumber": "0954548745", "relationship": "監護人" } ], "medicalRecordNumber": "0023112", "labels": [ { "id": 9, "title": "HT" }, { "id": 10, "title": "AA" }, { "title": "BBC" }, { "title": "ZZ" }, { "title":"XYZ" } ], "families": [ { "id": 6, "name": "王大中", "idNumber": "R123587888", "relationship": "父子" }, { "id": 4, "name": "王大中", "idNumber": "R123587888", "relationship": "父女" }, { "id":10, "name": "王大娘", "idNumber":"R123587523", "relationship":"監護人" } ] } ``` ### Response: ```json= { "data": "null", "message": "更新成功" } ``` :::success ::: ==約診紀錄== ## 取得被請假醫生影響的病患資料(ok) ::: success ::: spoiler GET /api/v1/clinic/patients/dayoff/influences?doctorId=89&date=2023/01/12 ### Description: 更新特定病患的基本資料 ### Request: + Header ```json= { //可能還缺什麼資訊?? } ``` + QueryString ```json doctorId: 89 date: 2023/01/12 ``` + body ### Response: ```json= { "data": { "patientsWithLineId": [ 22, 15 ], "patientsWithoutLineId": [ { "name": "落壽", "phoneNumber": [ "066587895", "0935778469" ], "idNumber": "R12358731", "reason": "尚未綁定line。" } ] }, "message": "成功。" } ``` :::success ::: ## 下載被請假醫師影響且沒有綁定LINE ID的病患列表(ok) ::: success ::: spoiler POST /api/v1/clinic/patients/dayoff/influences/csv ### Description: 下載被請假醫師影響且沒有綁定LINE ID的病患列表 ### Request: + body ```json [ { "name": "落壽", "phoneNumber": [ "066587895", "0935778469" ], "idNumber": "R12358731", "reason": "尚未綁定line。" } ] ``` + Header 'Content-Type': 'application/xlsx', "Content-Disposition": "attachment; filename=document.xlsx", ### Response: ```json= ``` :::success ::: ###### tags: `掛號系統`