Validation

The FHIR requests are validated using the FHIR validator provided with the HAPI-FHIR. This reads profiles (StructureDefinition files) that are downloaded from Simplifier (https://simplifier.net/Kjernejournalr4/).

The validator checks that the submitted resource meets the requirements specified in the profile; this covers structure, cardinality, as well as other constraints that that we have defined. The FHIR validator has been extended to check that the resource contains a URL. That url defines which profile the resource claims to match. This is to ensure that we only receive resources that claim to meet kjernejournal's requirements. Some rules are difficult / impossible to validate with the FHIR validator. This applies to date / age validation and validation of major coding systems such as ATC and FEST. We therefore do an additional validation of this information ourselves (after we have used the FHIR validator).

Schema validation

The Forge tool is used to document and develop the FHIR alert info profiles. From this tool the FHIR json files with constraint rules are uploaded to Simplifier.

These json files are then download from Simplifier as resources in the code and used by the Hapi validator libraries.

Custom validation

Following logical rules are not captured by the schema validation, but instead implemented as custom validations:

  • In case of change / activation of a registration: The infection field is not be changed

  • Time: The patient's age must be between 0 and the actual age (if selected)

  • Time: Date must be between birthday and today's date (if selected)

  • Changed and created date can not be forward in time.

  • Changed date can not be before the previous version of the same registration.

© Norsk helsenett - kjernejournal