Discover how a bimodal integration strategy can address the major data management challenges facing your organization today.
Get the Report →Connect to FHIR Data from PowerBuilder
This article demonstrates how to use the CData ODBC Driver for FHIR to connect to FHIR data and execute queries in PowerBuilder.
The CData ODBC Driver for FHIR can be used from any platform or development technology that supports ODBC, including PowerBuilder. This article shows how to connect to FHIR data and execute queries from the Database Painter and controls such as the DataWindow.
Connect to FHIR as an ODBC Data Source
If you have not already, first specify connection properties in an ODBC DSN (data source name). This is the last step of the driver installation. You can use the Microsoft ODBC Data Source Administrator to create and configure ODBC DSNs.
Set URL to the Service Base URL of the FHIR server. This is the address where the resources are defined in the FHIR server you would like to connect to. Set ConnectionType to a supported connection type. Set ContentType to the format of your documents. Set AuthScheme based on the authentication requirements for your FHIR server.
Generic, Azure-based, AWS-based, and Google-based FHIR server implementations are supported.
Sample Service Base URLs
- Generic: http://my_fhir_server/r4b/
- Azure: https://MY_AZURE_FHIR.azurehealthcareapis.com/
- AWS: https://healthlake.REGION.amazonaws.com/datastore/DATASTORE_ID/r4/
- Google: https://healthcare.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/datasets/DATASET_ID/fhirStores/FHIR_STORE_ID/fhir/
Generic FHIR Instances
The product supports connections to custom instances of FHIR. Authentication to custom FHIR servers is handled via OAuth (read more about OAuth in the Help documentation. Before you can connect to custom FHIR instances, you must set ConnectionType to Generic.
Create a Profile for the ODBC Driver for FHIR
Follow the steps below to use the Database Painter tool to create a database profile based on an ODBC DSN (data source name) for FHIR. In the Database Painter, you can use wizards and the UI to work with FHIR data.
- In PowerBuilder, click Tools -> Database Painter.
- In the Objects window in the Database Painter, right-click the ODBC node and click New Profile.
- On the Connection tab, enter a name for the profile and select the FHIR DSN in the Data Source menu.
- To view and modify a table, right-click a table and then click Edit Data -> Grid.
Using FHIR Data with PowerBuilder Controls
You can use standard PowerBuilder objects to connect to ODBC data sources and execute queries. The following example shows how to retrieve FHIR data into a DataWindow. You can add the following code to the open method:
SQLCA.DBMS = "ODBC"
SQLCA.DBParm = "ConnectString='DSN=CData FHIR Source'"
CONNECT USING SQLCA;
dw_patient.SetTransObject(SQLCA);
dw_patient.Retrieve();