Schema for Bifrost Flow Settings

From FlowSettings.schema.yaml (bifrost/FlowSettings.schema)

---
$id: https://skeleton.botmd.io/bifrost/FlowSettings.schema
$schema: http://json-schema.org/draft-07/schema#

title: Flow Settings
description: Flow settings are settings accessed by the flow implementation.

type: object
additionalProperties: false
required: []

properties:
  base_noop:
    $ref: "/skeleton/Any.schema"

  botmd_groupchat:
    $ref: "#/definitions/botmd_groupchat"

  nemg_sinopharm:
    $ref: "#/definitions/nemg_sinopharm"

  nemg_admin_payment_flow:
    $ref: "#/definitions/nemg_admin_payment_flow"

  nemg_patient_payment_flow:
    $ref: "#/definitions/nemg_patient_payment_flow"

  # nemg services
  nemg_services_schedule_visit:
    $ref: "#/definitions/nemg_services_schedule_visit"

  nemg_services_event_reminder:
    $ref: "#/definitions/nemg_services_event_reminder"

  # nemg medication refill
  nemg_medication_refill:
    $ref: "#/definitions/nemg_medication_refill"

  # nemg teleconsult
  nemg_teleconsult_create_or_cancel_request:
    $ref: "#/definitions/nemg_teleconsult_create_or_cancel_request"

  nemg_teleconsult_respond_to_request:
    $ref: "#/definitions/nemg_teleconsult_respond_to_request"

  nemg_teleconsult_clinic_start:
    $ref: "#/definitions/nemg_teleconsult_clinic_start"

  nemg_teleconsult_doctor_end:
    $ref: "#/definitions/nemg_teleconsult_doctor_end"

  nemg_teleconsult_patient_retry:
    $ref: "#/definitions/nemg_teleconsult_patient_retry"

#end properties

