NAV
python

Introduction

Welcome to Welkin V8 Release.

When reading this API, we take a liberty and assume that you are familiar with the following Welkin concepts, but for the sake of clarity will shortly repeat them here:

  1. Tenant (Organization) - This is a customer space, dedicated to one customer. Every customer will have its own tenant that will host customer users, apps and instances
  2. Instance (Environment) - This is a separate database inside a tenant. Typical customer will have 2-3 instances, representing customer development, testing and live environments, as you build out your Welkin care program
  3. API client - this is an auto-generated pair of key and secrets, that allows you to access variety of API that Welkin exposes
  4. Security Policies and Roles - set of rules that dictates what API your client can access and what actions are allowed to be performed
  5. Designer - Codeless editor for configuring Care Program and all the elements of that program, including Permissions and Roles
  6. Admin - Admin app that allows one to assign permissions and roles to API clients (among other things)
  7. Care - Care portal that users will be using to deliver care to patients

For better demonstration of the API, we will use the following setup:

  1. Organization (Tenant): gh
  2. Instance (Environment): sb-demo

Creating API Client

Though this is better covered in our User Guide document, we are going to repeat the steps here, to ensure successful setup

  1. Create API client in your Organization

    • Navigate to Admin -> API Clients -> Create Client
    • Copy the Client Name and Secret Key or download it.
  2. Navigate to the API Client page you created

    • Configure appropriate access for the client (Instance Access, Roles, Security Policies)

Reminder: Security Policies and Roles are defined in the Designer and assigned in the Admin

For this example we will assume Client Name is VBOPNRYRWJIP and Secret Key is +}B{KGTG6#zG%P;tQm0C

Authentication

To obtain a Bearer token:

import requests

params = {'secret': '+}B{KGTG6#zG%P;tQm0C'}
r = requests.post('https://api.live.welkincloud.io/gh/admin/api_clients/VBOPNRYRWJIP', json=params)
print(r.json())

Successful response will look like:

{
  "clientName": "VBOPNRYRWJIP",
  "token": "eyJraWQiOiJvaGloUEZOREk2WmE5WEtXNEVIdTdVaFFob1l3Ull0aFFFMmpIY1MrczZrPSIsImFsZyI6IlJTMjU2In0.eyJjdXN0b206dHlwZSI6IkFQSV9DTElFTlQiLCJzdWIiOiIzZWQyMjNjOS1hNjFmLTRmMDktOGUzMi0wNGRkNjU2NDY2YzQiLCJhdWQiOiIycTJ0YmRnanV0Y3Zqdjg5NGY0Zm4wcXRnMCIsImV2ZW50X2lkIjoiMWVmYTc4MWItMzMzNy00MWI4LWExZjYtNTlmY2ZmYWYzMjgxIiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE2MTUyMjg0MjcsImlzcyI6Imh0dHBzOlwvXC9jb2duaXRvLWlkcC51cy1lYXN0LTEuYW1hem9uYXdzLmNvbVwvdXMtZWFzdC0xXzBjOVhLV1pFQSIsImN1c3RvbTppZCI6IjAyZDI0MzU5LTU0ZWYtNGQ4Mi05MmRjLWZiY2RjOTQyNDJjMCIsImNvZ25pdG86dXNlcm5hbWUiOiJNVE5LREdVQUdQVUUiLCJleHAiOjE2MTUyMzIwMjcsImlhdCI6MTYxNTIyODQyN30.ktjPG0CIHP0As8e8I1UGMP1kocvjd4AIeQBZlZ0esMz414Dpsb6gwPNuDhJS-ej_gh_tZNSw4tePdxQcagfJHp64ByOuv3ZtAHPAm5l5dEZOcVxG4l4O45Mn1hIGhqP6vizNVBFlBWTnzYTyPlbJKS2PMeMsWPqxUDKeoEffczr2sb9VptUMg2dgY-vz6VZvZjtpPfWjKjnJHeIVMxUiW-9LcR-6BK2DHj5qwlzOkDs89rnqE_OFMUiyLfQlvQuoglSRUUiXNXGiU88YCNNzzG7fb3luuwFXBAdwWhK7pXM4o355eDp2bH-EFx_q82mJBy7lB0DfZTm1AHHjcn8BXg",
  "enabled": true
}

Once you finished the steps, lets review the URL structure that is typically generated for such setup:

URL Structure: https://api.live.welkincloud.io/{tenantName}/admin/api_clients/{apiClientName}

There are several variables in this structure:

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your client name. We will use VBOPNRYRWJIP as a api client name

In order to Authenticate in Welkin, one needs to follow few steps:

  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/admin/api_clients/VBOPNRYRWJIP
  3. HTTP Reponse Codes: 201, 400, 500

There are three field in response object:

Field Name Description
clientName Echos back the name of API client you used
token Bearer token that you will use in subsequent requests
enabled will indicate if the client is enable. This is also controlled in the Admin app

Assessments

Basics

An assessment consists of 3 parts: main, scoring, condition settings.

The main part contains a list of sections. Each section contains a list of fields. The viewType parameter in the field indicates how the field will be displayed. The parameter can take one of two values: readOnly and question. The readOnly value of the parameter indicates that the field will be displayed as a text comment. The question value of the parameter indicates that the field will be displayed as a question with the possibility of user input. If the value of the viewType parameter is equal to question then parameters refCdtName, refCdtFieldName and meta are required. The combination of parameter values refCdtName and refCdtFieldName must be unique among all fields in the assessment.

The scoring part describes the rules for calculating the assessment score. The formula parameter indicates how the score will be calculated. The parameter can take one of two values: SUM and AVG. The SUM value of the parameter indicates that the group scores will be summed up. The AVG value of the parameter indicates that the average of the group scores will be calculated. Each group also has the formula parameter which takes the same values. The group score calculates from the field's scores. To associate fields in scoring with questions, you must specify refCdtName and refCdtFieldName.

The condition settings are divided into two parts: elements and events. The elements part describes how sections or questions will be displayed based on user answers. The events part describes which custom events will be hit based on user answers.

The collection supports several interactions

  1. Allows to obtain a list of assessment
  2. Allows to obtain a certain assessment
  3. Allows to obtain a list of CDTs that is associated with an assessments

Get All Assessments

To obtain a Bearer token:

import requests

params = {'secret': '+}B{KGTG6#zG%P;tQm0C'}
r = requests.post('https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments', json=params)
print(r.json())

Successful response will look like:

[
  {
        "id": "8be00831-fdeb-4b21-a4bc-e5bc52462806",
        "title": "PHQ v1",
        "name": "phq_v1",
        "version": 1,
        "sections": [
            {
                "title": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
                "name": "section-1",
                "order": 0,
                "fields": [
                    {
                        "label": "Little interest or pleasure in doing things",
                        "refCdtName": "phq",
                        "refCdtFieldName": "little_interest_pleasure",
                        "order": 0,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling down, depressed, or hopeless",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_down_depressed_hopeless",
                        "order": 1,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Trouble falling or staying asleep, or sleeping too much",
                        "refCdtName": "phq",
                        "refCdtFieldName": "trouble_falling_staying_asleep_sleeping_too_much",
                        "order": 2,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling tired or having little energy",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_tired_having_little_energy",
                        "order": 3,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Poor appetite or overeating",
                        "refCdtName": "phq",
                        "refCdtFieldName": "poor_appetite_overeating",
                        "order": 4,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling bad about yourself, or that you are a failure, or have let yourself or your family down",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_bad_about_yourself_failure_let_yourself_family_down",
                        "order": 5,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Trouble concentrating on things, such as reading the newspaper or watching television",
                        "refCdtName": "phq",
                        "refCdtFieldName": "trouble_concentrating_things",
                        "order": 6,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Moving or speaking so slowly that other people could have noticed. Or the opposite—being so fidgety or restless that you have been moving around a lot more than usual .",
                        "refCdtName": "phq",
                        "refCdtFieldName": "moving_speaking_slowly_fidgety_restless",
                        "order": 7,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    }
                ]
            }
        ],
        "scoring": {
            "formula": "SUM",
            "groups": [
                {
                    "name": "phq",
                    "title": "PHQ",
                    "fields": [
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "little_interest_pleasure",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_down_depressed_hopeless",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "trouble_falling_staying_asleep_sleeping_too_much",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_tired_having_little_energy",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "poor_appetite_overeating",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_bad_about_yourself_failure_let_yourself_family_down",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "trouble_concentrating_things",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "moving_speaking_slowly_fidgety_restless",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        }
                    ],
                    "formula": "SUM"
                }
            ]
        },
        "programs": [
            {
                "program": "coaching",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            },
            {
                "program": "group_therapy",
                "phases": [
                    "active",
                    "treatment_completed"
                ]
            },
            {
                "program": "individual_therapy",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            },
            {
                "program": "relationship_therapy",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            }
        ],
        "template": null,
        "conditionSettings": null,
        "_containsPHI": true
    }
]

Collection of all assessment formation would be located at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/{}/assessments

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is your formation version. We will use current to get published version and draft to get version in draft.

  4. HTTP Method: GET

  5. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments

  6. HTTP Response Codes: 200

Get One Assessment

To obtain a Bearer token:

import requests

params = {'secret': '+}B{KGTG6#zG%P;tQm0C'}
r = requests.post('https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments', json=params)
print(r.json())

Successful response will look like:

{
        "id": "8be00831-fdeb-4b21-a4bc-e5bc52462806",
        "title": "PHQ v1",
        "name": "phq_v1",
        "version": 1,
        "sections": [
            {
                "title": "Over the last 2 weeks, how often have you been bothered by any of the following problems?",
                "name": "section-1",
                "order": 0,
                "fields": [
                    {
                        "label": "Little interest or pleasure in doing things",
                        "refCdtName": "phq",
                        "refCdtFieldName": "little_interest_pleasure",
                        "order": 0,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling down, depressed, or hopeless",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_down_depressed_hopeless",
                        "order": 1,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Trouble falling or staying asleep, or sleeping too much",
                        "refCdtName": "phq",
                        "refCdtFieldName": "trouble_falling_staying_asleep_sleeping_too_much",
                        "order": 2,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling tired or having little energy",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_tired_having_little_energy",
                        "order": 3,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Poor appetite or overeating",
                        "refCdtName": "phq",
                        "refCdtFieldName": "poor_appetite_overeating",
                        "order": 4,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Feeling bad about yourself, or that you are a failure, or have let yourself or your family down",
                        "refCdtName": "phq",
                        "refCdtFieldName": "feeling_bad_about_yourself_failure_let_yourself_family_down",
                        "order": 5,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Trouble concentrating on things, such as reading the newspaper or watching television",
                        "refCdtName": "phq",
                        "refCdtFieldName": "trouble_concentrating_things",
                        "order": 6,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    },
                    {
                        "label": "Moving or speaking so slowly that other people could have noticed. Or the opposite—being so fidgety or restless that you have been moving around a lot more than usual .",
                        "refCdtName": "phq",
                        "refCdtFieldName": "moving_speaking_slowly_fidgety_restless",
                        "order": 7,
                        "viewType": "question",
                        "meta": {
                            "type": "select",
                            "required": true
                        },
                        "prePopulatedValue": null
                    }
                ]
            }
        ],
        "scoring": {
            "formula": "SUM",
            "groups": [
                {
                    "name": "phq",
                    "title": "PHQ",
                    "fields": [
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "little_interest_pleasure",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_down_depressed_hopeless",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "trouble_falling_staying_asleep_sleeping_too_much",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_tired_having_little_energy",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "poor_appetite_overeating",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "feeling_bad_about_yourself_failure_let_yourself_family_down",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "trouble_concentrating_things",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        },
                        {
                            "refCdtName": "phq",
                            "refCdtFieldName": "moving_speaking_slowly_fidgety_restless",
                            "type": "select",
                            "scores": [
                                {
                                    "score": 0,
                                    "answer": "0 -Not at all"
                                },
                                {
                                    "score": 1,
                                    "answer": "1 - Several days"
                                },
                                {
                                    "score": 2,
                                    "answer": "2 - More than half the days"
                                },
                                {
                                    "score": 3,
                                    "answer": "3 - Nearly every day"
                                }
                            ]
                        }
                    ],
                    "formula": "SUM"
                }
            ]
        },
        "programs": [
            {
                "program": "coaching",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            },
            {
                "program": "group_therapy",
                "phases": [
                    "active",
                    "treatment_completed"
                ]
            },
            {
                "program": "individual_therapy",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            },
            {
                "program": "relationship_therapy",
                "phases": [
                    "active",
                    "internal_referral_needed",
                    "treatment_completed"
                ]
            }
        ],
        "template": null,
        "conditionSettings": null,
        "_containsPHI": true
    }

A certain assessment formation would be located at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/{}/assessments/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is your formation version. We will use current to get published version and draft to get version in draft
  4. Fourth parameter is assessment name. We will specify an assessment name which we want to get

Example request:

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments/phq_v1
  3. HTTP Response Codes: 200, 404

To obtain a Bearer token:

import requests

params = {'secret': '+}B{KGTG6#zG%P;tQm0C'}
r = requests.post('https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments/cdt/_phq_v1', json=params)
print(r.json())

Successful response will look like:

    {
        "id": "f53fb1be-42cf-41c9-bfbc-b118bcd532ef",
        "name": "_phq_v1",
        "title": null,
        "label": "PHQ v1",
        "version": 13,
        "internal": true,
        "readable": false,
        "updatable": false,
        "type": "MULTI_RECORD",
        "relation": "ASSESSMENT",
        "fields": [
            {
                "name": "phq__little_interest_pleasure",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Little interest or pleasure in doing things",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__feeling_down_depressed_hopeless",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Feeling down, depressed, or hopeless",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__trouble_falling_staying_asleep_sleeping_too_much",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Trouble falling or staying asleep, or sleeping too much",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__feeling_tired_having_little_energy",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Feeling tired or having little energy",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__poor_appetite_overeating",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Poor appetite or overeating",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__feeling_bad_about_yourself_failure_let_yourself_family_down",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Feeling bad about yourself, or that you are a failure, or have let yourself or your family down",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__trouble_concentrating_things",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Trouble concentrating on things, such as reading the newspaper or watching television",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "phq__moving_speaking_slowly_fidgety_restless",
                "type": "select",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": true,
                "meta": {
                    "label": "Moving or speaking so slowly that other people could have noticed. Or the opposite—being so fidgety or restless that you have been moving around a lot more than usual .",
                    "required": true,
                    "options": [
                        {
                            "label": "0 - Not at all",
                            "value": "0 -Not at all",
                            "refCdtName": null
                        },
                        {
                            "label": "1 - Several days",
                            "value": "1 - Several days",
                            "refCdtName": null
                        },
                        {
                            "label": "2 - More than half the days",
                            "value": "2 - More than half the days",
                            "refCdtName": null
                        },
                        {
                            "label": "3 - Nearly every day",
                            "value": "3 - Nearly every day",
                            "refCdtName": null
                        }
                    ]
                }
            },
            {
                "name": "id",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "created_at",
                "type": "datetime",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "created_by",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "created_by_name",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "updated_at",
                "type": "datetime",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "updated_by",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "updated_by_name",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "source_name",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "source_type",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "source_id",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "external_id",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            },
            {
                "name": "external_guid",
                "type": "text",
                "dictionary": null,
                "searchable": false,
                "bulkEdit": false,
                "phi": false,
                "meta": {
                    "required": false
                }
            }
        ],
        "_containsPHI": true
    }

For each assessment, a CDT is created automatically to store user answers. If an assessment contains scoring section separate CDT creates to store user scores. These CDTs are internal. As all internal CDTs they have '_' prefix. CDT for scoring has '_scoring' postfix.

For example:

An assessment with name phq_v1 has general CDT _phq_v1 and CDT for scoring _phq_v1_scoring.

A certain CDT related to assessment would be located at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/{}/assessments/cdt/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is your formation version. We will use current to get published version and draft to get version in draft
  4. Fourth parameter is CDT name. We will specify a CDT name which we want to get

Example request:

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments/cdt/_phq_v1
  3. HTTP Response Codes: 200, 404

Create an assessment

To create an assessment would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/draft/assessments

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs

Please note that you can create an assessment only in the draft version of the formation

Example request:

  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments
  3. HTTP Response Codes: 200, 404

Update an assessment

To update an assessment would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/draft/assessments/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is your assessment name. We will specify an assessment name which we want to update

Please note on two things:

  1. You can update an assessment only in the draft version of the formation
  2. You cannot update an assessment name. To update the name of assessment you should recreate the assessment with the correct name

Example request:

  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments/phq_v1
  3. HTTP Response Codes: 200, 404

Delete an assessment

To delete an assessment would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/formation/draft/assessments/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is your assessment name. We will specify an assessment name which we want to delete

Please note that you can create an assessment only in the draft version of the formation

Example request:

  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/formation/current/assessments/phq_v1
  3. HTTP Response Codes: 200, 404

Assessment records

Get all assessment records

Example of getting a list of assessments

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessment-records", headers=h)
print(r.json())

Example of response

{
    "content": [
        {
            "id": "b35aa7a3-2ce0-41da-b941-0e0a3aae50e3",
            "createdAt": "2021-05-13T09:21:32.113Z",
            "updatedAt": "2021-05-13T09:21:39.999Z",
            "createdBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
            "updatedBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
            "createdByName": "NAME",
            "updatedByName": "NAME",
            "finalizedDate": "2021-05-13T09:21:39.999Z",
            "assessmentName": "depression-assessment",
            "assessmentTitle": "Depression assessment",
            "assessmentCdtName": "_depression-assessment",
            "version": 105,
            "patientId": "6a0d3eec-a989-47d0-8530-6eb538c4a752",
            "status": "COMPLETED",
            "answers": {
                "external_guid": null,
                "depression__feeling-down": "several_days",
                "created_at": "2021-05-13T09:21:32.140Z",
                "source_type": "ASSESSMENT",
                "external_id": null,
                "created_by_name": "NAME",
                "created_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
                "depression__trouble-concentrating": "not_at_all",
                "updated_by_name": "NAME",
                "dated__date": "2021-05-13T09:21:32Z",
                "updated_at": "2021-05-13T09:21:39.432Z",
                "updated_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
                "id": "4edec03b-7a53-47a7-b47d-c95b1b39d5c9",
                "source_id": "b35aa7a3-2ce0-41da-b941-0e0a3aae50e3",
                "source_name": "depression-assessment"
            },
            "scoring": {}
        }
    ],
    "pageable": {
        "sort": {
            "sorted": false,
            "unsorted": true,
            "empty": true
        },
        "offset": 0,
        "pageNumber": 0,
        "pageSize": 20,
        "unpaged": false,
        "paged": true
    },
    "totalElements": 1,
    "last": true,
    "totalPages": 1,
    "number": 0,
    "sort": {
        "sorted": false,
        "unsorted": true,
        "empty": true
    },
    "numberOfElements": 1,
    "first": true,
    "size": 20,
    "empty": false
}

To get all assessment records would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid ogf the patient whose records we want to receive

Example request:

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records
  3. HTTP Response Codes: 200

Get an assessment record

Example of getting an assessment

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessment-records/b35aa7a3-2ce0-41da-b941-0e0a3aae50e3", headers=h)
print(r.json())

Example of response

{
            "id": "b35aa7a3-2ce0-41da-b941-0e0a3aae50e3",
            "createdAt": "2021-05-13T09:21:32.113Z",
            "updatedAt": "2021-05-13T09:21:39.999Z",
            "createdBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
            "updatedBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
            "createdByName": "NAME",
            "updatedByName": "NAME",
            "finalizedDate": "2021-05-13T09:21:39.999Z",
            "assessmentName": "depression-assessment",
            "assessmentTitle": "Depression assessment",
            "assessmentCdtName": "_depression-assessment",
            "version": 105,
            "patientId": "6a0d3eec-a989-47d0-8530-6eb538c4a752",
            "status": "COMPLETED",
            "answers": {
                "external_guid": null,
                "depression__feeling-down": "several_days",
                "created_at": "2021-05-13T09:21:32.140Z",
                "source_type": "ASSESSMENT",
                "external_id": null,
                "created_by_name": "NAME",
                "created_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
                "depression__trouble-concentrating": "not_at_all",
                "updated_by_name": "NAME",
                "dated__date": "2021-05-13T09:21:32Z",
                "updated_at": "2021-05-13T09:21:39.432Z",
                "updated_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
                "id": "4edec03b-7a53-47a7-b47d-c95b1b39d5c9",
                "source_id": "b35aa7a3-2ce0-41da-b941-0e0a3aae50e3",
                "source_name": "depression-assessment"
            },
            "scoring": {}
        }

To get an assessment record would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid of the patient whose records we want to receive
  4. Fourth variable is uuid of the records which we want to receive

Example request:

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records/some-uuid
  3. HTTP Response Codes: 200, 404

Create an assessment record

Example of creating an assessment

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessment-records", headers=h)
print(r.json())

Example of request body

{
    "assessmentName": "depression_assessment",
    "status": "IN_PROGRESS"
}

To create an assessment record would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid of the patient for whom we want to create the record

NOTE

You cannot save answers through this URL, to save answers see *Update answers of assessment record*

Example request:

  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records/some-uuid
  3. HTTP Response Codes: 200, 404

Update an assessment record

Example of updating an assessment

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessment-records/b35aa7a3-2ce0-41da-b941-0e0a3aae50e3", headers=h)
print(r.json())

Example of request body

{
    "status": "COMPLETED"
}

To update an assessment record would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid of the patient for whom we want to update the record
  4. Fourth variable is uuid of record which we want to update

