German Dental FHIR Profiles (R4)
0.65.0 - trial-use Germany

German Dental FHIR Profiles (R4) - Downloaded Version null See the Directory of published versions

Offline Validation

Offline validation with validator_cli

This page explains how to validate instances against this guide with the HL7 FHIR Validator (validator_cli.jar) without a terminology server (-tx n/a), and without network access once the package cache is filled.

Packages the validator loads

Every package this guide depends on is publicly available. No package from an authenticated registry is needed. The home page lists the dependencies; their exact versions are the dependencies in this guide's package.json (inside package.tgz), and each Cognovis package names its own dependencies the same way.

Package Source
hl7.fhir.r4.core, hl7.terminology.r4, hl7.fhir.uv.extensions.r4, hl7.fhir.uv.tools.r4 packages.fhir.org; the validator downloads them itself
de.basisprofil.r4, kbv.basis, kbv.ita.for, de.gematik.fhir.atf, de.gematik.dipag packages.fhir.org; the validator downloads them itself
de.cognovis.fhir.dental.core https://fhir.cognovis.de/dental-core/<version>/package.tgz
de.cognovis.fhir.billing https://fhir.cognovis.de/billing/<version>/package.tgz
de.cognovis.fhir.billing.core (a dependency of de.cognovis.fhir.billing) https://fhir.cognovis.de/billing-core/<version>/package.tgz
de.cognovis.fhir.dental (this guide) https://fhir.cognovis.de/dental/<version>/package.tgz

The validator does not find the de.cognovis.fhir.* packages on packages.fhir.org by itself. Download each archive once and pass it with -ig on every run.