definitions:
  botmd_groupchat:
    title: Bot MD Group Chat
    description: >-
      `GroupChatFlow` is a simple flow to demonstrate the use of Bifrost. It simply takes all messages sent to the `incoming` connection and forwards them to phone numbers in `group_member_phones` via the `outgoing` connection.

    type: object
    additionalProperties: false
    properties:
      group_member_phones:
        title: Group Member Phones
        description: List of E.164 phone numbers of people in the group chat. Only people in this group can use the group chat.

        type: array
        items:
          type: string
          pattern: '^\+\d{5,}$'
  #end botmd_groupchat

  nemg_admin_payment_flow:
    title: NEMG Simple Payment - Admin Flow
    description: Settings for flows related to `bifrost.organizations.nemg.services.AdminPaymentFlow`. This is the entry point of the flow, accessible by admins when they request payment/refund/cancellation.

    type: object
    required: []
    additionalProperties: false

    properties:
      patient_cancelation_message:
        title: Patient Cancellation Message
        description: Message to be sent to the patient when an admin cancels the payment request.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_payment_request_message:
        title: Patient Payment Message
        description: Message to be sent to the patient when an admin requests payment.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_refund_message:
        title: Patient Refund Message
        description: Message to be sent to the patient when an admin refunds payment.

        $ref: "/ratatoskr/MessageTemplate.schema"

      clinic_moneta_providers:
        title: Clinic Moneta Providers
        description: Map of Moneta provider UIDs to clinic names

        type: object

      qa_parser:
        title: QA Parser
        description: QA Parser settings for the triggering onform payload (typeform).

        $ref: "/onform/QAParserSettings.schema"
  #end nemg_admin_payment_flow

  nemg_patient_payment_flow:
    title: NEMG Simple Payment - Patient Flow
    description: Settings for flows related to `bifrost.organizations.nemg.services.PatientPaymentFlow`. Accessible by patients after they make payment.

    type: object
    required: []
    additionalProperties: false

    properties:
      patient_payment_confirmation_message:
        title: Patient Confirmation Message
        description: Message to be sent to the patient when he makes payment.

        $ref: "/ratatoskr/MessageTemplate.schema"
  #end nemg_patient_payment_flow

  nemg_sinopharm:
    title: NEMG Sinopharm
    description: NEMG Sinopharm Settings.

    type: object
  #end nemg_sinopharm

  nemg_services_schedule_visit:
    title: NEMG Services - Schedule Visit
    description: Settings for flows related to `bifrost.organizations.nemg.services.ScheduleVisitFlow`. This is the entry point of the flow, accessible by patients when they schedule or cancel a teleconsult request.

    type: object
    required: []
    additionalProperties: false

    properties:
      clinic_confirmation_message:
        title: Clinic Confirmation Message
        description: Message to be sent to the clinic when a patient schedules a new visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      clinic_reschedule_message:
        title: Clinic Reschedule Message
        description: Message to be sent to the clinic when a patient reschedules a visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      clinic_cancelation_message:
        title: Clinic Cancelation Message
        description: Message to be sent to the clinic when a patient cancels a visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_confirmation_message:
        title: Patient Confirmation Message
        description: Message to be sent to patient when they schedule a new visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_confirmation_messages:
        title: Patient Confirmation Message
        description: Message to be sent to patient when they schedule a new visit (per event type).

        $ref: "#/definitions/event_messages_mapping"

      patient_reschedule_message:
        title: Patient Reschedule Message
        description: Message to be sent to patient when they reschedule am existing visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_reschedule_messages:
        title: Patient Reschedule Message
        description: Message to be sent to patient when they reschedule an existing visit (per event type).
        $ref: "#/definitions/event_messages_mapping"

      patient_cancelation_message:
        title: Patient Cancelation Message
        description: Message to be sent to patient when they cancel am existing visit.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_cancelation_messages:
        title: Patient Cancelation Message
        description: Message to be sent to patient when they cancel an existing visit (per event type).

        $ref: "#/definitions/event_messages_mapping"

      reminder_buffer:
        title: Reminder Buffer
        description: Amount of time before the patient should receive their reminder.

        type: integer

      reminder_buffers:
        title: Reminder Buffers
        description: Amount of time before the patient should receive their reminder. This is an array and will take precedence over `reminder_buffer`.

        type: array
        minItems: 1
        items:
          type: integer

      qa_parser:
        title: QA Parser
        description: QA Parser settings for the triggering onform payload (calendly).

        $ref: "/onform/QAParserSettings.schema"
  #end nemg_scheduling

  nemg_services_event_reminder:
    title: NEMG Services - Event Reminder
    description: Settings for flows related to `bifrost.organizations.nemg.services.EventReminderFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      reminder_message:
        title: PReminder Message
        description: Message to be sent to patient as a reminder to their scheduled event.

        $ref: "/ratatoskr/MessageTemplate.schema"

      reminder_messages:
        title: Reminder Message
        description: Message to be sent to patient as a reminder to their scheduled event (per event type).

        $ref: "#/definitions/event_messages_mapping"
    #end properties
  #end nemg_patient_reminder

  nemg_medication_refill:
    title: NEMG Medication Reffill
    description: NEMG medication refill settings are for flows related to `bifrost.organizations.nemg.medication_refill`.

    type: object
    required: []
    additionalProperties: false

    properties:
      clinic_phones:
        title: Clinic Phones
        description: A list containing clinic name and a corresponding chat app (eg. whatsapp) phone number of the admin

        type: array
        items:
          type: object
          required: []
          additionalProperties: false
          properties:
            clinic_name:
              title: Clinic Name
              description: The Clinic Name should be same as it appears on Typeform (or other) form
              type: string
            phone:
              title: Phone
              description: This should be the admin Whatsapp phone number of a clinic
              type: string
        #end items
      #end clinic_phones

      patient_confirmation_message:
        title: Patient Confirmation Message
        description: Whatsapp template; to be sent to a patient once he/she requests to Rx Refill

        $ref: "/ratatoskr/MessageTemplate.schema"

      admin_confirmation_message:
        title: Admin Confirmation Message
        description: Whatsapp template; to be sent to the clinic admin once a patient requests to Rx Refill from that particular clinic

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_reminder_message:
        title: Patient Reminder Message
        description: Whatsapp template; to be sent to a patient to remind him/her about collection

        $ref: "/ratatoskr/MessageTemplate.schema"

      qa_parser:
        $ref: "/onform/QAParserSettings.schema"
  #end medication_refill

  nemg_teleconsult_create_or_cancel_request:
    title: NEMG Teleconsult - Create/Cancel  Request
    description: Settings for flows related to `bifrost.organizations.nemg.teleconsult.CreateOrCancelRequestFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      doctor_invitation_message:
        title: Doctor Invitation Message
        description: Message to be sent to all doctors once a teleconsult is requested by a patient, typically contains the patient and event details.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_confirmation_message:
        title: Patient Confirmation Message
        description: Message to be sent to the requesting patient confirming their request was received successfuly and awaiting to be paired with a doctor.

        $ref: "/ratatoskr/MessageTemplate.schema"

      patient_cancelation_message:
        title: Patient Cancelation Message
        description: Message to be sent to the requesting patient upon canceling the teleconsult.

        $ref: "/ratatoskr/MessageTemplate.schema"

      doctor_cancelation_message:
        title: Doctor Cancelation Message
        description: Message to be sent to the paired doctor (If exists) upon canceling the teleconsult by the patient.

        $ref: "/ratatoskr/MessageTemplate.schema"

      clinic_cancelation_message:
        title: Clinic Cancelation Message
        description: Message to be sent to the clinics upon canceling the teleconsult by the patient.

        $ref: "/ratatoskr/MessageTemplate.schema"

      respond_to_request_flow_uid:
        title: Respond To Request Flow UID
        description: UID of a flow instance of class `RespondToRequestFlow`

        type: string
        minLength: 1

      qa_parser:
        title: QA Parser
        description: QA Parser settings for the triggering onform payload (calendly).

        $ref: "/onform/QAParserSettings.schema"
    #end properties
  #end nemg_create_or_cancel_teleconsult

  nemg_teleconsult_respond_to_request:
    title: NEMG Teleconsult - Respond to Request
    description: Settings for flows related to `bifrost.organizations.nemg.teleconsult.RespondToRequestFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      start_teleconsult_typeform_url:
        title: Typeform URL for Start Teleconsult
        description: Typeform URL for Start Teleconsult

        type: string
        format: uri

      clinic_incoming_patient_message:
        title: Clinic Incoming Patient Message
        description: Message to be sent to the clinic upon the doctor confirmation of a teleconsult.

        $ref: "/ratatoskr/MessageTemplate.schema"

      success_response:
        title: Success Response
        description: Reponse (HTTP Response data) to be sent to the doctor upon successfull teleconsult matching.

        type: string
        minLength: 1

      failure_response:
        title: Failure Response
        description: Reponse (HTTP Response data) to be sent to the doctor upon failing to match a the desired teleconsult (already matched or canceled).
    #end properties
  #end nemg_respond_to_teleconsult

  nemg_teleconsult_clinic_start:
    title: NEMG Teleconsult - Clinic Start
    description: Settings for flows related to `bifrost.organizations.nemg.teleconsult.ClinicStartFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      patient_confirmation_message:
        title: Patient Confirmation Message
        description: Message to be sent to the patient upon the clinic admin confirmation of the teleconsult request.

        $ref: "/ratatoskr/MessageTemplate.schema"

      doctor_confirmation_message:
        title: Doctor Confirmation Message
        description: Message to be sent to the doctor upon the clinic admin confirmation of the teleconsult request.

        $ref: "/ratatoskr/MessageTemplate.schema"

      qa_parser:
        title: QA Parser
        description: QA Parser settings for the triggering onform payload (typeform).

        $ref: "/onform/QAParserSettings.schema"

      end_teleconsult_typeform_url:
        title: Typeform URL for End Teleconsult
        description: Typeform URL for End Teleconsult

        type: string
        format: uri
    #end properties
  #end nemg_clinic_start_teleconsult

  nemg_teleconsult_doctor_end:
    title: NEMG Teleconsult - Doctor End
    description: Settings for flows related to `bifrost.organizations.nemg.teleconsult.DoctorEndFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      patient_end_message:
        title: Patient End Message
        description: Message to be sent to the patient upon the doctor submitting the end teleconsult flow.

        $ref: "/ratatoskr/MessageTemplate.schema"

      clinic_end_message:
        title: Doctor End Message
        description: Message to be sent to the clinic upon the doctor submitting the end teleconsult flow.

        $ref: "/ratatoskr/MessageTemplate.schema"

      details_email_subject:
        title: Details Email Subject
        description: Subject of the email that will be sent to the clinic carrying the teleconsult information.

        type: string

      details_email_body:
        title: Details Email Body
        description: Body of the email that will be sent to the clinic carrying the teleconsult information. (Use `\n` for line  breaks, currently only plain text is supported)

        type: string

      qa_parser:
        title: QA Parser
        description: QA Parser settings for the triggering onform payload (typeform).

        $ref: "/onform/QAParserSettings.schema"
    #end properties
  #end nemg_doctor_end_teleconsult

  nemg_teleconsult_patient_retry:
    title: NEMG Teleconsult - Patient Retry
    description: Settings for flows related to `bifrost.organizations.nemg.teleconsult.PatientRetryFlow`.

    type: object
    required: []
    additionalProperties: false

    properties:
      retry_message:
        title: Retry Message
        description: Message to be sent to the patient after failing to match with a doctor for their teleconsult request.

        $ref: "/ratatoskr/MessageTemplate.schema"
    #end properties
  #end nemg_teleconsult_patient_retry

  event_messages_mapping:
    title: Event Messages Mapping
    description: Event Messages Mapping

    additionalProperties: false
    type: object
    patternProperties:
      .+(\((?P<clinic>.*?)\))$: # Event (Clinic Name)
        $ref: "/ratatoskr/MessageTemplate.schema"
    minProperties: 1
  #end event_messages_mapping
#end definitions

[Main Page] [Schema Documentation] [Examples]