Skip to content

Commit

Permalink
Associate DGCVaccine primitive to DGCInfo, update generators
Browse files Browse the repository at this point in the history
  • Loading branch information
mukundanps committed May 16, 2021
1 parent 25df270 commit b028881
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 63 deletions.
123 changes: 71 additions & 52 deletions packages/pathogen-schemas/schemas/DGCVaccinationInformation.json
Original file line number Diff line number Diff line change
@@ -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": []
}
23 changes: 17 additions & 6 deletions packages/pathogen-schemas/schemas/DGCVaccine.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const faker = require('faker');
const { getDGCSubject } = require('./DGCSubject');

const getDGCTestInformation = () => {
const getTestName = () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
const faker = require('faker');

const { getDGCVaccine } = require('./DGCVaccine');

const getDGCVaccinationInformation = () => {
const getAdministeringCenter = () => {
const centers = [
Expand Down Expand Up @@ -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'],
Expand All @@ -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;
};
Expand Down
12 changes: 10 additions & 2 deletions packages/pathogen-schemas/typings.d.ts
Original file line number Diff line number Diff line change
@@ -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'),
Expand All @@ -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'),
}

0 comments on commit b028881

Please sign in to comment.