NOTE

You cannot save answers through this URL, to save answers see *Update answers of assessment record*

Example request:

  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records/some-uuid
  3. HTTP Response Codes: 200, 404

Update answers of assessment record

Example of updating answers of assessment

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessment-records/b35aa7a3-2ce0-41da-b941-0e0a3aae50e3/answers", headers=h)
print(r.json())

Example of request body

{
    "depression__trouble-concentrating": "not_at_all",
    "depression__feeling-down": "several_days"
}

To update answers of assessment record would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records/{}/answers

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid of the patient for whom we want to update the record
  4. Fourth variable is uuid of record whose answers we want to update

Example request:

  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records/some-uuid/answers
  3. HTTP Response Codes: 200, 404

Delete an assessment record

To delete an assessment record would be used at the following URL

URL Structure: https://api.live.welkincloud.io/{tenantName}/{instanceName}/patients/{}/assessment-records/{}

  1. First variable is your Tenant name. We will use gh as a tenant name through this set of api docs
  2. Second variable is your Instance name. We will use sb-demo as an instance name through this set of api docs
  3. Third variable is uuid of the patient for whom we want to update the record
  4. Fourth variable is uuid of record which we want to delete

Example request:

  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/assessments-records/some-uuid
  3. HTTP Response Codes: 200, 404

Calendar

{
 "localStartDateTime": "2020-01-01T00:00:00.000+03:00",
 "localEndDateTime": "2020-01-31T23:59:59.000+03:00",
}

Note:

  1. Calendar API includes read only date fields (such as localStartDateTime or localEndDateTime) with the timezone applied. Such fields use ISO-8601 datetime format.

If API caller is a user (not API CLIENT), that user timezone will be applied. If caller is an API CLIENT, that timezone of event user host id will be applied.

For UTC time you should use field without local prefix (such as startDateTime and endDateTime)

{
 "startDateTime": "2020-01-01T00:00:00.000Z",
 "endDateTime": "2020-01-31T23:59:59.000Z",
}

Calendar Events

{
 "id": "313c2029-493b-4114-8b86-788d631a1851",
 "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
 "createdAt": "2021-05-03T13:39:12.847Z",
 "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
 "updatedAt": "2021-05-03T13:39:12.847Z",
 "eventTitle": "Weekly Appointment with Jack",
 "eventDescription": "",
 "startDateTime": "2020-01-01T00:00:00.000Z",
 "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
 "endDateTime": "2020-01-31T23:59:59.000Z",
 "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
 "allDayEvent": false,
 "duration": 2678399,
 "externalId": null,
 "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
 "eventType": "ENCOUNTER",
 "encounterInfo": {
   "encounterId": "70b745ac-d560-40b2-b360-dbe1b785dd1b",
   "templateName": "etmp-main",
   "patientId": "79eec731-514a-451b-ab37-7c75d508423e"
 },
 "eventStatus": "SCHEDULED",
 "eventMode": "IN-PERSON",
 "eventColor": null,
 "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
 "additionalInfo": {
   "remarks": "",
   "location": "",
   "attachment": ""
 },
 "participants": [
   {
     "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
     "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
     "participantRole": "psm",
     "participationStatus": "",
     "attended": false
   },
   {
     "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
     "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
     "participantRole": "patient",
     "participationStatus": "",
     "attended": false
   }
 ]
}

It is a typical calendar API to create and manage events

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} /calendar/ events

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/calendar/events

Fields description:

Field Name Supported Values
eventType "GROUP_THERAPY", "APPOINTMENT", "LEAVE", "ENCOUNTER"
eventStatus "SCHEDULED", "CANCELLED", "COMPLETED", "MISSED"
eventMode "IN-PERSON", "CALL", "VIDEO"
participantRole "patient", "psm"
Field Name Field description
hostId ID of user which owns the event
additionalInfo Custom object without strict defined structure
externalId Custom string for object identification, must be different for each event
externalIdUpdatedAt Timestamp when calendar event externalId has been updated

Please note that participants field must contain participant with id=hostId

Create Calendar Event

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "createdBy": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "eventTitle": "Weekly Appointment with Jack",
    "eventDescription": "",
    "startDateTime": "2020-01-01T00:00:00.000Z",
    "endDateTime": "2020-01-31T23:59:59.000Z",
    "eventType": "APPOINTMENT",
    "eventStatus": "SCHEDULED",
    "eventMode": "IN-PERSON",
    "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "externalId": "externalId",
    "additionalInfo": {
        "location": "",
        "remarks": "",
        "attachment": ""
    },
    "participants": [
        {
            "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
            "participantRole": "psm",
            "attended": false
        },
        {
            "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
            "participantRole": "patient",
            "attended": false
        }
    ]
}

r = requests.post("https://api.live.welkincloud.io/gh/sb-demo//calendar/events", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
  "id": "313c2029-493b-4114-8b86-788d631a1851",
  "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "createdAt": "2021-05-03T13:39:12.847Z",
  "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "updatedAt": "2021-05-03T13:39:12.847Z",
  "eventTitle": "Weekly Appointment with Jack",
  "eventDescription": "",
  "startDateTime": "2020-01-01T00:00:00.000Z",
  "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
  "endDateTime": "2020-01-31T23:59:59.000Z",
  "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
  "allDayEvent": false,
  "duration": 2678399,
  "eventType": "APPOINTMENT",
  "eventStatus": "SCHEDULED",
  "eventMode": "IN-PERSON",
  "eventColor": null,
  "externalId": "externalId",
  "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
  "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "additionalInfo": {
    "location": "",
    "remarks": "",
    "attachment": ""
  },
  "participants": [
    {
      "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
      "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "participantRole": "psm",
      "participationStatus": "",
      "attended": false
    },
    {
      "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
      "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
      "participantRole": "patient",
      "participationStatus": "",
      "attended": false
    }
  ]
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events

Event required fields:

Get Event By ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/313c2029-493b-4114-8b86-788d631a1851", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned Json

{
  "id": "313c2029-493b-4114-8b86-788d631a1851",
  "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "createdAt": "2021-05-03T13:39:12.847Z",
  "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "updatedAt": "2021-05-03T13:55:59.652Z",
  "eventTitle": "New event title",
  "eventDescription": "",
  "startDateTime": "2020-01-01T00:00:00.000Z",
  "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
  "endDateTime": "2020-01-31T23:59:59.000Z",
  "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
  "allDayEvent": false,
  "duration": 2678399,
  "eventType": "APPOINTMENT",
  "eventStatus": "SCHEDULED",
  "eventMode": "IN-PERSON",
  "eventColor": null,
  "externalId": "externalId",
  "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
  "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "additionalInfo": {
    "remarks": "",
    "location": "",
    "attachment": ""
  },
  "participants": [
    {
      "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
      "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "participantRole": "psm",
      "participationStatus": "",
      "attended": false
    },
    {
      "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
      "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
      "participantRole": "patient",
      "participationStatus": "",
      "attended": false
    }
  ]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/313c2029-493b-4114-8b86-788d631a1851
Parameters Format Description
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

Get Event By External ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/externalId?type=EXTERNAL_ID", headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned Json

{
  "id": "313c2029-493b-4114-8b86-788d631a1851",
  "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "createdAt": "2021-05-03T13:39:12.847Z",
  "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "updatedAt": "2021-05-03T13:55:59.652Z",
  "eventTitle": "New event title",
  "eventDescription": "",
  "startDateTime": "2020-01-01T00:00:00.000Z",
  "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
  "endDateTime": "2020-01-31T23:59:59.000Z",
  "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
  "allDayEvent": false,
  "duration": 2678399,
  "eventType": "APPOINTMENT",
  "eventStatus": "SCHEDULED",
  "eventMode": "IN-PERSON",
  "eventColor": null,
  "externalId": "externalId",
  "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
  "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "additionalInfo": {
    "remarks": "",
    "location": "",
    "attachment": ""
  },
  "participants": [
    {
      "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
      "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "participantRole": "psm",
      "participationStatus": "",
      "attended": false
    },
    {
      "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
      "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
      "participantRole": "patient",
      "participationStatus": "",
      "attended": false
    }
  ]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/externalId?type=EXTERNAL_ID
Parameters Format Description
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

Find Events

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/events?from=2020-01-15T14:00:00.000Z&participantIds=301b2895-cbf0-4cac-b4cf-1d082faee95c&sort=createdAt,asc&to=2020-02-11T00:00:00.000Z&eventType=APPOINTMENT", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
  "content": [
    {
      "id": "313c2029-493b-4114-8b86-788d631a1851",
      "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
      "createdAt": "2021-05-03T13:39:12.847Z",
      "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
      "updatedAt": "2021-05-03T13:39:12.847Z",
      "eventTitle": "Weekly Appointment with Jack",
      "eventDescription": "",
      "startDateTime": "2020-01-01T00:00:00.000Z",
      "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
      "endDateTime": "2020-01-31T23:59:59.000Z",
      "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
      "allDayEvent": false,
      "duration": 2678399,
      "eventType": "APPOINTMENT",
      "eventStatus": "SCHEDULED",
      "eventMode": "IN-PERSON",
      "eventColor": null,
      "externalId": "externalId",
      "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
      "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "additionalInfo": {
        "remarks": "",
        "location": "",
        "attachment": ""
      },
      "participants": [
        {
          "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
          "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
          "participantRole": "psm",
          "participationStatus": "",
          "attended": false
        },
        {
          "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
          "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
          "participantRole": "patient",
          "participationStatus": "",
          "attended": false
        }
      ]
    }
  ],
....pagination links omitted
}

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/
Parameters Format Description
participantIds list of id and values, either users or patients participantIds=28f393a8-62b3-4b4b-aa42-da769ce4489
from Date_time in ISO-8601 format, required from=2021-01-28T23:10:04.874Z
to Date_time in ISO-8601 format , required to=2021-01-28T23:10:04.874Z
eventType Enum of allowed values "GROUP_THERAPY", "APPOINTMENT", "LEAVE", "ENCOUNTER"
sort Allows one to specify the sort order of the returned patients collection sort=createdAt,asc
includeCancelled Boolean value Should or not API return cancelled events (default: false)
includeEncounterInfo Boolean value Should or not API include encounterInfo field into dto (the field is exists for events with ENCOUNTER event type) (default: false)
excludeAssignedToEncounterEvents Boolean value If true, only events that are not assigned to encounter will returns (default: false)
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

Example URLs:

  1. https://api.live.welkincloud.io/gh/sb-demo/calendar/events?from=2020-01-15T14:00:00.000Z&participantIds=301b2895-cbf0-4cac-b4cf-1d082faee95c&sort=createdAt,asc&to=2020-02-11T00:00:00.000Z&eventType=APPOINTMENT

  2. https://api.live.welkincloud.io/gh/sb-demo/calendar/events?from=2020-01-15T14:00:00.000Z&to=2020-02-11T00:00:00.000Z&eventType=ENCOUNTER&includeEncounterInfo=true

Update Calendar Event by ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "updatedBy": "28f393a8-62b3-4b4b-aa42-da769ce4489a",
    "eventTitle": "Patient Appointment",
    "eventDescription": "problem in hands",
    "startDateTime": "2020-01-15T16:00:00.000Z",
    "endDateTime": "2020-01-15T17:00:00.000Z",
    "eventType": "APPOINTMENT",
    "eventStatus": "SCHEDULED",
    "eventMode": "IN-PERSON",
    "hostId": "28f393a8-62b3-4b4b-aa42-da769ce4489a",
    "additionalInfo": {
        "location": "Room 1408",
        "remarks": "Please wear mask",
        "attachment": ""
    },
    "participants": [
        {
            "id": "4ebfd582-3b20-43d9-b4ee-e658194caeb0",
            "participantId": "28f393a8-62b3-4b4b-aa42-da769ce4489a",
            "participantRole": "psm",
            "attended": false
        },
        {
            "id": "9fe72d19-c0c8-4ebe-8a91-e8f19d4ca7bc",
            "participantId": "28f393a8-62b3-4b4b-aa42-da769ce4489b",
            "participantRole": "patient",
            "attended": false
        }
    ]
  }

r = requests.put("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/313c2029-493b-4114-8b86-788d631a1851", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
  "id": "313c2029-493b-4114-8b86-788d631a1851",
  "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "createdAt": "2021-05-03T13:39:12.847Z",
  "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "updatedAt": "2021-05-03T13:55:59.652Z",
  "eventTitle": "Patient Appointment",
  "eventDescription": "",
  "startDateTime": "2020-01-01T00:00:00.000Z",
  "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
  "endDateTime": "2020-01-31T23:59:59.000Z",
  "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
  "allDayEvent": false,
  "duration": 2678399,
  "eventType": "APPOINTMENT",
  "eventStatus": "SCHEDULED",
  "eventMode": "IN-PERSON",
  "eventColor": null,
  "externalId": null,
  "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
  "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "additionalInfo": {
    "location": "Room 1408",
    "remarks": "Please wear mask",
    "attachment": ""
  },
  "participants": [
    {
      "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
      "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "participantRole": "psm",
      "participationStatus": "",
      "attended": false
    },
    {
      "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
      "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
      "participantRole": "patient",
      "participationStatus": "",
      "attended": false
    }
  ]
}

  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573

Note: see list of the required fields

Patch update event by ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "eventTitle": "New event title"
}


r = requests.patch("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/313c2029-493b-4114-8b86-788d631a1851", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
  "id": "313c2029-493b-4114-8b86-788d631a1851",
  "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "createdAt": "2021-05-03T13:39:12.847Z",
  "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
  "updatedAt": "2021-05-03T13:55:59.652Z",
  "eventTitle": "New event title",
  "eventDescription": "",
  "startDateTime": "2020-01-01T00:00:00.000Z",
  "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
  "endDateTime": "2020-01-31T23:59:59.000Z",
  "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
  "allDayEvent": false,
  "duration": 2678399,
  "eventType": "APPOINTMENT",
  "eventStatus": "SCHEDULED",
  "eventMode": "IN-PERSON",
  "eventColor": null,
  "externalId": null,
  "externalIdUpdatedAt": "2021-06-11T18:10:45.711Z",
  "hostId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "additionalInfo": {
    "location": "Room 1408",
    "remarks": "Please wear mask",
    "attachment": ""
  },
  "participants": [
    {
      "id": "d4e6eb8b-b627-461d-a17d-292083446df8",
      "participantId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
      "participantRole": "psm",
      "participationStatus": "",
      "attended": false
    },
    {
      "id": "8416e538-7417-4f3d-aaf5-19d212ae6f3b",
      "participantId": "4f684417-7868-467a-ae0a-f7aa8a4323e6",
      "participantRole": "patient",
      "participationStatus": "",
      "attended": false
    }
  ]
}
  1. HTTP Method: PATCH
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573

Update event invitation response by ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "participantId": "2279cbc9-0cb5-410b-9566-7f22b8f4263f",
    "participationStatus": "Yes"
}


r = requests.put("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573/invitation-response", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573/invitation-response

Note: all fields are required

Delete Calendar Event by ID

Note: Only future events can be deleted

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.delete("https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573", 
   headers=h)

print("Response Code: {}".format(r.status_code))
  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/events/2dfbd113-5282-4f70-b456-d8cf7ecb5573

Get Summary for the User

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-event-summary?from=2020-01-15T14:00:00.000Z&to=2020-02-11T00:00:00.000Z&psmIds=301b2895-cbf0-4cac-b4cf-1d082faee95c", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
 "startDateTime": "2020-01-15T14:00:00.000Z",
 "endDateTime": "2020-02-11T00:00:00.000Z",
 "summary": [
   {
     "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
     "totalCreatedEvents": 1,
     "totalOccurredEvents": 1,
     "totalFutureEvents": 0,
     "eventStatusCount": {
       "SCHEDULED": 1
     },
     "totalWorkingHours": "63.0 hours",
     "totalEventHours": "394.0 hours",
     "occupancy": "625.4%"
   }
 ]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-event-summary?from=2020-01-15T14:00:00.000Z&to=2020-02-11T00:00:00.000Z&psmIds=301b2895-cbf0-4cac-b4cf-1d082faee95c
Parameters Format Description
psm-ids user id psm-ids=301b2895-cbf0-4cac-b4cf-1d082faee95c
from Date_time in ISO-8601 format from=2021-01-28T23:10:04.874Z
to Date_time in ISO-8601 format to=2021-01-28T23:10:04.874Z

Calendar Working Hours

Using Working Hours API, users (doctors, clinicians) can set flexible working hours that vary from week to week. It is beneficial for people involved part-time.

{
 "psmId": "28f393a8-62b3-4b4b-aa42-da769ce4489a",
 "createdBy": "28f393a8-62b3-4b4b-aa42-da769ce4489a",
 "startDateTime": "2020-01-01T00:00:00.000Z",
 "endDateTime": "2020-01-31T23:59:59.000Z",
 "localStartDateTime": "2020-01-01T00:00:00.000+03:00",
 "localEndDateTime": "2020-01-31T23:59:59.000+03:00",
 "daysInfo": [
   {
     "day": 1,
     "startTime": "09:00:00",
     "endTime": "18:00:00"
   },
   {
     "day": 2,
     "startTime": "09:00:00",
     "endTime": "18:00:00"
   }
 ]
}

Note:

  1. psmId is userId. We will change it in the future releases to reflect that
  2. day field represents day of week (1 - monday, 2 - tuesday, ...)

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} /calendar/ work-hours

In our example it would be: https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours

Create Work Hours

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "createdBy": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "startDateTime": "2020-01-01T00:00:00.000Z",
    "endDateTime": "2020-01-31T23:59:59.000Z",
    "daysInfo": [
        {
            "day": 1,
            "startTime": "09:00:00",
            "endTime": "18:00:00"
        },
        {
            "day": 2,
            "startTime": "09:00:00",
            "endTime": "18:00:00"
        }
    ]
}

r = requests.post("https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

The above request returns JSON of the created work hours

{
  "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
  "details": [
    {
      "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
      "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
      "createdAt": "2021-05-03T13:18:16.424Z",
      "updatedAt": "2021-05-03T13:18:16.424Z",
      "workHoursId": "18b80840-63ef-4849-9d3a-0d36a2ace332",
      "startDateTime": "2020-01-01T00:00:00.000Z",
      "endDateTime": "2020-01-31T23:59:59.000Z",
      "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
      "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
      "daysInfo": [
        {
          "daysInfoId": "24e217e0-f33e-495d-96ae-f19b6d15a4c3",
          "startTime": "09:00:00",
          "endTime": "18:00:00",
          "day": 1
        },
        {
          "daysInfoId": "d740b70f-1aa7-41c6-8890-0a75cd5535df",
          "startTime": "09:00:00",
          "endTime": "18:00:00",
          "day": 2
        }
      ]
    }
  ]
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours

Work Hours required fields

Read Work Hours

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours?psm-ids=301b2895-cbf0-4cac-b4cf-1d082faee95c&from=2020-01-01T00:00:00.000Z&to=2020-01-31T23:59:59.000Z", 
  headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

[
  {
    "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "details": [
      {
        "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
        "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
        "createdAt": "2021-05-03T13:18:16.424Z",
        "updatedAt": "2021-05-03T13:18:16.424Z",
        "workHoursId": "18b80840-63ef-4849-9d3a-0d36a2ace332",
        "startDateTime": "2020-01-01T00:00:00.000Z",
        "endDateTime": "2020-01-31T23:59:59.000Z",
        "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
        "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
        "daysInfo": [
          {
            "daysInfoId": "24e217e0-f33e-495d-96ae-f19b6d15a4c3",
            "startTime": "09:00:00",
            "endTime": "18:00:00",
            "day": 1
          },
          {
            "daysInfoId": "d740b70f-1aa7-41c6-8890-0a75cd5535df",
            "startTime": "09:00:00",
            "endTime": "18:00:00",
            "day": 2
          }
        ]
      }
    ]
  }
]
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours
Parameters Format Description
psm-ids list of id and values psm-ids=301b2895-cbf0-4cac-b4cf-1d082faee95c
from Date_time in ISO-8601 format from=2021-01-28T23:10:04.874Z
to Date_time in ISO-8601 format to=2021-01-28T23:10:04.874Z
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

URL examples:

  1. https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours ?psm-ids=301b2895-cbf0-4cac-b4cf-1d082faee95c &from=2020-01-01T00:00:00.000Z &to=2020-01-31T23:59:59.000Z

  2. https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours ?psm-ids=301b2895-cbf0-4cac-b4cf-1d082faee95c,18f393a8-62b3-4b4b-aa42-da769ce4489a &from=2020-01-01T00:00:00.000Z &to=2020-01-31T23:59:59.000Z

Update Work Hours

Updating work hours by ID

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "updatedBy": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "startDateTime": "2020-01-01T00:00:00.000Z",
    "endDateTime": "2020-01-31T23:59:59.000Z",
    "daysInfo": [
      {
          "day": 1,
          "startTime": "10:00:00",
          "endTime": "19:00:00"
      },
      {
          "day": 2,
          "startTime": "10:00:00",
          "endTime": "19:00:00"
      }
    ]
}

r = requests.put("https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours/c7a4251f-d70e-4ccb-8c96-1038c76fd737", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
 "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
 "updatedBy": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
 "startDateTime": "2020-01-01T00:00:00.000Z",
 "endDateTime": "2020-01-31T23:59:59.000Z",
 "daysInfo": [
   {
     "day": 1,
     "startTime": "10:00:00",
     "endTime": "19:00:00"
   },
   {
     "day": 2,
     "startTime": "10:00:00",
     "endTime": "19:00:00"
   }
 ]
}
  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/calendar/work-hours/c7a4251f-d70e-4ccb-8c96-1038c76fd737

