Sequoia Project Healthcare Directory Implementation Guide
1.0.10 - Release 1

Legacy API (Pre FHIR R4 directories only)

This page contains documentation of the previous Sequoia RESTful API, prior to the release of Sequoia's FHIR R4 directories. It is retained for historical purposes only, and should not be used with current FHIR R4 directories.

Please see Primary API - CRUD Operations for documentation on the current APIs.

Create Operation

Functionality:

Potentially create new Organization resource/s in the directory. This function can be used in two modes of operation, to either create a single Organization, or a FHIR bundle containing multiple Organization resources.

Short Example

Request: Request URL: post <base url>/Organization Params:

  • apikey: ApiKey to check permission of create operation.
  • format: xml must be 'xml' for this release of the directory software

Body: One Organization resource or bundle of one or more Organization resources.

Internal Ruby Source Code Function: createOrganization(orgs, neworg)

Success Response: HTTP status code: 200 Body:

Operation Outcome Create Success Example

Error Response: HTTP status code: 403 Body:

Operation Outcome Create Error Example

Full Example

curl -i -X POST -H 'Content-Type:application/xml' 'http://FHIR-BASE-URL/Organization?_apikey=testkey&_format=xml' -d '<Organization/>'

Where the content of <Oranization/> is as follows:

Create Full Example

A successful response should be generated by the server as shown below (with HTTP headers): HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 Access-Control-Allow-Origin: * X-Custom-Value: Copyright(c) 2016-18 The Sequoia Project. All rights reserved. Business confidential. X-Powered-By: The Sequoia Project Healthcare Directory Server Server: Undisclosed Cache-Control: public, must-revalidate, max-age=3600 Expires: 2018-08-20 17:16:24 -0500 ETag: "3782fe20-86ec-0136-bd24-5481d7f50949" X-Content-Type-Options: nosniff Content-Length: 721

Operation Outcome Create Success Example 2

Read Operation

Functionality:

Retrieve or Query Resources These functions operate in two different modes retrieve or query. The distinction is that a retrieve operation only returns a single matching FHIR resource directly as a resource object, whereas a query mode of operation returns a FHIR Bundle containing potentially more that one resource that is associated with the query parameters. Request: Request URL: get /Organization/id Supported Request Parameters:

Parameter Description Additional Information
apikey ApiKey to check permission of retrieve operation
\_format xml or json Some operations such as create only support xml as detailed elsewhere in this document.
/id The Organization.id to directly retrieve Note that is is not a query parameter; it is the FHIR resource id value allowing direct access. It is used by specifying a REST request similar to .../Organization/1.2.3 where 1.2.3 is the desired Organization resource .id value.

Request: Request URL: get /Organization Supported Query Parameters: query: To filter organizations use the below query parameters:

