Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "$schema": "http://json-schema.org/draft-07/schema#",
- "definitions": {
- "patient_event": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "patient_event"
- },
- "id": {
- "type": "integer"
- },
- "title": {
- "type": [
- "string",
- "null"
- ]
- },
- "description": {
- "type": [
- "string",
- "null"
- ]
- },
- "icon": {
- "type": [
- "string",
- "null"
- ],
- "title": "Name of an icon from Bootstrap/Glyphicons icon set.",
- "description": "available icons: https://glyphicons.bootstrapcheatsheets.com/",
- "examples": [
- "scale",
- "facetime-video",
- "exclaimation-sign"
- ],
- "pattern": "^[a-z\\-]+$"
- },
- "type_key": {
- "type": [
- "string",
- "null"
- ],
- "title": "An enum-like string that indicates special type of patient event.",
- "examples": [
- "patient_event_type/operation",
- "patient_event_type/hospitalization",
- "patient_event_type/doctor_visit"
- ],
- "pattern": "^patient_event_type/[A-Za-z0-9_]+$"
- },
- "start_date": {
- "type": "string",
- "format": "date-time",
- "title": "Start date+time of patient event",
- "description": "e.g.: your doctor visit starts at 12:00 tomorrow"
- },
- "end_date": {
- "type": "string",
- "format": "date-time",
- "title": "End date+time of patient event",
- "description": "e.g.: your doctor visit ends at 12:00 tomorrow"
- }
- },
- "required": [
- "timeline_item_type",
- "id",
- "description",
- "start_date",
- "end_date",
- "icon",
- "title",
- "type_key"
- ],
- "additionalProperties": false
- },
- "measurement_task": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "measurement_task"
- },
- "mtype": {
- "type": "string",
- "title": "measurement type",
- "description": "an enum-like string that tells you what to measure",
- "examples": [
- "blood_pressure",
- "blood_sugar",
- "body_weight",
- "oxygen",
- "pulse",
- "temperature"
- ],
- "pattern": "^[A-Za-z0-9_]+$"
- },
- "task_id": {
- "type": "integer",
- "title": "ID of patient task object in server's DB",
- "description": "can be used to group multiple occurrences of the same recurring task"
- },
- "start_date": {
- "type": "string",
- "format": "date-time",
- "description": "Start of time interval, when patient can do the measurement."
- },
- "due_date": {
- "type": "string",
- "format": "date-time",
- "description": "Due time, before which the patient should do the measurement."
- },
- "end_date": {
- "type": "string",
- "format": "date-time",
- "description": "End of time interval, when patient can do the measurement.",
- "$comment": "may be slightly larger than 'due_date', because we may allow to send overdue measurements to the server"
- },
- "is_done": {
- "type": "boolean",
- "title": "Is measurement done by patient?",
- "description": "true if server receives a measurement in the start_date/end_date interval"
- },
- "is_missed": {
- "type": "boolean",
- "title": "Is due_time missed?",
- "description": "true if measurement was made after due_time, or wasn't made at all"
- },
- "measurements": {
- "type": "array",
- "items": {
- "type": [
- "object",
- "null"
- ],
- "description": "A list of measurements made by patient in the start_date/end_date interval",
- "examples": [
- {
- "mid": 1,
- "ctime": "2020-02-01T12:00:00.000000Z",
- "alert_level": null,
- "values": {
- "code": {
- "coding": [
- {
- "code": "pulse"
- }
- ]
- },
- "valueQuantity": {
- "value": 66.73308218457154,
- "unit": "BPM"
- }
- }
- },
- {
- "mid": 2,
- "ctime": "2020-02-01T12:05:02.000000Z",
- "alert_level": "YELLOW",
- "values": {
- "component": [
- {
- "code": {
- "coding": [
- {
- "code": "systolic"
- }
- ]
- },
- "valueQuantity": {
- "value": 149.64389162882992,
- "unit": "mmHg"
- }
- },
- {
- "code": {
- "coding": [
- {
- "code": "diastolic"
- }
- ]
- },
- "valueQuantity": {
- "value": 106.78179536808875,
- "unit": "mmHg"
- }
- }
- ],
- "notes": [
- {
- "time": "2019-08-13 08:41:02.365846",
- "text": "This is a comment/annotation"
- }
- ]
- }
- }
- ],
- "properties": {
- "mid": {
- "type": "integer",
- "title": "Measurement ID",
- "description": "An Unique ID of a Measurement object from server's DB"
- },
- "ctime": {
- "type": "string",
- "format": "date-time",
- "title": "Creation Time",
- "description": "Time when measurement was made (or when recevied by server if measurement time is not known)"
- },
- "values": {
- "type": "object",
- "if": {
- "$comment": "Check if is a multi-component measurement",
- "properties": {
- "component": {
- "type": "array"
- }
- }
- },
- "then": {
- "$comment": "Multi-value measurement - an array of value objects is nested under the 'component' key",
- "component": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/measurementValue"
- }
- }
- },
- "else": {
- "$comment": "Single-value measurement",
- "$ref": "#/definitions/measurementValue"
- }
- },
- "alert_level": {
- "type": [
- "string",
- "null"
- ]
- }
- },
- "required": [
- "mid",
- "ctime",
- "alert_level",
- "values"
- ],
- "additionalProperties": false
- }
- }
- },
- "required": [
- "timeline_item_type",
- "mtype",
- "task_id",
- "start_date",
- "due_date",
- "end_date",
- "is_done",
- "is_missed",
- "measurements"
- ],
- "additionalProperties": false
- },
- "measurementValue": {
- "type": "object",
- "examples": [
- {
- "code": {
- "coding": [
- {
- "code": "blood_glucose"
- }
- ]
- },
- "valueQuantity": {
- "value": 8.863299622639252,
- "unit": "mmol/L"
- }
- }
- ],
- "properties": {
- "code": {
- "type": "object",
- "properties": {
- "coding": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "code": {
- "type": "string"
- }
- },
- "required": [
- "code"
- ]
- }
- }
- },
- "required": [
- "coding"
- ]
- },
- "valueQuantity": {
- "type": "object",
- "properties": {
- "value": {
- "type": "number"
- },
- "unit": {
- "type": "string"
- }
- },
- "required": [
- "value",
- "unit"
- ]
- }
- },
- "required": [
- "code",
- "valueQuantity"
- ]
- },
- "survey": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "survey"
- },
- "task_id": {
- "type": "integer",
- "title": "ID of patient task object in server's DB",
- "description": "can be used to group multiple occurrences of the same recurring task"
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": [
- "string",
- "null"
- ]
- },
- "start_date": {
- "type": "string",
- "format": "date-time",
- "description": "Start of time interval when patient can post answers."
- },
- "due_date": {
- "type": "string",
- "format": "date-time",
- "description": "Due date+time, before which patient should post answers."
- },
- "end_date": {
- "type": "string",
- "format": "date-time",
- "title": "End of time interval, when patient could post survey answers.",
- "$comment": "may be greater than 'due_date' because we may want to accept answers even after due time is reached."
- },
- "is_done": {
- "type": "boolean",
- "title": "Is this survey done by patient?",
- "description": "true if server received answers in the start_date/due_date time interval"
- },
- "is_missed": {
- "type": "boolean",
- "title": "Is due_time missed?",
- "description": "true if the survey was done after due_date, or wasn't done at all"
- }
- },
- "required": [
- "timeline_item_type",
- "task_id",
- "title",
- "description",
- "start_date",
- "due_date",
- "end_date",
- "is_done",
- "is_missed"
- ],
- "additionalProperties": false
- },
- "global_survey": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "global_survey"
- },
- "task_id": {
- "type": "integer",
- "title": "ID of patient task object in server's DB",
- "description": "can be used to group multiple occurrences of the same recurring task"
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": [
- "string",
- "null"
- ]
- },
- "start_date": {
- "type": "string",
- "format": "date-time",
- "description": "Start of time interval when patient can post answers."
- },
- "due_date": {
- "type": "string",
- "format": "date-time",
- "description": "Due date+time, before which patient should post answers."
- },
- "end_date": {
- "type": "string",
- "format": "date-time",
- "title": "End of time interval, when patient could post survey answers.",
- "$comment": "may be greater than 'due_date' because we may want to accept answers even after due time is reached."
- },
- "is_done": {
- "type": "boolean",
- "title": "Is this survey done by patient?",
- "description": "true if server received answers in the start_date/due_date time interval"
- },
- "is_missed": {
- "type": "boolean",
- "title": "Is due_time missed?",
- "description": "true if the survey was done after due_date, or wasn't done at all"
- }
- },
- "required": [
- "timeline_item_type",
- "task_id",
- "title",
- "description",
- "start_date",
- "due_date",
- "end_date",
- "is_done",
- "is_missed"
- ],
- "additionalProperties": false
- },
- "reminder_task": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "reminder_task"
- },
- "task_id": {
- "type": "integer",
- "title": "ID of patient task object in server's DB",
- "description": "can be used to group multiple occurrences of the same recurring task"
- },
- "title": {
- "type": "string"
- },
- "due_date": {
- "type": "string",
- "format": "date-time",
- "title": "a due time, until the patient should complete the task",
- "description": "e.g.: don't forget to wake up today at 08:00"
- }
- },
- "required": [
- "timeline_item_type",
- "task_id",
- "title",
- "due_date"
- ],
- "additionalProperties": false
- },
- "assignment": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "const": "assignment"
- },
- "task_id": {
- "type": "integer",
- "title": "ID of patient task object in server's DB",
- "description": "can be used to group multiple occurrences of the same recurring task"
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": [
- "string",
- "null"
- ]
- },
- "type_key": {
- "type": [
- "string",
- "null"
- ],
- "description": "an enum-like string that indicates a special type of assignment",
- "examples": [
- "assignment_type/appointment",
- "assignment_type/physical_activity",
- "assignment_type/videocall"
- ],
- "pattern": "^assignment_type/[A-Za-z0-9_]+$"
- },
- "start_date": {
- "type": "string",
- "format": "date-time",
- "title": "date+time when the assignment starts",
- "description": "e.g.: you have a videocall tomorrow starting at 13:00"
- },
- "due_date": {
- "type": "string",
- "format": "date-time",
- "title": "Due date+time, before which the patient must complete the assignment.",
- "description": "e.g.: you should go for a walk today before 11:00 AM"
- },
- "end_date": {
- "type": "string",
- "format": "date-time",
- "description": "The end of the time interval, during which the patient can complete the assignment.",
- "$comment": "may be larger than due_date, because we may want to allow overdue tasks"
- },
- "is_missed": {
- "type": "boolean",
- "title": "was due_time missed?",
- "description": "true if patient didn't done the assignment before due_time"
- },
- "is_done": {
- "type": "boolean",
- "title": "is done by patient?",
- "description": "true if assignment was done by patient (possibly even after due_time)"
- }
- },
- "required": [
- "timeline_item_type",
- "task_id",
- "title",
- "description",
- "type_key",
- "start_date",
- "due_date",
- "end_date",
- "is_missed",
- "is_done"
- ],
- "additionalProperties": false
- }
- },
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "timeline_item_type": {
- "type": "string",
- "enum": [
- "patient_event",
- "measurement_task",
- "survey",
- "global_survey",
- "reminder_task",
- "assignment"
- ]
- }
- },
- "oneOf": [
- {
- "$ref": "#/definitions/patient_event"
- },
- {
- "$ref": "#/definitions/measurement_task"
- },
- {
- "$ref": "#/definitions/survey"
- },
- {
- "$ref": "#/definitions/global_survey"
- },
- {
- "$ref": "#/definitions/reminder_task"
- },
- {
- "$ref": "#/definitions/assignment"
- }
- ]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement