x QBOS REST API documentation for CAPAIN

QBOS REST API documentation (CAPAIN)

(return to Main Document)

Introduction

The CAPAIN API allows client applications to maintain CAPAIN data record sets.

Audience

This developer's guide is intended for software developers needing a technical reference for using the QBOS REST API. The information you find in this guide is written by software engineering, and is authoritative on how the API behaves.

Additional resources, information about this guide

Occasionally, we make a mistake in this documentation, or unknowingly break a feature that you depend on. If this has happened to you, we apologize! You can help us fix the issue by contacting us at: pkajaani@qbos.com. We appreciate your help.

Getting Started

To place any request in a QBOS API application from a third party application you need to first authenticate your user account and set/calculate values for the following request headers: x-qbos-id, x-qbos-nonce, x-qbos-date-utc, x-qbos-hash-version, x-qbos-auth

See details in Authentication Documentation.

Custom resource vs. standard resource URI format

Custom resource (a.k.a applet) URI contains the resource vendor id in place of "/o/" in the standard object URI. Compare: .../v1/o/...with .../v1/{vendor_id}/...

CAPAIN properties

Properties prefixed with '_' (underscore) are read-only properties. i.e. POST and PUT processing will ignore these properties.

Name Type Max
Length
Numeric Required
For POST
Filterable Default Description
_client_Id bigint Yes NULL This is the Data Org Id.
_owner_Id bigint Yes Yes NULL This is the user id of the record owner. Defaults to the creatorOpid.
_creator_Opid bigint Yes Yes NULL This is the user id of the original record submitter.
_create_Date datetime No {timestamp}   Not enterable upon Insert. System sets this date upon record creation.
status_id int Yes Yes 5576 The status id of the record. Taken from the Life Cycle statuses in ADS.
_status_Change_Date datetime No NULL Not enterable. System sets this date whenever the statusid is changed.
Assessment_with nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
Pain_not_assessed nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
Pain_discomfort nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
Scheduled_opioid nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
PRN_opioid nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
Scheduled_opioid_init_cont nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
PRN_opioid_init_cont nvarchar 20 Yes NULL This property is populated by a Type 2 Value List.
Click here for the appropriate API and sample of value options for this column.
Scheduled_opioid_date datetime Yes NULL
PRN_opioid_date datetime Yes NULL

CAPAIN Relationships

Parent and Child relations to CAPAIN.

Note that the only Required status on relationships that affect a POST of an object are on the parent relations. A Required status on a child relation is only meaningful when POSTing the child object.

Linking during POST: a custom object record can be linked to a parent or child record (custom or standard) during POST by including (in the payload) the realtion id paired with the parent or child object record being linked to. For example: { "REl_3031" : 1832 }      Multiple links may be created in the same POST.

Relation Id Cardinality
(Parent-to-Child)
Required
For POST
Links Up To Is Unary?*
REL_2945 1-1 Yes CA_Assessment
Parent Relations

CAPAIN

Child Relations
Relation Id Cardinality
(Parent-to-Child)
Required
**on POST of child
Links Down To  
REL_3031 1-Many Yes** PainSite_PU  
REL_3033 1-Many Treatment_PU  
REL_3032 1-Many Medication_PU  
REL_3034 1-Many CP_POC_Issue  
REL_2921 1-Many Assessment_Issue  
REL_3035 1-1 Notes  
 



Read CAPAIN by id:

GET https:/.../v1/517090/CAPAIN/{id}

Response codes:

  • 200 - OK
  • 404 - Not found or user does not have permission to access resources of this type.
  • 400 - Client error
  • 500 - Server error

Response data: GET https:/.../v1/517090/CAPAIN/2
Unauthorized request.

Read CAPAIN by parent id:

GET https:/.../v1/517090/{parent_relation_id}/{parent_id}/links/CAPAIN[?{filter}]

Response codes:

  • 400 - Client error
  • 500 - Server error
  • 404 - Not found or user does not have permission to access resources of this type.
  • 200 - OK

Response data: GET https:/.../v1/517090/2945/32/links/CAPAIN
Unauthorized request.

Read CAPAIN by filter:

GET https:/.../v1/517090/CAPAIN[?{filter}]

Response codes:

  • 200 - OK
  • 400 - Client error
  • 404 - Not found or user does not have permission to access resources of this type.
  • 500 - Server error

Response data: GET https:/.../v1/517090/CAPAIN?id=2
Unauthorized request.

Create CAPAIN:

POST https:/.../v1/517090/CAPAIN

Request data [See properties]:

Response codes:

Update CAPAIN:

PUT https:/.../v1/517090/CAPAIN/{id}

Request data [See properties]:

Response codes:

  • 200 - OK Content returned [See response data]
  • 204 - OK No content
  • 400 - Client error
  • 404 - Not found
  • 500 - Server error

Delete CAPAIN:

DELETE https:/.../v1/517090/CAPAIN/{id}

The "id" in JSON payload is required to match the {id} in the URI to ensure that deletion requests are intended and safe

Response codes:

  • 204 - OK
  • 400 - Client error
  • 404 - Not found
  • 500 - Server error

Create Link for CAPAIN:

POST https:/.../v1/517090/{relation_id}/{link_to_id}/links/CAPAIN/{id}


{relation_id} can indicate either a parent or a child relation.

Response codes:

  • 204 - OK
  • 400 - Client error
  • 404 - Not found
  • 500 - Server error

Delete Link for CAPAIN:

DELETE https:/.../v1/517090/{parent_relation_id}/{parent_id}/links/CAPAIN/{id}


Deleting a link from CAPAIN down to a child object must be explicitly indicated by negating the relation id:

DELETE https:/.../v1/517090/{-child_relation_id}/{child_id}/links/CAPAIN/{id}

Response codes:

  • 204 - OK
  • 400 - Client error
  • 404 - Not found
  • 500 - Server error