Care Connect API Implementation Guide - Java (code) Examples

Version 1.0.0-alpha of the API was released yesterday (the webex will be available soon).

We had a few questions on test servers and JSON versions of the examples.

Test Server

We used a local version of the public HAPI server ( for testing out the search parameters. The easiest way to explore CareConnectAPI/FHIR is to use the public site but this supports all the FHIR Search parameters not just the common core listed in the CareConnectAPI IG.

The code for the local version is based on this post (HOWTO Build a health database and FHIR API Server in 15 mins using open source - current github but is configured to run using maven and springboot. This can be found here:
This uses a embedded Apache Derby database but doesn’t include the HAPI overlay which the main version uses but is useful for a developer.

CareConnect Profiles Examples

The XML examples were again built using HAPI (java libraries) the code can be found here
This is also a springboot app.

When run the code will output FHIR resources in XML format to the console and post the resources to the standalone HAPI server.

To change output to JSON and where the resources are sent, your will need to use a JSON parser and alter the serverBase string. These can be found in

     IParser parser = ctxFHIR.newXmlParser();
// This is to base HAPI server not the CareConnectAPI
     String serverBase = "";`

In the example below this line of code has been changed to use the public HAPI server and JSON Parser

     IParser parser = ctxFHIR.newJsonParser();
// This is to base HAPI server not the CareConnectAPI
     String serverBase = "";`

Recording of webex