From 2605f0fa5e687e7c5e5c0f56c48662000cf4d5f9 Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Tue, 31 Jan 2023 09:20:58 +0100 Subject: [PATCH 01/13] Prepare release 2.12.0. --- CHANGELOG.md | 5 +++++ README.md | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d802531..6faf4da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change log +## Release 2.12.0 + +**TODO** + + ## Release 2.11.0 * Add a value set that encodes Annex A of the guidelines document, including its derivation. diff --git a/README.md b/README.md index 51071ed..01fc114 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This repository contains the value sets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). -Release: 2.11.0 +Release: 2.12.0 Note that these value sets do not form a core part of the [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema) but are referenced by it. These value sets can (and should) be regularly updated and distributed from the main Digital COVID Certificate Gateway (DCCG), under clear versioning and release management. From 1f8c735b71dc5edc94a8987c91ed33df39493b25 Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Fri, 17 Feb 2023 10:00:22 +0100 Subject: [PATCH 02/13] Improved readme: added description of files, governance and reminders over the gateway. Also renamed files for clarity based on other discussions. --- valueset.json => DCC.ValueSets.schema.json | 0 README.md | 33 +++++++++++++++++++--- test-manf.json => test-manf-example.json | 0 3 files changed, 29 insertions(+), 4 deletions(-) rename valueset.json => DCC.ValueSets.schema.json (100%) rename test-manf.json => test-manf-example.json (100%) diff --git a/valueset.json b/DCC.ValueSets.schema.json similarity index 100% rename from valueset.json rename to DCC.ValueSets.schema.json diff --git a/README.md b/README.md index 01fc114..24eae3c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,35 @@ -# EU eHealthNetwork Digitial COVID Certificate value sets +# EU eHealthNetwork Digital COVID Certificate value-sets -This repository contains the value sets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). +Welcome to the EU-DCC value-sets repository. This repository contains a snapshot of the value-sets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the value-sets are distributed on the DCCG (DCC Gateway). + +All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. Release: 2.12.0 -Note that these value sets do not form a core part of the [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema) but are referenced by it. These value sets can (and should) be regularly updated and distributed from the main Digital COVID Certificate Gateway (DCCG), under clear versioning and release management. +## Overview + +Here is an overview of the files available in this repository. The column "managed on" describes the place where the value-set is managed. In most cases that is in this Github repository. Those value-sets will usually be very close to the versions provided on the EU DGC Gateway. + +**Reminder: the value-sets on the EU DGC Gateway are leading, the value-sets here should only be used for development purposes.** + +File name | Description | Managed on +------------------------------------ | ----------------------------------------------------------------- | ------------ +country-2-codes.json | List of ISO-3166-2 country codes used for issuers | Github +disease-targeted-agent.json | List of diseases/targeted agent (i.e. covid) | Github +test-manf-example.json | Example of the test manufacturers value-set | DGC Gateway +test-result.json | List of supported test results (i.e. detected, not detected..) | Github +test-type.json | List of supported test types (i.e. PCR, rapid-antigen..) | Github +vaccine-encoding-instructions.json | List of valid encodings (manufacturer + medical product) | Github +vaccine-mah-manf.json | List of vaccine manufacturers | Github +vaccine-medical-product.json | List of the vaccines | Github +vaccine-prophylaxis.json | List of the vaccine/prophylaxis types | Github + +The JSON Schema definition for the structure used for all of the above value-sets can be found in [DCC.ValueSets.schema.json](DCC.ValueSets.schema.json) + +Finally the we have [changelog](CHANGELOG.md), [license](LICENSE.md) and [versioning](VERSIONING.md) files and, of course, this [readme](README.md). + +## Governance -This repository has been created to provide a home for the value sets (for development purposes only) which have up until then (2021-06-16) been living a somewhat orphaned life in the [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema) repository. +The value-sets are owned by the eHealth Network Subgroup on Semantics (SSG). Any requests for additions or changes must be directed to that group. If you or your country are not members of that subgroup then you can raise an issue on this Github repository and, if appropriate, we will raise it with the SSG on your behalf. +This repository, as with all of the eHN Github repositories, is maintained by a number of volunteers from the eHealth Network Technical IOP Subgroup. diff --git a/test-manf.json b/test-manf-example.json similarity index 100% rename from test-manf.json rename to test-manf-example.json From e2e7de5f0bca65f03210fc34b32ca3a8e419ac3f Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Fri, 17 Feb 2023 11:20:00 +0100 Subject: [PATCH 03/13] Code review comments --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 24eae3c..ee0741a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# EU eHealthNetwork Digital COVID Certificate value-sets +# EU eHealthNetwork Digital COVID Certificate valuesets -Welcome to the EU-DCC value-sets repository. This repository contains a snapshot of the value-sets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the value-sets are distributed on the DCCG (DCC Gateway). +Welcome to the EU-DCC valuesets repository. This repository contains a snapshot of the valuesets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the valuesets are distributed on the DCCG (DCC Gateway). All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. @@ -8,9 +8,9 @@ Release: 2.12.0 ## Overview -Here is an overview of the files available in this repository. The column "managed on" describes the place where the value-set is managed. In most cases that is in this Github repository. Those value-sets will usually be very close to the versions provided on the EU DGC Gateway. +Here is an overview of the files available in this repository. The column "managed on" describes the place where the value-set is managed. In most cases that is in this GitHub repository. Those valuesets will usually be very close to the versions provided on the EU DGC Gateway. As they are managed in the GitHub they will always be the newest version, just bear in mind that the version provided by the EU DGC Gateway is always considered the **current** version. -**Reminder: the value-sets on the EU DGC Gateway are leading, the value-sets here should only be used for development purposes.** +**Reminder: the valuesets on the EU DGC Gateway are leading, the valuesets here are provided for purposes of development and as part of our release process.** File name | Description | Managed on ------------------------------------ | ----------------------------------------------------------------- | ------------ @@ -24,12 +24,12 @@ vaccine-mah-manf.json | List of vaccine manufacturers | Github vaccine-medical-product.json | List of the vaccines | Github vaccine-prophylaxis.json | List of the vaccine/prophylaxis types | Github -The JSON Schema definition for the structure used for all of the above value-sets can be found in [DCC.ValueSets.schema.json](DCC.ValueSets.schema.json) +The JSON Schema definition for the structure used for all of the above valuesets can be found in [DCC.ValueSets.schema.json](DCC.ValueSets.schema.json) Finally the we have [changelog](CHANGELOG.md), [license](LICENSE.md) and [versioning](VERSIONING.md) files and, of course, this [readme](README.md). ## Governance -The value-sets are owned by the eHealth Network Subgroup on Semantics (SSG). Any requests for additions or changes must be directed to that group. If you or your country are not members of that subgroup then you can raise an issue on this Github repository and, if appropriate, we will raise it with the SSG on your behalf. +The valuesets are owned by the eHealth Network Subgroup on Semantics (SSG). Any requests for additions or changes must be directed to that group. If you or your country are not members of that subgroup then you can raise an issue on this GitHub repository and, if appropriate, we will raise it with the SSG on your behalf. -This repository, as with all of the eHN Github repositories, is maintained by a number of volunteers from the eHealth Network Technical IOP Subgroup. +This repository, as with all of the eHN GitHub repositories, is maintained by a number of volunteers from the eHealth Network Technical IOP Subgroup. From a74f26c712a3b38ec1ea5718f8778e3e8dce377b Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Fri, 17 Feb 2023 11:24:09 +0100 Subject: [PATCH 04/13] DGC gateway --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee0741a..ff44151 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EU eHealthNetwork Digital COVID Certificate valuesets -Welcome to the EU-DCC valuesets repository. This repository contains a snapshot of the valuesets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the valuesets are distributed on the DCCG (DCC Gateway). +Welcome to the EU-DCC valuesets repository. This repository contains a snapshot of the valuesets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the valuesets are distributed on the [EU DGC Gateway](https://github.com/eu-digital-green-certificates/dgc-gateway). All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. From c175ffe3fc5f2c8539441f545c2b9f164504d73b Mon Sep 17 00:00:00 2001 From: Ryan Barrett Date: Fri, 24 Feb 2023 16:19:03 +0100 Subject: [PATCH 05/13] Validate valueset schema(s) (#70) With this PR the schema of the valuesets will be validated automatically both pre-commit and during the PR workflow by the Github Actions. This will improve the quality of our releases and avoid inadvertent or undocumented changes happening. --------- Co-authored-by: Stavros Kounis --- .github/workflows/test.yml | 17 ++ .gitignore | 1 + DCC.ValueSets.schema.json | 25 -- README.md | 43 +++ hooks/pre-commit | 8 + package-lock.json | 273 ++++++++++++++++++ package.json | 10 + schemas/DCC.ValueSets.schema.json | 76 +++++ .../vaccine-encoding-instructions.schema.json | 69 +++++ schemas/validate-valuesets.js | 80 +++++ 10 files changed, 577 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/test.yml create mode 100644 .gitignore delete mode 100644 DCC.ValueSets.schema.json create mode 100755 hooks/pre-commit create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 schemas/DCC.ValueSets.schema.json create mode 100644 schemas/vaccine-encoding-instructions.schema.json create mode 100644 schemas/validate-valuesets.js diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..97a8e24 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,17 @@ +name: Tests + +on: + - push + - pull_request + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install general dependencies + run: sudo apt-get install jq nodejs + - name: Install node dependencies + run: npm install + - name: Validate the valuesets + run: npm test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c2658d7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules/ diff --git a/DCC.ValueSets.schema.json b/DCC.ValueSets.schema.json deleted file mode 100644 index cc086ab..0000000 --- a/DCC.ValueSets.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "title": "EU DCC Value Sets", - "required": [ - "valueSetId", - "valueSetDate", - "valueSetValues" - ], - "type": "object", - "properties": { - "valueSetId": { - "title": "Value Set Identifier", - "type": "string" - }, - "valueSetDate": { - "title": "Value Set Version", - "type": "string", - "format": "date" - }, - "valueSetValues": { - "title": "Allowed values in Value Set", - "type": "object" - } - } -} diff --git a/README.md b/README.md index ff44151..71d761f 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,49 @@ The JSON Schema definition for the structure used for all of the above valuesets Finally the we have [changelog](CHANGELOG.md), [license](LICENSE.md) and [versioning](VERSIONING.md) files and, of course, this [readme](README.md). + +## Working with the valuesets + +### NOTE FOR WINDOWS USERS + +The scripts we used are bash-based, if you're a Windows users you will either need to use the amazing [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) or use another [Cygwin](https://www.cygwin.com/). + +Although the maintainers are primarily Windows developers the internet - and the git eco-system - are POSIX focused. With the fantastic support for POSIX on modern Windows we have decided to focus on a POSIX-based workflow. + +### Pre-reqs + +[Node.js 18.14.2 or above ](https://nodejs.org/en/) +NPM 9.5.0 (included with Node.js) + +### Configuring git hooks + +This repository makes use of the `pre-commit` git hook. This executes the schema validation scripts (which are described below). + +To enable git hooks you need to tell git to use them, you can do that by running this command from the terminal in the root directory of this project: + + git config core.hooksPath hooks + +### Validating schema + +First lets ask node to install the dependencies: + + npm install + +Then to run the schema validator simply: + + npm test + +If there are any validation errors they will be shown on the screen. + +## How the schema and validator work + +We use [JSON Schema 2020-12](https://json-schema.org/specification.html) to define the schema of the valuesets. For most of the valuesets there is a [shared schema](schemas/DCC.ValueSets.schema.json). + +For files which have a different schema - such as `vaccine-encoding-instructions` - the validator supports the definition of a custom schema. By convention these schema files are named `.schema.json` and are stored in `./schema`. So for `vaccine-encoding-instructions.json` the schema `vaccine-encoding-instructions.schema.json` is used. + +The validator code has been written in an imperative style for ease of understanding and [can be found in the schema directory](schemas/validate-valuesets.js). + + ## Governance The valuesets are owned by the eHealth Network Subgroup on Semantics (SSG). Any requests for additions or changes must be directed to that group. If you or your country are not members of that subgroup then you can raise an issue on this GitHub repository and, if appropriate, we will raise it with the SSG on your behalf. diff --git a/hooks/pre-commit b/hooks/pre-commit new file mode 100755 index 0000000..9833847 --- /dev/null +++ b/hooks/pre-commit @@ -0,0 +1,8 @@ +#!/bin/sh +# + +# Ensure npm pre-reqs are installed +npm install + +# Run the NPM tests +npm test || exit 1 \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3312be6 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,273 @@ +{ + "name": "eu-dcc-valuesets", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "ajv": "^8.12.0", + "ajv-cli": "^5.0.0", + "ajv-formats": "^2.1.1" + } + }, + "node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-cli": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ajv-cli/-/ajv-cli-5.0.0.tgz", + "integrity": "sha512-LY4m6dUv44HTyhV+u2z5uX4EhPYTM38Iv1jdgDJJJCyOOuqB8KtZEGjPZ2T+sh5ZIJrXUfgErYx/j3gLd3+PlQ==", + "dependencies": { + "ajv": "^8.0.0", + "fast-json-patch": "^2.0.0", + "glob": "^7.1.0", + "js-yaml": "^3.14.0", + "json-schema-migrate": "^2.0.0", + "json5": "^2.1.3", + "minimist": "^1.2.0" + }, + "bin": { + "ajv": "dist/index.js" + }, + "peerDependencies": { + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + } + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "node_modules/fast-json-patch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/fast-json-patch/-/fast-json-patch-2.2.1.tgz", + "integrity": "sha512-4j5uBaTnsYAV5ebkidvxiLUYOwjQ+JSFljeqfTxCrH9bDmlCQaOJFS84oDJ2rAXZq2yskmk3ORfoP9DCwqFNig==", + "dependencies": { + "fast-deep-equal": "^2.0.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/fast-json-patch/node_modules/fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha512-bCK/2Z4zLidyB4ReuIsvALH6w31YfAQDmXMqMx6FyfHqvBxtjC0eRumeSu4Bs3XtXwpyIywtSTrVT99BxY1f9w==" + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-migrate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/json-schema-migrate/-/json-schema-migrate-2.0.0.tgz", + "integrity": "sha512-r38SVTtojDRp4eD6WsCqiE0eNDt4v1WalBXb9cyZYw9ai5cGtBwzRNWjHzJl38w6TxFkXAIA7h+fyX3tnrAFhQ==", + "dependencies": { + "ajv": "^8.0.0" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b50e291 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "dependencies": { + "ajv": "^8.12.0", + "ajv-cli": "^5.0.0", + "ajv-formats": "^2.1.1" + }, + "scripts": { + "test": "node schemas/validate-valuesets.js" + } +} diff --git a/schemas/DCC.ValueSets.schema.json b/schemas/DCC.ValueSets.schema.json new file mode 100644 index 0000000..4c3f78f --- /dev/null +++ b/schemas/DCC.ValueSets.schema.json @@ -0,0 +1,76 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "EU DCC Value Sets", + "required": + [ + "valueSetId", + "valueSetDate", + "valueSetValues" + ], + "type": "object", + "properties": + { + "valueSetId": + { + "title": "Value Set Identifier", + "type": "string" + }, + "valueSetDate": + { + "title": "Value Set Version", + "type": "string", + "format": "date" + }, + "valueSetValues": + { + "title": "Allowed values in Value Set", + "type": "object", + "patternProperties": + { + "^.*$": + { + "title": "Allowed values in records", + "type": "object", + "properties": + { + "display": + { + "type": "string" + }, + "lang": + { + "type": "string" + }, + "active": + { + "type": "boolean" + }, + "version": + { + "type": "string" + }, + "system": + { + "type": "string" + }, + "validUntil": + { + "type": "string", + "format": "date" + } + }, + "additionalProperties": false, + "required": + [ + "display", + "lang", + "active", + "version", + "system" + ] + } + } + }, + "additionalProperties": false + } +} \ No newline at end of file diff --git a/schemas/vaccine-encoding-instructions.schema.json b/schemas/vaccine-encoding-instructions.schema.json new file mode 100644 index 0000000..d4a5568 --- /dev/null +++ b/schemas/vaccine-encoding-instructions.schema.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "EU DCC Value Sets", + "required": + [ + "valueSetId", + "valueSetDate", + "valueSetValues" + ], + "type": "object", + "properties": + { + "valueSetId": + { + "title": "Value Set Identifier", + "type": "string" + }, + "valueSetDate": + { + "title": "Value Set Version", + "type": "string", + "format": "date" + }, + "valueSetValues": + { + "title": "Allowed values in Value Set", + "type": "object", + "patternProperties": + { + "^.*$": + { + "title": "Allowed values in records", + "type": "object", + "properties": + { + "vaccine-code": + { + "type": "string" + }, + "vaccine-manufacturer": + { + "type": "string" + }, + "sct-codes": + { + "type": "array", + "items": + { + "type": "string" + } + }, + "note": + { + "type": "string" + } + }, + "required": + [ + "vaccine-code", + "vaccine-manufacturer", + "sct-codes" + ] + } + }, + "additionalProperties": false + }, + "additionalProperties": false + } +} \ No newline at end of file diff --git a/schemas/validate-valuesets.js b/schemas/validate-valuesets.js new file mode 100644 index 0000000..aa09901 --- /dev/null +++ b/schemas/validate-valuesets.js @@ -0,0 +1,80 @@ +const fs = require('fs'); +const exec = require('child_process').exec; +const Ajv2020 = require("ajv/dist/2020"); // see: https://ajv.js.org/json-schema.html#draft-2020-12 +const addFormats = require("ajv-formats"); + +// Default schema to be used if no file-specific one is defined +const DEFAULT_SCHEMA = 'DCC.ValueSets.schema.json'; + +// Directories containing schemas/valuesets +const SCHEMA_DIR = "./schemas/"; +const VALUESET_DIR = "./"; + +// These files will be excluded from the schema check +const FILES_TO_EXCLUDE = [ + 'package.json', + 'package-lock.json' +]; + +// Init ajv +const ajv = new Ajv2020({ + strict: true, + allErrors: true, + allowUnionTypes: true, + validateSchema: true +}); +addFormats(ajv); + +// Error flag defaults to false, when a file fails validation it is set to true +let exitWithError = false; + +// Get a list of all of the valuesets +const valuesets = fs + .readdirSync(VALUESET_DIR, {withFileTypes: true}) + .filter(item => !item.isDirectory()) + .filter(item => !FILES_TO_EXCLUDE.find(x => x == item.name)) + .filter(item => item.name.endsWith(".json")) + .map(item => item.name); + +// Get a list of all of the schemas +const schemas = fs + .readdirSync(SCHEMA_DIR, {withFileTypes: true}) + .filter(item => !item.isDirectory()) + .filter(item => item.name.endsWith(".json")) + .map(item => item.name); + +// Validate all of the valuesets against their schema +for(const item of valuesets) +{ + // Choose + load schema; if a schema exists with named .schema.json then that will be used, + // this allows us to override the default schema when needed + // + // NOTE: the schemas could be loaded once, that is slightly faster but will make this script more complex.. + const schemaFileName = schemas.find(x => x === item.replace(".json", ".schema.json")) || DEFAULT_SCHEMA; + const schemaRaw = fs.readFileSync(`${SCHEMA_DIR}${schemaFileName}`); + const schema = JSON.parse(schemaRaw); + + // Load valuesets + const valuesetRaw = fs.readFileSync(`${VALUESET_DIR}${item}`); + const valueset = JSON.parse(valuesetRaw); + + // Validate + const valid = ajv.validate(schema, valueset); + + // Handle validation errors + if(valid) { + console.log(`Validating ${item} (with schemas/${schemaFileName}) -> OK`); + } else { + console.log(`Validating ${item} -> FAILED`) + console.log(ajv.errors); + exitWithError = true; + } +} + +// Handle exit +if(exitWithError){ + console.log("Validation failed!"); + process.exit(1); +} else { + console.log("Validation succeeded!"); +} \ No newline at end of file From ccba3921b197b6ba40fc89601ec1ee32cd2903eb Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Mon, 6 Mar 2023 14:07:45 +0100 Subject: [PATCH 06/13] Describe versioning more thoroughly. --- VERSIONING.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/VERSIONING.md b/VERSIONING.md index 57023af..1e98194 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -34,6 +34,10 @@ That can be done on the commandline as follows (assuming the `main` branch is cu $ git tag $ git push --tags +After this, a release page can be made for that tag, using the [GitHub releases overview](https://github.com/ehn-dcc-development/ehn-dcc-valuesets/releases). + +After releasing, the European Commission's (EC) representative in the eHN should be notified of the release, so they can notify TSi to update the EU DCC Gateway. + It's advisable to rebase a release branch manually, and check it afterwards, as there's no guarantee that a conflict-free automatic rebase is syntactically, or semantically correct. On the commandline, that's (assuming the release branch is currently checked out): @@ -46,11 +50,13 @@ After a manual rebase, the rebased branch has to be force-pushed, using: $ git push --force -The release branch can be deleted after merging the PR, for the following reasons: +The release branch _could_ be deleted after merging the PR, for the following reasons: - A branch is essentially a label on a HEAD commit, and a tag fulfills the labelling function just as well. - Having many branches can be confusing. +However, currently (essentially) all release branches are kept. + ### Fixing a release From bf932b4200527f0f86f631eaddc6ee59ce3f5f8d Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Mon, 13 Mar 2023 14:34:20 +0100 Subject: [PATCH 07/13] (Fix not-yet-renamed links.) --- CHANGELOG.md | 2 +- README.md | 4 ++-- VERSIONING.md | 4 ++-- source-update/README.md | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6faf4da..f896138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,5 +145,5 @@ The [guidelines document v1.5 has been adopted and published](https://ec.europa. ## Prior releases -Change log for releases before 2.3.0 are available through the [releases page](https://github.com/ehn-dcc-development/ehn-dcc-valuesets/releases). +Change log for releases before 2.3.0 are available through the [releases page](https://github.com/ehn-dcc-development/eu-dcc-valuesets/releases). diff --git a/README.md b/README.md index 71d761f..4c991d0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # EU eHealthNetwork Digital COVID Certificate valuesets -Welcome to the EU-DCC valuesets repository. This repository contains a snapshot of the valuesets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). The most up-to-date version of the valuesets are distributed on the [EU DGC Gateway](https://github.com/eu-digital-green-certificates/dgc-gateway). +Welcome to the EU-DCC valuesets repository. This repository contains a snapshot of the valuesets referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/eu-dcc-schema). The most up-to-date version of the valuesets are distributed on the [EU DGC Gateway](https://github.com/eu-digital-green-certificates/dgc-gateway). All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. @@ -26,7 +26,7 @@ vaccine-prophylaxis.json | List of the vaccine/prophylaxis types | Git The JSON Schema definition for the structure used for all of the above valuesets can be found in [DCC.ValueSets.schema.json](DCC.ValueSets.schema.json) -Finally the we have [changelog](CHANGELOG.md), [license](LICENSE.md) and [versioning](VERSIONING.md) files and, of course, this [readme](README.md). +Finally, we have [changelog](CHANGELOG.md), [license](LICENSE.md) and [versioning](VERSIONING.md) files and, of course, this [readme](README.md). ## Working with the valuesets diff --git a/VERSIONING.md b/VERSIONING.md index 1e98194..73ca48d 100644 --- a/VERSIONING.md +++ b/VERSIONING.md @@ -13,7 +13,7 @@ Each release is identified through a [semver version number](https://semver.org/ Releases are prepared in branches named `release/`. After preparation has finished, a _Pull Request_ (PR) from the release branch into `main` is created on GitHub. -That can e.g. be done by clicking the “New Pull Request” button on the [branches page](https://github.com/ehn-dcc-development/ehn-dcc-valuesets/branches). +That can e.g. be done by clicking the “New Pull Request” button on the [branches page](https://github.com/ehn-dcc-development/eu-dcc-valuesets/branches). Such a PR serves as the trigger a code review for that release. That possibly leads to discussion conducted inside the PR page, and further work being committed to that release branch. @@ -34,7 +34,7 @@ That can be done on the commandline as follows (assuming the `main` branch is cu $ git tag $ git push --tags -After this, a release page can be made for that tag, using the [GitHub releases overview](https://github.com/ehn-dcc-development/ehn-dcc-valuesets/releases). +After this, a release page can be made for that tag, using the [GitHub releases overview](https://github.com/ehn-dcc-development/eu-dcc-valuesets/releases). After releasing, the European Commission's (EC) representative in the eHN should be notified of the release, so they can notify TSi to update the EU DCC Gateway. diff --git a/source-update/README.md b/source-update/README.md index 20a3b2c..a3d6906 100644 --- a/source-update/README.md +++ b/source-update/README.md @@ -8,7 +8,7 @@ > This script is now deprecated and will not be kept up-to-date. Currently, due to changes in the source JSON format the script is not functional. The generation of the rapid antigen tests (RATs) value set is managed by the DCC Gateway, > see • https://github.com/eu-digital-green-certificates/dgc-gateway/blob/main/src/main/java/eu/europa/ec/dgc/gateway/service/RatValuesetUpdateService.java -This repository contains scripts that are used to update the value set for the common list of rapid antigen tests (RATs) referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/ehn-dcc-schema). +This repository contains scripts that are used to update the value set for the common list of rapid antigen tests (RATs) referenced by the EU Digital COVID Certificate (DCC) [JSON Schema](https://github.com/ehn-dcc-development/eu-dcc-schema). Release: 2.0.0 From cef875a7168effc2eda54281784ce7ec535a6b01 Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Mon, 13 Mar 2023 14:39:04 +0100 Subject: [PATCH 08/13] Implement comparing actual vs. expected value sets. --- README.md | 2 + schemas/validate-valuesets.js | 86 +++++++++++++++++++++++++++++------ 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4c991d0..9fcacd2 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,8 @@ We use [JSON Schema 2020-12](https://json-schema.org/specification.html) to defi For files which have a different schema - such as `vaccine-encoding-instructions` - the validator supports the definition of a custom schema. By convention these schema files are named `.schema.json` and are stored in `./schema`. So for `vaccine-encoding-instructions.json` the schema `vaccine-encoding-instructions.schema.json` is used. +The validator also checks whether the set of actual valuesets coincides with the set expected by the [EU DCC Schema standard](https://github.com/ehn-dcc-development/eu-dcc-schema/blob/release/1.3.2/DCC.ValueSets.schema.json). + The validator code has been written in an imperative style for ease of understanding and [can be found in the schema directory](schemas/validate-valuesets.js). diff --git a/schemas/validate-valuesets.js b/schemas/validate-valuesets.js index aa09901..196341a 100644 --- a/schemas/validate-valuesets.js +++ b/schemas/validate-valuesets.js @@ -1,5 +1,4 @@ -const fs = require('fs'); -const exec = require('child_process').exec; +const fs = require("fs"); const Ajv2020 = require("ajv/dist/2020"); // see: https://ajv.js.org/json-schema.html#draft-2020-12 const addFormats = require("ajv-formats"); @@ -12,8 +11,8 @@ const VALUESET_DIR = "./"; // These files will be excluded from the schema check const FILES_TO_EXCLUDE = [ - 'package.json', - 'package-lock.json' + "package.json", + "package-lock.json" ]; // Init ajv @@ -44,8 +43,7 @@ const schemas = fs .map(item => item.name); // Validate all of the valuesets against their schema -for(const item of valuesets) -{ +for (const item of valuesets) { // Choose + load schema; if a schema exists with named .schema.json then that will be used, // this allows us to override the default schema when needed // @@ -62,19 +60,79 @@ for(const item of valuesets) const valid = ajv.validate(schema, valueset); // Handle validation errors - if(valid) { + if (valid) { console.log(`Validating ${item} (with schemas/${schemaFileName}) -> OK`); } else { + exitWithError = true; console.log(`Validating ${item} -> FAILED`) console.log(ajv.errors); + } +} + + +const assertSameSet = (actuals, expecteds, what) => { + if ( + actuals.length !== expecteds.length + || !actuals.every((l) => expecteds.indexOf(l) > -1) + || !expecteds.every((l) => actuals.indexOf(l) > -1) + ) { exitWithError = true; + const extraActuals = actuals.filter((actual) => expecteds.indexOf(actual) === -1); + const extraExpecteds = expecteds.filter((expected) => actuals.indexOf(expected) === -1); + console.log(`Mismatch between actual and expected ${what}:`); + if (extraActuals.length > 0) { + console.log(`\tAmong actual, but not among expected: ${extraActuals.join(", ")}`); + } + if (extraExpecteds.length > 0) { + console.log(`\tAmong expected, but not among actual: ${extraExpecteds.join(", ")}`); + } } } -// Handle exit -if(exitWithError){ - console.log("Validation failed!"); - process.exit(1); -} else { - console.log("Validation succeeded!"); -} \ No newline at end of file + +const EXPECTED_MISSING = [ + "test-manf.json" +]; +const EXPECTED_EXTRA = [ + "test-manf-example.json" +]; + +const removedValuesetsPrefix = (path) => { + const prefix = "valuesets/"; + if (!path.indexOf(prefix) === 0) { + exitWithError = true; + console.log(`Valueset URI doesn't start with expected prefix "${prefix}" --> check DCC.ValueSets.schema.json in schema repository`) + return path; + } + return path.substring(prefix.length); +} + + +fetch(new URL("https://raw.githubusercontent.com/ehn-dcc-development/eu-dcc-schema/1.3.2/DCC.ValueSets.schema.json")) + .then((response) => response.json()) + .then((valuesetsRefSchema) => { + const expectedValuesets = Object.values(valuesetsRefSchema["$defs"]) + .map((valuesetDef) => valuesetDef["valueset-uri"]) + .map(removedValuesetsPrefix); + + assertSameSet( + valuesets.filter((valueset) => expectedValuesets.indexOf(valueset) === -1), + EXPECTED_EXTRA, + "extra valuesets" + ); + assertSameSet( + expectedValuesets.filter((expected) => valuesets.indexOf(expected) === -1), + EXPECTED_MISSING, + "missing valuesets" + ); + + // handle exit: + if (exitWithError){ + console.log("Validation failed!"); + process.exit(1); + } else { + console.log("Validating entire set against DCC.ValueSets.schema.json in schema repository --> OK") + console.log("Validation succeeded!"); + } + }); + From f8c4eca636f9a44a34f85156cb2bba481a0e9fb8 Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Mon, 13 Mar 2023 15:48:19 +0100 Subject: [PATCH 09/13] Parametrize exact EU DCC Schema reference. --- README.md | 2 ++ schemas/config.js | 6 ++++++ schemas/validate-valuesets.js | 17 ++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 schemas/config.js diff --git a/README.md b/README.md index 9fcacd2..e23294d 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,8 @@ We use [JSON Schema 2020-12](https://json-schema.org/specification.html) to defi For files which have a different schema - such as `vaccine-encoding-instructions` - the validator supports the definition of a custom schema. By convention these schema files are named `.schema.json` and are stored in `./schema`. So for `vaccine-encoding-instructions.json` the schema `vaccine-encoding-instructions.schema.json` is used. The validator also checks whether the set of actual valuesets coincides with the set expected by the [EU DCC Schema standard](https://github.com/ehn-dcc-development/eu-dcc-schema/blob/release/1.3.2/DCC.ValueSets.schema.json). +The exact GitHub reference - being a (release) tag, or branch - is configured through the `EU_DCC_SCHEMA_REF` constant defined in [this config file](./schemas/config.js). +This constant needs to be updated when a new release of the EU DCC Schema is released, or while being worked on. The validator code has been written in an imperative style for ease of understanding and [can be found in the schema directory](schemas/validate-valuesets.js). diff --git a/schemas/config.js b/schemas/config.js new file mode 100644 index 0000000..a3c5bf3 --- /dev/null +++ b/schemas/config.js @@ -0,0 +1,6 @@ +// module.exports.EU_DCC_SCHEMA_REF = "release/1.3.2"; + +// to verify that the 1.3.3 version of the EU DCC Schema will work: +module.exports.EU_DCC_SCHEMA_REF = "feature/vaccine-encoding-instructions-valueset"; +// FIXME remove and uncomment 1st line before merging + diff --git a/schemas/validate-valuesets.js b/schemas/validate-valuesets.js index 196341a..82633c7 100644 --- a/schemas/validate-valuesets.js +++ b/schemas/validate-valuesets.js @@ -3,7 +3,7 @@ const Ajv2020 = require("ajv/dist/2020"); // see: https://ajv.js.org/json-schema const addFormats = require("ajv-formats"); // Default schema to be used if no file-specific one is defined -const DEFAULT_SCHEMA = 'DCC.ValueSets.schema.json'; +const DEFAULT_SCHEMA = "DCC.ValueSets.schema.json"; // Directories containing schemas/valuesets const SCHEMA_DIR = "./schemas/"; @@ -90,25 +90,28 @@ const assertSameSet = (actuals, expecteds, what) => { } -const EXPECTED_MISSING = [ - "test-manf.json" -]; +const SCHEMA_WITH_EXPECTED_VALUESETS = "DCC.ValueSets.schema.json"; + const EXPECTED_EXTRA = [ "test-manf-example.json" ]; +const EXPECTED_MISSING = [ + "test-manf.json" +]; const removedValuesetsPrefix = (path) => { const prefix = "valuesets/"; if (!path.indexOf(prefix) === 0) { exitWithError = true; - console.log(`Valueset URI doesn't start with expected prefix "${prefix}" --> check DCC.ValueSets.schema.json in schema repository`) + console.log(`Valueset URI doesn't start with expected prefix "${prefix}" --> check ${SCHEMA_WITH_EXPECTED_VALUESETS} in schema repository`); return path; } return path.substring(prefix.length); } +const {EU_DCC_SCHEMA_REF} = require("./config"); -fetch(new URL("https://raw.githubusercontent.com/ehn-dcc-development/eu-dcc-schema/1.3.2/DCC.ValueSets.schema.json")) +fetch(new URL(`https://raw.githubusercontent.com/ehn-dcc-development/eu-dcc-schema/${EU_DCC_SCHEMA_REF}/${SCHEMA_WITH_EXPECTED_VALUESETS}`)) .then((response) => response.json()) .then((valuesetsRefSchema) => { const expectedValuesets = Object.values(valuesetsRefSchema["$defs"]) @@ -131,7 +134,7 @@ fetch(new URL("https://raw.githubusercontent.com/ehn-dcc-development/eu-dcc-sche console.log("Validation failed!"); process.exit(1); } else { - console.log("Validating entire set against DCC.ValueSets.schema.json in schema repository --> OK") + console.log(`Validating entire set against ${SCHEMA_WITH_EXPECTED_VALUESETS} in schema repository --> OK`); console.log("Validation succeeded!"); } }); From d218d2bae75e518ecd1679363907b3010a61d81e Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Wed, 29 Mar 2023 20:58:10 +0200 Subject: [PATCH 10/13] (Add missing line for previous release 2.11.0 to CHANGELOG.) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f896138..ba94d54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,8 @@ 2. The derivation script for this value set has been updated to check for deprecated ACT/SCT codes. (It also reports the correct row numbers now.) + The [guidelines document v1.14 has been adopted and published](https://ec.europa.eu/health/sites/default/files/ehealth/docs/digital-green-value-sets_en.pdf) through the [eHealth network page on the EU DCC](https://ec.europa.eu/health/ehealth/covid-19_en). + ## Release 2.10.0 From 0b8b6fb25b111ffdd459dabc40c0ccee21cb2bef Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Fri, 31 Mar 2023 09:48:33 +0200 Subject: [PATCH 11/13] Point properly to release version 1.3.3 (=not yet released!). --- README.md | 2 +- schemas/config.js | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index e23294d..5bbbfc4 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ We use [JSON Schema 2020-12](https://json-schema.org/specification.html) to defi For files which have a different schema - such as `vaccine-encoding-instructions` - the validator supports the definition of a custom schema. By convention these schema files are named `.schema.json` and are stored in `./schema`. So for `vaccine-encoding-instructions.json` the schema `vaccine-encoding-instructions.schema.json` is used. -The validator also checks whether the set of actual valuesets coincides with the set expected by the [EU DCC Schema standard](https://github.com/ehn-dcc-development/eu-dcc-schema/blob/release/1.3.2/DCC.ValueSets.schema.json). +The validator also checks whether the set of actual valuesets coincides with the set expected by the [EU DCC Schema standard](https://github.com/ehn-dcc-development/eu-dcc-schema/blob/release/1.3.3/DCC.ValueSets.schema.json). The exact GitHub reference - being a (release) tag, or branch - is configured through the `EU_DCC_SCHEMA_REF` constant defined in [this config file](./schemas/config.js). This constant needs to be updated when a new release of the EU DCC Schema is released, or while being worked on. diff --git a/schemas/config.js b/schemas/config.js index a3c5bf3..1bb00ce 100644 --- a/schemas/config.js +++ b/schemas/config.js @@ -1,6 +1 @@ -// module.exports.EU_DCC_SCHEMA_REF = "release/1.3.2"; - -// to verify that the 1.3.3 version of the EU DCC Schema will work: -module.exports.EU_DCC_SCHEMA_REF = "feature/vaccine-encoding-instructions-valueset"; -// FIXME remove and uncomment 1st line before merging - +module.exports.EU_DCC_SCHEMA_REF = "release/1.3.3"; From 99923f0aa70ce16d35d75b7f6a682f3a75263eaf Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Fri, 5 May 2023 16:08:16 +0200 Subject: [PATCH 12/13] Prepare for release 2.13.0, with adoption of valuesets v1.15. --- CHANGELOG.md | 14 +++++++++++++- README.md | 3 ++- annex-A/table.tsv | 1 + vaccine-encoding-instructions.json | 10 +++++++++- vaccine-mah-manf.json | 7 +++++++ vaccine-medicinal-product.json | 7 +++++++ 6 files changed, 39 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ba94d54..5be0e24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,20 @@ # Change log + +## Release 2.13.0 + +* Update to eHN guidelines document for value sets, version 1.15: + 1. New vaccine entry added: “Bimervax“, ID'd as “EU/1/22/1709”. + This new entry does not have an explicit version because it's an EMA-approved vaccine, and EMA has their own versioning system. + 2. Addition of a marketing authorization holder or manufacturer “Hipra Human Health S.L.” for the new vaccine entry, ID'd as “ORG-100036914”. + 3. Addition of a vaccine encoding instruction corresponding to the combination of sub items 1 and 2. + + The [guidelines document v1.15 has been adopted and published](https://ec.europa.eu/health/sites/default/files/ehealth/docs/digital-green-value-sets_en.pdf) through the [eHealth network page on the EU DCC](https://ec.europa.eu/health/ehealth/covid-19_en). + + ## Release 2.12.0 -**TODO** +**TODO** (get by rebasing on 2.12.0 release) ## Release 2.11.0 diff --git a/README.md b/README.md index 5bbbfc4..8f245ef 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ Welcome to the EU-DCC valuesets repository. This repository contains a snapshot All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. -Release: 2.12.0 +Release: 2.13.0 + ## Overview diff --git a/annex-A/table.tsv b/annex-A/table.tsv index af7bba0..b26a8ee 100644 --- a/annex-A/table.tsv +++ b/annex-A/table.tsv @@ -37,3 +37,4 @@ Soberana 02 Soberana-02 Finlay-Institute 28531000087107 Also known as FINLAY-FR- Soberana Plus Soberana-Plus Finlay-Institute 28531000087107 Also known as FINLAY-FR-1A. COVID-19 Vaccine Valneva "EU/1/21/1624" ORG-100036422 28531000087107 Previously known as VLA2001. VidPrevtyn Beta EU/1/21/1580 ORG-100000788 28531000087107 Previously known as Vidprevtyn. +Bimervax EU/1/22/1709 ORG-100036914 28531000087107 Previously known as COVID-19 Vaccine HIPRA diff --git a/vaccine-encoding-instructions.json b/vaccine-encoding-instructions.json index 9a7349c..6a9803d 100644 --- a/vaccine-encoding-instructions.json +++ b/vaccine-encoding-instructions.json @@ -1,6 +1,6 @@ { "valueSetId": "vaccines-covid-19-encoding-instructions", - "valueSetDate": "2023-01-26", + "valueSetDate": "2023-05-05", "valueSetValues": { "Comirnaty": { "vaccine-code": "EU/1/20/1528", @@ -320,6 +320,14 @@ "28531000087107" ], "note": "Previously known as Vidprevtyn." + }, + "Bimervax": { + "vaccine-code": "EU/1/22/1709", + "vaccine-manufacturer": "ORG-100036914", + "sct-codes": [ + "28531000087107" + ], + "note": "Previously known as COVID-19 Vaccine HIPRA" } } } \ No newline at end of file diff --git a/vaccine-mah-manf.json b/vaccine-mah-manf.json index d4a4c42..252fb92 100644 --- a/vaccine-mah-manf.json +++ b/vaccine-mah-manf.json @@ -211,6 +211,13 @@ "active": true, "system": "http://ec.europa.eu/temp/vaccinemanufacturer", "version": "1.10" + }, + "ORG-100036914": { + "display": "Hipra Human Health S.L.", + "lang": "en", + "active": true, + "system": "https://spor.ema.europa.eu/v1/organisations", + "version": "" } } } diff --git a/vaccine-medicinal-product.json b/vaccine-medicinal-product.json index fa24ba5..3e82c97 100644 --- a/vaccine-medicinal-product.json +++ b/vaccine-medicinal-product.json @@ -267,6 +267,13 @@ "active": true, "system": "https://ec.europa.eu/health/documents/community-register/html/", "version": "" + }, + "EU/1/22/1709": { + "display": "Bimervax", + "lang": "en", + "active": true, + "system": "https://ec.europa.eu/health/documents/community-register/html/", + "version": "" } } } From 066c338a3f4e8ffd8e2456e1d9d3e0f8d93c06fc Mon Sep 17 00:00:00 2001 From: Meinte Boersma Date: Tue, 23 May 2023 10:11:36 +0200 Subject: [PATCH 13/13] Prepare release 2.12.0 including v1.15. (This effectively merges intended release 2.13.0 into 2.12.0.) --- CHANGELOG.md | 10 +++++----- README.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5be0e24..59c0a7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,6 @@ # Change log - -## Release 2.13.0 +## Release 2.12.0 * Update to eHN guidelines document for value sets, version 1.15: 1. New vaccine entry added: “Bimervax“, ID'd as “EU/1/22/1709”. @@ -11,10 +10,11 @@ The [guidelines document v1.15 has been adopted and published](https://ec.europa.eu/health/sites/default/files/ehealth/docs/digital-green-value-sets_en.pdf) through the [eHealth network page on the EU DCC](https://ec.europa.eu/health/ehealth/covid-19_en). +* Implement validation of valuesets against the EU DCC Schema. + * Implement a Git hook that runs that validation prior to committing. -## Release 2.12.0 - -**TODO** (get by rebasing on 2.12.0 release) +* Improve the documentation - [README](./README.md) an [VERSIONING](./VERSIONING.md) - in various ways. + * Fix not-yet-renamed links to repos which formerly were prefixed with "`ehn-dcc-`". ## Release 2.11.0 diff --git a/README.md b/README.md index 8f245ef..1d6715e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to the EU-DCC valuesets repository. This repository contains a snapshot All of the file found in this repository should be considered for reference usage only. The current official release is published on the EU DGC Gateway. As access to this gateway is only available to Member States please refer to your own Member State to for access to those files. -Release: 2.13.0 +Release: 2.12.0 ## Overview