From b02888142aaa50a9013e6f69efb6f88fc37656c5 Mon Sep 17 00:00:00 2001 From: Mukundan Parthasarathy Date: Sun, 16 May 2021 07:55:38 -0700 Subject: [PATCH] Associate DGCVaccine primitive to DGCInfo, update generators --- .../schemas/DGCVaccinationInformation.json | 123 ++++++++++-------- .../pathogen-schemas/schemas/DGCVaccine.json | 23 +++- .../src/generators/DGCTestInformation.js | 1 - .../generators/DGCVaccinationInformation.js | 10 +- packages/pathogen-schemas/typings.d.ts | 12 +- 5 files changed, 106 insertions(+), 63 deletions(-) diff --git a/packages/pathogen-schemas/schemas/DGCVaccinationInformation.json b/packages/pathogen-schemas/schemas/DGCVaccinationInformation.json index 6276620..fd5f5cd 100644 --- a/packages/pathogen-schemas/schemas/DGCVaccinationInformation.json +++ b/packages/pathogen-schemas/schemas/DGCVaccinationInformation.json @@ -1,55 +1,74 @@ { - "$id": "https://w3id.org/pathogen/schemas/DGCVaccinationInformation.json", - "$schema": "http://json-schema.org/draft-07/schema#", - "$comment": "{\"term\": \"DGCVaccinationInformation\", \"@id\": \"https://w3id.org/pathogen#DGCVaccinationInformation\"}", - "title": "DGCVaccinationInformation", - "description": "Vaccination event information", - "type": "object", - "properties": { - "@context": { - "type": "array" + + "$id": "https://w3id.org/pathogen/schemas/DGCVaccinationInformation.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "$comment": "{\"term\": \"DGCVaccinationInformation\", \"@id\": \"https://w3id.org/pathogen#DGCVaccinationInformation\"}", + "title": "DGCVaccinationInformation", + "description": "Vaccination event information", + "type": "object", + "properties": { + "@context": { + "type": "array" + }, + "type": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "array" + } + ] + }, + "administeringCentre": { + "$comment": "{\"term\": \"administeringCentre\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.location.name\" }", + "title": "Vaccine Administration Center", + "description": "Location where vaccination was administered", + "type": "string" + }, + "batchNumber": { + "$comment": "{\"term\": \"batchNumber\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.lotNumber\"}", + "title": "Vaccine Batch or Lot number", + "description": "Alphanumeric batch or lot number of the vaccine administered", + "type": "string" + }, + "countryOfVaccination": { + "$comment": "{\"term\": \"countryOfVaccination\", \"@id\": \"http://hl7.org/fhir/ValueSet/iso3166-1-2\"}", + "title": "Country of vaccination", + "description": "ISO country code", + "type":"string" + }, + "dateOfVaccination": { + "$comment": "{\"term\": \"dateOfVaccination\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.occurenceDateTime\"}", + "title": "Date of Vaccination", + "description": "Date when the vaccination was administered", + "type": "string" + }, + "healthProfessional": { + "$comment": "{\"term\": \"healthProfessional\", \"@id\": \"http://hl7.org/fhir/ValueSet/immunization-function\"}", + "title": "Identifier referring the health professional", + "description": "Health professional reference", + "type": "string" + }, + "nextVaccinationDate": { + "$comment": "{\"term\": \"nextVaccinationDate\", \"@id\": \"http://hl7.org/fhir/ImmunizationRecommendation.dateCriterion.value\"}", + "title": "Date of next vaccination", + "description": "Date of next vaccination", + "type": "string" + }, + "order": { + "$comment": "{\"term\": \"order\", \"@id\": \"http://hl7.org/fhir/Immunization.protocolApplied.doseNumber\"}", + "title": "Dose number", + "description": "Dose number in the vaccination series", + "type": "string" + }, + "vaccine": { + "$comment": "{\"term\": \"vaccine\", \"@id\": \"http://id.who.int/icd/entity/164949870\" }", + "title": "Vaccine code", + "description": "Vaccine code", + "$ref": "https://w3id.org/pathogen/schemas/DGCVaccine.json" + } }, - "type": { - "oneOf": [ - { - "type": "string" - }, - { - "type": "array" - } - ] - }, - "administeringCentre": { - "$comment": "{\"term\": \"administeringCentre\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.location.name\" }", - "type": "string" - }, - "batchNumber": { - "$comment": "{\"term\": \"batchNumber\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.lotNumber\"}", - "type": "string" - }, - "countryOfVaccination": { - "$comment": "{\"term\": \"countryOfVaccination\", \"@id\": \"http://hl7.org/fhir/ValueSet/iso3166-1-2\"}", - "type":"string" - }, - "dateOfVaccination": { - "$comment": "{\"term\": \"dateOfVaccination\", \"@id\": \"http://hl7.org/fhir/uv/ips/Immunization.occurenceDateTime\"}", - "type": "string" - }, - "healthProfessional": { - "$comment": "{\"term\": \"healthProfessional\", \"@id\": \"http://hl7.org/fhir/ValueSet/immunization-function\"}", - "type": "string" - }, - "nextVaccinationDate": { - "$comment": "{\"term\": \"nextVaccinationDate\", \"@id\": \"http://hl7.org/fhir/ImmunizationRecommendation.dateCriterion.value\"}", - "type": "string" - }, - "order": { - "$comment": "{\"term\": \"order\", \"@id\": \"http://hl7.org/fhir/Immunization.protocolApplied.doseNumber\"}", - "type": "string" - }, - "vaccine": { - "$comment": "{\"term\": \"vaccine\", \"@id\": \"http://id.who.int/icd/entity/164949870\" }", - "type": "string" - } - } + "additionalProperties": false, + "examples": [] } \ No newline at end of file diff --git a/packages/pathogen-schemas/schemas/DGCVaccine.json b/packages/pathogen-schemas/schemas/DGCVaccine.json index da08037..0a7c1d0 100644 --- a/packages/pathogen-schemas/schemas/DGCVaccine.json +++ b/packages/pathogen-schemas/schemas/DGCVaccine.json @@ -18,21 +18,32 @@ "type": "array" } ] - },"code" : { - "$comment": "{\"term\": \"code\", \"@id\": \" \"}", + }, + "code" : { + "$comment": "{\"term\": \"code\", \"@id\": \"http://id.who.int/icd/entity/164949870\"}", + "title": "Vaccine code", + "description": "Vaccine code", "type": "string" }, "targetDisease" : { - "$comment": "{\"term\": \"targetDisease\", \"@id\": \" \"}", + "$comment": "{\"term\": \"targetDisease\", \"@id\": \"http://hl7.org/fhir/Immunization.protocolApplied.targetedDisease\"}", + "title": "Targeted Disease", + "description": "Disease targeted by this vaccine", "type": "string" }, "marketingAuthHolder" : { - "$comment": "{\"term\": \"marketingAuthHolder\", \"@id\": \" \"}", + "$comment": "{\"term\": \"marketingAuthHolder\", \"@id\": \"http://hl7.eu/fhir/ig/dgc/ValueSet/vaccines-covid-19-auth-holders\"}", + "title": "Marketing Auth holder", + "description": "Marketing Auth holder", "type": "string" }, "medicinalProductName" : { - "$comment": "{\"term\": \"medicinalProductName\", \"@id\": \" \"}", + "$comment": "{\"term\": \"medicinalProductName\", \"@id\": \"http://hl7.eu/fhir/ig/dgc/ValueSet/vaccines-covid-19-names\"}", + "title": "Product name", + "description": "Product or Trade name used for the vaccine", "type": "string" } - } + }, + "additionalProperties": false, + "examples": [] } \ No newline at end of file diff --git a/packages/pathogen-schemas/src/generators/DGCTestInformation.js b/packages/pathogen-schemas/src/generators/DGCTestInformation.js index a080b89..221bfc2 100644 --- a/packages/pathogen-schemas/src/generators/DGCTestInformation.js +++ b/packages/pathogen-schemas/src/generators/DGCTestInformation.js @@ -1,5 +1,4 @@ const faker = require('faker'); -const { getDGCSubject } = require('./DGCSubject'); const getDGCTestInformation = () => { const getTestName = () => { diff --git a/packages/pathogen-schemas/src/generators/DGCVaccinationInformation.js b/packages/pathogen-schemas/src/generators/DGCVaccinationInformation.js index c656947..dc4cc53 100644 --- a/packages/pathogen-schemas/src/generators/DGCVaccinationInformation.js +++ b/packages/pathogen-schemas/src/generators/DGCVaccinationInformation.js @@ -1,5 +1,7 @@ const faker = require('faker'); +const { getDGCVaccine } = require('./DGCVaccine'); + const getDGCVaccinationInformation = () => { const getAdministeringCenter = () => { const centers = [ @@ -30,7 +32,11 @@ const getDGCVaccinationInformation = () => { return order[faker.random.number({ min: 0, max: 2 })]; }; - const getVaccineCode = () => 'ICD-11#164949870'; + const getVaccine = () => { + const vax = getDGCVaccine(); + return vax; + }; + // 'ICD-11#164949870'; const example = { '@context': ['https://w3id.org/pathogen/v1'], @@ -42,7 +48,7 @@ const getDGCVaccinationInformation = () => { healthProfessional: getHealthProfessional(), nextVaccinationDate: faker.date.between('2021-05-11', '2021-06-11'), order: getVaccineAdminOrder(), - vaccine: getVaccineCode(), + vaccine: getVaccine(), }; return example; }; diff --git a/packages/pathogen-schemas/typings.d.ts b/packages/pathogen-schemas/typings.d.ts index 64cac25..0dda54f 100644 --- a/packages/pathogen-schemas/typings.d.ts +++ b/packages/pathogen-schemas/typings.d.ts @@ -1,20 +1,27 @@ export default { Brand: require('./schemas/Brand.json'), -chargeAndPaymentType: require('./schemas/chargeAndPaymentType.json'), ContactPoint: require('./schemas/ContactPoint.json'), CovidTestPassEvidenceDocument: require('./schemas/CovidTestPassEvidenceDocument.json'), CovidTestPassStandardCredentialDetailed: require('./schemas/CovidTestPassStandardCredentialDetailed.json'), CovidTestPassStandardCredentialMinimal: require('./schemas/CovidTestPassStandardCredentialMinimal.json'), CovidTestRegistrationCredential: require('./schemas/CovidTestRegistrationCredential.json'), +DGCInfectionInformation: require('./schemas/DGCInfectionInformation.json'), +DGCProofOfCovidTest: require('./schemas/DGCProofOfCovidTest.json'), +DGCProofOfRecovery: require('./schemas/DGCProofOfRecovery.json'), +DGCProofOfVaccination: require('./schemas/DGCProofOfVaccination.json'), +DGCSubject: require('./schemas/DGCSubject.json'), +DGCTestInformation: require('./schemas/DGCTestInformation.json'), +DGCVaccinationInformation: require('./schemas/DGCVaccinationInformation.json'), +DGCVaccine: require('./schemas/DGCVaccine.json'), Entity: require('./schemas/Entity.json'), GeoCoordinates: require('./schemas/GeoCoordinates.json'), -LegalEntityIdentifierCredential: require('./schemas/LegalEntityIdentifierCredential.json'), LEIaddress: require('./schemas/LEIaddress.json'), LEIauthority: require('./schemas/LEIauthority.json'), LEIentity: require('./schemas/LEIentity.json'), LEIevidenceDocument: require('./schemas/LEIevidenceDocument.json'), LEIregistration: require('./schemas/LEIregistration.json'), +LegalEntityIdentifierCredential: require('./schemas/LegalEntityIdentifierCredential.json'), MedicalTest: require('./schemas/MedicalTest.json'), Organization: require('./schemas/Organization.json'), Person: require('./schemas/Person.json'), @@ -25,4 +32,5 @@ Product: require('./schemas/Product.json'), ProductRegistrationEvidenceDocument: require('./schemas/ProductRegistrationEvidenceDocument.json'), QuantitativeValue: require('./schemas/QuantitativeValue.json'), TotalCharge: require('./schemas/TotalCharge.json'), +chargeAndPaymentType: require('./schemas/chargeAndPaymentType.json'), }