mishkin
mishkin

Reputation: 6212

Is there an easy way to generate sample FHIR resources?

Without using commercial tools, is there an easy way to generate sample FHIR resources?

I'm working an a project to store FHIR messages to Elasticsearch, and I need a tool to generate FHIR sample messages in real-time to ship over TCP/IP.

Upvotes: 15

Views: 8764

Answers (4)

Soundararajan
Soundararajan

Reputation: 2194

Here are few options 1 & 3 gives you proper schema, 2 gives you clinically relevant data.

  1. FHIR Bulk Downloader sample app allows you to generate sample bulk FHIR extracts for given resource types. It has a reasonable number of records to be used for non-clinical use cases, like populating an elastic cache, building a parser etc.,
  2. A more meaningful form of the data is available in MIMIC III. This is a clinical database de-identified and is available for download. It's a full fledged qualified clinical database and is used in lot of research papers. This is in roughly 100 GB in total size, but realistic data. There could be some details on the type of medical coding used, fields that are populated, but that is totally dependent on the use case you are looking at this data for. Maintains referential integrity across FHIR resources.
  3. Some generated sample data from SMART on FHIR is available in this github repo, that can be used readily.

Upvotes: 0

citizenrich
citizenrich

Reputation: 335

An easy way to generate example resources (in 2022) is to use FHIR Shorthand (FSH). Here's a copy of the example on FSH School from which you easily create the JSON.

Link: https://fshschool.org/FSHOnline/#/share/3LH920m

Instance: PatientExample
InstanceOf: Patient
Description: "Example of Patient"
* name.family = "Anyperson"
* name.given[0] = "John"
* name.given[1] = "B."
// The first element [0] can also be represented as [+] if it is not preceded by any hard index
* contact.telecom[+].system = #phone
* contact.telecom[=].value = "555-555-5555"
* contact.telecom[=].use = #home
* gender = #male
* birthDate = "1951-01-20"
* address.line = "123 Main St"
* address.city = "Anytown"
* address.postalCode = "12345"
* address.country = "US"

Have a try at https://fshschool.org/

A bonus is that you can reverse JSON into FSH as well. And, templating is easy enough use in FSH (though it's not built-in.). For a worked example see https://github.com/intrahealth/bulk-fsh

Upvotes: 3

mishkin
mishkin

Reputation: 6212

Did some digging and here is what I've found.

If you do not need a lot of samples, the easiest way is to grab a zip file with resource examples from hl7 website http://hl7.org/fhir/downloads.html

IMHO the easiest way I've found to get more than a few samples is by using Synthea project. You can generate millions of records of synthetic realistic data https://github.com/synthetichealth/synthea

They even run a public server. Here is an example to get a bundle with 100 patients - very neat! https://syntheticmass.mitre.org/fhir/Patient?_offset=0&_count=100

You can also find examples of bulk FHIR API implementations - some of them have demo web sites you can use to download examples: https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/implementations.md

Another generator in Python from SMART on FHIR project (looks outdated): https://github.com/smart-on-fhir/sample-patients.

Upvotes: 24

Grahame Grieve
Grahame Grieve

Reputation: 3586

The only way I know to do this is to use a service provided by test.fhir.org. You call

http://test.fhir.org/r3/StructureDefinition/[resource]/$generate-template

e.g.

http://test.fhir.org/r3/StructureDefinition/Patient/$generate-template

Upvotes: 6

Related Questions