SOP-16: Create Treatment Diary with Daily Entries
API SOPStart a treatment recovery diary and add daily progress entries with photos and health metrics.
3 nodes · 3 edgesmedirank
apisopmedirankdiaries
Visual
ex-sop-16-create-treatment-diary.osop.yaml
# 原始:SOP-16: 建立療程日記 + 新增每日紀錄
osop_version: '1.0'
id: sop-16-create-treatment-diary
name: 'SOP-16: Create Treatment Diary with Daily Entries'
description: Start a treatment recovery diary and add daily progress entries with photos and health metrics.
version: 1.0.0
tags:
- api
- sop
- medirank
- diaries
nodes:
- id: step_1
type: api
subtype: rest
name: POST /diaries
description: Start a new treatment recovery diary.
runtime:
method: POST
url: https://medi-rank.com/api/v1
endpoint: /diaries
headers:
Authorization: Bearer ${secrets.TOKEN}
content_type: multipart/form-data
body:
title: My HA Filler Recovery Diary
treatment_type: Hyaluronic acid filler
clinic_id: 1
doctor_id: 3
treatment_id: 2
summary: Recording the full recovery process from treatment to completion
started_at: '2026-03-15'
is_public: true
cover_image: (file)
- id: step_2
type: api
subtype: rest
name: POST /diaries/{diary_id}/entries
description: Add a daily progress entry with mood, pain, swelling ratings and photos. Repeat for each recovery day.
runtime:
method: POST
url: https://medi-rank.com/api/v1
endpoint: /diaries/{diary_id}/entries
headers:
Authorization: Bearer ${secrets.TOKEN}
content_type: multipart/form-data
body:
day_offset: 0
title: Treatment Day
body: Just finished, some swelling...
mood_rating: 3
pain_level: 4
swelling_level: 6
photos[]: (files)
- id: step_3
type: api
subtype: rest
name: PUT /diaries/{diary_id}
description: Optionally mark the diary as complete when recovery is done.
runtime:
method: PUT
url: https://medi-rank.com/api/v1
endpoint: /diaries/{diary_id}
headers:
Authorization: Bearer ${secrets.TOKEN}
body:
is_complete: true
edges:
- from: step_1
to: step_2
mode: sequential
- from: step_2
to: step_2
mode: loop
when: more_recovery_days_to_record
- from: step_2
to: step_3
mode: conditional
when: diary_finished