Home Schema Example JSON Schema

Reminder Settings

Type: object

Schema for storing reminder settings which include schedules.

No Additional Properties

Timezone

Type: string

The timezone for the reminder schedule. Defaults to clinic timezone (or UTC if that is not set).

Must be at least 1 characters long

Schedule


Describes the reminder schedule, triggers, actions, etc.

No Additional Properties

Type: object

The following properties are required:

  • action
  • start_trigger
Type: object

The following properties are required:

  • action
  • end_trigger
Type: object

The following properties are required:

  • action
  • recurring_frequencies

Action

Type: object

The action to take when reminder is triggered. Actions are implemented in cleo/types/reminder/actions.py.

No Additional Properties

Type: object

The following properties are required:

  • type
  • send_template
Type: object

The following properties are required:

  • type
  • send_reminder
Type: object

The following properties are required:

  • type
  • enrollment
Type: object

The following properties are required:

  • type
  • discharge
Type: object

The following properties are required:

  • type
  • program_enrollment
Type: object

The following properties are required:

  • type
  • program_discharge
Type: object

The following properties are required:

  • type
  • program_discharge_with_enrollment
Type: object

The following properties are required:

  • type
  • noop

Type

Type: enum (of string)

The type of reminder action. This is a fixed set.

Must be one of:

  • "send_template"
  • "send_reminder"
  • "enrollment"
  • "discharge"
  • "noop"
  • "program_enrollment"
  • "program_discharge"
  • "program_discharge_with_enrollment"

Program Condition

Type: object

Trigger if metadata-entries matches the condition

Filter Settings

Type: object

Schema for storing filter settings.

No Additional Properties

Type

Type: const

The type of this element.

Specific value: "expression"

Expression

Type: object

Expression of filter.

No Additional Properties

Operator


Operator of expressions.

Type: object
No Additional Properties

Type

Type: enum (of string)

The type of this element.

Must be one of:

  • "and"
  • "or"
  • "not"
Type: object
No Additional Properties

Type

Type: const

The type of this element.

Specific value: "at_least"

At least

Type: object

An operator that filters any data where at least N of the conditions are true

No Additional Properties

Number of data

Type: integer

Number of data where condition is true.

Value must be greater or equal to 1

Expressions

Type: array

Expressions of data

No Additional Items

Each item of this array must be:


Type: object
No Additional Properties

Type

Type: const

The type of this element.

Specific value: "condition"

Type: object
No Additional Properties

Type

Type: const

The type of this element.

Specific value: "Q"

Query


Django ORM query

No Additional Properties

Type: object

The following properties are required:

  • key
  • string
Type: object

The following properties are required:

  • key
  • boolean
Type: object

The following properties are required:

  • key
  • string_array
Type: object

The following properties are required:

  • key
  • number
Type: object

The following properties are required:

  • key
  • datetime

Query key

Type: string

Must be at least 1 characters long

String

Type: string

Must be at least 1 characters long

Number

Type: integer

Value must be greater or equal to 0

String Array

Type: array

Must contain a minimum of 1 items

No Additional Items

To exclude data which matches expression in filter_queryset

Type: boolean

Validator

Type: enum (of string)

Method to validate if filter fullfill condition.

Must be one of:

  • "exist"
  • "count"
  • "not_exist"

Count

Type: integer

Number of expected metadata entries.

Value must be greater or equal to 1

Event Condition

Type: object

Trigger if metadata-entries matches the condition

Filter Settings

Type: object

Schema for storing filter settings.

Same definition as filter

Validator

Type: enum (of string)

Method to validate if filter fullfill condition.

Must be one of:

  • "exist"
  • "count"
  • "not_exist"

Count

Type: integer

Number of expected metadata entries.

Value must be greater or equal to 1

Send Template

Type: object

This action sends a template message to the patient-form.

No Additional Properties

Purpose

Type: string

Template set purpose to send. If purpose is REMINDER, there are additional logic involved.

Must be at least 1 characters long

Template Set

Type: string

Template set name or uid. This should align with purpose.

Must be at least 1 characters long

Send Reminder

Type: object

This action sends a reminder message to the patient-form.

Discharge

Type: object

This action discharges a patient-form.

Enrollment

Type: object

This action enroll patient into new monitoring form.

No Additional Properties

Monitoring Formset UID

Type: string

Monitoring formset where patient will be enroll into.

Must be at least 1 characters long

Program Discharge

Type: object

This action discharges a patient-program.

Program enrollment

Type: object

This action enroll patient into new clinic program.

No Additional Properties

Clinic Program UID

Type: string

Clinic program where patient will be enroll into.

Must be at least 1 characters long

Program discharge with enrollment

Type: object

This action discharges a patient-program and enroll patient into a new clinic program.