See list of the required fields

Schedule

There are two APIs that are relevant to the schedules feature:

Get Schedules

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-schedules", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

[
 {
   "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
   "workHours": [
     {
       "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
       "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
       "createdAt": "2021-05-03T13:18:16.424Z",
       "updatedAt": "2021-05-03T13:18:16.424Z",
       "workHoursId": "18b80840-63ef-4849-9d3a-0d36a2ace332",
       "startDateTime": "2020-01-01T00:00:00.000Z",
       "endDateTime": "2020-01-31T23:59:59.000Z",
       "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
       "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
       "daysInfo": [
         {
           "daysInfoId": "24e217e0-f33e-495d-96ae-f19b6d15a4c3",
           "startTime": "09:00:00",
           "endTime": "18:00:00",
           "day": 1
         },
         {
           "daysInfoId": "d740b70f-1aa7-41c6-8890-0a75cd5535df",
           "startTime": "09:00:00",
           "endTime": "18:00:00",
           "day": 2
         }
       ]
     }
   ],
   "events": [
     {
       "id": "313c2029-493b-4114-8b86-788d631a1851",
       "eventId": "313c2029-493b-4114-8b86-788d631a1851",
       "eventTitle": "New event title",
       "eventType": "APPOINTMENT",
       "eventColor": "pink",
       "allDayEvent": false,
       "startDateTime": "2020-01-01T00:00:00.000Z",
       "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
       "endDateTime": "2020-01-31T23:59:59.000Z",
       "localEndDateTime": "2020-02-01T02:59:59.000+03:00"
     }
   ]
 }
]

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / calendar /psm-schedules

in our example it would be: https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-schedules

Parameters Format Description
psmIds list of id and values psmIds=28f393a8-62b3-4b4b-aa42-da769ce4489
from Date_time in ISO-8601 format from=2021-01-28T23:10:04.874Z
to Date_time in ISO-8601 format to=2021-01-28T23:10:04.874Z
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

Example:

https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-schedules ?psmIds=28f393a8-62b3-4b4b-aa42-da769ce4489a,18f393a8-62b3-4b4b-aa42-da769ce4489a &from=2020-01-01T00:00:00.000Z &to=2020-01-31T23:59:59.000Z

Get Available Schedules

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-schedules?psmIds=28f393a8-62b3-4b4b-aa42-da769ce4489a,18f393a8-62b3-4b4b-aa42-da769ce4489a&from=2020-01-01T00:00:00.000Z&to=2020-01-31T23:59:59.000Z", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

[
  {
    "psmId": "301b2895-cbf0-4cac-b4cf-1d082faee95c",
    "workHours": [
      {
        "createdBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
        "updatedBy": "9565d236-f654-4116-bfb4-c10a5e840a9c",
        "createdAt": "2021-05-03T13:18:16.424Z",
        "updatedAt": "2021-05-03T13:18:16.424Z",
        "workHoursId": "18b80840-63ef-4849-9d3a-0d36a2ace332",
        "startDateTime": "2020-01-01T00:00:00.000Z",
        "endDateTime": "2020-01-31T23:59:59.000Z",
        "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
        "localEndDateTime": "2020-02-01T02:59:59.000+03:00",
        "daysInfo": [
          {
            "daysInfoId": "24e217e0-f33e-495d-96ae-f19b6d15a4c3",
            "startTime": "09:00:00",
            "endTime": "18:00:00",
            "day": 1
          },
          {
            "daysInfoId": "d740b70f-1aa7-41c6-8890-0a75cd5535df",
            "startTime": "09:00:00",
            "endTime": "18:00:00",
            "day": 2
          }
        ]
      }
    ],
    "events": [
      {
        "id": "313c2029-493b-4114-8b86-788d631a1851",
        "eventId": "313c2029-493b-4114-8b86-788d631a1851",
        "eventTitle": "New event title",
        "eventType": "APPOINTMENT",
        "eventColor": null,
        "allDayEvent": false,
        "startDateTime": "2020-01-01T00:00:00.000Z",
        "localStartDateTime": "2020-01-01T03:00:00.000+03:00",
        "endDateTime": "2020-01-31T23:59:59.000Z",
        "localEndDateTime": "2020-02-01T02:59:59.000+03:00"
      }
    ]
  }
]

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / calendar / available-psm-schedules

in our example it would be: https://api.live.welkincloud.io/gh/sb-demo/calendar/available-psm-schedules

Parameters Format Description
psmIds list of id and values psmIds=28f393a8-62b3-4b4b-aa42-da769ce4489
from Date_time in ISO-8601 format from=2021-01-28T23:10:04.874Z
to Date_time in ISO-8601 format to=2021-01-28T23:10:04.874Z
viewerTimezone String timezone (IANA format) If provided, return localtime fields (localStartDateTime, localEndDateTime) with provided timezone, otherwise use timezone for psmId user

Example:

https://api.live.welkincloud.io/gh/sb-demo/calendar/psm-schedules ?psmIds=28f393a8-62b3-4b4b-aa42-da769ce4489a,18f393a8-62b3-4b4b-aa42-da769ce4489a &from=2020-01-01T00:00:00.000Z &to=2020-01-31T23:59:59.000Z

Care plans

APIs for working with patient care plan: overview and goals

Get care plan by patientId

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan"
    .format(patientId)

payload={}
headers = {
    "Authorization": "Bearer {}".format(token)
}

response = requests.request("GET", url, headers=headers, data=payload)

Response

{
  "id": "c5b5a589-257f-482d-b6a6-907a6c45cd00",
  "createdByName": "John Dou",
  "createdAt": "2021-05-04T05:53:47.211Z",
  "updatedByName": "John Dou",
  "updatedAt": "2021-05-04T07:36:59.435Z",
  "patientOverview": {
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T07:36:39.793Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T07:36:59.434Z",
    "overview": "Lorem ipsum dolor sit amet..."
  }
}

Description

Get overview and system fields

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Create patient overview

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/overview"
    .format(patientId)

payload = {
    "overview": "Lorem ipsum dolor sit amet..."
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, json=payload)

Response

{
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T07:36:39.793Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T07:36:59.434Z",
    "overview": "Lorem ipsum dolor sit amet..."
}

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/care-plan/overview

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/overview

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 OK
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Update patient overview

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/overview"
    .format(patientId)

payload = {
    "overview": "Lorem ipsum dolor sit amet..."
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("PUT", url, headers=headers, json=payload)

Response

{
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T07:36:39.793Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T07:36:59.434Z",
    "overview": "Lorem ipsum dolor sit amet..."
}

Description

Update patient overview

HTTP Request

PUT /{tenantName}/{instanceName}/patients/{patientId}/care-plan/overview

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/overview

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Create Goal

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals"
    .format(patientId)

payload = {
    "goalTemplateName": "example-template-name"
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, json=payload)

Note: The goal-template must already be created in the designer.

Response

{
  "id": "57827fdb-d240-46f9-8e6a-a89441cf8718",
  "createdByName": "John Dou",
  "createdAt": "2021-05-04T09:21:31.205Z",
  "updatedByName": "John Dou",
  "updatedAt": "2021-05-04T09:21:31.205Z",
  "name": "Example",
  "type": "Test",
  "priority": "LOW",
  "status": "ACTIVE",
  "templateName": "example-template-name"
}

Description

Create goal for patient by goal-template

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dto body dto Yes json

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Update Goal

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{}"
    .format(patientId, goalId)

payload = {
    "name": "Another goal name",
    "priority": "HIGH",
    "status": "REMOVED"
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("PATCH", url, headers=headers, json=payload)

Response

{
  "id": "57827fdb-d240-46f9-8e6a-a89441cf8718",
  "createdByName": "John Dou",
  "createdAt": "2021-05-04T09:21:31.205Z",
  "updatedByName": "John Dou",
  "updatedAt": "2021-05-04T09:21:31.205Z",
  "name": "Another goal name",
  "type": "Test",
  "priority": "HIGH",
  "status": "REMOVED",
  "templateName": "example-template-name"
}

Description

Update goal details: name, status, priority.

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dto body dto Yes json

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Goal details

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{}"
    .format(patientId, goalId)

payload = {}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, json=payload)

Response

{
  "details": {
    "id": "57827fdb-d240-46f9-8e6a-a89441cf8718",
    "createdByName": "Jane Dou",
    "createdAt": "2021-05-04T09:21:31.205Z",
    "updatedByName": "Jane Dou",
    "updatedAt": "2021-05-04T09:37:11.206Z",
    "name": "Example",
    "type": "Test",
    "priority": "HIGH",
    "status": "ACTIVE",
    "templateName": "example-template-name"
  },
  "tasks": [
    {
      "id": "ce9e012e-4ae8-4366-9987-bbf5ebdf4a2d",
      "createdAt": "2021-05-04T09:21:31.571Z",
      "updatedAt": "2021-05-04T09:21:31.571Z",
      "name": "task1",
      "description": "",
      "dueDate": "2021-05-05T12:21:31.534Z",
      "status": "TODO",
      "priority": "LOW",
      "patient": {
        "id": "d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1",
        "name": "John Dou"
      },
      "assignee": {
        "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
        "name": "Jane Dou"
      },
      "author": {
        "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
        "name": "Jane Dou"
      },
      "watchers": [
        {
          "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
          "name": "Jane Dou"
        }
      ],
      "comments": [
        {
          "id": "c84992c2-568e-41b0-ab51-903c83e46d81",
          "createdByName": "Jane Dou",
          "createdAt": "2021-05-04T10:01:21.108Z",
          "updatedByName": "Jane Dou",
          "updatedAt": "2021-05-04T10:01:21.108Z",
          "text": "test comment"
        }
      ],
      "goalId": "57827fdb-d240-46f9-8e6a-a89441cf8718",
      "watchersType": "POINT_OF_CONTACT"
    }
  ],
  "comments": []
}

Description

Get extended goal view: details, tasks, comments.

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Goals list

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals"
    .format(patientId)

payload = {}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, json=payload)

Response

{
  "data": [
    {
      "id": "57827fdb-d240-46f9-8e6a-a89441cf8718",
      "createdByName": "John Dou",
      "createdAt": "2021-05-04T09:21:31.205Z",
      "updatedByName": "John Dou",
      "updatedAt": "2021-05-04T09:37:11.206Z",
      "name": "Example",
      "type": "Test",
      "priority": "HIGH",
      "status": "ACTIVE",
      "templateName": "example-template-name"
    }
  ],
  "metaInfo": {
    "page": 0,
    "pageSize": 20,
    "totalElements": 1,
    "numberOfElements": 1,
    "totalPages": 1,
    "firstPage": true,
    "lastPage": true
  }
}

Description

Get goals list without additional entity (tasks, comments), can be filtered by status.

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
status query Goal status No ACTIVE,REMOVED,COMPLETED
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
page query Page Index No integer
size query Page Size No integer

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Goal comments list

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{goalId}/comments"
    .format(patientId)

payload = {}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, json=payload)

Response

[
  {
    "id": "c84992c2-568e-41b0-ab51-903c83e46d81",
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T10:01:21.108Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T10:01:21.108Z",
    "text": "test comment"
  }
]

Description

Get list of comments related to goal

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}/comments

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718/comments

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 Created
401 Unauthorized
403 Forbidden
404 Not Found

Add Goal comment

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{goalId}/comments"
    .format(patientId)

payload = {
    "text": "test comment"
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, json=payload)

Response

{
  "id": "c84992c2-568e-41b0-ab51-903c83e46d81",
  "createdByName": "John Dou",
  "createdAt": "2021-05-04T10:01:21.108Z",
  "updatedByName": "John Dou",
  "updatedAt": "2021-05-04T10:01:21.108Z",
  "text": "test comment"
}

Description

Add comment to goal

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}/comments

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718/comments

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Goal tasks list

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{goalId}/tasks"
    .format(patientId)

payload = {}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("GET", url, headers=headers, json=payload)

Response

[
  {
    "id": "c84992c2-568e-41b0-ab51-903c83e46d81",
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T10:01:21.108Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T10:01:21.108Z",
    "text": "test comment"
  }
]

Description

Get list of tasks related to goal

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}/tasks

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718/tasks

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 Created
401 Unauthorized
403 Forbidden
404 Not Found

Add Goal task

Request

import requests

url = "https://api.live.welkincloud.io/gh/sb-demo/patients/{}/care-plan/goals/{goalId}/tasks"
    .format(patientId)

payload = {
    "name": "New task",
    "description": "Create new patient profile",
    "dueDate": "2021-12-01T12:16:38.514Z",
    "status": "TODO",
    "priority": "URGENT",
    "assignee": {
        "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb"
    }
}
headers = {
    "Authorization": "Bearer {}".format(token),
    'Content-Type': 'application/json'
}

response = requests.request("POST", url, headers=headers, json=payload)

Response

[
  {
    "id": "c84992c2-568e-41b0-ab51-903c83e46d81",
    "createdByName": "John Dou",
    "createdAt": "2021-05-04T10:01:21.108Z",
    "updatedByName": "John Dou",
    "updatedAt": "2021-05-04T10:01:21.108Z",
    "text": "test comment"
  }
]

Description

Add custom task to goal

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/care-plan/goals/{goalId}/tasks

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/care-plan/goals/57827fdb-d240-46f9-8e6a-a89441cf8718/tasks

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
goalId path ID of goal Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 Created
401 Unauthorized
403 Forbidden
404 Not Found

Custom Data Types (CDT)

Custom data types in Welkin are associated with a Patient. In REST terms, they are a sub-resource to the patient object

Each CDT has a set of system fields associated with it and a set of custom fields that you will create in the designer

System Fields

Field Name Type Description
id UUID Unique autogenerated identifier
updated_by UUID UUID of user or client who updated the record
updated_by_name String Full name of the user or api client that updated the record
updated_at Date_time in ISO-8601 format Date and time of the last update to the record
created_by UUID UUID of user or client who created the record
created_by_name String Full name of the user or api client that created the record
created_at Date_time in ISO-8601 format Date and time when the record was created
source_type String Source type of the record (for example: ASSESSMENT if assessment type generated this record)
source_name String Name of the source type (for example: my_medication_assessment if assessment type generated this record)
source_id UUID record ID of the source

Formula field type

Type formula is intended for calculating values at the time of receipt of the cdt record. The formula looks like a mathematical expression. See Example 1.

Example 1 of a simple formula

{
  "formula": "(2 + 2) * 2"
}

Variables

The formula supports the mechanism of variables. This allows you to reference fields in CDT and substitute values into the formula at runtime. To refer to a field, you should specify the field name and enclose it in double curly brackets. An example of a field reference is {{some-cdt-field}}. See Example 2.

Example

Some cdt contains two integer fields named field-a and field-b. The formula for calculating the sum of these fields values is as follows.

Example 2 of a sum of fields values

{
  "formula": "{{field-a}} + {{field-b}}"
}

Functions

The formula supports the mechanism of functions. Functions allow you to perform more complex calculations. to specify a function, you should specify # and then the name of the function and parentheses () to list the passed parameters. An example of a function is #functionName(2, {{variable}})

Example

You want to know how many days have passed since the onset of the illness. A cdt contains a date field named onset-disease. See Example 3.

Example 3 of receiving days from the onset of illness

{
  "formula": "#daysBetween(#today(), {{onset-disease}})"
}

Working with CDT records

Description

Get all cdt records

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals

Response

