SOP-21: Full Clinic Setup with Doctors, Treatments, and Reviews

API SOP

End-to-end setup of a complete clinic page including doctors, treatments, reviews, photos, articles, and forum posts.

10 nodes · 9 edgesmedirank
apisopmedirankclinicsonboarding
ex-sop-21-full-clinic-setup.osop.yaml
# 原始:SOP-21: 完整建立一間診所(含醫師、療程、評價)
osop_version: '1.0'
id: sop-21-full-clinic-setup
name: 'SOP-21: Full Clinic Setup with Doctors, Treatments, and Reviews'
description: End-to-end setup of a complete clinic page including doctors, treatments, reviews, photos, articles, and forum
  posts.
version: 1.0.0
tags:
- api
- sop
- medirank
- clinics
- onboarding
nodes:
- id: step_ai
  type: agent
  subtype: llm
  name: AI generates clinic content
  description: AI agent generates descriptions, review text, and article content for the new clinic.
- id: step_1
  type: api
  subtype: rest
  name: POST /clinics
  description: Register the new clinic.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /clinics
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      name: Clinic Name
      type: aesthetic_medicine
      description: AI-generated description
      address: Address
      phone: Phone
      booking_enabled: true
- id: step_2
  type: api
  subtype: rest
  name: POST /clinics/{clinic_id}/images
  description: Add clinic photos.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /clinics/{clinic_id}/images
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      images[]: (files)
- id: step_3
  type: api
  subtype: rest
  name: POST /doctors
  description: Add a doctor to the clinic.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /doctors
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      name: Doctor Name
      clinic_id: ${clinic_id}
      title: Attending Physician
      specialties[]:
      - Specialty
      avatar: (file)
- id: step_4
  type: api
  subtype: rest
  name: POST /treatments
  description: Define a treatment offered by the clinic.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /treatments
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      name: Treatment Name
      category: injection
      description: AI-generated description
      cover_image: (file)
- id: step_5
  type: api
  subtype: rest
  name: POST /clinic-reviews
  description: Add a star-rated clinic review.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /clinic-reviews
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      clinic_id: ${clinic_id}
      rating: 5
      content: AI-generated review
      review_images[]: (files)
- id: step_6
  type: api
  subtype: rest
  name: POST /treatment-reviews
  description: Add a treatment review linking clinic, doctor, and treatment.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /treatment-reviews
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    body:
      clinic_id: ${clinic_id}
      doctor_id: ${doctor_id}
      treatment_id: ${treatment_id}
      rating_overall: 5
      content: AI-generated review
- id: step_7
  type: api
  subtype: rest
  name: POST /treatment-reviews/{review_id}/photos
  description: Add comparison photos to the treatment review.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /treatment-reviews/{review_id}/photos
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      before_photo: (file)
      after_photo: (file)
      days_after: 30
- id: step_8
  type: api
  subtype: rest
  name: POST /articles
  description: Create a professional article for the clinic's doctor.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /articles
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      doctor_id: ${doctor_id}
      treatment_id: ${treatment_id}
      title: AI-generated title
      body: <p>AI-generated article</p>
      status: published
- id: step_9
  type: api
  subtype: rest
  name: POST /posts
  description: Create a related forum discussion post.
  runtime:
    method: POST
    url: https://medi-rank.com/api/v1
    endpoint: /posts
    headers:
      Authorization: Bearer ${secrets.TOKEN}
    content_type: multipart/form-data
    body:
      title: AI-generated title
      content: <p>AI-generated content</p>
      clinic_id: ${clinic_id}
      tags[]:
      - clinic-name
edges:
- from: step_ai
  to: step_1
  mode: sequential
- from: step_1
  to: step_2
  mode: sequential
- from: step_2
  to: step_3
  mode: sequential
- from: step_3
  to: step_4
  mode: sequential
- from: step_4
  to: step_5
  mode: sequential
- from: step_5
  to: step_6
  mode: sequential
- from: step_6
  to: step_7
  mode: sequential
- from: step_7
  to: step_8
  mode: sequential
- from: step_8
  to: step_9
  mode: sequential