For the complete documentation index, see llms.txt. This page is also available as Markdown.

CDT Record

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

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

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.

Get all CDT Records

get

Get all cdt records

  1. HTTP Request

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

2. In our example it would be:

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

Responses

Code
Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

Query parameters
fieldsstringOptional

: fields=name,phone

Example: field1,field2
pageintegerOptional

Page number

Default: 0Example: 1
sizeintegerOptional

Page size

Default: 20Example: 3
filtersstringOptional

key - cdt field name; v1,v3,v4 - values to search

Example: key=v1,v2
dateStartstring · date-timeOptional

Date_time in ISO-8601 format

Example: 2021-03-25T11:40:02.803Z
sortstringOptional

Sort field with sorting order(asc or desc) after coma

Example: time,asc
dateEndstring · date-timeOptional

Date_time in ISO-8601 format

Responses
200

Paginated CDT records

application/json
namestringOptional
get/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}
GET /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "name": "text",
  "data": {
    "content": [
      {
        "id": "123e4567-e89b-12d3-a456-426614174000",
        "patientId": "123e4567-e89b-12d3-a456-426614174000",
        "cdtId": "123e4567-e89b-12d3-a456-426614174000",
        "version": 1,
        "cdtName": "text",
        "jsonBody": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      }
    ],
    "pageable": {
      "sort": {
        "sorted": true,
        "unsorted": true,
        "empty": true
      },
      "pageSize": 1,
      "pageNumber": 1,
      "offset": 1,
      "unpaged": true,
      "paged": true
    },
    "totalElements": 1,
    "totalPages": 1,
    "last": true,
    "first": true,
    "number": 1,
    "size": 1,
    "numberOfElements": 1,
    "empty": true,
    "sort": {
      "sorted": true,
      "unsorted": true,
      "empty": true
    }
  }
}

Create CDT Record

post

Create cdt record

  1. HTTP Request

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

2. In our example it would be:

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

Responses

Code
Description

201

Created

401

Unauthorized

403

Forbidden

404

Not Found

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

Body

Field values as defined by the target CDT schema.

Other propertiesanyOptional
Responses
201

Created CDT record

application/json
idstring · uuidOptional
patientIdstring · uuidOptional
cdtIdstring · uuidOptional
versionintegerOptional
cdtNamestringOptional
post/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}
POST /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "patientId": "123e4567-e89b-12d3-a456-426614174000",
  "cdtId": "123e4567-e89b-12d3-a456-426614174000",
  "version": 1,
  "cdtName": "text",
  "jsonBody": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Update CDT Records with bulk

patch

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

  1. HTTP Request

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

2. In our example it would be:

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

Responses

Code
Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

Body
Responses
200

Bulk update result (per-row status)

application/json
patch/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}
PATCH /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 106

{
  "rows": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "jsonBody": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      }
    }
  ]
}
{
  "rows": [
    {
      "id": "123e4567-e89b-12d3-a456-426614174000",
      "jsonBody": {
        "ANY_ADDITIONAL_PROPERTY": "anything"
      },
      "result": {
        "status": "OK",
        "content": {
          "ANY_ADDITIONAL_PROPERTY": "anything"
        }
      }
    }
  ]
}

Get CDT Record By ID

get

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

  1. HTTP Request

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

2. 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

Responses

Code
Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Examples

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

cdtIdstring · uuidRequired

UUID of the CDT record

Query parameters
fieldsstringOptionalExample: field1,field2
typestringOptional

Identificator type (ID, EID, EGUID), default ID

Example: ID
Responses
200

CDT record

application/json
idstring · uuidOptional
patientIdstring · uuidOptional
cdtIdstring · uuidOptional
versionintegerOptional
cdtNamestringOptional
get/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId}
GET /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "patientId": "123e4567-e89b-12d3-a456-426614174000",
  "cdtId": "123e4567-e89b-12d3-a456-426614174000",
  "version": 1,
  "cdtName": "text",
  "jsonBody": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Delete CDT Record by ID

delete

Delete cdt record by id

  1. HTTP Request

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

2. 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

Responses

Code
Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

cdtIdstring · uuidRequired

UUID of the CDT record

Responses
200

CDT record deleted

No content

delete/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId}
DELETE /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*

No content

Update CDT Record by ID

patch

Update cdt record by id

  1. HTTP Request

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

2. 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

Responses

Code
Description

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

Authorizations
AuthorizationstringRequired

Bearer token obtained from POST /{tenantName}/admin/api_clients/{clientName}. Valid for 60 minutes.

Path parameters
tenantNamestringRequired

Your organization (tenant) name, e.g. acme-health

Example: acme-health
instanceNamestringRequired

Your environment name: live, sandbox, or a custom name

Example: live
patientIdstring · uuidRequired

UUID of the patient record

cdtNamestringRequired

Machine-readable CDT name defined in Designer (e.g. my_custom_type)

cdtIdstring · uuidRequired

UUID of the CDT record

Body

Partial field values to update.

Other propertiesanyOptional
Responses
200

Updated CDT record

application/json
idstring · uuidOptional
patientIdstring · uuidOptional
cdtIdstring · uuidOptional
versionintegerOptional
cdtNamestringOptional
patch/{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId}
PATCH /{tenantName}/{instanceName}/patients/{patientId}/cdts/{cdtName}/{cdtId} HTTP/1.1
Host: api.live.welkincloud.io
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 38

{
  "ANY_ADDITIONAL_PROPERTY": "anything"
}
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "patientId": "123e4567-e89b-12d3-a456-426614174000",
  "cdtId": "123e4567-e89b-12d3-a456-426614174000",
  "version": 1,
  "cdtName": "text",
  "jsonBody": {
    "ANY_ADDITIONAL_PROPERTY": "anything"
  }
}

Last updated

Was this helpful?