NAV Navbar
Overview UI / JS API
API v1.2.0
HTTP
  • Introduction
  • Authentication
  • Basic
  • Advanced
  • Schemas
  • Introduction

    The Antidote API is organised around REST. The API has predictable URLs and makes proper use of HTTP methods (E.G GET, POST, PATCH, DELETE, PUTS) and status codes (E.G 200, 201, 204, 400, 403, 401...). It also supports cross-origin resource sharing (CORS) which allows you to use the browser to communicate directly and securely with the API without the need for a proxy.

    The API has been broken down into three documents that you should read:

    Base URL:

    Authentication

    Scope Scope Description
    screening Allows you to start and finish screening sessions, and also view finalised screening sessions performed under this client.

    Basic

    For use with the Managed UI and Unmanaged UI

    POST /screening

    HTTP Sample

    POST https://api.cegascreening.com/screening HTTP/1.1
    Host: api.cegascreening.com
    Content-Type: application/json
    Accept: application/json
    
    

    Start a screening session

    Body parameter

    {
      "previousId": "00000000-0000-0000-0000-00000000",
      "settings": {
        "associatedEvents": false,
        "altitudeExclusions": false
      }
    }
    

    Parameters

    Parameter In Type Required Description
    body body object false Payload
    » previousId body string(uuid) false This is used to perform a re-screen on a previous screening session id.
    » settings body object false Screening Session Settings
    »» associatedEvents body boolean false Toggle associated events feature for this screening session.
    »» altitudeExclusions body boolean false Toggle altitude exclusions feature for this screening session.

    Example responses

    {
      "id": "00000000-0000-0000-0000-00000000",
      "state": "editable",
      "settings": {
        "version": "201712010100",
        "associatedEvents": true,
        "altitudeExclusions": false
      },
      "conditionAnswers": {
        "00000000-0000-0000-0000-00000000": {
          "00000000-0000-0000-0000-00000000": "00000000-0000-0000-0000-00000000"
        }
      },
      "conditions": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "name": "string",
          "decline": false,
          "altitudeExclusion": false,
          "questions": [
            {
              "id": "string",
              "text": "Is this an example question?",
              "position": 1,
              "answers": [
                {
                  "id": "00000000-0000-0000-0000-00000000",
                  "text": "Yes, this is an example answer.",
                  "position": 2,
                  "forwardConditionId": "00000000-0000-0000-0000-00000000",
                  "forwardConditionSynonyms": [
                    "string"
                  ],
                  "nextQuestionPosition": 0
                }
              ]
            }
          ]
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Screening Session has been created. EditableScreeningSession

    GET /screening/{sessionId}

    HTTP Sample

    GET https://api.cegascreening.com/screening/{sessionId} HTTP/1.1
    Host: api.cegascreening.com
    
    Accept: application/json
    
    

    Get screening session

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session

    Example responses

    {
      "totalScore": 5.6,
      "conditionScores": {
        "property1": {
          "score": 5.6,
          "associatedEvent": {
            "description": "Example Associated Event Description",
            "conditions": [
              {
                "id": "00000000-0000-0000-0000-00000000",
                "name": "Example 1",
                "synonyms": [
                  {
                    "id": "00000000-0000-0000-0000-00000000",
                    "name": "Example 2"
                  }
                ]
              }
            ]
          }
        },
        "property2": {
          "score": 5.6,
          "associatedEvent": {
            "description": "Example Associated Event Description",
            "conditions": [
              {
                "id": "00000000-0000-0000-0000-00000000",
                "name": "Example 1",
                "synonyms": [
                  {
                    "id": "00000000-0000-0000-0000-00000000",
                    "name": "Example 2"
                  }
                ]
              }
            ]
          }
        }
      },
      "events": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "title": "FinishScreeningCondition",
          "description": "Finished Screening Condition 'Example'",
          "data": {},
          "recordedAt": "2018-02-19T21:38:54Z"
        }
      ],
      "id": "00000000-0000-0000-0000-00000000",
      "state": "editable",
      "settings": {
        "version": "201712010100",
        "associatedEvents": true,
        "altitudeExclusions": false
      },
      "conditionAnswers": {
        "00000000-0000-0000-0000-00000000": {
          "00000000-0000-0000-0000-00000000": "00000000-0000-0000-0000-00000000"
        }
      },
      "conditions": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "name": "string",
          "decline": false,
          "altitudeExclusion": false,
          "questions": [
            {
              "id": "string",
              "text": "Is this an example question?",
              "position": 1,
              "answers": [
                {
                  "id": "00000000-0000-0000-0000-00000000",
                  "text": "Yes, this is an example answer.",
                  "position": 2,
                  "forwardConditionId": "00000000-0000-0000-0000-00000000",
                  "forwardConditionSynonyms": [
                    "string"
                  ],
                  "nextQuestionPosition": 0
                }
              ]
            }
          ]
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Screening Session contents, this will return the EditableScreeningSession or FinalisedScreeningSession model depending on the screening session state. FinalisedScreeningSession
    401 Unauthorized Requires Authentication as the screening session has been finished None

    POST /screening/{sessionId}:finish

    HTTP Sample

    POST https://api.cegascreening.com/screening/{sessionId}:finish HTTP/1.1
    Host: api.cegascreening.com
    
    
    

    Finish screening session

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session

    Responses

    Status Meaning Description Schema
    204 No Content Screening Session has been finished and the medical risk has been calculated. None

    Advanced

    For use with the Unmanaged UI

    PUT /screening/{sessionId}/conditions/{conditionId}

    HTTP Sample

    PUT https://api.cegascreening.com/screening/{sessionId}/conditions/{conditionId} HTTP/1.1
    Host: api.cegascreening.com
    Content-Type: application/json
    
    

    Set condition answers

    This endpoint is for setting the answers given to questions for the condition.

    Body parameter

    {
      "answers": [
        {
          "property1": "00000000-0000-0000-0000-00000000",
          "property2": "00000000-0000-0000-0000-00000000"
        }
      ]
    }
    

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session
    conditionId path string true The unique identifier of a medical condition
    body body object false Payload (without the question/answer positions)
    » answers body [object] false No description

    Responses

    Status Meaning Description Schema
    204 No Content Medical condition screening answers have been set or updated. None

    POST /screening/{sessionId}/conditions/{conditionId}

    HTTP Sample

    POST https://api.cegascreening.com/screening/{sessionId}/conditions/{conditionId} HTTP/1.1
    Host: api.cegascreening.com
    
    Accept: application/json
    
    

    Start screening condition

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session
    conditionId path string true The unique identifier of a medical condition

    Example responses

    {
      "id": "00000000-0000-0000-0000-00000000",
      "name": "string",
      "decline": false,
      "questions": [
        {
          "id": "string",
          "text": "Is this an example question?",
          "position": 1,
          "answers": [
            {
              "id": "00000000-0000-0000-0000-00000000",
              "text": "Yes, this is an example answer.",
              "position": 2,
              "forwardConditionId": "00000000-0000-0000-0000-00000000",
              "forwardConditionSynonyms": [
                "string"
              ],
              "nextQuestionPosition": 0
            }
          ]
        }
      ]
    }
    

    Responses

    Status Meaning Description Schema
    201 Created Medical Condition has been added to the session for screening. Condition

    DELETE /screening/{sessionId}/conditions/{conditionId}

    HTTP Sample

    DELETE https://api.cegascreening.com/screening/{sessionId}/conditions/{conditionId} HTTP/1.1
    Host: api.cegascreening.com
    
    
    

    Delete a condition

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session
    conditionId path string true The unique identifier of a medical condition

    Responses

    Status Meaning Description Schema
    204 No Content Medical Condition has been removed from the session. None

    GET /screening/{sessionId}/conditions

    HTTP Sample

    GET https://api.cegascreening.com/screening/{sessionId}/conditions?filter[query]=string HTTP/1.1
    Host: api.cegascreening.com
    
    Accept: application/json
    
    

    Search for conditions

    Parameters

    Parameter In Type Required Description
    sessionId path string true The unique identifier of a screening session
    filter[query] query string true Filter for conditions by name

    Example responses

    {
      "id": "00000000-0000-0000-0000-00000000",
      "name": "string",
      "synonyms": [
        "00000000-0000-0000-0000-00000000"
      ]
    }
    

    Responses

    Status Meaning Description Schema
    200 OK Screening Session has been created. SearchResult

    Schemas

    Answer

    {
      "id": "00000000-0000-0000-0000-00000000",
      "text": "Yes, this is an example answer.",
      "position": 2,
      "forwardConditionId": "00000000-0000-0000-0000-00000000",
      "forwardConditionSynonyms": [
        "string"
      ],
      "nextQuestionPosition": 0
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false Answer ID
    text string false Answer Text
    position number false Position to place the answer on screen
    forwardConditionId string(uuid) false ID of condition to forward to after screening this condition
    nextQuestionPosition number false The position of the next question to be displayed. If this answer is selected and the value is 0 then this conditions question set is complete, and you can show a button to submit the answers.
    forwardConditionSynonyms [string] false List of condition synonym ids of the condition being forwarded to. This should be checked against to prevent duplicate screening of an already screened forward

    Condition

    {
      "id": "00000000-0000-0000-0000-00000000",
      "name": "string",
      "decline": false,
      "altitudeExclusion": false,
      "questions": [
        {
          "id": "string",
          "text": "Is this an example question?",
          "position": 1,
          "answers": [
            {
              "id": "00000000-0000-0000-0000-00000000",
              "text": "Yes, this is an example answer.",
              "position": 2,
              "forwardConditionId": "00000000-0000-0000-0000-00000000",
              "forwardConditionSynonyms": [
                "string"
              ],
              "nextQuestionPosition": 0
            }
          ]
        }
      ]
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false Condition ID
    name string false Condition Name
    decline boolean false Is the condition an automatic decline? (Not currently used)
    altitudeExclusion boolean false Does the condition carry an altitude exclusion? (altitudeExclusions setting must be enabled)
    questions [Question] false List of questions attached to the condition
    » id string(uuid) false Question ID
    » text string false Question Text
    » position number false Position to place the question on screen
    » answers [Answer] false List of answers applicable to this question
    »» id string(uuid) false Answer ID
    »» text string false Answer Text
    »» position number false Position to place the answer on screen
    »» forwardConditionId string(uuid) false ID of condition to forward to after screening this condition
    »» nextQuestionPosition number false The position of the next question to be displayed. If this answer is selected and the value is 0 then this conditions question set is complete, and you can show a button to submit the answers.
    »» forwardConditionSynonyms [string] false List of condition synonym ids of the condition being forwarded to. This should be checked against to prevent duplicate screening of an already screened forward

    Event

    {
      "id": "00000000-0000-0000-0000-00000000",
      "title": "FinishScreeningCondition",
      "description": "Finished Screening Condition 'Example'",
      "data": {},
      "recordedAt": "2017-12-21T14:41:39Z"
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false Event ID
    title string false Event Title (Key to use for the event)
    description string false Event Description
    data object false Data related to the event.
    recordedAt string(date-time) false No description

    Question

    {
      "id": "string",
      "text": "Is this an example question?",
      "position": 1,
      "answers": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "text": "Yes, this is an example answer.",
          "position": 2,
          "forwardConditionId": "00000000-0000-0000-0000-00000000",
          "forwardConditionSynonyms": [
            "string"
          ],
          "nextQuestionPosition": 0
        }
      ]
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false Question ID
    text string false Question Text
    position number false Position to place the question on screen
    answers [Answer] false List of answers applicable to this question
    » id string(uuid) false Answer ID
    » text string false Answer Text
    » position number false Position to place the answer on screen
    » forwardConditionId string(uuid) false ID of condition to forward to after screening this condition
    » nextQuestionPosition number false The position of the next question to be displayed. If this answer is selected and the value is 0 then this conditions question set is complete, and you can show a button to submit the answers.
    » forwardConditionSynonyms [string] false List of condition synonym ids of the condition being forwarded to. This should be checked against to prevent duplicate screening of an already screened forward

    AssociatedEvent

    {
      "description": "Example Associated Event Description",
      "conditions": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "name": "Example 1",
          "synonyms": [
            {
              "id": "00000000-0000-0000-0000-00000000",
              "name": "Example 2"
            }
          ]
        }
      ]
    } 
    

    Properties

    Name Type Required Description
    description string false The description of the associated event.
    conditions [object] false The conditions attached to the associated event.
    » id string(uuid) false Condition ID
    » name string false Condition Name
    » synonyms [object] false List of synonyms for this condition
    »» id string(uuid) false Condition ID
    »» name string false Condition Name

    FinalisedScreeningSession

    {
      "totalScore": 5.6,
      "conditionScores": {
        "00000000-0000-0000-0000-00000000": {
          "score": 5.6,
          "associatedEvent": {
            "description": "Example Associated Event Description",
            "conditions": [
              {
                "id": "00000000-0000-0000-0000-00000000",
                "name": "Example 1",
                "synonyms": [
                  {
                    "id": "00000000-0000-0000-0000-00000000",
                    "name": "Example 2"
                  }
                ]
              }
            ]
          }
        },
        "00000000-0000-0000-0000-00000001": {
          "score": 5.6,
          "associatedEvent": {
            "description": "Example Associated Event Description",
            "conditions": [
              {
                "id": "00000000-0000-0000-0000-00000000",
                "name": "Example 1",
                "synonyms": []
              }
            ]
          }
        }
      },
      "events": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "title": "FinishScreeningCondition",
          "description": "Finished Screening Condition 'Example'",
          "data": {},
          "recordedAt": "2017-12-21T14:41:39Z"
        }
      ],
      "id": "00000000-0000-0000-0000-00000000",
      "state": "editable",
      "settings": {
        "version": "201712010100",
        "associatedEvents": true,
        "altitudeExclusions": false
      },
      "conditionAnswers": {
        "00000000-0000-0000-0000-00000000": {
          "00000000-0000-0000-0000-00000000": "00000000-0000-0000-0000-00000000"
        }
      },
      "conditions": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "name": "string",
          "decline": false,
          "altitudeExclusion": false,
          "questions": [
            {
              "id": "string",
              "text": "Is this an example question?",
              "position": 1,
              "answers": [
                {
                  "id": "00000000-0000-0000-0000-00000000",
                  "text": "Yes, this is an example answer.",
                  "position": 2,
                  "forwardConditionId": "00000000-0000-0000-0000-00000000",
                  "forwardConditionSynonyms": [
                    "string"
                  ],
                  "nextQuestionPosition": 0
                }
              ]
            }
          ]
        }
      ]
    } 
    

    Properties

    Name Type Required Description
    totalScore number(float) false The risk score after the session has been finalised and calculated.
    conditionScores object false The risk score after the session has been finalised and calculated.
    » score number(float) false Individual Risk of the current condition.
    » associatedEvent AssociatedEvent false (! Optional) Associated Events of the current condition. This is only returned if it was asked for in the settings when starting a screening session.
    »» description string false The description of the associated event.
    »» conditions [object] false The conditions attached to the associated event.
    »»» id string(uuid) false Condition ID
    »»» name string false Condition Name
    »»» synonyms [object] false List of synonyms for this condition
    »»»» id string(uuid) false Condition ID
    »»»» name string false Condition Name
    events [Event] false List of events that occurred during the screening session.
    » id string(uuid) false Event ID
    » title string false Event Title (Key to use for the event)
    » description string false Event Description
    » data object false Data related to the event.
    » recordedAt string(date-time) false No description
    id string(uuid) false No description
    state string false The current state of the screening session.
    settings object false The settings being used to perform the current screening session.
    conditionAnswers object false A map of condition ids to maps of question ids and answers. Example Format: {"conditionId1":{"questionId1":"answerId2","questionId1":["answerId1","answerId2"]}}. An answer can be a string or an array of strings. The only types of answers that are multiple choice are those with a 'forwardConditionId'.
    conditions [Condition] false List of conditions screened in the screening session.
    » id string(uuid) false Condition ID
    » name string false Condition Name
    » decline boolean false Is the condition an automatic decline? (Not currently used)
    » questions [Question] false List of questions attached to the condition
    »» id string(uuid) false Question ID
    »» text string false Question Text
    »» position number false Position to place the question on screen
    »» answers [Answer] false List of answers applicable to this question
    »»» id string(uuid) false Answer ID
    »»» text string false Answer Text
    »»» position number false Position to place the answer on screen
    »»» forwardConditionId string(uuid) false ID of condition to forward to after screening this condition
    »»» nextQuestionPosition number false The position of the next question to be displayed. If this answer is selected and the value is 0 then this conditions question set is complete, and you can show a button to submit the answers.
    »»» forwardConditionSynonyms [string] false List of condition synonym ids of the condition being forwarded to. This should be checked against to prevent duplicate screening of an already screened forward

    Enumerated Values

    Property Value
    state editable
    state finalised

    EditableScreeningSession

    {
      "id": "00000000-0000-0000-0000-00000000",
      "state": "editable",
      "settings": {
        "version": "201712010100",
        "associatedEvents": true
      },
      "conditionAnswers": {
        "00000000-0000-0000-0000-00000000": {
          "00000000-0000-0000-0000-00000000": "00000000-0000-0000-0000-00000000"
        }
      },
      "conditions": [
        {
          "id": "00000000-0000-0000-0000-00000000",
          "name": "string",
          "decline": false,
          "altitudeExclusion": false,
          "questions": [
            {
              "id": "string",
              "text": "Is this an example question?",
              "position": 1,
              "answers": [
                {
                  "id": "00000000-0000-0000-0000-00000000",
                  "text": "Yes, this is an example answer.",
                  "position": 2,
                  "forwardConditionId": "00000000-0000-0000-0000-00000000",
                  "forwardConditionSynonyms": [
                    "string"
                  ],
                  "nextQuestionPosition": 0
                }
              ]
            }
          ]
        }
      ]
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false No description
    state string false The current state of the screening session.
    settings object false The settings being used to perform the current screening session.
    conditionAnswers object false A map of condition ids to maps of question ids and answers. Example Format: {"conditionId1":{"questionId1":"answerId2","questionId1":["answerId1","answerId2"]}}. An answer can be a string or an array of strings. The only types of answers that are multiple choice are those with a 'forwardConditionId'.
    conditions [Condition] false List of conditions screened in the screening session.
    » id string(uuid) false Condition ID
    » name string false Condition Name
    » decline boolean false Is the condition an automatic decline? (Not currently used)
    » questions [Question] false List of questions attached to the condition
    »» id string(uuid) false Question ID
    »» text string false Question Text
    »» position number false Position to place the question on screen
    »» answers [Answer] false List of answers applicable to this question
    »»» id string(uuid) false Answer ID
    »»» text string false Answer Text
    »»» position number false Position to place the answer on screen
    »»» forwardConditionId string(uuid) false ID of condition to forward to after screening this condition
    »»» nextQuestionPosition number false The position of the next question to be displayed. If this answer is selected and the value is 0 then this conditions question set is complete, and you can show a button to submit the answers.
    »»» forwardConditionSynonyms [string] false List of condition synonym ids of the condition being forwarded to. This should be checked against to prevent duplicate screening of an already screened forward

    Enumerated Values

    Property Value
    state editable
    state finalised

    SearchResult

    {
      "id": "00000000-0000-0000-0000-00000000",
      "name": "string",
      "synonyms": [
        "00000000-0000-0000-0000-00000000"
      ]
    } 
    

    Properties

    Name Type Required Description
    id string(uuid) false Condition ID
    name string false Condition Name
    synonyms [string(uuid)] false List of condition synonym ids of this condition. This should be checked against to prevent duplicate screening of an already screened condition.