# FHIR文件整理 ###### tags: `規格書` # GET ### 程式說明 ------------------------------- > fetch > 在 JavaScript 使用 fetch() 函式時會需要傳入一段 url,它會 return 一個 promise ,這個 promise 就是我們要處理的物件。 ```javascript= let fetchPromise = fetch(`https....`) console.log(fetchPromise) //{<pending>} ``` > .then() > 1. 要拿到 Promise 裡面的資料,我們需要使用 .then() 這個函式 > 2. .then() 裡面回傳一個值,這個值就會成為下一個 .then() 的參數 ```javascript= .then((response) => response.json()) .then((data) => {} ``` > return > 最後我們可以使用return回傳一個Promise的物件做後續的使用 ```javascript= return (getData = data); ``` > 範例 ```javascript= let getData; //用來接return 回來的Promise物件 let fetchPromise = fetch(url, { method: "GET", //method為GET headers: { "Content-Type": "application/json", //格式為JSON }, }) .then((response) => response.json()) .then((data) => { //取得Promise中的資料 return (getData = data); //回傳取得到的Promise物件 }) .catch((error) => console.error(error)); const data = await fetchPromise;//將回傳的Promise物件儲存在data中 ``` > 取得資料 > 之後若要使用Promise物件中的資料 # javascript建立table >建立元素 ```javascript= const 自訂名稱 = document.createElement('要建立的元素標籤') ``` >插入一列 ```javascript= const 自訂名稱 = table.insertRow(); ``` >編輯欄位內容 ```javascript= const 自訂名稱 = document.createElement("th");//建立th元素 header1.textContent = "header1";//將th中的文字設為"header1" ``` >加入table row中 ```javascript= tableContainer.appendChild(table); headerRow.appendChild(header1); ``` > 範例 ```javascript= <!DOCTYPE html> <head></head> <body> <button onclink="createTable()"> <div id="tableContainer"></div> <script> async function eventSearch() { function createTable() { //抓到html裡table位置的div const tableContainer = document.getElementById("table-container"); //建立table元素 const table = document.createElement("table"); //插入一列 const headerRow = table.insertRow(); //建立th元素 const header1 = document.createElement("th"); const header2 = document.createElement("th"); const header3 = document.createElement("th"); //編輯欄位中的內容 header1.textContent = "header1"; header2.textContent = "header2"; header3.textContent = "header3"; //設定列的寬度 header3.colSpan = 3; //將變數加入row中 tableContainer.appendChild(table); headerRow.appendChild(header1); headerRow.appendChild(header2); headerRow.appendChild(header3); } </script } </script> </body> </html> ``` # serviceRequest復健中心系統 ## 1.情境 > 民眾到復健中心看診,醫院會開立復健療程。看診結束後民眾可到復健中心預約場地、預約復健師、租借復健需要用的器材 >流程:看診->開立療程->預約場地器材租借 > ==**這份說明文件主要著重在開設處方、人員預約、場地、器材租借**== ## 2.系統架構圖 ![1704593678220](https://hackmd.io/_uploads/Hyf7FFPO6.jpg) ## 3.功能介紹 1. ==民眾端:復健預約系統== + 預約看診時段或醫師(encounter) + 查詢處方(復健療程)(民眾端serviceRequest) + 預約復健中心場地(民眾端serviceRequest) + 預約復健人員(民眾端serviceRequest) + 租借器材 (民眾端serviceRequest) 2. ==醫護端:復健科看診系統== + **復健中心開設療程處方:(醫院端serviceRequest)** + 療程時間(起始、結束) + 處方藥物、器材 + 治療類型 + 治療目標 + 治療頻率 + 特殊指示 + **建立病患資料(patient)** + **建立組織、組織醫生(Organization、Practitioner)** 3. ==角色== + 醫護人員 + 復健場域人員 + 一般民眾 ## 4.欄位介紹(開設處方) 1. **reference** + 病人資料 + 醫生資料 + encounter資料 + 醫療器材 2. 治療目標:code->text 3. 治療類型代碼:code->coding->code 4. 治療類型:code->coding->display 5. 治療頻率、治療平率的單位(日、週、月):quantityQuantity->1.value2.unit 6. 治療開始日期:occurrencePeriod->start 7. 治療結束日期:occurrencePeriod->end 10. 醫療器材:device->reference 12. 備註:note->text ## 5.JSON格式 ![1704594891789](https://hackmd.io/_uploads/rkOxAFPOa.jpg) ## 6.系統介面 ### 民眾端 + 初複診選擇 + ![1704597064622](https://hackmd.io/_uploads/HJuP85v_T.jpg) + 建立初診資料 + ![02](https://hackmd.io/_uploads/ByrrPqDua.jpg) + 查詢復健中心預約 + ![1704597924735](https://hackmd.io/_uploads/Sk-6t9Pu6.jpg) + 查詢處方 + ![1704597604483](https://hackmd.io/_uploads/SkdYdcvdp.jpg) + 復健中心預約 + ![1704596918054](https://hackmd.io/_uploads/BJZoI5Ddp.jpg) ## 醫護端 + 開設處方(醫護端) + ![1704702498233](https://hackmd.io/_uploads/SJ0HMVKda.jpg) ----------------------------------------------------- ## 其他 + 建立組織、指派組織醫師 + ![1704598197986](https://hackmd.io/_uploads/r1h659DOp.jpg) ## 7.其他功能 1. 保險和付款處理 2. 反饋和滿意度調查 3. 轉介管理 4. 復健時的生理狀態紀錄 ## 8.部分程式碼範例 + 處方JSON物件 ```javascript= var serviceRequestData = { "resourceType": "ServiceRequest", "identifier": [ { "use": "official", "value": patientIdentity } ], "status": "active", "intent": "order", "subject": { "reference": "Patient/" + patientId }, "encounter": { "reference": "Encounter/" + encounterId }, "authoredOn": treatStartDate, "requester": { "reference": "Practitioner/" + doctorId }, "code": { "coding": [ { "system": "http://hl7.org/fhir/CodeSystem/treatment", "code": TreatmentCode, "display": TreatmentType } ], "text": TreatmentGoals }, "quantityQuantity": { "value": TreatmentFrequency, "unit": frequencyUnit }, "occurrencePeriod": { "start": treatStartDate, "end": treatEndDate }, "medicationCodeableConcept": { "coding": [ { "system": "http://hl7.org/fhir/medication-code", "code": drugsCode, "display": drugs } ] }, "device": [ { "reference": "Device/" + deviceId } ], "note": [ { "text": note } ] }; ``` + 建立醫療處方POST + ![1704811926056](https://hackmd.io/_uploads/Hkyh6A9uT.jpg) --------------------------------- # 漸凍症患者管理 - 提交系統 ## 1.情境 主要是用來練習condition和observation的練習,實際應用上比較沒有價值,情境主要是拿來記錄漸凍症患者的就醫訊息。 ## 2.功能介紹 1. ==醫療背景==:記錄患者的病史和當前症狀,這些訊息我把它存在 Condition。 2. ==生活質量與功能評估==:輸入患者的生活質量評估和功能評分,這些訊息會記錄在Observation 中。 3. ==生理監測資料==:輸入患者的舒張壓、收縮壓,這些訊息會記錄在Observation 中。 4. ==治療記錄==:記錄看診時的資訊,儲存在Procedure 5. ==查詢==:查詢上述四點紀錄的訊息 ## 3.系統介面 + 患者訊息提繳 ![1704810808145](https://hackmd.io/_uploads/S1B_t09O6.jpg) + 患者訊息查詢 ![1704810897808](https://hackmd.io/_uploads/BklsFRcua.jpg) ## 4.部分程式碼 + 醫療病史POST範例 + ![1704811607859](https://hackmd.io/_uploads/r1-F3A5OT.jpg) + 醫療病史GET範例 + ![1704811692729](https://hackmd.io/_uploads/Hk4p2C5da.jpg)