Parameter Description Additional Information
\_id=string Return organization of which id equals to \_id Unlike a retrieve, a query always returns a FHIR bundle.
\_id=string Return organization of which id equals to \_id Unlike a retrieve, a query always returns a FHIR bundle.
\_zip=string Return organizations of which postal code equals to \_zip \_zip should be a US Postal Service value. It may be a partial zip code (less than 5 digits) in which case the query will return all resources with a matching left most zip code. For example \_zip=12345 will return matches with that zip code. A query of \_zip=12 will return directory entities with a left most two digits of 12 and any succeeding right 3 digits. It is equivalent to regular expression of 12*.
\_radius=miles Return organizations which are within the specified distance in miles. Radius based searches require that either 1) the \_zip query parameter be specified will all 5 digits, or 2) that both the \_city and \_state query parameters specified.
\_active=Boolean Return organizations of which active equals the specified value (of either true or false). The Boolean parameter must be either true or false.
\_identifier=string Return organizations of which the Organization identifier exactly equals the \_identifier query string.
\_sort=orgname Return the FHIR Bundle sorted by the Organization name attribute.
\_start=integer Return Organizations within the search results set from the \_start index.
\_count=integer Return \_count of searched organizations. If \_count=0, the n it returns number of searched organization with empty Organization list. Note that using \_start and \_count parameters together allow for convenient paging of the results to only return a manageable amount of queries per response while still allowing acquisition of the full directory. 1) if \_count is not a base 10 number then it is ignored. 2) if \_count > number of matching Organization, it returns all matching organizations. 3) if \_count <= number of matching Organization, it returns at most \_count matching organizations. 4) if \_sort param is available, then it reduces the result after sorting.
\_name=string Return organizations of which displayname or at least one aliase starts with the specified string. Please not that only alphanumeric characters are allowed. \_name:contains=string: Return organizations of which displayname or at least one aliases contains \_name \_name:exact=string: Return organizations of which displayname or at least one aliases is same as \_name. Examples: \_name=Texas (would match "texas organization" and "TEXAS") \_name:exact=Texas (would match "Texas" but not "Texas organization" and not "TEXAS"). \_name:contains=Texas (would match "Texas" and "Texas organization" and "TEXAS" and "Company in Texas USA").
\_lastUpdated= [compare] dateString This class of queries returns the requested entities based on that entitys lastUpdate metadata element. **gt**: Return organizations of which lastUpdated is greater than \_lastUpdated **ge**: Return organizations of which lastUpdated is greater than or equal to \_lastUpdated **lt**: Return organizations of which lastUpdated is less than \_lastUpdated **le**: Return organizations of which lastUpdated is less than or equal to \_lastUpdated. **eq**: Return organization of which lastUpdated is equal to \_lastUpdated. **ne**: Return organization of which lastUpdated is not equal to \_lastUpdated. Examples: \_lastUpdated=gt2017-12-31(would match 2017-12-31T00:00:01 and 2018-02-03T21:32:09 but not match 2017-12-30T23:59:59) \_lastUpdated=eq2017-12-30(would match 2017-12-30T00:00:01 but not match 2017-12-31T00:00:01 or 2017-12-29T23:59:59)

Internal Ruby Source Code Function: searchOrganizations(orgs, query_hash) Response: FHIR Bundle of zero or more Organizations potentially limited as per the above query parameters.

CURL examples:

Return the directory of active Organizations: curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml' -same as- curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml&\_active=true' Return a directory of inactive Organizations: curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml&\_active=false' Return list of directory active Organizations with updates on or after 2018-12-31: curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml&\_lastUpdated=ge2018-12-31' Query for a single organization based on its Organization.id value: curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml&\_id=1.2.1.0' Query for organizations based on the Organization.name or aliases value(s): curl 'http://FHIR-BASE-URL/Organization?_apikey=testkey&\_format=xml&\_name=ehr' Retrieve (not query) and then delete sequence: curl 'http://FHIR-BASE-URL/Organization/1.1.1.1?_apikey=testkey&\_format=xml' curl -X DELETE 'http://localhost:80/fhir-stu3/1.0.1/Organization/1.1.1.1?_apikey=testkey&\_format=xml'

Update Operation

Functionality

Potentially update one Organization resources of a certain Organization internal id value.

Request: Request URL: put /Organization Params: apikey: ApiKey to check permission of update operation _format: xml _id: ID of organization to update

Body: One Organization

Internal Function to update: updateOrganization(orgs, new_org, org_id)

Examples

Success Response: HTTP status code: 200 Body:

Operation Outcome Update Success Example

Validate Operation

Functionality

Used to confirm that a given posted document can be successfully parsed.

Request: Request URL: post /Organization/validate Params: apikey: ApiKey for filtering users. _format: xml

Body: One or bundle of Organizations.

Internal Ruby Source Code Function: checkValidationOrganization(request, requestText)

Examples

Success Response: HTTP status code: 200 Body:

Operation Outcome Validate Success Example

Error Response: HTTP status code: 403 Body:

Operation Outcome Validate Error Example