FHIR Example Channel
Importing the Example Channel
Creating the Database
Adding the Configuration Map Properties
Notes on Implementation
Sending Sample Requests
Next Steps
Note:
This example channels are hosted
Success Community
as a zip file and includes the necessary code templates and transformer.
Importing the Example Channel
Creating the Database
Adding the Configuration Map Properties
Notes on Implementation
Sending Sample Requests
Next Steps
Recommendations
Explore
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Importing the Example Channel
Log on to Success Community and download the FHIR Example Channel zip file, which can be found in Mirth Connect Download Central. Unzip the file to a desired location. Then open the Mirth® Connect Administrator, navigate to the Channels view, and click on Import Channel to the left. Select the channel XML file, and then click Open(You can import it into versions 4.6 and later). The channel comes bundled with a couple of code template libraries, so make sure to choose Yes and then Import when it prompts you: Then you'll be taken to the edit channel view: Image of the Edit Channel view. Click on Save Changes to save the channel. Parent topic: FHIR Example Channel
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Next Steps
This sample channel is intended as a starting point to teach you the basics of FHIR resources/interactions and how the FHIR Listener works with them. From here, feel free to tweak the destinations or add more as you see fit. The trial-use standard tells you what to do with resources (create them, update them, etc.), and you can use Mirth® Connect to customize the actual implementation however you wish. Parent topic: FHIR Example Channel
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Adding the Configuration Map Properties
The example channel also relies on some configuration map properties to store database connection information. If you don't already have configuration map properties set, you can import this file: PostgreSQL: # The type of database server (postgres, sqlserver).fhirDBDatabaseType = postgres# The JDBC Driver class to use when connecting to the FHIR database.fhirDBDriver = org.postgresql.Driver# The JDBC connection URL to use when connecting to the FHIR database.fhirDBUrl = jdbc:postgresql://localhost:5432/fhirdb# The username to use when connecting to the FHIR database.fhirDBUsername = postgres# The password to use when connecting to the FHIR database.fhirDBPassword = postgres# The maximum amount of retry attempts when a database connection fails.fhirDBMaxRetries = 3 SQL Server: # The type of database server (postgres, sqlserver).fhirDBDatabaseType = sqlserver# The JDBC Driver class to use when connecting to the FHIR database.fhirDBDriver = net.sourceforge.jtds.jdbc.Driver# The JDBC conn
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Sending Sample Requests
Once you've made any necessary tweaks to the channel or configuration map (like pointing it to your local database), save and deploy it. The FHIR Listener channel will be up and running, and you should be able to request the home page at the URL http://localhost:9001/r4/, or the conformance statement at the URL http://localhost:9001/r4/metadata. Note that the IP, port, or base context path may be different depending on your source connector settings. If you request a resource (like the conformance statement) in a web browser, it will return the HTML template with the resource narrative (if available): Image of the HTML template of the CapabilityStatement Resource Creating a Patient Resource After verifying the /metadata endpoint works correctly, try creating a new Patient resource. To do this, POST a request to http://localhost:9001/r4/Patient. You can go here to get some example patient resources: Resource Patient - Examples. If you choose an XML-formatted resource, use "application/f
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Notes on Implementation
First, note that certain interactions have been selectively enabled for certain resource types. For this example we'll only actually be implementing some interactions, so this is largely for illustration. You can enable or disable interactions as you see fit, so that the generated conformance statement will reflect that support to clients. On the source connector settings, we also have a custom "response" variable selected. This indicates that the FhirResponse object the FHIR Listener uses will be retrieved from the response map. Source Transformer Here we have a single step. We use destination set filtering to decide in advance which destination to send a message to. Each destination is named according to one of the possible FHIR interactions, like "create" or "update". Because the interaction of the request will be in the "fhirInteraction" source map variable, we can use that to directly filter on destinations:var interaction = sourceMap.get('fhirInteraction'); if (interaction == 'op
Mirth® Connect by NextGen Healthcare FHIR Connector User Guide
Creating the Database
This example channel depends on a database to store resource information. It is setup to support PostgreSQL or SQL Server, though you can modify the code templates to support others. Once you create a schema (e.g. "fhirdb"), here are the other create statements you need: PostgreSQL: CREATE SEQUENCE resource_sequence INCREMENT 1 START 1;CREATE TABLE resource( sequence_id bigint NOT NULL DEFAULT nextval('resource_sequence'::regclass), name character varying(255) NOT NULL, id character varying(255) NOT NULL, version integer NOT NULL, data xml, mimetype character varying(255), last_modified timestamp with time zone DEFAULT now(), deleted boolean, request_method character varying, request_url character varying, CONSTRAINT resource_pkey PRIMARY KEY (sequence_id), CONSTRAINT resource_unq UNIQUE (name, id, version)); SQL Server: CREATE TABLE resource_sequence( id BIGINT NOT NULL);INSERT INTO resource_sequence VALUES (1);CREATE TABLE resource( sequence_id BIGINT NOT NULL, name NVARCHAR(255) NOT