toFHIR Features: Mapping Testing
When defining a mapping from your EHR data to a FHIR resource, it's important to test the mapping before executing it on the entire dataset. Running the full mapping process each time can be time-consuming and inefficient. Instead, you may want to test the mapping on a small subset of the data to verify that it works as expected. Additionally, it's useful to check whether the generated FHIR resource is valid. In this post, we’ll explore how to do that using toFHIR.
Mapping Testing in Action

First, you need to select the mapping you want to test. In the mapping menu, you’ll find a Test button at the top. Clicking this button will open the testing page.

In the mapping testing menu, you need to configure a few settings before starting the test:
- Test With Job: Select a job definition from the available jobs.
- Test With Task: Choose a mapping task from the selected job.
- Order: Specify whether toFHIR should read the data sequentially or in a randomized order.
- Row Amount: Set how many rows should be read from the data source.
Once you’ve completed the required configurations, you can start the test by clicking the green Start button.

In the test results view, you can clearly compare the input data with the resulting FHIR resource. On the left-hand side, you'll see the source JSON — the raw data taken from the selected job and task. On the right-hand side, you’ll see the corresponding FHIR resource generated by the mapping logic you’ve defined. This side-by-side layout allows you to easily verify whether each field in the source data has been correctly mapped to the appropriate FHIR elements. It’s especially useful for spotting missing values, incorrect mappings, or any formatting issues before running the mapping on a larger dataset.

When you click the Validate button, the generated FHIR resource is checked against FHIR resource definition. This validation helps ensure that the structure and content of your mapped resource conform to FHIR standards. Any errors or warnings detected during validation will be shown, allowing you to quickly identify and fix issues before using the mapping in production.

When you click the Show Validation Result button, a detailed view of the validation outcome is displayed. This view presents informational messages, warnings, and errors generated during the validation process. Each message indicates which part of the FHIR resource failed validation and helping you identify issues such as missing required fields, invalid codes, or unmet constraints. Reviewing these messages allows you to refine your mapping and ensure the resulting FHIR resource is fully compliant.