// This module is included in the following assemblies:
// as_connecting-to-fhir.adoc

[id='creating-fhir-connections_{context}']
= Creating a connection to a FHIR server

In an integration, to operate on FHIR resources, 
create a connection to a FHIR server and then add that connection to 
the middle of a flow or as a simple integration's finish connection. 

A FHIR connection cannot be the start connection of a simple
integration. However, you can start a simple integration with a timer 
that periodically triggers a FHIR connection. 

.Prerequisites
* You must know the URL for the FHIR server that you want to connect to. 
* You must have authorization credentials for accessing the FHIR server. 
You should obtain these from the FHIR server administrator. 
Rarely, a FHIR server does not require authentication and you can 
create a connection without specifying credentials. For example, 
a public FHIR server or a FHIR server in a private network might 
not require authentication.

.Procedure

. In {prodname}, in the left panel, click *Connections* to
display any available connections.
. Click *Create Connection* to display
connectors.  
. Click the *FHIR* connector and configure the connection as follows:
.. In the *FHIR version* field, accept *DSTU3*, which is required.
.. In the *FHIR server URL* field, enter the URL for the FHIR server 
that you want to access. While creating an integration, you might
accept the default test server `\http://fhirtest.uhn.ca/baseDstu3`.
.. In the *FHIR server username* field, enter your username. This 
is required by FHIR servers that use basic authentication. 
.. In the *FHIR server password* field, enter your password, which 
is also required by FHIR servers that use basic authentication.
.. In the *FHIR server bearer token* field, enter your token.
This is required by FHIR servers that use OAuth authentication. 
. Click *Validate*. {prodname} immediately tries to validate the 
connection and displays a message that indicates whether 
validation is successful. If validation fails, revise the input 
parameters and try again.
. If validation is successful, click *Next*.
. In the *Name* field, enter your choice of a name that
helps you distinguish this connection from any other connections.
For example, you might enter `FHIR West`.
. In the *Description* field, optionally enter any information that
is helpful to know about this connection. 
. Click *Save* to see that the connection you 
created is now available. If you
entered the example name, you would 
see that *FHIR West* appears as a connection that you can 
choose to add to an integration. 
