H365V2
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 健康時間軸 ## 更新記錄 | 日期 | 說明 | | -------- | -------- | | 2021/01/08 | 建立健康時間軸 API 初版 | | 2021/01/13 | 修改查詢生理趨勢 API 回傳格式 | | 2021/01/14 | 增加查詢生理資料臨界區間 API 連結 | | 2021/01/15 | 增加查詢健康照護建議 API | | 2021/01/19 | 修改查詢生理趨勢 API 回傳格式| | 2021/01/19 | 修改查詢健康照護建議 API 回傳格式| | 2021/01/20 | 修改查詢生理趨勢 API URI| | 2021/01/22 | 修改查詢健康照護建議 API 回傳格式| | 2021/01/25 | 修改查詢健康照護建議 API 輸入參數名稱| | 2021/02/02 | 增加查詢生理圖表 API| | 2021/02/04 | 增加查詢量測記錄 API| | 2021/02/18 | 修改查詢量測記錄 API 回傳格式| | 2021/02/19 | 增加查詢喝水量記錄 API | | 2021/02/19 | 增加查詢週綜合分析 API | | 2021/02/19 | 增加查詢月綜合分析 API | | 2021/02/22 | 合併週和月之綜合分析 API | | 2023/07/17 | 增加肌肉量/腰圍/臀圍 欄位 | ## API 列表 * [查詢生理趨勢](#查詢生理趨勢) * [查詢健康照護建議](#查詢健康照護建議) * [查詢生理圖表](#查詢生理圖表) * [查詢量測記錄](#查詢量測記錄) * [查詢綜合分析](#查詢綜合分析) * [查詢生理資料臨界區間](#查詢生理資料臨界區間) * [查詢喝水量記錄](#查詢喝水量記錄) ## 生理指標列表 (15項) * bodyWeight(體重) * fat(體脂) * bmi(BMI) * muscle(肌肉量) * waist(腰圍) * hips(臀圍) * heartRate(脈博) * systolic(收縮壓) * diastolic(舒張壓) * beforeMeals(飯前血糖) * afterMeals(飯後血糖) * oxygen(血氧) * insulin(胰島素) * temperature(體溫) * waterVolume(喝水量) ## 查詢生理趨勢 ### 查詢最新的生理數值及趨勢 ```url GET /timeline/legend/id={id} ``` ==查詢的生理資料總計十項== ### Query Param | 欄位 | 型態 | 說明 | |---|---|---| |id | String | household_member_id| ### Response Body Param | 欄位 | 型態 | 說明 | |---|---|---| |value_{生理指標} | number | 最近一筆量測數值,若 -1 則代表此生理數值連一筆記錄都沒有| |trend_{生理指標} | number | 1:上升 / 2:持平或無第二筆數值 / 3:下降 / -1:一筆資料都沒有所以無法比較| ### trend 參數說明 * 取最後一筆值(v1),並與倒數第二筆值(v2)作對比,得到上升,持平,下降的趨勢 * 比較結果 * -1 : ==一筆資料都沒有所以無法比較== * 1 : v1 > v2 ==上升== * 2 : v1 = v2 或 v2 不存在 ==持平== * 3 : v1 < v2 ==下降== ### value 及 trend 陣列順序 * value 及 trend 陣列會依序列出所有生理資料,順序為 * bmi * fat * bodyWeight * heartRate * diastolic * systolic * beforeMeals * afterMeals * temperature * oxygen * muscle * waist * hips ### Response Body Example ```javascript { "httpCode": 200, "result": { "data": { "value":[3, 3.8, 88, 280, -1, 34, ...], "trend":[2, 3, 1, 2, -1, 3, ...] } } } ``` ## 查詢健康照護建議 * 查詢包含到當下 (currentTime) 為止共七天的不正常數值及次數 * currentTime 當天為最後一天 * 查詢照護建議 ### Request URL ```url POST /timeline/advice ``` ### Query Param | 欄位 | 型態 | 必填 | 說明 | |---|---|---|---| |hmid | String | Y(**Web端**)<br/>N(**App端**) | household_member_id| |currentTime | timestamp | Y | 查詢時段的結尾時間| ### Request Body Example ```javascript { "query": { "hmid": "7890bcfd11724a36a7077dc9ade21611", "currentTime": "1550448000000" } } ``` ### Response Body Param | 欄位 | 型態 | 說明 | |---|---|---| |diastolic | number | 舒張壓高於正常值次數| |systolic | number | 收縮壓高於正常值次數 | |beforeMeals | number | 飯前血糖高於正常值次數 | |afterMeals | number | 飯後血糖高於正常值次數 | |getEnergy | number | 攝取熱量高於建議值天數 | |getEnergyTarget | number | 攝取熱量建議值 | |bmi | number | 這七天的 bmi 最大值 | |bodyWeight | number | 這七天的體重最大值 | |forgetMedicine | number | 忘記用藥次數 | |advice | string | 照護建議 i18n 代碼的陣列 | |bmiOverCount | number | BMI高於正常值次數 | |bodyWeightOverCount | number | 體重高於正常值次數 | ### Response Body Example ```javascript { "httpCode": 200, "result": { "data": { "diastolic":3, "systolic": 2, "beforeMeals": 5, "afterMeals": 1, "getEnergy": 2, "getEnergyTarget": 1500 "bmi": 38, "bodyWeight": 65, "forgetMedicine": 3, "bmiOverCount": 3, "bodyWeightOverCount": 3, "advice": [ "HEALTH_TIMELINE.SUGGESTION.HIGH_PRESURE_DRUG", "HEALTH_TIMELINE.SUGGESTION.BLOOD_SUGAR_BAD_CONTROL_DIETARY" ] } } } ``` ## 查詢生理圖表 * 查詢包含從 startAt 到 endAt 為止所有生理資料的最大值最小值和平均 * 若duration為1,則返回值會區分為 1~4 區間,若 duration 為 2,則返回值的區間皆為0代表以全天去做計算 ### Request URL ```url POST /timeline/graph ``` ### Query Param | 欄位 | 型態 | 說明 | |---|---|---| |hmid | String | household_member_id| |startAt | timestamp(milliseconds) | 查詢時段的起始時間| |endAt | timestamp(milliseconds) | 查詢時段的結尾時間| |duration | number | 1:週 2:月| ### Request Body Example ```javascript { "query": { "hmid": "7890bcfd11724a36a7077dc9ade21611", "startAt": 1550448000000, "endAt": 1570448000000, "duration": 1 } } ``` ### Response Body Param | 欄位 | 型態 | 說明 | |---|---|---| |type | String | 生理資料種類| |max | number | 本時段內此生理資料的最大值| |min | number | 本時段內此生理資料的最小值| |avg | number | 本時段內此生理資料的平均值| |timeDate | String | 此生理資料參考日期| |timeRange | int | 此生理資料參考之時段; 0:全天,1:0h ~ 9h,2:10h ~ 14h,3:15h ~ 20h,4:21h ~ 23h| |total | number | 本時段內此生理資料的筆數| ### 生理資料種類包含以下 * bmi * fat * bodyWeight * heartRate * diastolic * systolic * beforeMeals * afterMeals * temperature * oxygen * insulin * muscle * waist * hips ### Response Body Example ```javascript { "httpCode": 200, "result": { "data": { "dataList":[ { "type":"heartbeat", "max": 160, "min": 80, "avg": 120, "timeDate":"2021-01-01", "timeRange":1, "total":3 }, { "type":"heartbeat", "max": 140, "min": 100, "avg": 90, "timeDate":"2021-01-01", "timeRange":3, "total":2 }, { "type":"bmi", "max": 80.6, "min": 60.3, "avg": 70.1, "timeDate":"2021-01-01", "timeRange":1, "total":4 }... ] } } } ``` ## 查詢量測記錄 ### 顯示各生理資料在特定時段內的量測記錄 ### Request URL ```url POST /timeline/record ``` ### Query Param | 欄位 | 型態 | 說明 | |---|---|---| |hmid | String | household_member_id| |startAt | timestamp(milliseconds) | 查詢時段的起始時間| |endAt | timestamp(milliseconds) | 查詢時段的結尾時間| |typeList | String 陣列 | 查詢生理資料的種類| | page | number | 當前頁數| | pageSize | number | 每頁結果數量,-1 為顯示所有| | field | string | 排序欄位,這裡支援用 type 或 time 排序| | order | string | 排序方法,這裡支援用 asc 或 desc 排序| ### Request Body Example ```javascript { "query": { "hmid": "7890bcfd11724a36a7077dc9ade21611", "startAt": 1550448000000, "endAt": 1570448000000, "typeList": ["fat", "diastolic", "afterMeals", "oxygen"] }, "pagination": { "current": 1, "pageSize":-1 }, "sorter": { "field": "type", "order": "asc" } } ``` ### 生理資料種類包含以下 * bmi * fat * bodyWeight * heartRate * diastolic * systolic * beforeMeals * afterMeals * temperature * oxygen * insulin * muscle * waist * hips ### Response Body Param | 欄位 | 型態 | 說明 | |---|---|---| |type | String | 生理資料種類| |record | number | 生理資料記錄值| |dateMark | String | 生理資料記錄日期| |timeMark | String | 生理資料記錄時間,24小時制| |source | number | 資料來源,如果是 1 代表手動輸入,0 代表設備量測| |total | number | 所有生理資料的筆數| ### Response Body Example ```javascript { "httpCode": 200, "result": { "data": [ { "type":"heartbeat", "record": 120, "dateMark":"2021/01/01", "timeMark":"08:12:00", "source": 1 }, { "type":"diastolic", "record": 140, "dateMark":"2021/01/02", "timeMark":"20:30:00", "source": 0 }, { "type":"afterMeals", "record": 110.6, "dateMark":"2021/01/03", "timeMark":"22:30:00", "source": 0 }... ], "pagination": { "current": 3, "pageSize": 10, "total": 75 }, "sorter": { "field": "type", "order": "asc" } } } ``` ## 查詢綜合分析 ### 使用於顯示綜合分析記錄 * 分析內容包括 飲食記錄,運動記錄,未用藥,喝水量,步行數,忘記用藥次數 ### Request ```url POST /timeline/analyze ``` ### Query Param | 欄位 | 型態 | 說明 | |---|---|---| |hmid | String | household_member_id| |startAt | timestamp(milliseconds) | 查詢時段的起始時間| |endAt | timestamp(milliseconds) | 查詢時段的結尾時間| |duration | number | 1:週 2:月| ### Request Body Example ```javascript { "query": { "startAt": "1550448000000", "endAt": "1550799654741", "hmid": "7890bcfd11724a36a7077dc9ade21611", "duration":1 } } ``` ### Response Body Param Attribute | Description | Remark -|-|- dataList | JsonArray | 標示飲食,運動,未用藥的詳細記錄 type | String | 註記種類,包括飲食 (diet),運動 (sport),未用藥(noMedicine) value | number | 資料筆數 timeDate | String | 此生理資料起始日期 timeRange | int | 此生理資料包含之時段; 1:0h ~ 9h,2:10h ~ 14h,3:15h ~ 20h,4:21h ~ 23h,5:當日,6:包含當日連續七天 value | number | 此生理數值之資料 analyzeList | JsonArray | 每日分析之記錄 ### analyze 之回傳欄位在不同 duration 之定義 Attribute | Description | duration=1 (週) | druation=2 (月) -|-|-|- waterVolume | number | 當日喝水量總計 | 每日平均喝水量,計算方法為當週總和除以有記錄之天數 stepCount | number | 當日步行數總計 | 每日平均步數,計算方法為當週總和除以有記錄之天數 getCalories | number | 當日攝取熱量 | 每日平均攝取熱量,計算方法為當週總和除以有記錄之天數 noMedicineCount | number | 當日忘記用藥次數 | 維持 0,不予參考 ### Response Example ```javascript= { "httpCode": 200, "result": { "data": { "dataList": [ { "type":"diet", "timeDate":"2021-01-01", "timeRange":1, "value": 20 }, { "type":"sport", "timeDate":"2021-01-02", "timeRange":3, "value": 10 }, { "type":"noMedicine", "timeDate":"2021-01-02", "timeRange":4, "value": 8, }, { "type":"sport", "timeDate":"2021-01-03", "timeRange":6, "value":80 } ], "analyzeList":[ { "getCalories": 142.5, "stepCount": 120, "waterVolume": 460, "noMedicineCount":0, "timeDate":"2021-01-03", "timeRange":6, }, { "getCalories": 201.6, "stepCount": 16, "waterVolume": 320, "noMedicineCount":3, "timeDate":"2021-01-06", "timeRange":5, } ] } } } ``` ## 查詢生理資料臨界區間 * 請參考 [生理量測-取得生理資料警示範圍](https://hackmd.io/o6HdTr4USBe3HmbkT6gedA) ## 查詢喝水量記錄 * 請參考 [生理資料-查詢喝水量](https://hackmd.io/BpvOkwuaQteEneeibx4uVw?view#%E6%9F%A5%E8%A9%A2%E5%96%9D%E6%B0%B4%E9%87%8F) ### 週水量部份 * Request 參數 * avg 帶 0 * Response * dataList 裡為每筆喝水記錄 * waterTotal 為總喝水量 ### 月水量部份 * 需 Request 兩次 * 第一次 Request * avg 帶 0 * 取得 Response 裡的 dataList 為每筆喝水記錄 * 第二次 Request * avg 帶 1 * 取得 Response 裡的 waterAvg 為每日平均喝水量

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully