Element | Description |
---|---|
Authentication and Application Parameters | All authentication tokens and other configurable parameters are storred in the app.properties file. A (mostly) working example of this file is included in the root of the folder of the zip file that is used by application users. For full functionality you will need to provide your UMLS and Synthea keys. Developers can add an app.properties file to the fhir-to-omop/src/main/resources/auth folder. This file is excluded from our repository explicitly in .gitignore and is explicitly removed as part of the deploy build. |
Data Value Objects (DVOs) |
The OMOP Common Data Model (CDM) tables are represented in the Java code base of fhir-to-omop as Data Value Objects (DVOs). These data value objects are auto generated by querying the databases meta data and then constructing Java classes that exactly represent these tables. The intersection between FHIR and OMOP is completely encapsulated in the OmopPersonEverything class. The OmopPersonEverything is constructed using and FHIR /Person/[ID]/$everything resource. The OmopPersonEverything then provides this resources as collections of DVOs that exactly map to OMOP tables. These DVO objects can then be used to directly write data to the data base using the Dao class. These DVO objects can also be used to otherwise represent the data as CDM structures (e.g. by writing the data to CSV files that represent the CDM tables). In some cases additional information is derived from the data. This additional data is managed using the DvoProxy class (which create DVO classes under the hood). Details for the OmopPersonEverything and OmopPersonEverythingFactory are listed in the Utilities section below. |
Tool | Description |
---|---|
Build Your OMOP CDM Database |
Build a complete OMOP CDM Database
The CreateOmopInstanceTool class will build a complete OMOP CDM database that is ready to receive data and get plugged into OHDSI tools. This tool will
This tool can be run from the Standalone Application using the "instant-omop" or "i" option:
|
Get the IDs of the Patients on Your FHIR Server |
Get a list of all of the IDs for all of the patients on a FHIR server.
Before you can ask for a patient, you'll need to know what patients exist on a server. This tool can be used to fetch the entire list of patients that exist on a server. The ids will be written to a list of files with 1000 patient ids each. The files are written to the dir specified in the app.properties file. This utility gets all of its parameters from the app.properties file. This tool was developed using the Synthea SyntheticMass FHIR Server. To run this tool using SyntheticMass you will need to get Synthea credentials as describe in the Getting Started document. This tool can be run using the DownloadPatientIds tool. This class has a main method that can be call directly.
This tool can be run from the Standalone Application using the "download-patient-ids" or "ids" option:
|
Download Patients from Your FHIR Server |
Download a set of patients from a FHIR Server.
The DownloadPatients tool is used to download a set of patients from a FHIR server. This class has a main method that can be called directly. The FHIR server is configured in the app.properties file. This tool uses the files down loaded by the DownloadPatientIds tool that contain the patient ids for the FHIR server. This tool is configured in the app.properties file to point to the directory containing the id files. When the tool is run all of the resources representing the Patient/[id]/$everything resource for each patient is downloaded. The Patient/[id]/$everything resource is allowed to be paged so each patient is usually represented by more than one file. The files representing each patient are downloaded into a directory given the name of the patient id. Each file in that directory is prefixed with the download order (0_, 1_, etc.) and the patient id and an arbitrary guid (to prevent duplicates).
This tool can be run from the Standalone Application using the "download" or "d" option:
|
Upload Patients |
Upload Your FHIR Patients into Your OMOP CDM Database
The PopulateOmopInstanceFromFhirFiles tool can be used to populate an OMOP instance from a set of files representing FHIR patients. This tool is configured in the app.properties file. This tool will scan a root directory. Each directory in the root directory represents a patient. All of the files in that directory are Patient/[id]/$everything resources. Each Patient/[id]/$everything file is read. The set of files are parsed into a single OmopPerson object. The OmopPerson object is composed of Data Value Objects (DVOs) that are exact 1:1 mappings to the OMOP CDM. The OmopPerson object is then written to the OMOP CDM Database. The PopulateOmopInstanceFromFhirFiles tool has a main method and can be called directly.
This tool can be run from the Standalone Application using the "download" or "d" option:
|
Atlas: Initialization |
Initialize Atlas MS Sql Server Database and PostgreSql Database
This tool is provided to automate the creation of the database objects (e.g. users, permissions, schemas, tables, etc.) required for installation of Atlas. Detailed instructions for installing Atlas are provided here.
This tool can be run from the Standalone Application using the "download" or "d" option:
|
Atlas: Datasources |
Initialize Atlas MS Sql Server Datasources
This tool is provided to automate the creation of the database objects (e.g. users, permissions, schemas, tables, etc.) required for the Atlas Data Sources functionality. This needs to be a separate process from the Atlas initialization as other steps need to be peformed before this step can be completed (e.g. the Postgres server needs to be created manually before this process can be executed). Detailed instructions for installing Atlas are provided here.
This tool can be run from the Standalone Application using the "download" or "d" option:
|
OAUTH Authentication | The fhir-to-omop tools use dynamic class loading to allow for any authentication method to be integrated into this framework. Authentication is done in the FhirServerAuthenticator class. This class dynamically loads the implementation of the HttpClientAuthenticator interface specified in the app.properties file. The HeaderTokenAuthenticator class is an implementation of HttpClientAuthenticator that is provided by this framework. This is the authenticator that has been used to authenticate to the SyntheticMass FHIR patient server. Other authenticators will be made available as requirements dictate as new servers become supported. The FhirServerAuthenticatorIntegrationTest class demonstrates how this authentication is implemented. |
FHIR Parser Classes | The org.nachc.tools.fhirtoomop.fhir.parser package contains a series of Parser classes. These classes use the HAPI FHIR API to parse FHIR resources. The Parser classes encapsulate HAPI FHIR API functionality and simplify common tasks such as reducing indirection and aggregating functionality in to single method calls. |
FHIR Patient | The FhirPatient class is a Data Value Object (DVO) that represents a FHIR Patient resource. The FhirPatient is composed of a series of FhirParser objects that represent the different components of a FhirPatient. For example, for each FhirPatient instance, there is a single PatientParser representing the patient data and lists of EncounterParser, ConditionParser, MedicationRequestParser, etc. objects that compose each FhirPatient instance. |
FHIR Patient Factory | The FhirPatientFactory class builds a FhirPatient from a FhirPatientResources. The FhirPatientResources class represents a list of resources that represent a single FHIR Patient/[id]/$everything resource. FhirPatientResources is an interface and can be used for any FHIR resource that can be converted into an InputStream (e.g. FhirPatientResources can use files or pull data directly from a FHIR REST service). Use of the FhirPatientFactory is demonstrated in the FhirPatientFactoryIntegrationTest class. |
DVO Classes | The org.nachc.tools.omop.yaorma.dvo package contains a series of Data Value Objects (DVOs). These DVOs represent a one-to-one mapping of the OMOP Common Data Model (CDM). Each DVO represents an OMOP CDM table. Each DVO has a field that represents each attribute of the OMOP CDM entity it represents. These classes are used to compose the OmopPerson class described below. These classes can be written to the database directly, or can be used to otherwise persist the information they contain (for example, they could be used to write the data to csv files etc.). |
OMOP Person | The OmopPerson class represents all of the OMOP CDM data for a single person. The OmopPerson object is composed of collections of DVO objects that are one-to-one mappings to the OMOP CDM. Instances of OmopPerson are created from a FhirPatient object by the OmopPersonFactory class described below. |
OMOP Person Factory | The OmopPersonFactory class takes an instance of a FhirPerson and creates an OmopPerson instance. Each component of the OmopPerson is built by its respective Builder class. Builder classes are found in the org.nachc.tools.fhirtoomop.omop.person.factory.builder package. The functionality of the OmopPersonFactory class is demonstrated in the OmopPersonBuilderIntegrationTest class. |
Write OMOP Person to CDM Database | The WriteOmopPersonToDatabase class writes a single OmopPerson to an instance of the CDM as specified in the app.parameters file. The functionality of this class is demonstrated in the WriteOmopPeopleToDatabaseIntegrationTest class. This class is used in a multi-threaded environment to write up to 200 patients per second to an OMOP instance (approximately 1.5 million patients in 2 hours). |
Write OMOP People to CDM Database (Threading Implementation) | The WriteOmopPeopleToDatabase class implements the threading model used by the fhir-to-omop tools to write FHIR Patients to OMOP. This threading model is very efficient and is capable of processing 1.5 million FHIR Patients in approximately 2 hours. This includes the entire process including reading the file from disc, parsing the FHIR content using HAPI FHIR, mapping of FHIR systems and codes to OMOP vocabulary_id values and OMOP concept_id values, and the inserts in to the OMOP data tables to populate the OMOP database. This threading model is based on the ThreadTool framework described below. The functionality of the WriteOmopPeopleToDatabase class is demonstrated in the WriteOmopPeopleToDatabaseIntegrationTest class. |
thread-tool (Threading Framework) |
The thread-tool project
is a framework that can be used to easily create very efficient multi-threaded applications.
This framework provides several advantages over other strategies for implementing multi-threaded applications in Java
|