Module health.clients.fhir.cerner

ballerinax/health.clients.fhir.cerner Ballerina library

1.0.0
FHIR Client Connector

FHIR client connector that can be used to connect to a FHIR server and perform common interactions and operations.

Capability Statement

  • https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d/metadata?_format=application/json

Supported FHIR Resource Types

The table below lists supported resource types, interactions and operations. Interactions are shown as inline code and separated by line breaks for readability.

Resource TypeInteractionsOperations
CapabilityStatementread-
Accountread
search-type
-
AllergyIntoleranceread
search-type
create
update
-
Appointmentread
search-type
create
patch
-
Basiccreate-
Binaryreadautogen-ccd-if
CarePlanread
search-type
-
CareTeamread
search-type
-
ChargeItemread
search-type
modify
create
credit
Communicationread
search-type
create
patch
-
Conditionread
search-type
create
update
-
Consentread
search-type
-
Coverageread
search-type
create
patch
delete
-
Deviceread
search-type
-
DiagnosticReportread
search-type
create
-
DocumentReferenceread
search-type
create
update
USCoreFetchDocumentReferences
Encounterread
search-type
create
patch
-
FamilyMemberHistoryread
search-type
create
update
-
Goalread
search-type
-
Groupexport
Immunizationread
search-type
create
update
-
InsurancePlanread
search-type
-
Locationread
search-type
-
Mediaread-
MedicationAdministrationread
search-type
-
MedicationDispenseread
search-type
-
MedicationRequestread
search-type
create
patch
-
NutritionOrderread
search-type
-
Observationread
search-type
create
update
-
OperationDefinitionread-
Organizationread
search-type
create
get-cg-for-mrcu
Patientread
search-type
create
patch
health-cards-issue
export
Personread
search-type
-
Practitionerread
search-type
create
-
Procedureread
search-type
create
-
Provenanceread
search-type
create
-
Questionnaireread
search-type
-
QuestionnaireResponseread
search-type
update
-
RelatedPersonread
search-type
create
patch
-
Scheduleread
search-type
-
ServiceRequestread
search-type
-
Slotread
search-type
patch
-
Specimenread
search-type
-
StructureDefinitionread-

Notes:

  • indicates no special operations supported for that resource in this connector.
  • Use the server's CapabilityStatement to verify support for additional interactions or operations on a given server instance.

Functions

The connector represents the interactions and operations as functions. Each function corresponds to a specific FHIR interaction or operation.

Interaction/OperationFunction
Readget{ResourceType}ById
Version Readget{ResourceType}ByVersion
Updateupdate{ResourceType}
Patchpatch{ResourceType}
Deletedelete{ResourceType}
History Typeget{ResourceType}History
History Instanceget{ResourceType}InstanceHistory
Createcreate{ResourceType}
Search Typesearch{ResourceType}
$Operation{Operation}{ResourceType}Operation

Replace {ResourceType} with the actual resource type (e.g., Patient, Observation) and {Operation} with the specific operation name (e.g., everything, validate).

Sample Usage

Copy
import ballerinax/health.clients.fhir as fhirClient;
import <package>/cerner.fhir.connector;
import ballerina/io;


public function main() returns error? {
    // Initialize the Cerner connector client
    fhirClient:FHIRConnectorConfig cernerConfig = {
        baseURL: base,
        mimeType: fhirClient:FHIR_JSON,
        authConfig: {
            tokenUrl: tokenUrl,
            clientId: clientId,
            clientSecret: clientSecret,
            scopes: scopes
        }
    };
    connector:FHIRClientConnector cernerFhirclientconnector = check new (cernerConfig);
    
    // Example 1: Read a patient by ID
    fhirClient:FHIRResponse patientResult = check cernerFhirclientconnector->getPatientById("12724067");
    io:println("[FHIR GET] Patient resource by ID (12724067): ", patientResult.'resource);
    
    // Example 2: Search Encounters by Patient
    fhirClient:FHIRResponse encounterResult = check cernerFhirclientconnector->searchEncounter(patient = "12724066");
    io:println("[FHIR SEARCH] Encounter resources for Patient ID (12724067): ", encounterResult.'resource);
}

Import

import ballerinax/health.clients.fhir.cerner;Copy

Other versions

1.0.0

Metadata

Released date: 1 day ago

Version: 1.0.0


Compatibility

Platform: any

Ballerina version: 2201.12.3

GraalVM compatible: Yes


Pull count

Total: 0

Current verison: 0


Weekly downloads



Keywords

Area/Healthcare

Industry/Healthcare

Type/Connector

Vendor/Cerner

Cerner FHIR Connector