Module health.clients.fhir.epic

ballerinax/health.clients.fhir.epic 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.epic.com/interconnect-fhir-oauth/api/FHIR/R4/metadata

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
Accountread
search-type
-
AdverseEventread
search-type
-
AllergyIntolerancecreate
read
search-type
-
Appointmentread
search-type
-
Binaryread
search-type
-
BodyStructurecreate
read
search-type
update
-
CarePlanread
search-type
-
CareTeamread
search-type
-
Claimread
search-type
-
Communicationcreate
read
search-type
-
ConceptMapcreate
read
-
Conditioncreate
read
search-type
-
Consentread
search-type
-
Contractread
search-type
-
Coverageread
search-type
-
Deviceread
search-type
-
DeviceRequestread
search-type
-
DeviceUseStatementread
search-type
-
DiagnosticReportread
search-type
update
-
DocumentReferencecreate
read
search-type
update
-
Encounterread
search-type
-
Endpointread
search-type
-
EpisodeOfCareread
search-type
-
ExplanationOfBenefitread
search-type
-
FamilyMemberHistoryread
search-type
-
Flagread
search-type
-
Goalread
search-type
-
Groupread
search-type
group-export
ImagingStudyread
search-type
-
Immunizationread
search-type
-
ImmunizationRecommendationread
search-type
-
Listread
search-type
-
Locationread
search-type
-
Measureread
search-type
-
MeasureReportread
search-type
-
Mediaread
search-type
-
Medicationread
search-type
-
MedicationAdministrationread
search-type
-
MedicationDispenseread
search-type
-
MedicationRequestread
search-type
-
NutritionOrderread
search-type
-
Observationcreate
read
search-type
update
-
Organizationread
search-type
-
Patientcreate
read
search-type
summary
match
Practitionerread
search-type
-
PractitionerRoleread
search-type
-
Procedurecreate
read
search-type
update
-
Provenanceread-
Questionnaireread
search-type
-
QuestionnaireResponsecreate
read
search-type
-
RelatedPersonread
search-type
-
RequestGroupread
search-type
-
ResearchStudyread
search-type
-
ResearchSubjectread
search-type
-
ServiceRequestcreate
read
search-type
update
-
Specimenread
search-type
-
Substanceread
search-type
-
Taskread
search-type
update
-

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>/epic.fhir.connector;
import ballerina/io;


public function main() returns error? {
    // Initialize the Epic connector client
    fhirClient:FHIRConnectorConfig epicConfig = {
        baseURL: base,
        mimeType: fhirClient:FHIR_JSON,
        authConfig: {
            tokenEndpoint: tokenEndpoint,
            clientId: clientId,
            keyFile: keyFile
        }
    };
    connector:FHIRClientConnector epicFhirclientconnector = check new (epicConfig);
    
    // Example 1: Read a patient by ID
    fhir:FHIRResponse fhirFhirresponse = check epicFhirclientconnector->getPatientById("erXuFYUfucBZaryVksYEcMg3");
    io:println("Patient Read Response: ", fhirFhirresponse.'resource);

}

Import

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

Other versions

1.0.0

Metadata

Released date: 21 days 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

Healthcare

FHIR

epic

epic-fhir-connector