This repository shows reference material related to CDC Electronic Case Reporting (eCR) for cancer registry. The reference material uses Medplum Bots to validate and synchronize the FHIR resource bundles to the registry.
At a high level this integration takes a FHIR Transaction Bundle or FHIR DiagnosticReport resource from an EHR, like Endosoft, and produces a FHIR Message bundle and synchronizes it to the CDC FHIR server.
The workflow corresponds to the Cancer Reporting FHIR Implementation Guide.
Sample bundles are available in this repository.
The CDC maintains a FHIR server that expects expects bundles with a specific structure. The toolkit demonstrated here shows the process of receiving an FHIR bundle and then validating and reformatting it into the structure required by the Cancer Reporting FHIR Implementation Guide.
This repository also includes a unit test for the conversion, which can be useful as an example.
The message bundle has the following structure. Here is documentation on bundles and sample bundles. EHRs and other medical systems are typically the source for bundles like these.
├──Message Header
| ├──Collection Bundle
| | ├──Patient
| | ├──Practitioner
| | ├──PractitionerRole
| | ├──DiagnosticReport
| | ├──Observation 1
| | ├──Observation 2
| | ├──Observation *
The message bundle has the following structure. Here is documentation on bundles and sample bundles. This is what the CDC system expects to receive.
├──Transaction Bundle
| ├──Patient
| | ├──Practitioner
| | ├──PractitionerRole
| | ├──DiagnosticReport
| | ├──Observation 1
| | ├──Observation 2
| | ├──Observation 3
To set up your bot deployment you will need to do the following:
- Create a Bot on Medplum, call it
medmorph-bot
and note itsid
. (All Bots in your account can be found here) - With the
id
of the Botid
in hand, add a section tomedplum.config.json
like so
{
"name": "medmorph-bot",
"id": "<bot-id>",
"source": "src/examples/medmorph-bot.ts",
"dist": "dist/medmorph-bot.js"
}
- Create an ClientApplication on Medplum. (All ClientApplications in your account can be found here)
- Create a .env file locally by copying
.env.example
and put theClientId
andClientSecret
from theClientApplication
into the file. - (Optional) Create an AccessPolicy on Medplum that can only read/write Bots and add it to the Bot in the admin panel.
Create a Subscription on Medplum with criteria "Bundle" and have it trigger the bot you've just created.
Set bot secrets MEDMORPH_DEMO_REPORT_ENDPOINT
and MEDMORPH_DEMO_REPORT_ENDPOINT_AUTH
to the endpoint that the bot should send the final results to.
To run and deploy your Bot do the following steps:
Install:
npm i
Build:
npm run build
Test:
npm t
Deploy medmorph bot:
npx medplum deploy-bot medmorph-bot
You will see the following in your command prompt if all goes well:
Update bot code.....
Success! New bot version: 7fcbc375-4192-471c-b874-b3f0d4676226
Deploying bot...
Deploy result: All OK
- MedMorph Data Flow Diagram, this repo represents the Data Health Exchange App
- MedMorph Specification Bundle
- Reference Bot