Ready to get started?

Download a free trial of the FHIR Cmdlets to get started:

 Download Now

Learn more:

FHIR Icon FHIR Data Cmdlets

An easy-to-use set of PowerShell Cmdlets offering real-time access to FHIR. The Cmdlets allow users to easily read, write, update, and delete live data - just like working with SQL server.

How to pipe FHIR Data to CSV in PowerShell

Use standard PowerShell cmdlets to access FHIR tables.

The CData Cmdlets Module for FHIR is a standard PowerShell module offering straightforward integration with FHIR. Below, you will find examples of using our FHIR Cmdlets with native PowerShell cmdlets.

Creating a Connection to Your FHIR Data

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:
  • AWS:
  • Google:

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.

$conn = Connect-FHIR  -URL "$URL" -ConnectionType "$ConnectionType" -ContentType "$ContentType" -AuthScheme "$AuthScheme"

Selecting Data

Follow the steps below to retrieve data from the Patient table and pipe the result into to a CSV file:

Select-FHIR -Connection $conn -Table Patient | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myPatientData.csv -NoTypeInformation

You will notice that we piped the results from Select-FHIR into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.

The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.