Skip to content
dotasek edited this page Dec 19, 2022 · 6 revisions

The example code in this repository demonstrates how to validate FHIR resources using the org.hl7.fhir.core libraries.

To use these libraries you will first have to import them into your project as Maven dependencies:

 <dependency>
   <groupId>ca.uhn.hapi.fhir</groupId>
   <artifactId>org.hl7.fhir.validation</artifactId>
   <version>${org.hl7.fhir.core.version}</version>
 </dependency>

 <!-- Needed to define external servers -->
 <dependency>
   <groupId>com.squareup.okhttp3</groupId>
   <artifactId>okhttp</artifactId>
   <version>4.9.0</version>
 </dependency>

Once your project has these dependencies, you can customize the code in these examples to perform the validation your require.

The validation process is broken down into three steps:

  1. Initializing the Validation Engine
  2. Loading IGs
  3. Validating Resources

Each step links to code examples that are also used to run JUnit tests to verify their functionality.

Clone this wiki locally