No Additional Properties

Clinic Program UID

Type: string

Clinic program where patient will be enroll into after discharge from existing patient-program.

Must be at least 1 characters long

Noop

Type: object

This action does nothing except display a debug log message.

Start Trigger

Type: object

Describes how this reminder can be triggered. This usually refers to a pre-determined event. If unspecified, we assume the reminder starts immediately.

No Additional Properties

Trigger

Type: enum (of string)

The event that will trigger a reminder. This is a hardcoded set of values.

Must be one of:

  • "date_of_birth"
  • "exact"
  • "never"
  • "enrollment"
  • "discharge"
  • "event"
  • "condition"
  • "clinical_parameter"
  • "program_enrollment"
  • "program_discharge"
  • "program_clinical_parameter"
  • "program_condition"

Duration

Type: integer

Amount of time before/after the triggering event. This is expressed as an integer multiple of unit. Defaults to 0.

Value must be greater or equal to 0

Unit

Type: enum (of string)

The unit of measurement for duration.

Must be one of:

  • "minute"
  • "hour"
  • "day"
  • "week"
  • "month"
  • "year"

Time of Day

Type: string

The time of the day to recur the event at. This field should not be set when unit is minute or hour.

By default, the event will occur exactly duration x unit after the trigger event.

This is useful for overriding the time of the day such as 08:00 instead of some arbitrary time.

Must match regular expression: ^(?P<hour>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24):(?P<minute>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)$

Clinical Parameter UID

Type: string

Clinical parameter that is datetime type to be used as the trigger.

Clinical Parameter Name

Type: string

Clinical parameter that is datetime type to be used as the trigger.

Condition

Type: object

Trigger if metadata-entries matches the condition

Filter Settings

Type: object

Schema for storing filter settings.

Same definition as filter

Validator

Type: enum (of string)

Method to validate if filter fullfill condition.

Must be one of:

  • "exist"
  • "count"
  • "not_exist"

Count

Type: integer

Number of expected metadata entries.

Value must be greater or equal to 1

Trigger On

Type: stringFormat: date-time

Date time for Exact event to execute.

Is After

Type: boolean

True if the reminder is triggered duration after the event and false if reminder is triggered duration before the event. Defaults to true.

Require Enrollment

Type: boolean

If true, it will require an enrolled patient form for form related reminders and will not trigger for discharged patient forms. Does not apply to event reminders. Defaults to true.

Require Program Enrollment

Type: boolean

If true, it will require an enrolled patient program for program related reminders and will not trigger for discharged patient programs. Does not apply to event reminders. Defaults to true.

End Trigger

Type: object

Describes when this reminder is canceled. This usually refers to a pre-determined event. If unspecified, we assume the reminder never ends.

No Additional Properties

Trigger

Type: enum (of string)

The event that will trigger a reminder. This is a hardcoded set of values.

Must be one of:

  • "date_of_birth"
  • "exact"
  • "never"
  • "enrollment"
  • "discharge"
  • "event"
  • "condition"
  • "clinical_parameter"
  • "program_enrollment"
  • "program_discharge"
  • "program_clinical_parameter"
  • "program_condition"

Duration

Type: integer

Amount of time before/after the triggering event. This is expressed as an integer multiple of unit. Defaults to 0.

Value must be greater or equal to 0

Unit

Type: enum (of string)

The unit of measurement for duration.

Must be one of:

  • "minute"
  • "hour"
  • "day"
  • "week"
  • "month"
  • "year"

Time of Day

Type: string

The time of the day to recur the event at. This field should not be set when unit is minute or hour.

By default, the event will occur exactly duration x unit after the trigger event.

This is useful for overriding the time of the day such as 08:00 instead of some arbitrary time.

Must match regular expression: ^(?P<hour>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24):(?P<minute>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)$

Clinical Parameter UID

Type: string

Clinical parameter that is datetime type to be used as the trigger.

Clinical Parameter Name

Type: string

Clinical parameter that is datetime type to be used as the trigger.

Condition

Type: object

Trigger if metadata-entries matches the condition

Filter Settings

Type: object

Schema for storing filter settings.

Same definition as filter

Validator

Type: enum (of string)

Method to validate if filter fullfill condition.

Must be one of:

  • "exist"
  • "count"
  • "not_exist"

Count

Type: integer

Number of expected metadata entries.

Value must be greater or equal to 1

Trigger On

Type: stringFormat: date-time

Date time for Exact event to execute.

Is After

Type: boolean

True if the reminder is triggered duration after the event and false if reminder is triggered duration before the event. Defaults to true.

Require Enrollment

Type: boolean

If true, it will require an enrolled patient form for form related reminders and will not trigger for discharged patient forms. Does not apply to event reminders. Defaults to true.

