0.0.1 - CI Build

SequoiaProjectHealthcareDirectoryImplementationGuideSTU3 - Local Development build (v0.0.1). See the Directory of published versions

Detailed Workflow Example

Previous Page - Validate Operation

Query, Create, and Query sequence: Please note the below are live examples tested in a development environment. Production use of the directory MUST utilize TLS encryption. First we’ll perform a query to show that no organizations start with the name ‘EricXYZ’. curl ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=EricXYZ’ Note: We expect no results.

Bundle Read Success Example

As an additional test, we’ll attempt to query for an organization with an id of a test OID of 5.5.5.5. curl ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_id=5.5.5.5’ As expected (since the OID is not a valid Organization.id in the directory), there are no results returned:

Bundle Read Success Example2

Now we’ll create a new Organization (using the correct HTTP POST verb): curl -i -X POST -H “Content-Type:application/xml” “http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml” -d

Organization Create Full Example2

An successful response should be generated by the server: 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 Example2

Now we’ll query for the newly created organization: curl ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric’ Note that as shown below, no results were returned due to the fact that this organization was initially created with an active status = false. 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:21:50 -0500 ETag: “f9df2020-86ec-0136-bd28-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 555

Bundle Read Success Example3

We’ll repeat the query to return inactive organizations: curl ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric&_active=false’

Now with the addition of the ‘_active=false’ query parm, the newly created organization is now returned: 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:22:43 -0500 ETag: “195760c0-86ed-0136-bd2a-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 8629

Bundle Read Success Example4

Repeating the same POST RESTful request will result in an error: 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:22:43 -0500 ETag: “195760c0-86ed-0136-bd2a-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 8629

Bundle Update Error Example2

Here is the resulting error message. As you can see, the error was due to the use of a HTTP POST verb, which is only allowed to be used to create a new Organizational object; it MUST not be used to update an existing object. HTTP/1.1 403 Forbidden 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:24:15 -0500 ETag: “50507740-86ed-0136-bd2c-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 679

Operation Outcome Update Error Example3

So now we’ll try again using a HTTP PUT, which is the correct verb. Also, we’ll change a single line in the body of the request, where active=true, instead of active=false. curl -i -X PUT -H “Content-Type:application/xml” “http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml” -d

Organization Update Error Example4

But, as you can see an error is still being generated. The reason is that the PUT HTTP verb requires a resource to act upon. HTTP/1.1 404 Not Found Content-Type: text/html;charset=utf-8 Access-Control-Allow-Origin: * X-Cascade: pass X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff X-Frame-Options: SAMEORIGIN Content-Length: 88 Sequoia Project Healthcare Directory Server Message: ERROR FHIR resource not found error

We’ll now try again but we’ll correct the path to include the Organization.id as part of the URL: curl -i -X PUT -H “Content-Type:application/xml” “http://localhost:80/fhir-stu3/1.0.1/Organization/5.5.5.5?apikey=testkey&_format=xml” -d

Organization Update Success Example2

This results in a successful operation, as shown below: 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:31:55 -0500 ETag: “62c51a60-86ee-0136-bd2f-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 759

OperationOutcome Update Success Example3

To confirm this, we’ll repeat a query from above,and confirm that the organization is now marked with a status of ‘false’ for the ‘active’ element: curl -i ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric&_active=false’

And, as expected, no organizations were found. 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:37:08 -0500 ETag: “1d35d670-86ef-0136-bd33-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 555

Bundle Read Error Example

So we’ll change the query to only include active organizations and repeat the query. curl -i ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric’

And now our updated organization is found, showing the its status has been successfully changed from inactive to active. 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:37:53 -0500 ETag: “37f7d7b0-86ef-0136-bd37-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 8628

Bundle Read Success Example5

Next we’ll continue the example by changing the Organization contact: curl -i -X PUT -H “Content-Type:application/xml” “http://localhost:80/fhir-stu3/1.0.1/Organization/5.5.5.5?apikey=testkey&_format=xml” -d

Organization Update Success Example4

The result is a successful update operation: 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:51:14 -0500 ETag: “1536e170-86f1-0136-bd39-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 759

OperationOutcome Update Success Example5

Repeating the query operation confirms that the information has been updated: curl -i ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric’

Note the newly updated contact data elements: HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 Access-Control-Allow-Origin: * X-Custom-Value: Copyright(c) 2016-17 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:53:50 -0500 ETag: “728ab0a0-86f1-0136-bd3b-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 8629

Bundle Read Success Example6

Finally, we’ll logically delete this organization and confirm it’s active status has been set to ‘false’. curl -i -X DELETE ‘http://localhost:80/fhir-stu3/1.0.1/Organization/5.5.5.5?apikey=testkey&_format=xml’

The result of this operation are shown below: 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:56:43 -0500 ETag: “d9563f70-86f1-0136-bd3d-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 747

OperationOutcome Delete Success Example3

To confirm the delete operation had the desired effect, we can query twice. First, we’ll confirm that the organization does not get returned from the directory if the active status is set to the default value of ‘true’: curl -i ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric’

As expected, no organizations are returned: HTTP/1.1 200 OK Content-Type: application/xml; charset=utf-8 Access-Control-Allow-Origin: * X-Custom-Value: Copyright(c) 2016-17 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:59:15 -0500 ETag: “33d23920-86f2-0136-bd3e-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 555

Bundle Delete Success Example4

Repeating the query, with the addition of a active=false parameter, results in the organization being returned: curl -i ‘http://localhost:80/fhir-stu3/1.0.1/Organization?apikey=testkey&_format=xml&_name=Eric&_active=false’

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 18:00:41 -0500 ETag: “677ae9e0-86f2-0136-bd40-5481d7f50949” X-Content-Type-Options: nosniff Content-Length: 8630

Bundle Read Success Example7

This concludes the full workflow example.

Next Page - Operational Best Practices