Sidebar
0 votes
140 views
by hunter-k-2626 (150 points)

Where can I find more information about deploying the HAPI libraries and start using them?

The "FHIR Starter Kit" doesn't seem to use it and documentation seems to be sparse. If there's a dedicated document, I'd love to see it.

  • Does HAPI come in an external library? Is it a QIE-specific version?
  • How do we enable the ability to use HAPI?
  • Does HAPI allow me to use standard fields/operations in the mapping blocks? Or is it just script-based?
  • Does HAPI allow me to build URLs/queries? Or can I just parse results?

Thanks!

1 Answer

+1 vote
 
Best answer

To add the HAPI library to QIE:

1. System Administration

2. System Configuration

3. Manage External Libraries

----------------------------------------------------------------------------

----------------------------------------------------------------------------

From here, you can download the HAPI library version from a list of available versions.

----------------------------------------------------------------------------

----------------------------------------------------------------------------

Below is an example of creating a FHIR Account using the HAPI functions:

var account = new hapi.r4.Account();

account.setId("exampleAccount");

account.addIdentifier().setValue("654321").setSystem("urn:oid:0.1.2.3.4.5.6.7");

account.setStatus(hapi.r4.Account.AccountStatus.ACTIVE);

var ctx = hapi.context.getR4FhirContext();

// Instantiate a new JSON parser

var parser= ctx.newJsonParser();

parser.setPrettyPrint(true);

// Serialize it

var accountString = parser.encodeResourceToString(account);

message = qie.createJSONMessage(accountString, 'UTF-8');

----------------------------------------------------------------------------

----------------------------------------------------------------------------

You can find more information about the HAPI resources on the HAPI website:

https://hapifhir.io/hapi-fhir/docs/

by michael-h-5027 (15.2k points)
selected by hunter-k-2626
...