Require Program Enrollment

Type: boolean

If true, it will require an enrolled patient program for program related reminders and will not trigger for discharged patient programs. Does not apply to event reminders. Defaults to true.

Recurring Frequencies

Type: array

An array of RecurringFrequency objects to describe the reminder logic. This is used for recurring reminders.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Recurring Frequency

Type: object

Recurring frequency objects describe complex recurring logic that are usually not supported by cron.
This design is probably a super set of CRON.

No Additional Properties

Every

Type: integer

Event recurs in multiples of every units. Defaults to 1.

Value must be greater or equal to 1

Unit

Type: enum (of string)

The unit of measurement for every. Defaults to day.

Must be one of:

  • "minute"
  • "hour"
  • "day"
  • "week"
  • "month"
  • "year"

Count

Type: integer

The number of times for this recurring frequency before it ends. Count is based on the start_on. Defaults to repeat infinitely.

Value must be greater or equal to 1

Minute of Hour

Type: integer

For unit = hour, this is the minute of the hour for the event to recur. Required for unit = hour. Defaults to 0.

Value must be greater or equal to 0 and lesser or equal to 59

Time of Day

Type: stringFormat: time

For unit is one of {day, week, month, year}, this is the time of the day for the event to recur. Required for unit in {day, week, month, year}. Defaults to 09:00.

Day of Week

Type: enum (of string)

For unit = week, this is the day of the week for the event to recur. Required for unit = week. Defaults to mon.

Must be one of:

  • "mon"
  • "tue"
  • "wed"
  • "thu"
  • "fri"
  • "sat"
  • "sun"

Day of Month

Type: integer

For unit = month, this is the day of the month for the event to recur. For certain days that do not occur every month (e.g., 31), it will fallback to the last day of the month (e.g., Feb 28). Required for unit = month. Defaults to 1.

Value must be greater or equal to 1 and lesser or equal to 31

Day of Year

Type: string

For unit = year, this is the day of the year for the event to recur. For certain days that do not occur every month (e.g., 02/29), it will fallback to the closest equivalent (e.g., 02/28). Required for unit = year. Defaults to 1/1.

Must match regular expression: ^(01|02|03|04|05|06|07|08|09|10|11|12)\/(01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31)$

Start From Trigger

Type: boolean

If true, the event will start from the trigger time. If false, the event will start from the next recurring time. Defaults to false.

Follow Up Intervals

Type: array of integer

Sends a follow up reminder if the patient did not submit to the first reminder event. This is an array of intervals in seconds after the first ReminderEvent. Note that the maximum value for an interval is 43200 seconds (i.e., 12 hours).

No Additional Items

Each item of this array must be:

Interval

Type: integer

Value must be strictly greater than 0 and lesser or equal to 43200

Recent Submission

Type: object

Describes how submissions are attached to ReminderEvents.

No Additional Properties

Before

Type: number

Submissions that were submitted before seconds before the reminder will be attached to the ReminderEvent. Defaults to 14400 seconds.

Value must be strictly greater than 0

After

Type: number

Submissions that were submitted after seconds after the reminder will be attached to the ReminderEvent. Defaults to 14400 seconds.

Value must be strictly greater than 0

Metadata for reminder

Type: object

Metadata of this reminder.

Additional Properties of any type are allowed.

Type: object

Deprecated (Cron Expressions)

Type: array

This field has been deprecated.

All items must be unique

No Additional Items

Frontend (DEPRECATED)

Type: object

This field has been deprecated. Use schedule instead.

No Additional Properties

Times

Type: array of string

An array of reminder times in %H:%M format. Reminders will be sent at this time of the day as determined by the frequency and local timezone.

No Additional Items

Each item of this array must be:

Time

Type: string

Times are always in %H:%M format. Assume local timezone as determined by above.

Must match regular expression: ^(?P<hour>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24):(?P<minute>00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|32|33|34|35|36|37|38|39|40|41|42|43|44|45|46|47|48|49|50|51|52|53|54|55|56|57|58|59)$

Every

Type: integer

Reminders will be sent every every_unit (e.g., days, weeks, etc).

Value must be greater or equal to 1

Every Unit

Type: enum (of string)

Reminders will be sent every every every_unit (e.g., days, weeks, etc).

Must be one of:

  • "day"
  • "week"
  • "month"

Days of Week

Type: array of enum (of string)

For reminders every WEEK, the days of the week for which we will remind. Required when every_unit is WEEK.

Must contain a minimum of 1 items

No Additional Items

Each item of this array must be:

Day

Type: enum (of string)

Must be one of:

  • "mon"
  • "tue"
  • "wed"
  • "thu"
  • "fri"
  • "sat"
  • "sun"