The KZBV DPF finding and therapy systems need no extra package: this guide declares both with their bare codes, so the validator checks DPF codes, their letter case and their system offline (see the DPF coded emission contract). The other externally licensed catalogs (BEMA, beb'97, SWS 2.0) need none either: their CodeSystems are published with content = not-present. Versions up to and including 0.63.0 still declared a dependency on a KZBV DPF terminology package that only an authorized registry served; validate against a later version.

Example

Version 0.65.0 of this guide builds on Dental Core 0.17.0 and Billing 0.9.0, which builds on Billing Core 0.42.3. Download the four archives into the current directory:

DENTAL_VERSION=0.65.0
curl -fsSo billing-core-0.42.3.tgz https://fhir.cognovis.de/billing-core/0.42.3/package.tgz
curl -fsSo dental-core-0.17.0.tgz https://fhir.cognovis.de/dental-core/0.17.0/package.tgz
curl -fsSo billing-0.9.0.tgz https://fhir.cognovis.de/billing/0.9.0/package.tgz
curl -fsSo "dental-${DENTAL_VERSION}.tgz" "https://fhir.cognovis.de/dental/${DENTAL_VERSION}/package.tgz"

For another version of this guide, set DENTAL_VERSION to it and take the versions of the other three archives from its package.json. Then validate:

java -jar validator_cli.jar instance.json \
  -version 4.0.1 -tx n/a \
  -ig billing-core-0.42.3.tgz \
  -ig dental-core-0.17.0.tgz \
  -ig billing-0.9.0.tgz \
  -ig "dental-${DENTAL_VERSION}.tgz"

Pass the dependencies before the guide. -tx n/a turns the terminology server off; the validator then checks codes only against CodeSystems and ValueSets it finds in the loaded packages.

Validation without network access

The validator downloads the HL7, HL7 Deutschland, KBV and gematik packages from packages.fhir.org into its package cache (~/.fhir/packages) on its first run. Once that run has filled the cache, every later run needs no network:

  1. Run the validation above once on a machine with network access.
  2. On a machine without network access, provide the filled package cache (copy ~/.fhir/packages) and the four Cognovis archives. Keep passing the archives with -ig: the cache alone does not replace them.
  3. Run the same command. On Linux, unshare -rn runs it in a new network namespace without any network, which shows that the run needs none:
unshare -rn java -jar validator_cli.jar instance.json \
  -version 4.0.1 -tx n/a \
  -ig billing-core-0.42.3.tgz \
  -ig dental-core-0.17.0.tgz \
  -ig billing-0.9.0.tgz \
  -ig "dental-${DENTAL_VERSION}.tgz"

Without network the validator logs that it could not look up the latest version of some packages and continues; these messages are not validation results.

A package cache that already holds an earlier de.cognovis.fhir.dental package can shadow the archive you pass when both carry the same canonical URLs: the validator may then resolve a definition from the cached package. Validate with a package cache that holds no de.cognovis.fhir.dental package, or one that holds only the version you pass with -ig.

Currency codes (ISO 4217)

Money.currency, for example ChargeItem.priceOverride.currency = EUR, has a required binding in FHIR R4 to the ValueSet http://hl7.org/fhir/ValueSet/currencies, which includes every code of urn:iso:std:iso:4217. No FHIR package carries that CodeSystem with its codes, so with -tx n/a the validator reports an error for every currency code, valid or not:

Error @ ChargeItem.priceOverride.currency: The System URI could not be determined
for the code 'EUR' in the ValueSet 'http://hl7.org/fhir/ValueSet/currencies|4.0.1':
a definition for the CodeSystem 'urn:iso:std:iso:4217' it includes could not be found

This is a limit of offline validation, not a defect of the instance. Give the validator a local definition of urn:iso:std:iso:4217 in a file CodeSystem-iso4217-local.json and pass it with -ig:

{
  "resourceType": "CodeSystem",
  "id": "iso4217-local",
  "url": "urn:iso:std:iso:4217",
  "name": "Iso4217Local",
  "status": "active",
  "content": "complete",
  "caseSensitive": true,
  "concept": [
    {"code": "EUR"}
  ]
}
java -jar validator_cli.jar instance.json -version 4.0.1 -tx n/a \
  -ig CodeSystem-iso4217-local.json \
  -ig billing-core-0.42.3.tgz -ig dental-core-0.17.0.tgz \
  -ig billing-0.9.0.tgz -ig "dental-${DENTAL_VERSION}.tgz"
  • With "content": "complete" the validator accepts exactly the listed currencies (here EUR) and rejects every other code. Use it to enforce the currencies your system accepts.
  • With "content": "fragment" the validator accepts any currency code and reports for an unlisted one only the note that it could not be validated without a terminology server.

The file is your local validation aid; it is not part of this guide. German dental invoices use EUR. A validation run against a terminology server (-tx with a server URL) needs no such file.

Which rules fire without a declared profile

The validator checks an instance against the profiles it declares in meta.profile and against the profiles named with -profile. Without either, it checks only base R4 and the definitions of the extensions the instance carries. A billing line or invoice without a declared profile is therefore not fully checked.

Rule Where it lives Fires without meta.profile or -profile
Base R4 cardinalities, types and required bindings FHIR R4 yes
Value type, cardinality and bindings that each extension definition itself states (for example the required code list of mehrkosten-28-2 and of tooth-surfaces) extension definition yes
A requested service has tax category S contextInvariant of the Billing DE leaf billing-requested-service yes
A fee agreement is dated no later than the service contextInvariant of the Billing DE leaf billing-fee-agreement yes
The agreed amount is in EUR (billing-fee-agreement-eur) invariant of the Billing DE leaf billing-fee-agreement yes
At most one billing-service-points, billing-analog-service, billing-fee-agreement and billing-requested-service on a line contextInvariants of these Billing DE leaves yes
Exactly one billing-tax-category on a line, with one UN/CEFACT 5305 coding from the German Private Invoice Tax Category ValueSet (the extension definition states only its value type) open line profile DentalBillingLineDE no
Regime rules of a dental billing line: dbl-code, dbl-tax-iff-e, dbl-tax-o, dbl-bema, dbl-bel, dbl-goz-tax, dbl-goae-number, dbl-goz-factor-agreement open line profile DentalBillingLineDE no
Invoice rules: dental-invoice-currency, dental-invoice-totals, dental-invoice-exemption-reason, required account and lines open invoice profile DentalInvoiceDE no
TI invoice rules: required account, KVNR, goz-invoice-exemption-reason GozInvoiceDE no

The rules of the open profiles fire only when the instance declares the profile in meta.profile, or when the run names it with -profile. A producer that leaves meta.profile empty validates its billing lines with -profile:

java -jar validator_cli.jar line.json -version 4.0.1 -tx n/a \
  -ig CodeSystem-iso4217-local.json \
  -ig billing-core-0.42.3.tgz -ig dental-core-0.17.0.tgz \
  -ig billing-0.9.0.tgz -ig "dental-${DENTAL_VERSION}.tgz" \
  -profile https://fhir.cognovis.de/dental/StructureDefinition/dental-billing-line

For example, a BEMA line without meta.profile that carries tax category AA and no exemption reason passes the run without -profile: no rule says a BEMA line is exempt. The same line fails the run with -profile, with one error from dbl-bema. Invoices take -profile https://fhir.cognovis.de/dental/StructureDefinition/dental-invoice-de or -profile https://fhir.cognovis.de/dental/StructureDefinition/goz-invoice-de. -profile applies to every instance of the run, so validate lines and invoices in separate runs.

A cancelled TI invoice takes neither invoice profile. DiPag fixes Invoice.status of dipag-rechnung to issued, so a TI invoice that is cancelled keeps status cancelled as a base R4 Invoice that claims no profile (see the billing mapping guide). Validate it without -profile: forcing -profile https://fhir.cognovis.de/dental/StructureDefinition/goz-invoice-de on it fails, among other errors because Invoice.status is fixed to issued. The example ExampleTiInvoiceReplaced is such an invoice; this guide's package carries it:

tar -xzf "dental-${DENTAL_VERSION}.tgz" package/example/Invoice-ExampleTiInvoiceReplaced.json
java -jar validator_cli.jar package/example/Invoice-ExampleTiInvoiceReplaced.json \
  -version 4.0.1 -tx n/a -allow-example-urls true \
  -ig CodeSystem-iso4217-local.json \
  -ig billing-core-0.42.3.tgz -ig dental-core-0.17.0.tgz \
  -ig billing-0.9.0.tgz -ig "dental-${DENTAL_VERSION}.tgz"

The example's identifier uses an example.org system, which the validator rejects unless the run passes -allow-example-urls true; validate a real invoice without that option. The run reports no error. Its two warnings say that the UN/CEFACT 5305 tax category codes cannot be checked offline.

GozInvoiceDE derives from the gematik dipag-rechnung, which the de.gematik.dipag 1.4.0 package ships without a snapshot. This guide's package carries the snapshot of GozInvoiceDE, so the validator checks a TI invoice through it offline with no separate snapshot step.

What offline validation does not check

Codes from a CodeSystem published with content = not-present, such as BEMA service codes, are not checked offline: the validator reports a warning that the definition includes no codes, and no error. A terminology server that holds the licensed catalog checks them.