QBOS REST API documentation (state)

(return to Main Document)

Introduction

The state API allows client applications to maintain state data including any part of its demographic 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. We appreciate your help.

Getting Started

To place any request in QBOS API application from third party application you need to authenticate 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.

state 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 Description

id

bigint

 

 

 

Required for GET(by id),PUT,DELETE

parent_id

bigint

 

yes

 

parent_type

nvarchar

50

 

yes

 

type

nvarchar

50

 

 

 

Value is "state"

href

varchar

30

 

 

 

ord_num

smallint

 

 

 

title

nvarchar

100

 

 

 

description

nvarchar

400

 

 

 

lock_data_sw

char

1

 

 

 

major_stage_id

tinyint

 

 

 

exclude_from_searches_sw

char

1

 

 

 

expected_avg_secs

int

 

 

 

_org_id

bigint

 

 

 

_resource_name

nvarchar

50

 

 

 

Read state by id:

GET https:/.../v1/ads/state/{id}

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/ads/state/2102
{ "parent_type" : "resource", "parent_id" : 10617, "type" : "state", "id" : 2102, "href" : "\/v1\/ads\/state\/2102", "ord_num" : 4, "title" : "Permanently Deactivated", "description" : "Permanently deactivate and close the Patient chart", "lock_data_sw" : 0, "major_stage_id" : 8, "exclude_from_searches_sw" : 0, "expected_avg_secs" : 0, "_org_id" : 517090, "_resource_name" : "Patient Chart" }

Read state from parent:

GET https:/.../v1/ads/{parent_type}/{parent_id}/links/state[?{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

GET https:/.../v1/ads/resource/10617/links/state
Response data:
{ "state" : [ { "parent_type" : "resource", "parent_id" : 10617, "type" : "state", "id" : 2089, "href" : "\/v1\/ads\/state\/2089", "ord_num" : 2, "title" : "Admitted - On Service", "description" : "Patient admitted, but awaiting document completion", "lock_data_sw" : 0, "major_stage_id" : 1, "exclude_from_searches_sw" : 0, "expected_avg_secs" : 0, "_org_id" : 517090, "_resource_name" : "Patient Chart" }, { "parent_type" : "resource", "parent_id" : 10617, "type" : "state", "id" : 2051, "href" : "\/v1\/ads\/state\/2051", "ord_num" : 1, "title" : "Referrals Pending", "description" : "Patient admission pending", "lock_data_sw" : 0, "major_stage_id" : 1, "exclude_from_searches_sw" : 0, "expected_avg_secs" : 0, "_org_id" : 517090, "_resource_name" : "Patient Chart" }, { "parent_type" : "resource", "parent_id" : 10617, "type" : "state", "id" : 2102, "href" : "\/v1\/ads\/state\/2102", "ord_num" : 4, "title" : "Permanently Deactivated", "description" : "Permanently deactivate and close the Patient chart", "lock_data_sw" : 0, "major_stage_id" : 8, "exclude_from_searches_sw" : 0, "expected_avg_secs" : 0, "_org_id" : 517090, "_resource_name" : "Patient Chart" }, { "parent_type" : "resource", "parent_id" : 10617, "type" : "state", "id" : 2101, "href" : "\/v1\/ads\/state\/2101", "ord_num" : 3, "title" : "Deactivated", "description" : "Patient chart is deactivated", "lock_data_sw" : 0, "major_stage_id" : 0, "exclude_from_searches_sw" : 0, "expected_avg_secs" : 0, "_org_id" : 517090, "_resource_name" : "Patient Chart" } ] }

Create state:

POST https:/.../v1/ads/resource/10617/state

Request data [See properties]:

{"state": [ { "parent_type" : "resource", "parent_id" : 10617, "property_a" : "value-a", "property" : "See state properties", "property_z" : "value-z" } ] }

Response codes:

Update state:

PUT https:/.../v1/ads/state/{id}

Request data [See properties]:

{"state": [ { "id" : 2102, "property_a" : "value-a", "property" : "See state properties", "property_z" : "value-z" } ] }

Response codes:

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

Delete state:

DELETE https:/.../v1/ads/state/{id}

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

{"state": [{"id":2102}]}

Response codes:

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

Response data:
{}