{
    "name": "vitals",
    "data": {
        "content": [
            {
                "id": "8c0684ac-217e-45f4-8727-5587220dd512",
                "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
                "cdtId": "ba36a882-bbec-49ea-a99a-c84aac025f3f",
                "version": 70,
                "jsonBody": {
                    "external_guid": null,
                    "source_record_id": null,
                    "weight": 1,
                    "created_at": "2021-01-28T13:35:36.861Z",
                    "source_type": null,
                    "external_id": null,
                    "created_by_name": "MY NAME",
                    "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                    "updated_by_name": "MY NAME",
                    "systolic": 1,
                    "diastolic": -1,
                    "updated_at": "2021-01-28T13:35:36.861Z",
                    "pulse": 1,
                    "temperature": -1,
                    "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                    "id": "8c0684ac-217e-45f4-8727-5587220dd512",
                    "source_id": null,
                    "blood_sugar": 1,
                    "source_name": null,
                    "height": -1
                }
            }
        ],
        "pageable": {
            "sort": {
                "sorted": false,
                "unsorted": true,
                "empty": true
            },
            "pageNumber": 0,
            "pageSize": 20,
            "offset": 0,
            "paged": true,
            "unpaged": false
        },
        "last": true,
        "totalPages": 1,
        "totalElements": 1,
        "numberOfElements": 1,
        "first": true,
        "number": 0,
        "sort": {
            "sorted": false,
            "unsorted": true,
            "empty": true
        },
        "size": 20,
        "empty": false
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string
fields args : fields=name,phone No string array
page args page number No integer
size args page size No integer
sort args Sort field with sorting order(asc or desc) after coma no field,order
filters args key=v1,v2,v3 No key-value
dateStart args Date_time in ISO-8601 format No datetime
dateEnd args Date_time in ISO-8601 format No datetime

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get cdt record by identifier (id, external_id, external_guid)

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtRecordId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/8c0684ac-217e-45f4-8727-5587220dd512

Response

{
    "id": "8c0684ac-217e-45f4-8727-5587220dd512",
    "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
    "cdtId": "ba36a882-bbec-49ea-a99a-c84aac025f3f",
    "version": 70,
    "jsonBody": {
        "external_guid": null,
        "source_record_id": null,
        "weight": 1,
        "created_at": "2021-01-28T13:35:36.861Z",
        "source_type": null,
        "external_id": null,
        "created_by_name": "MY NAME",
        "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updated_by_name": "MY NAME",
        "systolic": 1,
        "diastolic": -1,
        "updated_at": "2021-01-28T13:35:36.861Z",
        "pulse": 1,
        "temperature": -1,
        "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "id": "8c0684ac-217e-45f4-8727-5587220dd512",
        "source_id": null,
        "blood_sugar": 1,
        "source_name": null,
        "height": -1
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string
cdtRecordId path Identificator of cdt record Yes UUID (type = ID or EGUID), String (type = EID)
type query Identificator type (ID, EID, EGUID), default ID No String

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Examples

  1. https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/8c0684ac-217e-45f4-8727-5587220dd512
  2. https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/4a245aac-217e-45f4-8727-5587220dd512?type=EGUID
  3. https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/externalId?type=EID

Description

Create cdt record

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/{cdtName}

Request

{
    "weight": 1,
    "systolic": 1,
    "diastolic": -1,
    "pulse": 1,
    "temperature": -1,
    "blood_sugar": 1,
    "height": -1
}

Response

{
    "id": "8c0684ac-217e-45f4-8727-5587220dd512",
    "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
    "cdtId": "ba36a882-bbec-49ea-a99a-c84aac025f3f",
    "version": 70,
    "jsonBody": {
        "external_guid": null,
        "source_record_id": null,
        "weight": 1,
        "created_at": "2021-01-28T13:35:36.861Z",
        "source_type": null,
        "external_id": null,
        "created_by_name": "MY NAME",
        "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updated_by_name": "MY NAME",
        "systolic": 1,
        "diastolic": -1,
        "updated_at": "2021-01-28T13:35:36.861Z",
        "pulse": 1,
        "temperature": -1,
        "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "id": "8c0684ac-217e-45f4-8727-5587220dd512",
        "source_id": null,
        "blood_sugar": 1,
        "source_name": null,
        "height": -1
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update cdt record by id

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtRecordId}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/8c0684ac-217e-45f4-8727-5587220dd512

Request

{
   "pulse": 222
}

Response

{
    "id": "8c0684ac-217e-45f4-8727-5587220dd512",
    "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
    "cdtId": "ba36a882-bbec-49ea-a99a-c84aac025f3f",
    "version": 70,
    "jsonBody": {
        "external_guid": null,
        "source_record_id": null,
        "weight": 1,
        "created_at": "2021-01-28T13:35:36.861Z",
        "source_type": null,
        "external_id": null,
        "created_by_name": "MY NAME",
        "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updated_by_name": "MY NAME",
        "systolic": 1,
        "diastolic": -1,
        "updated_at": "2021-01-28T13:35:36.861Z",
        "pulse": 222,
        "temperature": -1,
        "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "id": "8c0684ac-217e-45f4-8727-5587220dd512",
        "source_id": null,
        "blood_sugar": 1,
        "source_name": null,
        "height": -1
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string
cdtRecordId path ID of cdt record Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update cdt records with bulk. Allowed only for list fields with bulk edit flag

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals

Request

{
    "rows": [
        {
            "id": "8c0684ac-217e-45f4-8727-5587220dd512",
            "jsonBody": {
                "list_field": "a"
            }
        }
    ]
}

Response

{
    "rows": [
        {
            "id": "8c0684ac-217e-45f4-8727-5587220dd512",
            "jsonBody": {
                "external_guid": null,
                "weight": 1,
                "created_at": "2021-01-28T13:35:36.861Z",
                "source_type": null,
                "external_id": null,
                "list_field": "a",
                "created_by_name": "MY NAME",
                "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "updated_by_name": "MY NAME",
                "systolic": 1,
                "diastolic": -1,
                "updated_at": "2021-05-05T14:29:23.368Z",
                "pulse": 1,
                "temperature": -1,
                "updated_by": "2116dedb-1833-42a3-9a09-77ba00e20959",
                "id": "8c0684ac-217e-45f4-8727-5587220dd512",
                "source_id": null,
                "blood_sugar": 1,
                "source_name": null,
                "height": -1
            },
            "result": {
                "status": "OK",
                "content": null
            }
        }
    ]
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete cdt record by id

HTTP Request

DELETE /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtRecordId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/cdts/vitals/8c0684ac-217e-45f4-8727-5587220dd512

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
cdtName path Name of cdt Yes string
cdtRecordId path ID of cdt record Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Chat

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / patient / {{patientId}} / chat

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/calendar/events

Send message to care team

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}
data = {
    "message": "hello, world!"
}

r = requests.post("https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/inbound", 
  json=data, headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
   "sender": {
       "clientType": "PATIENT",
       "id": "5cccfad8-c7b0-4fe8-a01e-eb80c0b234ab",
       "titleName": null
   },
   "message": "hello, world!",
   "externalId": "IM6f03096c79094f9b9466c7d009073ca1",
   "createdAt": "2021-02-08T17:17:29.000Z"
}

Send message from patient to care team.

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / patient / {{patientId}} / chat / inbound

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/inbound

Webhook

Webhook are sent to the configured endpoint when user sends a message to the patient. Webhooks are configured in the welkin admin panel.

Headers

X-WEBHOOK-API-KEY: Configured 3rdparty Api key
X-WEBHOOK-API-SECRET: Configured 3rdparty Api secret

Webhook body

{
  "patientId": "cdb303e7-844f-40f8-b634-fe99bfccce28",
  "patientUrl": "https://api.live.welkincloud.io/gh/sb-demo/patients/cdb303e7-844f-40f8-b634-fe99bfccce28",
  "tenantName": "gh",
  "instanceName": "sb-demo",
  "message": "Webhook test..."
}

Get messages

import requests
h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat", 
   headers=h)

print("Response Code: {}".format(r.status_code))
print(r.json())

Returned json

{
   "meta": {
       "nextPageToken": "eyJ0eXBlIjoiUFJPVklERVIiLCJ0d2lsaW9Ub2tlbiI6Ik9yZGVyPWRlc2MmUGFnZVNpemU9MSZQYWdlPTEmUGFnZVRva2VuPVBUMTAifQ==",
       "prevPageToken": null,
       "pageSize": 1,
       "found": true
   },
   "content": [
       {
           "sender": {
               "clientType": "USER",
               "id": "379a1c22-aac4-4741-a083-c3c80105ee94",
               "titleName": "Root Root"
           },
           "message": "Hello, World!",
           "externalId": "IMa1614231a02d456a84d6ad6e193adb66",
           "createdAt": "2021-03-09T12:23:18.000Z"
       }
   ]
}

Get messages for patient.

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / patient / {{patientId}} / chat

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat

Query parametrs:

Parameters Description
includeArchived if true, include archived messages to the result
pageSize page size, mutually exclusive with pageToken
pageToken token for fetching specific page, mutually exclusive with pageSize

Response meta fields

Field Description
nextPageToken Token for receiving next page (null if this page is last)
prevPageToken Token for receiving previous page (null if this page is first)

Response content fields

Field Description
externalId unique message ID
sender.clientType "PATIENT", "USER"
sender.titleName User firstname and lastname, joined by space. Exists only if clientType = "USER"

Search messages

{
   "meta": {
       "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfU0VBUkNIIiwicGFnZVNpemUiOjIsImJvcmRlckRhdGUiOiIyMDIxLTAzLTA1VDE2OjA3OjMxLjI5OFoiLCJxdWVyeSI6ImhlbGxvIiwiYmVmb3JlIjp0cnVlfQ==",
       "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfU0VBUkNIIiwicGFnZVNpemUiOjIsImJvcmRlckRhdGUiOiIyMDIxLTAzLTA1VDE2OjA5OjUyLjYNVoiLCJxdWVyeSI6ImhlbGxvIiwiYmVmb3JlIjpmYWxzZX0=",
       "pageSize": 1,
       "found": true
   },
   "content": [
       {
           "meta": {
               "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoyLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wNVQxNjowOTo1Mi42NTVaIiwiYmVmb3JlIjp0cnVlfQ==",
               "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoyLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wNVQxNjowOTo1Mi42NTVaIiwiYmVmb3JlIjpmYWxzZX0="
           },
           "message": {
               "sender": {
                   "clientType": "PATIENT",
                   "id": "795412db-3bea-499a-be10-3e6839349197",
                   "titleName": null
               },
               "message": "Hello, world!",
               "externalId": "IM1da645db820a497a913d743009e91398",
               "createdAt": "2021-03-05T16:09:52.655Z"
           }
       } 
   ]
}

Note: You might want to see Usage Example for the search api.

Query parametrs:

Parameters Description
query Query for search
pageSize How many search results per page will returns
contentPageSize How many messages per page will return get messages api when you'll pass content.meta.nextPageToken or content.meta.prevPageToken as pageToken param to that api
includeArchived If true, include archived messages, otherwise not.
pageToken token for fetching next or previous search results, mutually exclusive with others params

Response fields:

Field Description
meta.nextPageToken Token for fetching next search page
meta.prevPageToken Token for fetching previous search page
content.[].meta.nextPageToken Token for fetching messages which are located next to the found message. Should use in the get messages api.
content.[].meta.prevPageToken Token for fetching messages which are located back to the found message. Should use in the get messages api.

Archive messages

Archive chat message from specific date

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / patient / {{patientId}} / chat / archive

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/archive

  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/archive?archiveDate=2020-10-05T10:51:41.000Z

Query parametrs:

Parameters Description
archiveDate All messages that have been posted before that date will be archived

Restore archived messages

Restore all previously archived messages

URL Structure: {{url}} / {{tenantName}} / {{instanceName}} / patient / {{patientId}} / chat / restore

in our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/restore

  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/restore

Chat search usage example

Chat usage example

Fething first search page

Returned data

{
   "meta": {
       "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfU0VBUkNIIiwicGFnZVNpemUiOjIsImJvcmRlckRhdGUiOiIyMDIxLTAzLTA5VDIzOjUzOjA4LjkyNloiLCJxdWVyeSI6ImhlbGxvIiwiYmVmb3JlIjp0cnVlfQ==",
       "prevPageToken": null,
       "pageSize": 2,
       "found": true
   },
   "content": [
       {
           "meta": {
               "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1NDozOS4xNTJaIiwiYmVmb3JlIjp0cnVlfQ==",
               "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1NDozOS4xNTJaIiwiYmVmb3JlIjpmYWxzZX0="
           },
           "message": {
               "sender": {
                   "clientType": "USER",
                   "id": "379a1c22-aac4-4741-a083-c3c80105ee94",
                   "titleName": "Root Root"
               },
               "receiver": {
                   "clientType": "PATIENT",
                   "id": "c4f64a1a-2c9c-4ec2-b1d2-2c8dd4ce1df1",
                   "titleName": null
               },
               "message": "Hello2",
               "externalId": "IMf03066157abb419287c202bbc0e417d0",
               "createdAt": "2021-03-09T23:54:39.152Z"
           }
       },
       {
           "meta": {
               "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1MzowOC45MjZaIiwiYmVmb3JlIjp0cnVlfQ==",
               "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1MzowOC45MjZaIiwiYmVmb3JlIjpmYWxzZX0="
           },
           "message": {
               "sender": {
                   "clientType": "USER",
                   "id": "379a1c22-aac4-4741-a083-c3c80105ee94",
                   "titleName": "Root Root"
               },
               "receiver": {
                   "clientType": "PATIENT",
                   "id": "c4f64a1a-2c9c-4ec2-b1d2-2c8dd4ce1df1",
                   "titleName": null
               },
               "message": "Hello1",
               "externalId": "IMc630b6cfab684e5683e0d593e2b244a1",
               "createdAt": "2021-03-09T23:53:08.926Z"
           }
       }
   ]
}

Let assume that we have the following chat (messages in the list are sorted from older to newest):

So let’s search by query “Hello”. Assume pageSize=2 and contentPageSize=1 and make the following request

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/search?query=hello&pageSize=2&contentPageSize=1&includeArchived=true

As you can see, two messages are found: the first is “Hello2” and the second is “Hello1”. “content” length is limited to pageSize, so to fetch next messages that matches query you should use pass “meta.nextPageToken” as pageToken.

Fetching next search page

Returned JSON

{
   "meta": {
       "nextPageToken": null,
       "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfU0VBUkNIIiwicGFnZVNpemUiOjIsImJvcmRlckRhdGUiOiIyMDIxLTAzLTA5VDIzOjUyOjU1LjYxMVoiLCJxdWVyeSI6ImhlbGxvIiwiYmVmb3JlIjpmYWxzZX0=",
       "pageSize": 2,
       "found": true
   },
   "content": [
       {
           "meta": {
               "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoyLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1Mjo1NS42MTFaIiwiYmVmb3JlIjp0cnVlfQ==",
               "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoyLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1Mjo1NS42MTFaIiwiYmVmb3JlIjpmYWxzZX0="
           },
           "message": {
               "sender": {
                   "clientType": "USER",
                   "id": "379a1c22-aac4-4741-a083-c3c80105ee94",
                   "titleName": "Root Root"
               },
               "receiver": {
                   "clientType": "PATIENT",
                   "id": "c4f64a1a-2c9c-4ec2-b1d2-2c8dd4ce1df1",
                   "titleName": null
               },
               "message": "Hello0",
               "externalId": "IM9ebf08fe2c59436593c3e64ae28d898a",
               "createdAt": "2021-03-09T23:52:55.611Z"
           }
       }
   ]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat/search?pageToken=eyJ0eXBlIjoiTE9DQUxfU0VBUkNIIiwicGFnZVNpemUiOjIsImJvcmRlckRhdGUiOiIyMDIxLTAzLTA5VDIzOjUzOjA4LjkyNloiLCJxdWVyeSI6ImhlbGxvIiwiYmVmb3JlIjp0cnVlfQ==

And we received “Hello0” message, that’s the last message that matches query.

Fetch near-located messages

Returned json

{
   "meta": {
       "nextPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1NDozNi41ODVaIiwiYmVmb3JlIjp0cnVlfQ==",
       "prevPageToken": "eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1NDozNi41ODVaIiwiYmVmb3JlIjpmYWxzZX0=",
       "pageSize": 1,
       "found": true
   },
   "content": [
       {
           "sender": {
               "clientType": "USER",
               "id": "379a1c22-aac4-4741-a083-c3c80105ee94",
               "titleName": "Root Root"
           },
           "receiver": {
               "clientType": "PATIENT",
               "id": "c4f64a1a-2c9c-4ec2-b1d2-2c8dd4ce1df1",
               "titleName": null
           },
           "message": "Test2",
           "externalId": "IM9b366d9d29934008a8a500e4e834cd60",
           "createdAt": "2021-03-09T23:54:36.585Z"
       }
   ]
}

Let imagine the following situation: the user clicked on the found message, and we would like to open chat dialog and jump to the message. So we have to see messages that located near the found message.

So we’re using the following request and pass “content[].meta.nextPageToken” as pageToken param:

Note: We are not using search API, we are using get messages api

  1. HTTP Method: GET
  2. HTTP Url: https://api.live.welkincloud.io/gh/sb-demo/patient/7272b601-bb09-4abf-87c0-ade48ddfaea0/chat?pageToken=eyJ0eXBlIjoiTE9DQUxfRklORCIsInBhZ2VTaXplIjoxLCJib3JkZXJEYXRlIjoiMjAyMS0wMy0wOVQyMzo1NDozOS4xNTJaIiwiYmVmb3JlIjp0cnVlfQ==&includeArchived=false

As you can see, fetched message "Test2" located next to the found message "Hello2"

Data audit

Find data audit event

It is a typical API to work with data audit

URL Structure: {{url}} / {{tenantName}} / admin /audit-data

in our example it would be: https://api.live.welkincloud.io/gh/admin/audit-data

{
  "eventEntity": "PATIENT",
  "url": "https://api.live.welkincloud.io/gh/sb-demo/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "subjectUsername": "johndoe",
  "subjectUserId": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
  "subjectActor": "USER",
  "subjectFullName": "Json Doe",
  "patientFullName": "Charlie Schwarzenegger",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "instance": "sb-demo",
  "eventSubtype": "PATIENT_UPDATED",
  "sentAt": "2021-04-27T04:33:36.933Z",
  "record": {
    "id": "6801d498-26f4-4aee-961b-5daffcf193c8",
    "firstName": "Charlie",
    "lastName": "Schwarzenegger",
    "middleName": "Mc",
    "birthDate": "2012-08-12T00:00:00.000Z",
    "email": "1@1.com",
    "phone": "+13363034233",
    "country": "USA",
    "state": "American Samoa",
    "city": "Los Angeles",
    "zip": "99451",
    "addressLine1": "Hollywood Blvd 2021",
    "timezone ": "America/Los_Angeles",
    "patientTerritories": []
  }
}

Fields description:

Field Name Format Description Allowed values
cdtName String Cdt name
entity Enum of allowed values Type of the entity CDT, PATIENT
subjectUsername String Username of a person performing the action
subjectUserId UUID Id of a person performing the action
subjectFullName String Full name of the person performing the action
subjectActor Enum of allowed values Client type of the person performing the action API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
instance String Instance name
patientFullName String Full name of the patient who the action was taken on
patientId UUID Id of the patient who the action was taken on
sentAt Date_time in ISO-8601 format When action happens
cdt Cdt Object describe all fields with types
operation Enum of allowed values Type of action operation CREATE, UPDATE, DELETE
record Object Object after performing the action on it
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/admin/audit-data?size=20&page=0&sort=createdAt%2Cdesc&dateStart=2021-02-26T17%3A00%3A00.000Z&entity=PATIENT
Parameters Format Description Allowed values
cdtName String If type is CDT then may filter by name
entity Enum of allowed values Type of the entity CDT, PATIENT
subjectUsername String Username of the person performing the action
subjectFullName String Full name of the person performing the action
subjectActor Enum of allowed values Client type of the person performing the action API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
instance String Instance name
patientFullName String Full name of a patient who the action was taken on
patientId UUID Id of the patient who the action was taken on
operation Enum of allowed values Type of action operation CREATE, UPDATE, DELETE
dateEnd Date_time in ISO-8601 format Filter by sentAt
dateStart Date_time in ISO-8601 format Filter by sentAt
includeFormation Boolean Include cdt formation

Documents - Document Summary

Documents are based on CDTs - we have one common system CDT (formation) with name “_document_summary” and all document types will be created with a “link” to this summary. So relation between Document Summary Record and Document Type Record is one-to-one.

“_document_summary” can’t be edited.

“_document_summary” has such fields set by default: - type - it’s the “link” between summary and document types - each created document type will be shown in this list like option. By default, we have 3 document types: Assessment (name - doc-type-assessment), Docusign (name - doc-type-docusign) and Others (name - doc-type-others). - files - for storing document files. Currently, users can upload only jpg, jpeg, png and pdf files.

Get All Documents Summary Records

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "content": [{
    "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
    "cdtId": "fba56b12-d39b-47d8-9b03-bf4812a481ad",
    "version": 45,
    "jsonBody": {
      "external_guid": null,
      "created_at": "2021-04-30T16:59:05.691Z",
      "source_type": null,
      "external_id": null,
      "type": "doc-type-docusign",
      "created_by_name": "Jon Snow",
      "created_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
      "updated_by_name": "Jon Snow",
      "updated_at": "2021-04-30T16:59:27.110Z",
      "updated_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
      "files": [{
        "id": "f1941755-41d9-4dc7-b3f6-4f23811fba1c",
        "size": 141826,
        "storageKey": "key",
        "contentType": "application/pdf",
        "originalName": "fileName.pdf"
      }],
      "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
      "source_id": null,
      "source_name": null
    }
  }]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary
  3. HTTP Response Codes: 200

Following query parameters can be used:

Parameter Description Examples
sourceId Used for filtering by source id https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary?sourceId=360a30fb-257f-4bdc-8dc9-9d28f7f7cb69

Get Document Summary Record By Id

The above request returns JSON structured like this:

{
  "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "fba56b12-d39b-47d8-9b03-bf4812a481ad",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "created_at": "2021-04-30T16:59:05.691Z",
    "source_type": null,
    "external_id": null,
    "type": "doc-type-docusign",
    "created_by_name": "Jon Snow",
    "created_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "updated_by_name": "Jon Snow",
    "updated_at": "2021-04-30T16:59:27.110Z",
    "updated_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "files": [{
      "id": "f1941755-41d9-4dc7-b3f6-4f23811fba1c",
      "size": 141826,
      "storageKey": "key",
      "contentType": "application/pdf",
      "originalName": "fileName.pdf"
    }],
    "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_id": null,
    "source_name": null
  }
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741
  3. HTTP Response Codes: 200

Create Document Summary Record

The above request returns JSON structured like this:

{
  "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "fba56b12-d39b-47d8-9b03-bf4812a481ad",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "created_at": "2021-04-30T16:59:05.691Z",
    "source_type": null,
    "external_id": null,
    "type": "doc-type-docusign",
    "created_by_name": "Jon Snow",
    "created_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "updated_by_name": "Jon Snow",
    "updated_at": "2021-04-30T16:59:27.110Z",
    "updated_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "files": [{
      "id": "f1941755-41d9-4dc7-b3f6-4f23811fba1c",
      "size": 141826,
      "storageKey": "key",
      "contentType": "application/pdf",
      "originalName": "fileName.pdf"
    }],
    "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_id": null,
    "source_name": null
  }
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/
  3. HTTP Response Codes: 201

Update Document Summary Record

The above request returns JSON structured like this:

{
  "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "fba56b12-d39b-47d8-9b03-bf4812a481ad",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "created_at": "2021-04-30T16:59:05.691Z",
    "source_type": null,
    "external_id": null,
    "type": "doc-type-docusign",
    "created_by_name": "Jon Snow",
    "created_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "updated_by_name": "Jon Snow",
    "updated_at": "2021-04-30T16:59:27.110Z",
    "updated_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
    "files": [{
      "id": "f1941755-41d9-4dc7-b3f6-4f23811fba1c",
      "size": 141826,
      "storageKey": "key",
      "contentType": "application/pdf",
      "originalName": "fileName.pdf"
    }],
    "id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_id": null,
    "source_name": null
  }
}
  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741
  3. HTTP Response Codes: 200

Delete Document Summary Record

  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741
  3. HTTP Response Codes: 200

Upload Document Summary Record File

The above request returns JSON structured like this:

[{
  "id": "bcade721-fa3d-46fe-9013-d07033212c6a",
  "originalName": "fileName.png",
  "size": 488030,
  "contentType": "image/png",
  "storageKey": "key"
}]
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/files
  3. HTTP Response Codes: 201
  4. Content-Type: multipart/form-data;
  5. Files should be with key “files” (few files allowed)

Download Document Summary Record File

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/files/bcade721-fa3d-46fe-9013-d07033212c6a
  3. HTTP Response Codes: 200
  4. Content-Type is taken from file (e.g. image/png, image/jpeg)

Documents - Document Types

Get All Documents Types

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types", headers=h)
print(r.json())

The above request returns JSON structured like this:

[{
  "id": "be91b865-d60e-434d-86f8-e47489d75a12",
  "name": "doc-type-assessment",
  "title": "Assessment",
  "label": "Assessment",
  "version": 45,
  "internal": true,
  "readable": true,
  "updatable": true,
  "type": "MULTI_RECORD",
  "relation": "DOCUMENT_TYPE",
  "fields": [{
    "name": "notes",
    "type": "text",
    "dictionary": null,
    "searchable": false,
    "bulkEdit": false,
    "phi": false,
    "meta": {
      "required": false
    }
  }]
}, ...
]
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types
  3. HTTP Response Codes: 200

Get Document Type By Name

The above request returns JSON structured like this:

{
  "id": "be91b865-d60e-434d-86f8-e47489d75a12",
  "name": "doc-type-assessment",
  "title": "Assessment",
  "label": "Assessment",
  "version": 45,
  "internal": true,
  "readable": true,
  "updatable": true,
  "type": "MULTI_RECORD",
  "relation": "DOCUMENT_TYPE",
  "fields": [{
    "name": "notes",
    "type": "text",
    "dictionary": null,
    "searchable": false,
    "bulkEdit": false,
    "phi": false,
    "meta": {
      "required": false
    }
  }]
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types/doc-type-assessment
  3. HTTP Response Codes: 200

Create Document Type

The above request returns JSON structured like this:

{
  "id": "be91b865-d60e-434d-86f8-e47489d75a12",
  "name": "doc-type-assessment",
  "title": "Assessment",
  "label": "Assessment",
  "version": 45,
  "internal": true,
  "readable": true,
  "updatable": true,
  "type": "MULTI_RECORD",
  "relation": "DOCUMENT_TYPE",
  "fields": [{
    "name": "notes",
    "type": "text",
    "dictionary": null,
    "searchable": false,
    "bulkEdit": false,
    "phi": false,
    "meta": {
      "required": false
    }
  }]
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types/
  3. HTTP Response Codes: 201

Update Document Type

The above request returns JSON structured like this:

{
  "id": "be91b865-d60e-434d-86f8-e47489d75a12",
  "name": "doc-type-assessment",
  "title": "Assessment",
  "label": "Assessment",
  "version": 45,
  "internal": true,
  "readable": true,
  "updatable": true,
  "type": "MULTI_RECORD",
  "relation": "DOCUMENT_TYPE",
  "fields": [{
    "name": "notes",
    "type": "text",
    "dictionary": null,
    "searchable": false,
    "bulkEdit": false,
    "phi": false,
    "meta": {
      "required": false
    }
  }]
}
  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types/doc-type-assessment
  3. HTTP Response Codes: 200

Delete Document Type

  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/formations/current/document-types/doc-type-assessment
  3. HTTP Response Code: 200

Get Document Type Record

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/doc-type-docusign`", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "b34b45b7-18f6-42ee-bd64-26a039205ed1",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "notes": "some notes...",
    "created_at": "2021-05-04T16:44:46.623Z",
    "source_type": "DOCUMENT_SUMMARY",
    "external_id": null,
    "created_by_name": null,
    "created_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "updated_by_name": null,
    "updated_at": "2021-05-04T16:44:46.623Z",
    "updated_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
    "source_id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_name": "DOCUMENT_SUMMARY"
  }
}
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/doc-type-docusign
  3. HTTP Response Codes: 200

Create Document Type Record

The above request returns JSON structured like this:

{
  "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "b34b45b7-18f6-42ee-bd64-26a039205ed1",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "notes": "some notes...",
    "created_at": "2021-05-04T16:44:46.623Z",
    "source_type": "DOCUMENT_SUMMARY",
    "external_id": null,
    "created_by_name": null,
    "created_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "updated_by_name": null,
    "updated_at": "2021-05-04T16:44:46.623Z",
    "updated_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
    "source_id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_name": "DOCUMENT_SUMMARY"
  }
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/doc-type-docusign
  3. HTTP Response Codes: 201

Update Document Type Record

The above request returns JSON structured like this:

{
  "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
  "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
  "cdtId": "b34b45b7-18f6-42ee-bd64-26a039205ed1",
  "version": 45,
  "jsonBody": {
    "external_guid": null,
    "notes": "some notes...",
    "created_at": "2021-05-04T16:44:46.623Z",
    "source_type": "DOCUMENT_SUMMARY",
    "external_id": null,
    "created_by_name": null,
    "created_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "updated_by_name": null,
    "updated_at": "2021-05-04T16:44:46.623Z",
    "updated_by": "36ba66b6-305c-4664-b343-b2e1dd2dd611",
    "id": "cf10883b-8510-4aeb-a7b6-7e3a6e0f0f2d",
    "source_id": "4a59584c-af30-49c4-8601-b43b4fbeb741",
    "source_name": "DOCUMENT_SUMMARY"
  }
}
  1. HTTP Method: PUT
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/doc-type-docusign
  3. HTTP Response Codes: 200

Delete Document Type Record

  1. HTTP Method: DELETE
  2. HTTP URL: https://api.live.welkincloud.io/welkonnect/commcenter/patients/ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8/document-summary/4a59584c-af30-49c4-8601-b43b4fbeb741/doc-type-docusign
  3. HTTP Response Code: 200

Dictionaries

APIs for working with dictionary infrastructure: records and formation There are 3 dictionaries by default: 1. Timezone(timezone) - cannot be changed or populated 2. CPT(cpt) and ICD-10(icd-10) - cannot be changed, but can be populated

Dictionary records

Description

Get all dictionary records by name

HTTP Request

GET /{tenantName}/{instanceName}/dictionaries/{dictionaryName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt

Response

{
    "dictionaryName": "cpt",
    "lastUpdatedAt": "2021-05-11T07:08:37.209Z",
    "records": [
        {
            "id": "eb5d2e64-0f10-4014-b54d-7720028af60f",
            "createdAt": "2021-05-11T07:08:37.192Z",
            "updatedAt": "2021-05-11T07:08:37.192Z",
            "fullValue": "2222",
            "deleted": false,
            "values": {
                "value": "2222"
            }
        },
        {
            "id": "017e9b2f-c82d-4262-af0d-4827b7fb65c4",
            "createdAt": "2021-05-11T07:08:37.209Z",
            "updatedAt": "2021-05-11T07:08:37.209Z",
            "fullValue": "3333",
            "deleted": false,
            "values": {
                "value": "3333"
            }
        },
        {
            "id": "001806e2-3464-40b2-8adb-e756abe31fb1",
            "createdAt": "2021-04-09T09:24:44.566Z",
            "updatedAt": "2021-04-09T09:24:44.566Z",
            "fullValue": "1111",
            "deleted": false,
            "values": {
                "value": "1111"
            }
        }
    ]
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string
dateStart args From updated_at value no ISO datetime
dateEnd args Before updated_at value no ISO datetime
showDeleted args Show or hide deleted records no boolean

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get dictionary record by name and id

HTTP Request

GET /{tenantName}/{instanceName}/dictionaries/{dictionaryName}/{dictionaryRecordId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt/001806e2-3464-40b2-8adb-e756abe31fb1

Response

{
     "id": "001806e2-3464-40b2-8adb-e756abe31fb1",
     "createdAt": "2021-04-09T09:24:44.566Z",
     "updatedAt": "2021-04-09T09:24:44.566Z",
     "fullValue": "1111",
     "deleted": false,
     "values": {
         "value": "1111"
     }
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string
dictionaryRecordId path Record ID Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Add value to dictionary

HTTP Request

POST /{tenantName}/{instanceName}/dictionaries/{dictionaryName}

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt

Request

{
    "records": [
        {
            "values": {
                "value": "4444"
            }
        }
    ]
}

Response

{
    "dictionaryName": "cpt",
    "lastUpdatedAt": "2021-06-15T10:59:43.568Z",
    "records": [
        {
            "id": "e5df4668-18c0-4551-8021-3e0168ffbbb4",
            "createdAt": "2021-06-15T10:59:43.568Z",
            "updatedAt": "2021-06-15T10:59:43.568Z",
            "fullValue": "4444",
            "deleted": false,
            "values": {
                "value": "4444"
            }
        }
    ]
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Remove all values from dictionary and set new. Records will be deleted completely

HTTP Request

PUT /{tenantName}/{instanceName}/dictionaries/{dictionaryName}

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt

Request

{
    "records": [
        {
            "values": {
                "value": "6666"
            }
        },
        {
            "values": {
                "value": "7777"
            }
        }
    ]
}

Response

{
    "dictionaryName": "cpt",
    "lastUpdatedAt": "2021-06-15T11:22:16.546Z",
    "records": [
        {
            "id": "7599f47b-4a66-439a-9bf6-c51877900a41",
            "createdAt": "2021-06-15T11:22:16.543Z",
            "updatedAt": "2021-06-15T11:22:16.543Z",
            "fullValue": "6666",
            "deleted": false,
            "values": {
                "value": "6666"
            }
        },
        {
            "id": "0de7e286-4c57-49b2-8ace-b064fc9a6c3e",
            "createdAt": "2021-06-15T11:22:16.546Z",
            "updatedAt": "2021-06-15T11:22:16.546Z",
            "fullValue": "7777",
            "deleted": false,
            "values": {
                "value": "7777"
            }
        }
    ]
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update dictionary record by name and id

HTTP Request

PUT /{tenantName}/{instanceName}/dictionaries/{dictionaryName}/{dictionaryRecordId}

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt/001806e2-3464-40b2-8adb-e756abe31fb1

Request

{
    "values": {
        "value": "4445"
    }
}

Response

{
    "id": "001806e2-3464-40b2-8adb-e756abe31fb1",
    "createdAt": "2021-04-09T09:24:44.566Z",
    "updatedAt": "2021-06-15T11:18:31.233Z",
    "fullValue": "4445",
    "deleted": false,
    "values": {
        "value": "4445"
    }
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string
dictionaryRecordId path Record ID Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete dictionary record by name and id

HTTP Request

DELETE /{tenantName}/{instanceName}/dictionaries/{dictionaryName}/{dictionaryRecordId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/dictionaries/cpt/001806e2-3464-40b2-8adb-e756abe31fb1

Response

{
    "id": "001806e2-3464-40b2-8adb-e756abe31fb1",
    "createdAt": "2021-04-09T09:24:44.566Z",
    "updatedAt": "2021-06-15T11:19:48.993Z",
    "fullValue": "4445",
    "deleted": true,
    "values": {
        "value": "4445"
    }
}

Parameters

Name Located in Description Required Type
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string
dictionaryRecordId path Record ID Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Dictionary formation

Description

Get all dictionary formations

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/dictionaries

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/dictionaries

Response

[
    {
        "name": "cpt",
        "title": "CPT",
        "internal": false,
        "fields": [
            {
                "name": "value",
                "type": "text"
            }
        ]
    },
    {
        "name": "icd-10",
        "title": "ICD-10",
        "internal": false,
        "fields": [
            {
                "name": "value",
                "type": "text"
            }
        ]
    },
    {
        "name": "timezone",
        "title": "Timezone",
        "internal": true,
        "fields": [
            {
                "name": "timezone",
                "type": "text"
            }
        ]
    }
]

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get dictionary formation by name

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/dictionaries/{dictionaryName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/dictionaries/timezone

Response

{
    "name": "timezone",
    "title": "Timezone",
    "internal": true,
    "fields": [
        {
            "name": "timezone",
            "type": "text"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string
dictionaryName path Name of dictionary Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Create new dictionary formation

HTTP Request

POST /{tenantName}/{instanceName}/formations/draft/dictionaries

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/formations/draft/dictionaries

Request

{
    "name": "alphabet",
    "title": "Alphabet",
    "fields": [
        {
            "name": "lowercase-character",
            "type": "text"
        },
        {
            "name": "uppercase-character",
            "type": "text"
        }
    ]
}

Response

{
    "name": "alphabet",
    "title": "Alphabet",
    "internal": false,
    "fields": [
        {
            "name": "lowercase-character",
            "type": "text"
        },
        {
            "name": "uppercase-character",
            "type": "text"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update dictionary formation by name

HTTP Request

PUT /{tenantName}/{instanceName}/formations/draft/dictionaries/{dictionaryName}

in our example it would be:

PUT `https://api.live.welkincloud.io/gh/sb-demo/formations/draft/dictionaries/alphabet

Request

{
    "name": "alphabet",
    "title": "Alphabet",
    "fields": [
        {
            "name": "character",
            "type": "text"
        }
    ]
}

Response

{
    "name": "alphabet",
    "title": "Alphabet",
    "internal": false,
    "fields": [
        {
            "name": "character",
            "type": "text"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete dictionary formation by name

HTTP Request

DELETE /{tenantName}/{instanceName}/formations/draft/dictionaries/{dictionaryName}

in our example it would be:

DELETE `https://api.live.welkincloud.io/gh/sb-demo/formations/draft/dictionaries/alphabet

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
dictionaryName path Name of dictionary Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Emails

Collection of all emails would be located at the following URL:

{{url}} / {{tenantName}} / {{instanceName}} / patients / {{patientId}} / emails

In our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails

Get all emails

GET request

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "content": [
    {
      "id": "92c6f2c6-61b7-46ad-b1a8-3ca541b88c0f",
      "sendNow": false,
      "scheduledAt": "2021-05-04T19:50:09.808Z",
      "sentAt": "2021-05-04T19:50:11.234Z",
      "receivedAt": null,
      "date": "2021-05-04T19:50:11.234Z",
      "careTeam": "Nick Snow",
      "patientInfo": "John Doe",
      "timezone": "America/Los_Angeles",
      "sender": "de23c848-65aa-45a1-bf7b-f1d36a6e4ebe",
      "from": "n.snow@dev.welkincloud.io",
      "receiver": "830b8744-2c0f-4750-ad6d-5c2c94ada65d",
      "to": "j.doe@gmail.com",
      "direction": "OUT",
      "externalId": "20210504195011.1.4A9919421A983FF7@dev.welkincloud.io",
      "starred": false,
      "senderName": "Nick Snow",
      "receiverName": "John Doe",
      "subject": "Email subject",
      "body": "Email body.",
      "status": "DELIVERED",
      "secure": false,
      "attachments": null
    }
    ....pagination links omitted
  ]
}

Following Query Parameters can be used to sort or find approporiately

We can use any combination of this parameters in single request: Example: {{url}}/{{tenantName}}/{{instanceName}}/patients/{{patientId}}/emails?status=DELIVERED,FAILED&email=some-email@email.com&starred=true

Parameter Description Examples
sort Allows one to specify the sort order of the returned emails collection https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?sort=firstName,desc
size When specified, size per page https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?size=20
page When specified, page number https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?page=1
search When specified, will execute a search based on subject and body fields https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?search=sometext
sender When specified, search by sender id https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?sender=de23c848-65aa-45a1-bf7b-f1d36a6e4ebe
receiver When specified, search by receiver id https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?sender=de23c848-65aa-45a1-bf7b-f1d36a6e4ebe
direction When specified, search by direction (IN or OUT) https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?direction=IN
starred When specified, search by starred (boolean value) field (as an important email) https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?starred=true
from When specified, search by 'from' email https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?from=test@gmail.com
to When specified, search by 'to' email https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?to=test@gmail.com
email When specified, search by 'to' or 'from' email https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?email=test@gmail.com
senderName When specified, search by sender name https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?senderName=Jon doe
receiverName When specified, search by receiver name https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?receiverName=Jon doe
status When specified, search by status [SCHEDULED, ACCEPTED, DELIVERED, REJECTED, FAILED, UNRECOGNISED] https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails?status=DELIVERED

Get email by id

{{url}} / {{tenantName}} / {{instanceName}} / patients / {{patientId}} / emails / {{uuid}}

GET request

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/emails/92c6f2c6-61b7-46ad-b1a8-3ca541b88c0f", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "id": "92c6f2c6-61b7-46ad-b1a8-3ca541b88c0f",
  "sendNow": false,
  "scheduledAt": "2021-05-04T19:50:09.808Z",
  "sentAt": "2021-05-04T19:50:11.234Z",
  "receivedAt": null,
  "date": "2021-05-04T19:50:11.234Z",
  "careTeam": "Nick Snow",
  "patientInfo": "John Doe",
  "timezone": "America/Los_Angeles",
  "sender": "de23c848-65aa-45a1-bf7b-f1d36a6e4ebe",
  "from": "n.snow@dev.welkincloud.io",
  "receiver": "830b8744-2c0f-4750-ad6d-5c2c94ada65d",
  "to": "j.doe@gmail.com",
  "direction": "OUT",
  "externalId": "20210504195011.1.4A9919421A983FF7@dev.welkincloud.io",
  "starred": false,
  "senderName": "Nick Snow",
  "receiverName": "John Doe",
  "subject": "Email subject",
  "body": "Email body.",
  "status": "DELIVERED",
  "secure": false,
  "attachments": null
}

Encounters

APIs for working with an encounter infrastructure: records, assessment links, comments, template, disposition, disposition-formation

Encounter records

Description

Get all encounter records by patient id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters

Response

{
    "data": [
        {
            "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
            "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
            "cdtId": "aedc7247-a561-4b02-9e2a-86433b092b05",
            "version": 207,
            "jsonBody": {
                "startDatetime": "2021-04-15T07:41:48.272Z",
                "calendarEventId": null,
                "calendarEvent": null,
                "external_guid": null,
                "notes": null,
                "activeUserId": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "description": "test2",
                "created_at": "2021-04-14T10:23:00.983Z",
                "dispositionId": "e0e3eaa8-5f52-4a14-b578-31e810ae9b48",
                "source_type": null,
                "external_id": null,
                "title": "test2",
                "activeUserName": "MY NAME",
                "created_by_name": "MY NAME",
                "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "updated_by_name": "MY NAME",
                "updated_at": "2021-04-15T07:42:06.637Z",
                "templateName": null,
                "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
                "source_id": null,
                "endDatetime": null,
                "source_name": null,
                "status": "OPEN"
            }
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all encounter records with related data by patient id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/full-encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/full-encounters

Response

{
    "data": [
        {
            "encounter": {encounter record},
            "disposition": {disposition record},
            "calendarEvent": {calendar event record},
            "userRelatedToCalendarEvent": {user record},
            "assessmentLinks": [assessment links],
            "comments": [comments]
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order
onlyWithCalendarEvent args Exclude all information not related to calendar event, except encounter record no boolean

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all encounter records by user id

HTTP Request

GET /{tenantName}/{instanceName}/users/{userId}/encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/users/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters

Response

{
    "data": [
        {
            "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
            "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
            "cdtId": "aedc7247-a561-4b02-9e2a-86433b092b05",
            "version": 207,
            "jsonBody": {
                "startDatetime": "2021-04-15T07:41:48.272Z",
                "calendarEventId": null,
                "calendarEvent": null,
                "external_guid": null,
                "notes": null,
                "activeUserId": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "description": "test2",
                "created_at": "2021-04-14T10:23:00.983Z",
                "dispositionId": "e0e3eaa8-5f52-4a14-b578-31e810ae9b48",
                "source_type": null,
                "external_id": null,
                "title": "test2",
                "activeUserName": "MY NAME",
                "created_by_name": "MY NAME",
                "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "updated_by_name": "MY NAME",
                "updated_at": "2021-04-15T07:42:06.637Z",
                "templateName": null,
                "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
                "source_id": null,
                "endDatetime": null,
                "source_name": null,
                "status": "OPEN"
            }
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
withCareTeam args If true, return only encounter thats belong to the patients in the user care team (default: true) no boolean
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all encounter records by client_id from jwt token (work for users and api_clients tokens)

HTTP Request

GET /{tenantName}/{instanceName}/encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/encounters

Response

{
    "data": [
        {
            "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
            "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
            "cdtId": "aedc7247-a561-4b02-9e2a-86433b092b05",
            "version": 207,
            "jsonBody": {
                "startDatetime": "2021-04-15T07:41:48.272Z",
                "calendarEventId": null,
                "external_guid": null,
                "notes": null,
                "activeUserId": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "description": "test2",
                "created_at": "2021-04-14T10:23:00.983Z",
                "dispositionId": "e0e3eaa8-5f52-4a14-b578-31e810ae9b48",
                "source_type": null,
                "external_id": null,
                "title": "test2",
                "activeUserName": "MY NAME",
                "created_by_name": "MY NAME",
                "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "updated_by_name": "MY NAME",
                "updated_at": "2021-04-15T07:42:06.637Z",
                "templateName": null,
                "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
                "source_id": null,
                "endDatetime": null,
                "source_name": null,
                "status": "OPEN"
            }
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all encounter records with related data by user id

HTTP Request

GET /{tenantName}/{instanceName}/users/{userId}/full-encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/users/f5b84d92-7989-45f4-bb5f-d85336c8e4b6/full-encounters

Response

{
    "data": [
        {
            "encounter": {encounter record},
            "disposition": {disposition record},
            "calendarEvent": {calendar event record},
            "userRelatedToCalendarEvent": {user record},
            "assessmentLinks": [assessment links],
            "comments": [comments]
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
withCareTeam args If true, return only encounter thats belong to the patients in the user care team (default: true) no boolean
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order
onlyWithCalendarEvent args Exclude all information not related to calendar event, except encounter record no boolean

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all encounter records with related data by client_id from jwt token (work for users and api_clients tokens)

HTTP Request

GET /{tenantName}/{instanceName}/full-encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/full-encounters

Response

{
    "data": [
        {
            "encounter": {encounter record},
            "disposition": {disposition record},
            "calendarEvent": {calendar event record},
            "userRelatedToCalendarEvent": {user record},
            "assessmentLinks": [assessment links],
            "comments": [comments]
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
statuses args Encounter status. Available statuses: DRAFT,OPEN,ACTIVE,FINALIZED no string array
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order
onlyWithCalendarEvent args Exclude all information not related to calendar event, except encounter record no boolean

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get encounter record by a patient id and encounter id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82

Response

{
            "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
            "patientId": "eac29796-6943-4307-bfe6-6b424d8b4b4b",
            "cdtId": "aedc7247-a561-4b02-9e2a-86433b092b05",
            "version": 207,
            "jsonBody": {
                "startDatetime": "2021-04-15T07:41:48.272Z",
                "calendarEvent": null,
                "calendarEventId": null,
                "external_guid": null,
                "notes": null,
                "activeUserId": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "description": "test2",
                "created_at": "2021-04-14T10:23:00.983Z",
                "dispositionId": "e0e3eaa8-5f52-4a14-b578-31e810ae9b48",
                "source_type": null,
                "external_id": null,
                "title": "test2",
                "activeUserName": "MY NAME",
                "created_by_name": "MY NAME",
                "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "updated_by_name": "MY NAME",
                "updated_at": "2021-04-15T07:42:06.637Z",
                "templateName": null,
                "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
                "id": "8208e50a-1a88-440d-8ad1-d847115cca89",
                "source_id": null,
                "endDatetime": null,
                "source_name": null,
                "status": "OPEN"
            }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get encounter record with all related data by a patient id and encounter id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/full-encounters/{encounterId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/full-encounters/7d72c423-48bc-4fc6-aa35-72a6cdd0c4ca

Response

{
    "data": [
        {
            "encounter": {encounter record},
            "disposition": {disposition record},
            "calendarEvent": {calendar event record},
            "userRelatedToCalendarEvent": {user record},
            "assessmentLinks": [assessment links],
            "comments": [comments]
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "firstPage": true,
        "lastPage": true
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Create an encounter for patient

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/encounters

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/620ef7f0-2ba9-48e1-8e0f-a47f40890bf4/encounters

Request

{
    "title": "Title",
    "description": "Description",
    "templateName": "Template name",
    "currentScheduledAppointment": {
        "eventTitle": "Title",
        "eventDescription": "Description",
        "allDayEvent": false,
        "eventMode": "IN-PERSON",
        "hostId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "eventType": "ENCOUNTER",
        "eventStatus": "Scheduled",
        "startDateTime": "2022-01-14T11:00:00.000Z",
        "endDateTime": "2022-01-14T12:00:00.000Z",
        "participants": [
            {
                "participantId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
                "participantRole": "psm"
            },
            {
                "participantId": "620ef7f0-2ba9-48e1-8e0f-a47f40890bf4",
                "participantRole": "patient"
            }
        ],
        "eventColor": "pink"
    }
}

Response

{
    "id": "b30355dd-ff65-4ae3-aab7-a1bdd0fddd79",
    "patientId": "620ef7f0-2ba9-48e1-8e0f-a47f40890bf4",
    "cdtId": "62f57364-789c-40a5-93dc-321412f4bb7b",
    "version": 21,
    "jsonBody": {
        "startDatetime": null,
        "local_updated_at": "2022-01-14T10:55:30.834+00:00",
        "external_guid": null,
        "notes": null,
        "description": "Description",
        "created_at": "2022-01-14T10:55:30.663Z",
        "external_id": null,
        "type": "Template name",
        "title": "Title",
        "activeUserName": null,
        "created_by_name": "superadmin",
        "currentScheduledAppointment": {Scheduled appointment record},
        "updated_by_name": "superadmin",
        "localCalendarEventStartDatetime": "2022-01-14T11:00:00.000+00:00",
        "updated_at": "2022-01-14T10:55:30.834Z",
        "ownerUserName": null,
        "id": "b30355dd-ff65-4ae3-aab7-a1bdd0fddd79",
        "source_name": null,
        "calendarEventId": "9000e0d8-0128-4240-822d-abd49f9fd474",
        "activeUserId": null,
        "calendarEvent": {Calendar event record},
        "calendarEventStartDatetime": "2022-01-14T11:00:00.000Z",
        "dispositionId": "55ef5bef-1654-47f8-b383-e23b24f70668",
        "source_type": null,
        "created_by": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "localEndDatetime": null,
        "local_created_at": "2022-01-14T10:55:30.663+00:00",
        "templateName": "Template name",
        "instruction": "",
        "ownerUserId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "updated_by": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "source_id": null,
        "endDatetime": null,
        "localStartDatetime": null,
        "status": "DRAFT"
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update encounter record by encounter id

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/620ef7f0-2ba9-48e1-8e0f-a47f40890bf4/encounters/b30355dd-ff65-4ae3-aab7-a1bdd0fddd79

Request

{
    "title": "Title",
    "description": "Description",
    "templateName": "template-1",
    "status": "OPEN",
    "currentScheduledAppointment": {
        "eventTitle": "Title",
        "eventDescription": "",
        "allDayEvent": false,
        "eventMode": "IN-PERSON",
        "hostId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "eventType": "ENCOUNTER",
        "eventStatus": "Scheduled",
        "startDateTime": "2022-01-15T11:00:00.000Z",
        "endDateTime": "2022-01-15T12:00:00.000Z",
        "participants": [
          {
            "participantId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
            "participantRole": "psm"
          },
          {
            "participantId": "620ef7f0-2ba9-48e1-8e0f-a47f40890bf4",
            "participantRole": "patient"
          }
        ],
        "eventColor": "pink"
    }
}

Response

{
    "id": "b30355dd-ff65-4ae3-aab7-a1bdd0fddd79",
    "patientId": "620ef7f0-2ba9-48e1-8e0f-a47f40890bf4",
    "cdtId": "62f57364-789c-40a5-93dc-321412f4bb7b",
    "version": 21,
    "jsonBody": {
        "startDatetime": "2022-01-14T11:21:10.300Z",
        "local_updated_at": "2022-01-14T11:24:46.478+00:00",
        "external_guid": null,
        "notes": null,
        "description": "Event description",
        "created_at": "2022-01-14T10:55:30.663Z",
        "external_id": null,
        "type": "etmp-new-encounter-template",
        "title": "Title",
        "activeUserName": "superadmin",
        "created_by_name": "superadmin",
        "currentScheduledAppointment": {Scheduled appointment record},
        "updated_by_name": "superadmin",
        "localCalendarEventStartDatetime": "2022-01-15T11:00:00.000+00:00",
        "updated_at": "2022-01-14T11:24:46.478Z",
        "ownerUserName": null,
        "id": "b30355dd-ff65-4ae3-aab7-a1bdd0fddd79",
        "source_name": null,
        "calendarEventId": "9000e0d8-0128-4240-822d-abd49f9fd474",
        "activeUserId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "calendarEvent": {Calendar event record},
        "calendarEventStartDatetime": "2022-01-15T11:00:00.000Z",
        "dispositionId": "55ef5bef-1654-47f8-b383-e23b24f70668",
        "source_type": null,
        "created_by": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "localEndDatetime": null,
        "local_created_at": "2022-01-14T10:55:30.663+00:00",
        "templateName": "etmp-new-encounter-template",
        "instruction": "",
        "ownerUserId": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "updated_by": "2e7cbb0b-5208-46c0-8ad8-67a310933dc1",
        "source_id": null,
        "endDatetime": null,
        "localStartDatetime": "2022-01-14T11:21:10.300+00:00",
        "status": "OPEN"
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete encounter record by encounter id

HTTP Request

DELETE /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Encounter comments

Description

Get all encounter comments by encounter id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/comments

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/comments

Response

[
    {
        "id": "0e692ed3-b250-42ee-a17b-f65e69efcc07",
        "createdAt": "2021-04-21T06:59:30.079Z",
        "updatedAt": "2021-04-21T06:59:30.079Z",
        "createdBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updatedBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "createdByName": "MY NAME",
        "updatedByName": "MY NAME",
        "encounterId": "d74e3745-3692-4555-acb6-e4db94643f56",
        "text": "comment1"
    },
    {
        "id": "45955cdb-8d72-4f02-905f-34f7c158c351",
        "createdAt": "2021-04-21T06:59:35.170Z",
        "updatedAt": "2021-04-21T06:59:35.170Z",
        "createdBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updatedBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "createdByName": "MY NAME",
        "updatedByName": "MY NAME",
        "encounterId": "d74e3745-3692-4555-acb6-e4db94643f56",
        "text": "comment2"
    }
]

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get encounter comment by encounter id and comment id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/comments/{commentId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/comments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Response

{
        "id": "0e692ed3-b250-42ee-a17b-f65e69efcc07",
        "createdAt": "2021-04-21T06:59:30.079Z",
        "updatedAt": "2021-04-21T06:59:30.079Z",
        "createdBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updatedBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "createdByName": "MY NAME",
        "updatedByName": "MY NAME",
        "encounterId": "d74e3745-3692-4555-acb6-e4db94643f56",
        "text": "comment1"
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
commentId path ID of comment Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Create a comment for encounter

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/comments

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/comments

Request

{
    "text": "comment"
}

Response

{
        "id": "0e692ed3-b250-42ee-a17b-f65e69efcc07",
        "createdAt": "2021-04-21T06:59:30.079Z",
        "updatedAt": "2021-04-21T06:59:30.079Z",
        "createdBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updatedBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "createdByName": "MY NAME",
        "updatedByName": "MY NAME",
        "encounterId": "d74e3745-3692-4555-acb6-e4db94643f56",
        "text": "comment"
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update comment for encounter by comment id

HTTP Request

PUT /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/comments/{commentId}

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/comments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Request

{
    "text": "comment2"
}

Response

{
        "id": "0e692ed3-b250-42ee-a17b-f65e69efcc07",
        "createdAt": "2021-04-21T06:59:30.079Z",
        "updatedAt": "2021-04-21T06:59:30.079Z",
        "createdBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "updatedBy": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "createdByName": "MY NAME",
        "updatedByName": "MY NAME",
        "encounterId": "d74e3745-3692-4555-acb6-e4db94643f56",
        "text": "comment2"
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
commentId path ID of comment Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete comment for encounter by comment id

HTTP Request

DELETE /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/comments/{commentId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/comments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
commentId path ID of comment Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get all assessment links by encounter id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/assessments

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/assessments

Response

[
    {
        "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
        "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
        "cdtId": "0c9ce071-7dca-4714-8350-f75cbf01f2da",
        "version": 192,
        "jsonBody": {
            "created_at": "2021-03-30T10:31:11.151Z",
            "source_type": "ENCOUNTER",
            "fromTemplate": false,
            "created_by_name": "MY NAME",
            "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "relation": "ASSESSMENT",
            "updated_by_name": "MY NAME",
            "updated_at": "2021-03-30T10:31:11.151Z",
            "assessmentName": "ccc",
            "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
            "source_id": "91996e95-fa68-4f28-be9b-3d108cf081a8",
            "assessmentRecordId": null,
            "source_name": "__encounter__"
        }
    },
    {
        "id": "e88a7909-438f-4584-b219-0ce538bb24d8",
        "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
        "cdtId": "019b8736-5769-40a3-af22-787421e68b7e",
        "version": 191,
        "jsonBody": {
            "created_at": "2021-03-30T09:42:26.250Z",
            "source_type": "ENCOUNTER",
            "fromTemplate": true,
            "created_by_name": "MY NAME",
            "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "relation": "ASSESSMENT",
            "updated_by_name": "MY NAME",
            "updated_at": "2021-03-30T09:42:26.250Z",
            "assessmentName": "wel-1388",
            "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "id": "e88a7909-438f-4584-b219-0ce538bb24d8",
            "source_id": "91996e95-fa68-4f28-be9b-3d108cf081a8",
            "assessmentRecordId": null,
            "source_name": "__encounter__"
        }
    }
]

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get assessment link by encounter id and assessment link id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/assessments/{encounterAssessmentId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/assessments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Response

{
        "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
        "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
        "cdtId": "0c9ce071-7dca-4714-8350-f75cbf01f2da",
        "version": 192,
        "jsonBody": {
            "created_at": "2021-03-30T10:31:11.151Z",
            "source_type": "ENCOUNTER",
            "fromTemplate": false,
            "created_by_name": "MY NAME",
            "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "relation": "ASSESSMENT",
            "updated_by_name": "MY NAME",
            "updated_at": "2021-03-30T10:31:11.151Z",
            "assessmentName": "ccc",
            "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
            "source_id": "91996e95-fa68-4f28-be9b-3d108cf081a8",
            "assessmentRecordId": null,
            "source_name": "__encounter__"
        }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
encounterAssessmentId path ID of assessment link Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Create an assessment link for encounter

HTTP Request

POST /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/assessments

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/assessments

Request

{
    "assessmentName": "some-form",
    "assessmentRecordId": null
}

Response

{
        "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
        "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
        "cdtId": "0c9ce071-7dca-4714-8350-f75cbf01f2da",
        "version": 192,
        "jsonBody": {
            "created_at": "2021-03-30T10:31:11.151Z",
            "source_type": "ENCOUNTER",
            "fromTemplate": false,
            "created_by_name": "MY NAME",
            "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "relation": "ASSESSMENT",
            "updated_by_name": "MY NAME",
            "updated_at": "2021-03-30T10:31:11.151Z",
            "assessmentName": "some-form",
            "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
            "source_id": "91996e95-fa68-4f28-be9b-3d108cf081a8",
            "assessmentRecordId": null,
            "source_name": "__encounter__"
        }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update assessment link for encounter by assessment link id

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/assessments/{encounterAssessmentId}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/assessments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Request

{
    "assessmentRecordId": "196f6201-78bb-4a34-8334-4b969699772b"
}

Response

{
        "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
        "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
        "cdtId": "0c9ce071-7dca-4714-8350-f75cbf01f2da",
        "version": 192,
        "jsonBody": {
            "created_at": "2021-03-30T10:31:11.151Z",
            "source_type": "ENCOUNTER",
            "fromTemplate": false,
            "created_by_name": "MY NAME",
            "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "relation": "ASSESSMENT",
            "updated_by_name": "MY NAME",
            "updated_at": "2021-03-30T10:31:11.151Z",
            "assessmentName": "some-form",
            "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
            "id": "44b6c521-b85f-47a5-9c93-7c5d56c19efb",
            "source_id": "91996e95-fa68-4f28-be9b-3d108cf081a8",
            "assessmentRecordId": "196f6201-78bb-4a34-8334-4b969699772b",
            "source_name": "__encounter__"
        }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
encounterAssessmentId path ID of assessment link Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete assessment link for encounter by assessment link id

HTTP Request

DELETE /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/assessments/{encounterAssessmentId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/assessments/0e692ed3-b250-42ee-a17b-f65e69efcc07

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID
encounterAssessmentId path ID of assessment link Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Encounter disposition record

Description

Get disposition for encounter

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/disposition

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/disposition

Response

{
    "id": "b4d5fd02-50c6-4a47-9fdc-65e6e97c841d",
    "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
    "cdtId": "8ba794c6-2265-4574-8618-8f5e449b1889",
    "version": 191,
    "jsonBody": {
        "updated_by_name": "MY NAME",
        "updated_at": "2021-03-29T12:31:06.529Z",
        "cpt": null,
        "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "created_at": "2021-03-29T12:29:57.307Z",
        "source_type": "ENCOUNTER",
        "id": "b4d5fd02-50c6-4a47-9fdc-65e6e97c841d",
        "source_id": "336ae731-c674-4b85-941a-ef3b37d93b82",
        "icd-10": "val",
        "created_by_name": "MY NAME",
        "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "source_name": "__encounter__"
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update disposition for encounter

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/encounters/{encounterId}/disposition

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/d6ea79ce-d3d6-4c2d-a27e-e4d1207f60f1/encounters/336ae731-c674-4b85-941a-ef3b37d93b82/disposition

Request

{
    "cpt": null,
    "icd-10": null
}

Response

{
    "id": "b4d5fd02-50c6-4a47-9fdc-65e6e97c841d",
    "patientId": "552f1ea6-960e-4b3c-be50-35d7a1d01fc4",
    "cdtId": "8ba794c6-2265-4574-8618-8f5e449b1889",
    "version": 191,
    "jsonBody": {
        "updated_by_name": "MY NAME",
        "updated_at": "2021-03-29T12:31:06.529Z",
        "cpt": null,
        "updated_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "created_at": "2021-03-29T12:29:57.307Z",
        "source_type": "ENCOUNTER",
        "id": "b4d5fd02-50c6-4a47-9fdc-65e6e97c841d",
        "source_id": "336ae731-c674-4b85-941a-ef3b37d93b82",
        "icd-10": null,
        "created_by_name": "MY NAME",
        "created_by": "f5b84d92-7989-45f4-bb5f-d85336c8e4b6",
        "source_name": "__encounter__"
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterId path ID of encounter Yes UUID

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Encounter disposition formation

Description

Get disposition formation

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/encounter-disposition

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/encounter-disposition

Response

{
    "id": "c8578422-7369-45d3-b8ff-e4d6a9dc99f9",
    "name": "__encounter_disposition__",
    "title": null,
    "label": null,
    "version": 218,
    "internal": true,
    "readable": true,
    "updatable": true,
    "type": "MULTI_RECORD",
    "relation": "ENCOUNTER_DISPOSITION",
    "fields": [
        {
            "name": "notes",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_at",
            "type": "datetime",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_by",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_by_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_at",
            "type": "datetime",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_by",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_by_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_type",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "external_id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "external_guid",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        }
    ],
    "_containsPHI": false
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update disposition formation

HTTP Request

PUT /{tenantName}/{instanceName}/formations/draft/encounter-disposition

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/formations/draft/encounter-disposition

Request

{
    "name": "__encounter_disposition__",
    "fields": [
        {
            "name": "icd-10",
            "type": "text",
            "meta": {
                "required": true
            }
        },
        {
            "name": "cpt",
            "type": "select",
            "dictionary": {
                "name": "cpt",
                "field": "value"
            },
            "meta": {
                "required": false
            }
        }
    ]
}

Response

{
    "id": "c8578422-7369-45d3-b8ff-e4d6a9dc99f9",
    "name": "__encounter_disposition__",
    "title": null,
    "label": null,
    "version": 218,
    "internal": true,
    "readable": true,
    "updatable": true,
    "type": "MULTI_RECORD",
    "relation": "ENCOUNTER_DISPOSITION",
    "fields": [
          {
           "name": "icd-10",
           "type": "text",
           "dictionary": null,
           "searchable": false,
           "bulkEdit": false,
           "phi": false,
           "meta": {
               "required": false
           }
        },
        {
        "name": "cpt",
        "type": "select",
        "dictionary": {
           "name": "cpt",
           "field": "value"
        },
        "searchable": false,
         "bulkEdit": false,
         "phi": false,
         "meta": {
             "required": false
         }
        },
        {
            "name": "id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_at",
            "type": "datetime",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_by",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "created_by_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_at",
            "type": "datetime",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_by",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "updated_by_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_name",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_type",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "source_id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "external_id",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        },
        {
            "name": "external_guid",
            "type": "text",
            "dictionary": null,
            "searchable": false,
            "bulkEdit": false,
            "phi": false,
            "meta": {
                "required": false
            }
        }
    ],
    "_containsPHI": false
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Encounter templates

Description

Get all encounter templates

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/encounters

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/encounters

Response

[
    {
        "id": "a2063f42-395c-469f-8f4e-825af9223bef",
        "name": "temp-1",
        "title": "MyTitle",
        "assessmentNames": [
            "assessment-1"
        ]
    },
    {
        "id": "fdfea00b-e7f5-4c31-a7a0-affda858a9f6",
        "name": "temp-2",
        "title": "MyTitle",
        "assessmentNames": [
            "assessment-2"
        ]
    }
]

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Get encounter template by name

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/encounters/{encounterTemplateName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/encounters/temp-1

Response

{
        "id": "a2063f42-395c-469f-8f4e-825af9223bef",
        "name": "temp-1",
        "title": "MyTitle",
        "assessmentNames": [
            "assessment-1"
        ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string
encounterTemplateName path Name of template Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Create a template for encounter

HTTP Request

POST /{tenantName}/{instanceName}/formations/draft/encounters

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/formations/draft/encounters

Request

{
    "name": "temp-1",
    "title": "MyTitle",
    "assessmentNames": [
        "assessment-1"
    ]
}

Response

{
        "id": "a2063f42-395c-469f-8f4e-825af9223bef",
        "name": "temp-1",
        "title": "MyTitle",
        "assessmentNames": [
            "assessment-1"
        ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Description

Update encounter template by encounter template name

HTTP Request

PUT /{tenantName}/{instanceName}/formations/draft/encounters/{encounterTemplateName}

in our example it would be:

PUT `https://api.live.welkincloud.io/gh/sb-demo/formations/draft/encounters/temp-1

Request

{
    "name": "temp-1",
    "title": "MyTitle",
    "assessmentNames": [
        "assessment-2"
    ]
}

Response

{
        "id": "a2063f42-395c-469f-8f4e-825af9223bef",
        "name": "temp-1",
        "title": "MyTitle",
        "assessmentNames": [
            "assessment-2"
        ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterTemplateName path Name of template Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Description

Delete encounter template by template name

HTTP Request

DELETE /{tenantName}/{instanceName}/formations/draft/encounters/{encounterTemplateName}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/formations/draft/encounters/336ae731-c674-4b85-941a-ef3b37d93b82

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
encounterTemplateName path Name of template Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Export

GET request for export assessments. Similar responses will be when exporting PFA

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/ASSESSMENT", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "28c7663e-3516-4c65-b0f7-9b5428fc7cd5",
      "createdAt": "2022-02-23T14:49:29.846Z",
      "updatedAt": "2022-02-23T14:49:34.810Z",
      "createdBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
      "updatedBy": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
      "createdByName": "User Name",
      "updatedByName": "User Name",
      "finalizedDate": "2022-02-23T14:49:34.806Z",
      "assessmentName": "asm-some-name",
      "assessmentTitle": "Some name",
      "assessmentCdtName": "_asm-some-name",
      "version": 266,
      "patientId": "6a0d3eec-a989-47d0-8530-6eb538c4a752",
      "status": "COMPLETED",
      "cdtRecordId": "d97b1345-ca39-427a-8678-cefbc0e77302",
      "scoringRecordId": null,
      "answers": {
        "external_guid": null,
        "created_at": "2022-02-23T14:49:29.934Z",
        "external_id": null,
        "source_type": "ASSESSMENT",
        "created_by_name": "User Name",
        "created_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
        "updated_by_name": "User Name",
        "updated_at": "2022-02-23T14:49:33.012Z",
        "cdt-simple-text__cdtf-text1": "Simle text answer",
        "updated_by": "5bb3529c-2d44-479f-9f37-0e64aa1ce70d",
        "id": "d97b1345-ca39-427a-8678-cefbc0e77302",
        "source_id": "28c7663e-3516-4c65-b0f7-9b5428fc7cd5",
        "source_name": "asm-some-name"
      },
      "scoring": {},
      "questions": {
        "cdt-simple-text__cdtf-text1": "Question 1?"
      }
    }
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export CDT records.

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/CDT_RECORD", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
    "data": [
        {
            "id": "5ad6efbe-4ade-450f-a5ff-3cd965669fc1",
            "patientId": "5d44f40f-ccd7-4197-9633-20d87ef68e82",
            "cdtId": "79b22f1a-6e05-46dd-8672-8e0be2a4be92",
            "version": 2,
            "cdtName": "some-cdt-name",
            "jsonBody": {
                "updated_by_name": null,
                "external_guid": null,
                "updated_at": "2021-08-05T12:56:22.888Z",
                "updated_by": "84c3a701-0a2d-4209-bc97-29529c37b5ee",
                "created_at": "2021-08-05T12:56:22.888Z",
                "source_type": null,
                "external_id": null,
                "id": "5ad6efbe-4ade-450f-a5ff-3cd965669fc1",
                "source_id": null,
                "created_by_name": null,
                "created_by": "84c3a701-0a2d-4209-bc97-29529c37b5ee",
                "source_name": null
            }
        },
    ... other records are omitted
    ],
    "cursor": {
        "start": null,
        "end": "2021-08-10T13:32:02.528Z",
        "hasNext": false,
        "pageSize": 1000
    }
}

GET request for export calendar events

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/CALENDAR_EVENT", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "868b2ab6-7a42-4f9c-b083-ae185c780289",
      "createdBy": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
      "createdAt": "2021-02-02T21:43:11.000Z",
      "updatedBy": null,
      "updatedAt": "2021-02-02T21:43:19.996Z",
      "externalId": null,
      "externalIdUpdatedAt": "2021-06-17T09:19:11.467Z",
      "eventTitle": "Eat",
      "eventDescription": "",
      "startDateTime": "2021-02-02T13:00:00.000Z",
      "localStartDateTime": "2021-02-02T13:00:00.000+00:00",
      "endDateTime": "2021-02-02T14:00:00.000Z",
      "localEndDateTime": "2021-02-02T14:00:00.000+00:00",
      "allDayEvent": false,
      "duration": 3600,
      "eventType": "GROUP_THERAPY",
      "eventStatus": "RESCHEDULED",
      "eventMode": "IN-PERSON",
      "eventColor": null,
      "hostId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
      "timezone": null,
      "additionalInfo": {},
      "participants": [
        {
          "id": "84096745-e356-474c-9496-c65d99ae7545",
          "participantId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "participantRole": "psm",
          "participationStatus": "Yes",
          "attended": false,
          "timezone": null,
          "firstName": null,
          "lastName": null,
          "deleted": null,
          "hasAccess": null,
          "email": null,
          "phone": null,
          "gender": null,
          "birthDate": null,
          "enabled": null
        }
      ]
    }
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export emails

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/EMAIL", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "bd4f761a-e5d9-435e-b584-25451dd96316",
      "updatedAt": "2021-01-18T16:21:04.253Z",
      "sendNow": false,
      "scheduledAt": "2021-01-18T16:20:38.124Z",
      "sentAt": "2021-01-18T16:21:01.000Z",
      "receivedAt": null,
      "deletedAt": null,
      "date": "2021-01-18T16:21:01.000Z",
      "careTeam": "some.email@mail.com",
      "patientInfo": "vlad7101243@gmail.com",
      "timezone": "America/New_York",
      "sender": "9542d367-662c-49be-82b6-3ad910dad9d0",
      "from": "some.email@mail.com",
      "receiver": "94feeaf8-c93d-4420-a049-f18a7437e492",
      "to": "receiver@gmail.com",
      "direction": "OUT",
      "externalId": "20210118162038.1.CA7B4D3635992791@dev.welkincloud.io",
      "starred": false,
      "senderName": null,
      "receiverName": null,
      "errorMessage": null,
      "assignedBy": null,
      "assignedByName": null,
      "hasHistory": false,
      "unrecognized": false,
      "subject": "Some subject",
      "body": "Some body",
      "status": "DELIVERED",
      "secure": false,
      "attachments": null,
      "messageType": "CARE_TEAM",
      "bodyType": "PLAIN_TEXT"
    }
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export encounters

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/ENCOUNTER", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "825e986f-390c-42b7-b8ab-ee5cb14868be",
      "patientId": "ed468aba-7fdb-4603-9ed0-d58b7d5933e7",
      "cdtId": "9c04b687-b31f-49e4-8824-035971875ee3",
      "version": 61,
      "jsonBody": {
        "startDatetime": null,
        "external_guid": null,
        "notes": null,
        "description": "",
        "created_at": "2021-06-16T22:07:47.608Z",
        "external_id": null,
        "type": "Custom",
        "title": "Regular",
        "activeUserName": null,
        "created_by_name": "Ado Moshe",
        "currentScheduledAppointment": {
          "id": "0f47a510-581e-4528-beac-555ac54d408e",
          "hostId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "duration": 3600,
          "createdAt": "2021-06-16T10:07:46.914Z",
          "createdBy": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "eventMode": "IN-PERSON",
          "eventType": "ENCOUNTER",
          "updatedAt": "2021-06-16T10:07:46.914Z",
          "updatedBy": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "eventColor": "pink",
          "eventTitle": "Regular",
          "externalId": null,
          "allDayEvent": false,
          "endDateTime": "2021-06-17T12:15:46.587Z",
          "eventStatus": "Scheduled",
          "participants": [
            {
              "id": "1fe9711f-563b-4bd7-942e-e7cfbec55143",
              "attended": false,
              "participantId": "ed468aba-7fdb-4603-9ed0-d58b7d5933e7",
              "participantRole": "patient",
              "participationStatus": ""
            },
            {
              "id": "90c06fac-e296-41ff-8ab8-0a1dd3b63b7b",
              "attended": false,
              "participantId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
              "participantRole": "psm",
              "participationStatus": ""
            }
          ],
          "startDateTime": "2021-06-16T11:15:46.587Z",
          "additionalInfo": {},
          "eventDescription": "",
          "externalIdUpdatedAt": "2021-06-17T09:19:11.467Z"
        },
        "updated_by_name": "Ado Moshe",
        "updated_at": "2021-06-16T22:07:48.356Z",
        "id": "825e986f-390c-42b7-b8ab-ee5cb14868be",
        "source_name": null,
        "calendarEventId": "0f47a510-581e-4528-beac-555ac54d408e",
        "activeUserId": null,
        "calendarEvent": {
          "id": "0f47a510-581e-4528-beac-555ac54d408e",
          "hostId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "duration": 3600,
          "createdAt": "2021-06-16T10:07:46.914Z",
          "createdBy": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "eventMode": "IN-PERSON",
          "eventType": "ENCOUNTER",
          "updatedAt": "2021-06-16T10:07:46.914Z",
          "updatedBy": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
          "eventColor": "pink",
          "eventTitle": "Regular",
          "externalId": null,
          "allDayEvent": false,
          "endDateTime": "2021-06-17T12:15:46.587Z",
          "eventStatus": "Scheduled",
          "participants": [
            {
              "id": "1fe9711f-563b-4bd7-942e-e7cfbec55143",
              "attended": false,
              "participantId": "ed468aba-7fdb-4603-9ed0-d58b7d5933e7",
              "participantRole": "patient",
              "participationStatus": ""
            },
            {
              "id": "90c06fac-e296-41ff-8ab8-0a1dd3b63b7b",
              "attended": false,
              "participantId": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
              "participantRole": "psm",
              "participationStatus": ""
            }
          ],
          "startDateTime": "2021-06-16T11:15:46.587Z",
          "additionalInfo": {},
          "eventDescription": "",
          "externalIdUpdatedAt": "2021-06-17T09:19:11.467Z"
        },
        "calendarEventStartDatetime": null,
        "dispositionId": "3e24b7d0-36d8-46cd-8e97-391cdf1f7bd1",
        "source_type": null,
        "created_by": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
        "templateName": "regular",
        "updated_by": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
        "source_id": null,
        "endDatetime": null,
        "status": "DRAFT"
      },
      "cdtName": "__encounter__"
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export encounter comments

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/ENCOUNTER_COMMENT", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "b9ca20c9-fe46-4526-af09-43ea032d1e80",
      "createdAt": "2021-07-06T10:25:15.771Z",
      "updatedAt": "2021-07-06T10:25:15.771Z",
      "createdBy": "d1a84079-9f70-4e9b-ab71-097b82561cd3",
      "updatedBy": "d1a84079-9f70-4e9b-ab71-097b82561cd3",
      "createdByName": "Slava Admin",
      "updatedByName": "Slava Admin",
      "encounterId": "1f4d73bb-963e-4f43-b20f-9f5dc6092870",
      "text": "comment 01",
      "cursorAttribute": "2021-07-06T10:25:15.771Z"
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export encounter disposition

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/ENCOUNTER_DISPOSITION", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "4ee660ab-0e8f-404e-bb60-5a71105ae574",
      "patientId": "ee66e8e8-6ce1-40d3-b6cb-e5727c5347c8",
      "cdtId": "26af1fa8-8314-43f9-92ca-1e72db4d70c7",
      "version": 45,
      "jsonBody": {
        "external_guid": null,
        "cpt": null,
        "created_at": "2021-04-30T19:58:46.349Z",
        "external_id": null,
        "source_type": "ENCOUNTER",
        "icd-10": null,
        "created_by_name": "Dima Welkonnect",
        "created_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
        "updated_by_name": "Dima Welkonnect",
        "updated_at": "2021-04-30T19:58:46.349Z",
        "updated_by": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
        "id": "4ee660ab-0e8f-404e-bb60-5a71105ae574",
        "source_id": "633f0c62-bd81-4636-b022-ca7ef94dc669",
        "source_name": "__encounter__"
      },
      "cdtName": "__encounter_disposition__"
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export patients

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/PATIENT", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "e2a2a3d6-003c-487a-b639-2f3c3e4dbf01",
      "externalGuid": null,
      "externalId": null,
      "mrn": null,
      "createdAt": "2022-03-16T13:13:38.867Z",
      "updatedAt": "2022-03-16T13:13:38.867Z",
      "createdBy": "4ae80613-825a-4885-bace-2d3ce1480a6c",
      "updatedBy": "4ae80613-825a-4885-bace-2d3ce1480a6c",
      "createdByName": "Some user's name",
      "updatedByName": "Some user's name",
      "firstName": "Jimmy",
      "lastName": "Williams",
      "middleName": "",
      "birthDate": null,
      "gender": "MALE",
      "maritalStatus": "UKN",
      "primaryLanguage": "ENGLISH",
      "secondaryLanguage": null,
      "email": "patient.mail@gmail.com",
      "secondaryEmail": "",
      "phone": null,
      "secondaryPhone": null,
      "country": "",
      "state": null,
      "city": "",
      "zip": "",
      "addressLine1": "",
      "addressLine2": "",
      "timezone": null,
      "patientTerritories": [],
      "careTeamMembers": [
        {
          "id": "4ae80613-825a-4885-bace-2d3ce1480a6c",
          "pointOfContact": true
        }
      ],
      "patientPrograms": [],
      "careTeam": [
        {
          "id": "4ae80613-825a-4885-bace-2d3ce1480a6c",
          "username": "s.username",
          "firstName": "First name",
          "lastName": "Last name",
          "email": "s.username@gmail.com",
          "roles": [
            {
              "name": "all",
              "primaryRole": true
            }
          ],
          "pointOfContact": true,
          "enabled": true
        }
      ],
      "cadence": [],
      "patientRegion": null,
      "patientRegionTitle": null,
      "patientTerritory": null,
      "pointOfContact": {
        "id": "4ae80613-825a-4885-bace-2d3ce1480a6c",
        "pointOfContact": true
      }
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export SMS

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/SMS", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "dfed6dcb-4614-43a7-88e3-db7ca214cff3",
      "updatedAt": "2021-01-20T21:42:56.551Z",
      "sendNow": false,
      "scheduledAt": "2021-01-20T21:42:56.528Z",
      "sentAt": null,
      "receivedAt": null,
      "deletedAt": null,
      "date": "2021-01-20T21:42:56.528Z",
      "careTeam": "+15512128814",
      "patientInfo": "+18572346045",
      "timezone": "America/Los_Angeles",
      "sender": "b1c9977f-804f-453a-9aa7-49ac36ee8f30",
      "from": "+15512128814",
      "receiver": "ed468aba-7fdb-4603-9ed0-d58b7d5933e7",
      "to": "+18572346045",
      "direction": "OUT",
      "externalId": null,
      "starred": false,
      "senderName": null,
      "receiverName": null,
      "errorMessage": null,
      "assignedBy": null,
      "assignedByName": null,
      "hasHistory": false,
      "unrecognized": false,
      "message": "Hello",
      "parts": 0,
      "status": "SCHEDULED",
      "messageType": "CARE_TEAM",
      "phoneId": null,
      "attachments": null
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export tasks

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/TASK", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "9cae4f5c-19f6-4645-8cbe-8041c45555d1",
      "createdAt": "2021-05-12T18:58:53.362Z",
      "updatedAt": "2021-05-18T15:26:27.039Z",
      "name": "some-name",
      "description": "Description",
      "dueDate": null,
      "status": "COMPLETED",
      "priority": "LOW",
      "patient": null,
      "assignee": {
        "id": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
        "name": "Dima Welkonnect"
      },
      "author": {
        "id": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
        "name": "Dima Welkonnect"
      },
      "watchers": [
        {
          "id": "03f51404-a300-4857-b10c-0d6a1a1b88ae",
          "name": "Dima Welkonnect"
        }
      ],
      "comments": [],
      "templateName": null,
      "watchersType": "POINT_OF_CONTACT"
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

GET request for export voice calls

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/export/VOICE_CALL", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "data": [
    {
      "id": "8ad85b3f-adc7-49b8-8d55-ae08fc383227",
      "updatedAt": "2022-03-16T12:44:32.997Z",
      "sendNow": false,
      "scheduledAt": null,
      "sentAt": null,
      "receivedAt": "2022-03-16T12:44:27.442Z",
      "deletedAt": null,
      "date": "2022-03-16T12:44:27.442Z",
      "careTeam": "+17812096150",
      "patientInfo": "+16172978992",
      "timezone": "America/Los_Angeles",
      "sender": null,
      "from": "+16172978992",
      "receiver": null,
      "to": "+17812096150",
      "direction": "IN",
      "externalId": "CAdc5ad4f9f1822558b36a2b9be3386fd8",
      "starred": false,
      "senderName": null,
      "receiverName": null,
      "errorMessage": null,
      "assignedBy": null,
      "assignedByName": null,
      "hasHistory": false,
      "unrecognized": true,
      "childCallSid": null,
      "parentCallStatus": "COMPLETED",
      "childCallStatus": null,
      "userPhone": null,
      "parentCallDuration": 5,
      "childCallDuration": null,
      "recorded": false,
      "recordingDuration": null,
      "recordingSid": null,
      "recordingUrl": null,
      "recordingFile": null,
      "phoneId": null
    },
    ... other records are omitted
  ],
  "cursor": {
    "start": null,
    "end": "2022-02-23T14:49:34.810Z",
    "hasNext": false,
    "pageSize": 1000
  }
}

This is URL structure for export:

{{url}}/{{tenantName}}/{{instanceName}}/export/{{resourceName}}?start={value}&pageSize={value}

resourceName must be in uppercase and can be one of the following values:

Name Description
ASSESSMENT Exports all assessments stored in database
CALENDAR_EVENT Exports all calendar events stored in database
CDT_RECORD Exports all cdt records stored in database
EMAIL Exports all emails stored in database
ENCOUNTER Exports all encounters stored in database
ENCOUNTER_COMMENT Exports all encounter comments stored in database
ENCOUNTER_DISPOSITION Exports all encounter dispositions stored in database
PATIENT Exports all patients stored in database
PFA Exports all assessments sent to the patient
SMS Exports all sms records stored in database
TASK Exports all tasks stored in database
VOICE_CALL Exports all voices calls stored in database

Query parameters

Name Type Description Required Example
start Date Used as a cursor for fetching data from the database. If the parameter is not specified, the selection will start from the oldest record No 2021-08-10T13:32:02.528Z
pageSize Integer Min value is 1, max value is 500. If the parameter is not specified, the page size will be 500 No 300

Response body

cursor → start describes from what date the selection started, it can be null if the query parameter was not specified

cursor → end describes from what date the selection ended for the current request

cursor → hasNext describes whether the selected records are still left

cursor → pageSize describes the maximum number of records in the data field for the current request

Note:

Permission

The export API is only available to API clients. To retrieve the data, the administrator must set up the appropriate policies for the API client.

Patients

Collection of all patients would be located at the following URL

URL Structure: https://api.live.welkincloud.io/{}/{}/patients

In our example that is https://api.live.welkincloud.io/gh/sb-demo/patients

The collection supports several interactions

  1. Allows to obtain a list of patients (can be sorted)
  2. Allows to obtain a filtered list of patients based of email address (commonly referred as FINDER)
  3. Allows to create a new patient
  4. Allows to update an existing patient by ID, externalID, externalGuid, mrn

Get All Patients

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

data = {
  "programs": [
    {
      "name": "first-program",
      "phases": [
        {
          "name": "start"
        },
        {
          "name": "finish"
        }
      ]
    },
    {
      "name": "second-program",
      "phases": []
    }
  ],
  "regions": [
    {
      "name": "first-region-name",
      "territories": [
        "first-territory",
        "second-territory"
      ]
    },
    {
      "name": "second-region-name",
      "territories": []
    }
  ],
  "timezones": [
    "America/Los_Angeles",
    "US/Eastern",
    "US/Central"
  ],
  "careTeamIds": [
    "03a87f5b-3a04-4be8-b0ad-7a34a5b2892d"
  ],
  "cadence": "",
  "email": "1@1.com",
  "phone": "+13363034233"
}

r = requests.post("https://api.live.welkincloud.io/gh/sb-demo/by-filter/patients", json=data, headers=h)
print(r.json())

The above request returns JSON structured like this:

{"content": 
  [
    {
      "id": "6801d498-26f4-4aee-961b-5daffcf193c8",
      "firstName": "Charlie",
      "lastName": "Schwarzenegger",
      "middleName": "Mc",
      "birthDate": "2012-08-12T00:00:00.000Z",
      "email": "1@1.com",
      "phone": "+13363034233",
      "country": "USA",
      "state": "American Samoa",
      "city": "Los Angeles",
      "zip": "99451",
      "addressLine1": "Hollywood Blvd 2021",
      "timezone ": "America/Los_Angeles",
      "patientTerritories": [],
      "careTeam": []
    }
  ],
  "pageable": {
        "sort": {
            "sorted": False,
            "unsorted": True,
            "empty": True
            },
        "pageNumber": 2,
        "pageSize": 20,
        "offset": 40,
        "unpaged": False,
        "paged": True
    },
    "last": False,
    "totalElements": 357,
    "totalPages": 18,
    "first": False,
    "number": 2,
    "sort": {
        "sorted": False,
        "unsorted": True,
        "empty": True
    },
    "numberOfElements": 20,
    "size": 20,
    "empty": False
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/by-filter/patients
  3. HTTP Response Codes: 200, 400, 500

Following Query Parameters can be used to sort or find appropriately

Parameter Description
sort Allows one to specify the sort order of the returned patients collection
query When specified, will execute a search for a patient based of email address, first name, last name and phone
size Pagination: Specifies number of records to return by each page.
page Pagination: Specifies what page to return

Create a Patient

Note 1: patientTerritories must contain valid territory that was previously created in the designer. You can also omit this field when creating a patient and update it later.

Note 2: All careTeam members must be valid users, one of them must contain the pointOfContact: True flag, otherwise the first user from careTeam will be marked as pointOfContact. You can also omit this field when creating a patient and update it later.

Creating a new Patient is a simple as posting to a Patient Collection resource

import requests

h = {
    "Authorization": "Bearer {}".format(token)
}

data = {
    "firstName": "Charlie",
    "lastName": "Taylor",
    "birthDate": "2012-3-12T00:00:00.000Z",
    "timezone": "America/Los_Angeles",
    "phone": "+15556491369",
    "email": "Charlie.Taylor@superemail.com",
    "patientTerritories": [
        {
            "name": "california",
            "territories": [
                "los-angeles"
            ]
        }
    ],
    "careTeam": [
        {
            "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
            "pointOfContact": True
        },
        {
            "id": "03a87f5b-3a04-4be8-b0ad-7a34a5b2892d",
            "pointOfContact": False
        }
    ]
}

r = requests.post("https://api.live.welkincloud.io/gh/sb-demo/patients", json=data, headers=h)
print(r.json())

The above request returns JSON structured like this:


{
  "id": "e3dd671a-86f0-4951-80fb-13b12766292f", 
  "externalGuid": null, 
  "firstName": "Charlie", 
  "lastName": "Taylor", 
  "middleName": null, 
  "birthDate": "2012-03-12T00:00:00.000Z", 
  "email": "Charlie.Taylor@superemail.com", 
  "phone": "+15556491369", 
  "country": null, 
  "state": null, 
  "city": null, 
  "zip": null, 
  "addressLine1": null, 
  "addressLine2": null, 
  "timezone": "America/Los_Angeles",
  "patientTerritories": [
    {
      "name": "california",
      "territories": [
        "los-angeles"
      ]
    }
  ],
  "careTeam": [
    [
      {
        "id": "03a87f5b-3a04-4be8-b0ad-7a34a5b2892d",
        "username": "johndou",
        "firstName": "John",
        "lastName": "Dou",
        "roles": [
          {
            "name": "caregiver",
            "primaryRole": true
          }
        ],
        "pointOfContact": false
      },
      {
        "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
        "username": "janedou",
        "firstName": "Jane",
        "lastName": "Dou",
        "roles": [
          {
            "name": "admin",
            "primaryRole": false
          },
          {
            "name": "root",
            "primaryRole": true
          }
        ],
        "pointOfContact": true
      }
    ]
  ]
}
  1. HTTP Method: POST
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients
  3. HTTP Response Codes: 201, 400, 500

Get a Specific Patient By ID, externalID, externalGUID, MRN

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/patients/6801d498-26f4-4aee-961b-5daffcf193c8", 
  headers=h)
print("Response Code: {}".format(r.status_code))
print(r.json())

The above command returns JSON structured like this:

{
  "id": "6801d498-26f4-4aee-961b-5daffcf193c8",
  "firstName": "Charlie",
  "lastName": "Schwarzenegger",
  "middleName": "Mc",
  "birthDate": "2012-08-12T00:00:00.000Z",
  "email": "1@1.com",
  "phone": "+13363034233",
  "country": "USA",
  "state": "American Samoa",
  "city": "Los Angeles",
  "zip": "99451",
  "addressLine1": "Hollywood Blvd 2021",
  "timezone ": "America/Los_Angeles",
  "patientTerritories": []
}  

To get a patient by a known identifier (ID, external id, external guid, MRN)

  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/6801d498-26f4-4aee-961b-5daffcf193c8
  3. HTTP Response Codes: 200, 400, 500

Following Query Parameters can be used:

Parameter Allowed values Description
type ID, EID, EGUID, MRN Type of identifier (default ID)
expand true, false If true, request will return dto with territorialTeam field (default false)

Here are few examples:

  1. https://api.live.welkincloud.io/gh/sb-demo/patients/someId?type=EID
  2. https://api.live.welkincloud.io/gh/sb-demo/patients/123e4567-e89b-12d3-a456-426655440000?type=EGUID
  3. https://api.live.welkincloud.io/gh/sb-demo/patients/someMRN?type=MRN
  4. https://api.live.welkincloud.io/gh/sb-demo/patients/someId?type=EID&expand=true

Update a Specific Patient By ID

Note: Using the Patch request, you should specify only those fields that you want to update. All fields missing in the request will retain their previous values.

import requests

data = {
    "id": "6801d498-26f4-4aee-961b-5daffcf193c8",
    "firstName": "Charlie",
    "lastName": "Schwarzenegger",
    "birthDate": "2012-08-12T00:00:00.000Z",
    "email": "2@2.com",
    "phone": "+13363034233",
    "country": "USA",
    "state": "American Samoa",
    "city": "Los Angeles",
    "zip": "99451",
    "addressLine1": "Hollywood Blvd 1111",
    "timezone": "UTC",
    "patientTerritories": [],
    "careTeam": [
        {
            "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
            "pointOfContact": True
        }
    ]
}

h = {
    "Authorization": "Bearer {}".format(token)
}

r = requests.patch("https://api.live.welkincloud.io/gh/sb-demo/patients/6801d498-26f4-4aee-961b-5daffcf193c8",
                   json=data, headers=h)
print("Response Code: {}".format(r.status_code))
print(r.json())

The above command returns JSON structured like this:

{
  "id": "1e57da59-42e2-4412-9152-11f37129b782",
  "externalGuid": null,
  "externalId": null,
  "mrn": null,
  "createdAt": "2021-05-04T11:38:24.672Z",
  "updatedAt": "2021-05-04T11:38:24.672Z",
  "createdBy": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
  "updatedBy": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
  "createdByName": "Alex Skripnik",
  "updatedByName": "Alex Skripnik",
  "firstName": "Charlie",
  "lastName": "Schwarzenegger",
  "middleName": "Mc",
  "birthDate": "2012-08-12T00:00:00.000Z",
  "gender": "UNKNOWN",
  "email": "1@1.com",
  "phone": "+13363034233",
  "country": "USA",
  "state": "American Samoa",
  "city": "Los Angeles",
  "zip": "99451",
  "addressLine1": "Hollywood Blvd 2021",
  "addressLine2": null,
  "timezone": "UTC",
  "patientTerritories": [],
  "careTeam": [
    {
      "id": "20eb246e-8099-4c7c-854c-5e0f9a366ddb",
      "username": "root",
      "firstName": "John",
      "lastName": "Dou",
      "roles": [
        {
          "name": "admin",
          "primaryRole": true
        }
      ],
      "pointOfContact": true
    }
  ]
} 

To update a patient by a known ID

  1. HTTP Method: PATCH
  2. HTTP URL: https://api.live.welkincloud.io/gh/sb-demo/patients/6801d498-26f4-4aee-961b-5daffcf193c8
  3. HTTP Response Codes: 200, 400, 404, 500

Delete a Specific Patient

Patient programs

Get all patient program records by id

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/programs

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs

Response

{
    "data": [
        {
            "createdAt": "2021-01-21T07:38:32.333Z",
            "programName": "lead-management-program",
            "programTitle": "Lead Management Program",
            "programDescription": "Program for lead management",
            "assigned": true,
            "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
            "currentPhase": {
                "timestamp": "2021-01-21T09:38:44.323Z",
                "name": "intake",
                "title": "Intake",
                "description": "Intake Phase",
                "currentVersion": "59"
            },
            "status": "IN_PROGRESS",
            "compatibleWithCurrentVersion": true,
            "pathHistory": [
                {
                    "timestamp": "2021-01-21T09:38:44.323Z",
                    "name": "intake",
                    "title": "Intake",
                    "description": "Intake Phase",
                    "currentVersion": "59"
                }
            ]
        }
    ],
    "metaInfo": {
        "page": 0,
        "pageSize": 20,
        "totalElements": 1,
        "numberOfElements": 1,
        "totalPages": 1,
        "lastPage": true,
        "firstPage": true
    }
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
assignedPrograms args Assigned or unassigned programs no boolean
page args Pagination: page number no integer
size args Pagination: page size no integer
sort args Sort field with sorting order(asc or desc) after coma no field,order

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Get patient's program record by name or ID

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/programs/{programNameOrID}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/lead-management-program

OR

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/2f5c2ecb-168c-4441-a87a-863af62426ee

Note

Request by name will return only active program (with status NOT_STARTED, IN_PROGRESS, INTERRUPTED ).

If you need FINISHED program, please use request by ID, because the patient may have several FINISHED programs, so we can't identify them by name

Response

{
    "createdAt": "2021-01-21T07:38:32.333Z",
    "programName": "lead-management-program",
    "programTitle": "Lead Management Program",
    "programDescription": "Program for lead management",
    "assigned": true,
    "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
    "currentPhase": {
        "timestamp": "2021-01-21T09:38:44.323Z",
        "name": "intake",
        "title": "Intake",
        "description": "Intake Phase",
        "currentVersion": "59"
    },
    "status": "IN_PROGRESS",
    "compatibleWithCurrentVersion": true,
    "pathHistory": [
        {
            "timestamp": "2021-01-21T09:38:44.323Z",
            "name": "intake",
            "title": "Intake",
            "description": "Intake Phase",
            "currentVersion": "59"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programNameOrID path Name of program or program ID Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Get patient's current program record

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/programs/current/{programName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/current/lead-management-program

Note

Only for programs in status NOT_STARTED, IN_PROGRESS, INTERRUPTED

Response

{
    "createdAt": "2021-01-21T07:38:32.333Z",
    "programName": "lead-management-program",
    "programTitle": "Lead Management Program",
    "programDescription": "Program for lead management",
    "assigned": true,
    "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
    "currentPhase": {
        "timestamp": "2021-01-21T09:38:44.323Z",
        "name": "intake",
        "title": "Intake",
        "description": "Intake Phase",
        "currentVersion": "59"
    },
    "status": "IN_PROGRESS",
    "compatibleWithCurrentVersion": true,
    "pathHistory": [
        {
            "timestamp": "2021-01-21T09:38:44.323Z",
            "name": "intake",
            "title": "Intake",
            "description": "Intake Phase",
            "currentVersion": "59"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programName path Name of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Get patient's program record by ID

HTTP Request

GET /{tenantName}/{instanceName}/patients/{patientId}/programs/history/{programId}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/history/ec33b572-3e20-4c01-beca-dc0691e5d47d

Response

{
    "createdAt": "2021-01-21T07:38:32.333Z",
    "programName": "lead-management-program",
    "programTitle": "Lead Management Program",
    "programDescription": "Program for lead management",
    "assigned": true,
    "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
    "currentPhase": {
        "timestamp": "2021-01-21T09:38:44.323Z",
        "name": "intake",
        "title": "Intake",
        "description": "Intake Phase",
        "currentVersion": "59"
    },
    "status": "IN_PROGRESS",
    "compatibleWithCurrentVersion": true,
    "pathHistory": [
        {
            "timestamp": "2021-01-21T09:38:44.323Z",
            "name": "intake",
            "title": "Intake",
            "description": "Intake Phase",
            "currentVersion": "59"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programId path UUID of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Update patient program status and assign program

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/programs/{programName}

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/prog-4

Request

{
    "assigned" : true,
    "status" : "IN_PROGRESS"
}

Response

{
    "createdAt": "2021-05-17T09:13:33.332Z",
    "programName": "prog-4",
    "programTitle": "prog-4",
    "programDescription": "",
    "assigned": true,
    "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
    "currentPhase": null,
    "status": "IN_PROGRESS",
    "compatibleWithCurrentVersion": true,
    "pathHistory": []
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programName path Name of program Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Change phase for patient program

HTTP Request

PATCH /{tenantName}/{instanceName}/patients/{patientId}/programs/{programName}/phases

in our example it would be:

PATCH https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/lead-management-program/phases

Request

{
    "phaseName":"documents-sent"
}

Response

{
    "createdAt": "2021-01-21T07:38:32.333Z",
    "programName": "lead-management-program",
    "programTitle": "Lead Management Program",
    "programDescription": "Program for lead management",
    "assigned": true,
    "patientId": "08632f11-cb33-4b5b-aece-aaa360f9f747",
    "currentPhase": {
        "timestamp": "2021-05-17T12:18:10.295Z",
        "name": "documents-sent",
        "title": "Documents Sent",
        "description": "When documents are sent for signature",
        "currentVersion": "239"
    },
    "status": "IN_PROGRESS",
    "compatibleWithCurrentVersion": true,
    "pathHistory": [
        {
            "timestamp": "2021-01-21T09:38:44.323Z",
            "name": "intake",
            "title": "Intake",
            "description": "Intake Phase",
            "currentVersion": "59"
        },
        {
            "timestamp": "2021-05-17T12:18:10.295Z",
            "name": "documents-sent",
            "title": "Documents Sent",
            "description": "When documents are sent for signature",
            "currentVersion": "239"
        }
    ]
}

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programName path Name of program Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Unassign patient from program

HTTP Request

DELETE /{tenantName}/{instanceName}/patients/{patientId}/programs/{programId}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/patients/08632f11-cb33-4b5b-aece-aaa360f9f747/programs/11132f11-cb33-4b5b-aece-abc125fed987

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programId path ID of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Programs

Get all programs

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/programs

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/programs

Response

[
    {
        "name": "lead-management-program",
        "title": "Lead Management Program",
        "description": "Program for lead management",
        "phases": [
            {
                "name": "start",
                "title": "Start",
                "description": "",
                "navigateTo": [
                    {
                        "name": "intake"
                    }
                ]
            },
            {
                "name": "end",
                "title": "End",
                "description": "",
                "navigateTo": []
            },
            {
                "name": "intake",
                "title": "Intake",
                "description": "Intake Phase",
                "navigateTo": [
                    {
                        "name": "pre-enrollment"
                    }
                ]
            },
            {
                "name": "pre-enrollment",
                "title": "Pre-Enrollment",
                "description": "Before customer signs, but shows interest",
                "navigateTo": [
                    {
                        "name": "documents-sent"
                    }
                ]
            },
            {
                "name": "documents-sent",
                "title": "Documents Sent",
                "description": "When documents are sent for signature",
                "navigateTo": [
                    {
                        "name": "enrolled"
                    }
                ]
            },
            {
                "name": "enrolled",
                "title": "Enrolled",
                "description": "Customer became a patient",
                "navigateTo": [
                    {
                        "name": "end"
                    }
                ]
            }
        ],
        "nodes": [
            {
                "id": "start",
                "data": {
                    "label": "Start"
                },
                "type": "input",
                "position": {
                    "x": 20,
                    "y": 20
                },
                "sourcePosition": "right",
                "targetPosition": "left"
            }
        ]
    }
]

Parameters

Name Located in Description Required Type
patientId path ID of patient Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Get program by name

HTTP Request

GET /{tenantName}/{instanceName}/formations/{version}/programs/{programName}

in our example it would be:

GET https://api.live.welkincloud.io/gh/sb-demo/formations/current/programs/lead-management-program

Response

 {
        "name": "lead-management-program",
        "title": "Lead Management Program",
        "description": "Program for lead management",
        "phases": [
            {
                "name": "start",
                "title": "Start",
                "description": "",
                "navigateTo": [
                    {
                        "name": "intake"
                    }
                ]
            },
            {
                "name": "end",
                "title": "End",
                "description": "",
                "navigateTo": []
            },
            {
                "name": "intake",
                "title": "Intake",
                "description": "Intake Phase",
                "navigateTo": [
                    {
                        "name": "pre-enrollment"
                    }
                ]
            },
            {
                "name": "pre-enrollment",
                "title": "Pre-Enrollment",
                "description": "Before customer signs, but shows interest",
                "navigateTo": [
                    {
                        "name": "documents-sent"
                    }
                ]
            },
            {
                "name": "documents-sent",
                "title": "Documents Sent",
                "description": "When documents are sent for signature",
                "navigateTo": [
                    {
                        "name": "enrolled"
                    }
                ]
            },
            {
                "name": "enrolled",
                "title": "Enrolled",
                "description": "Customer became a patient",
                "navigateTo": [
                    {
                        "name": "end"
                    }
                ]
            }
        ],
        "nodes": [
            {
                "id": "start",
                "data": {
                    "label": "Start"
                },
                "type": "input",
                "position": {
                    "x": 20,
                    "y": 20
                },
                "sourcePosition": "right",
                "targetPosition": "left"
            }
        ]
    }

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
version path Version of formation Yes string
programName path Name of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Create a program

HTTP Request

POST /{tenantName}/{instanceName}/formations/draft/programs

in our example it would be:

POST https://api.live.welkincloud.io/gh/sb-demo/formations/draft/programs

Request

{
  "name": "care_program_name_1",
  "title": "care_program_title_1",
  "description": "care_program_description_1",
  "phases": [
    {
      "name": "phase_name_1",
      "title": "phase_title_1",
      "description": "phase_description_1",
      "navigateTo": [
        {
          "name": "phase_name_2"
        }
      ]
    },
    {
      "name": "phase_name_2",
      "title": "phase_title_2",
      "description": "phase_description_2",
      "navigateTo": null
    }
  ]
}

Response

{
    "name": "care_program_name_1",
    "title": "care_program_title_1",
    "description": "care_program_description_1",
    "phases": [
        {
            "name": "phase_name_1",
            "title": "phase_title_1",
            "description": "phase_description_1",
            "navigateTo": [
                {
                    "name": "phase_name_2"
                }
            ]
        },
        {
            "name": "phase_name_2",
            "title": "phase_title_2",
            "description": "phase_description_2",
            "navigateTo": null
        }
    ],
    "nodes": null
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string

Responses

Code Description
201 Created
401 Unauthorized
403 Forbidden
404 Not Found

Update program by name

HTTP Request

PUT /{tenantName}/{instanceName}/formations/draft/programs/{programName}

in our example it would be:

PUT https://api.live.welkincloud.io/gh/sb-demo/formations/draft/programs/care_program_name_1

Request

{
  "name": "care_program_name_1",
  "title": "care_program_title_1",
  "description": "care_program_description_1",
  "phases": [
    {
      "name": "phase_name_1",
      "title": "phase_title_1",
      "description": "phase_description_1",
      "navigateTo": null
    }
  ]
}

Response

{
    "name": "care_program_name_1",
    "title": "care_program_title_1",
    "description": "care_program_description_1",
    "phases": [
        {
            "name": "phase_name_1",
            "title": "phase_title_1",
            "description": "phase_description_1",
            "navigateTo": null
        }
    ],
    "nodes": null
}

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programName path Name of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Delete program by name

HTTP Request

DELETE /{tenantName}/{instanceName}/formations/draft/programs/{programName}

in our example it would be:

DELETE https://api.live.welkincloud.io/gh/sb-demo/formations/draft/programs/care_program_name_1

Parameters

Name Located in Description Required Type
userId path ID of user Yes UUID
tenantName path Name of tenant Yes string
instanceName path Name of instance Yes string
programName path Name of program Yes string

Responses

Code Description
200 OK
401 Unauthorized
403 Forbidden
404 Not Found

Security audit

Find security audit event

It is a typical API to work security audit

URL Structure: {{url}} / {{tenantName}} / admin /audit-security

in our example it would be: https://api.live.welkincloud.io/gh/admin/audit-security

{
  "sentAt":"2021-05-04T11:42:20.692Z",
  "subjectUsername":"johndoe",
  "subjectUserId":"c8701ee0-e26d-4177-bec5-dadd3d7519e1",
  "subjectActor":"USER",
  "subjectFullName":"Json Doe",
  "objectUsername":"johndoe",
  "objectUserId":"c8701ee0-e26d-4177-bec5-dadd3d7519e1",
  "objectActor":"USER",
  "objectFullName":"Json Doe",
  "eventSubtype":"USER_ACCESS_UPDATED",
  "record":{
    "auditSecurityAccessEnabled":true,
    "adminAccessEnabled":true,
    "id":"f3f40197-4e2f-48a7-b608-04a0bc5fb28c",
    "userId":"c8701ee0-e26d-4177-bec5-dadd3d7519e1",
    "instanceAccesses":[
      {
        "instanceId":"d002ef26-3b35-4ec1-b4bd-d7147cf07c9f",
        "instanceName":"sbx",
        "instanceDescription":"",
        "workshopAccessEnabled":true,
        "auditDataAccessEnabled":true
      },
      {
        "instanceId":"3879ba2b-d133-48d2-b841-dfad0eaac36a",
        "instanceName":"commcenter",
        "instanceDescription":"",
        "workshopAccessEnabled":true,
        "auditDataAccessEnabled":true
      }
    ]
  }
}

Fields description:

Field Name Format Description Allowed values
cdtName String Cdt name
subjectUsername String Username of a person performing the action
subjectUserId UUID Id of a person performing the action
subjectFullName String Full name of the person performing the action
subjectActor Enum of allowed values Client type of the person performing the action API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
objectUsername String Username of a person who the action was taken on
objectUserId UUID Id of a person who the action was taken on
objectFullName String Full name of a person who the action was taken on
objectActor Enum of allowed values Client type of a person who the action was taken on API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
eventSubtype Enum of allowed values Type of performing action
record Object Object after performing the action on it
  1. HTTP Method: GET
  2. HTTP URL: https://api.live.welkincloud.io/gh/admin/audit-security?size=20&page=0&sort=createdAt%2Cdesc&dateStart=2021-02-26T17%3A00%3A00.000Z&objectActor=API_CLIENT
Parameters Format Description Allowed values
subjectUsername String Username of the person performing the action
subjectFullName String Full name of the person performing the action
subjectActor Enum of allowed values Client type of the person performing the action API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
objectUsername String Username of a person who the action was taken on
objectFullName String Full name of a person who the action was taken on
objectActor Enum of allowed values Client type of a person who the action was taken on API_CLIENT, PATIENT, CS_TOOL_CLIENT, USER
dateEnd Date_time in ISO-8601 format Filter by sentAt
dateStart Date_time in ISO-8601 format Filter by sentAt
eventSubtype Enum of allowed values Type of performing action

Sms

Collection of all sms would be located at the following URL:

{{url}} / {{tenantName}} / {{instanceName}} / patients / {{patientId}} / sms

In our example it would be:

https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms

Get all sms

GET request

import requests
h = {
        "Authorization": "Bearer {}".format(token)
    }

r = requests.get("https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms", headers=h)
print(r.json())

The above request returns JSON structured like this:

{
  "content": [
    {
      "id": "92c6f2c6-61b7-46ad-b1a8-3ca541b88c0f",
      "sendNow": false,
      "scheduledAt": "2021-05-04T19:50:09.808Z",
      "sentAt": "2021-05-04T19:50:11.234Z",
      "receivedAt": null,
      "date": "2021-05-04T19:50:11.234Z",
      "careTeam": "Nick Snow",
      "patientInfo": "John Doe",
      "timezone": "America/Los_Angeles",
      "sender": "de23c848-65aa-45a1-bf7b-f1d36a6e4ebe",
      "from": "+15625345699",
      "receiver": "830b8744-2c0f-4750-ad6d-5c2c94ada65d",
      "to": "+15625345678",
      "direction": "OUT",
      "externalId": "SM993260f0b8744163ae3a56ce9d158a05",
      "starred": false,
      "senderName": "Nick Snow",
      "receiverName": "John Doe",
      "message": "sms message",
      "parts" : 1,
      "status": "DELIVERED"
    }
    ....pagination links omitted
  ]
}

Following Query Parameters can be used to sort or find approporiately

We can use any combination of this parameters in single request: Example: {{url}}/{{tenantName}}/{{instanceName}}/patients/{{patientId}}/sms?status=DELIVERED,FAILED&phone=+15625345678&starred=true

Parameter Description Examples
sort Allows one to specify the sort order of the returned sms collection https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?sort=firstName,desc
size When specified, size per page https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?size=20
page When specified, page number https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?page=1
search When specified, will execute a search based on message field https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?search=sometext
sender When specified, search by sender id https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?sender=de23c848-65aa-45a1-bf7b-f1d36a6e4ebe
receiver When specified, search by receiver id https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?sender=de23c848-65aa-45a1-bf7b-f1d36a6e4ebe
direction When specified, search by direction (IN or OUT) https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?direction=IN
starred When specified, search by starred (boolean value) field (as an important sms) https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?starred=true
from When specified, search by 'from' phone https://api.live.welkincloud.io/gh/sb-demo/patients/5da47c49-0c2b-4239-b438-7a826d407739/sms?from=test@gm