Skip to content

Getting started

verzada edited this page Mar 10, 2017 · 3 revisions

How to get started with creating a Fhir web service

Some basic information first

Before I start explaining how you create a fhir web service, you need to know about the structure in FhirStarter.

Name of the library Explaination
FhirStarter.Bonfire The Bonfire project is the main library. It is the core library which 99% of the logic lies in.
FhirStarter.Flare The Flare project contains only the global.asax and global.asax.cs file plus a xslt to render results to html.
FhirStarter.Inferno The Inferno project runs the fhir service. This service references the Bonfire and Flare project directly for debugging purposes
Fhirstarter.Inferno.Template The Inferno.Template project references the nuget packages from nuget.org, and can be used as a starting project for new fhir projects since all the basic necessities are present in the template project.

A FhirStarter service is based on the IFhirService interface. It contains all the necessary methods which the FhirController needs to access when receiving a request.

The FhirController is using ninject to create instances of IFhirServices, so you can have as many services as you want, but the resource in each service must be unique. So you can't for example have two Patient services in the same Inferno project.

How to get a head with FhirStarter

Since most of the logic to handle fhir is in the Bonfire project, the only thing needed to get things running is to copy the FhirStarter.Inferno.Template project and put it in your fhir solution.

It is preferable to change the Inferno.Template project (assembly and all) to something more easily associative with what the service is supposed to do. For example, PatientRegistry if the Inferno service is just getting patients from a registry.