-
Notifications
You must be signed in to change notification settings - Fork 2
/
CovidTestPassEvidenceDocument.js
44 lines (36 loc) · 1.17 KB
/
CovidTestPassEvidenceDocument.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
const faker = require('faker');
const { getMedicalTest } = require('./MedicalTest');
const { getOrganization } = require('./Organization');
const { getPerson } = require('./Person');
const getCovidTestPassEvidenceDocument = () => {
const getStatus = () => {
const types = ['Positive', 'Negative'];
return faker.random.arrayElement(types);
};
const getTestType = () => {
const types = ['Rapid PCR Test', 'PCR Test', 'Antigen Test'];
return faker.random.arrayElement(types);
};
const getHealthAdmin = () => {
const types = ['Yes', 'No', 'Unkown'];
return faker.random.arrayElement(types);
};
const valauth = getOrganization();
delete valauth['@context'];
const patient = getPerson();
delete patient['@context'];
const test = getMedicalTest();
delete test['@context'];
const example = {
'@context': ['https://w3id.org/pathogen/v1'],
type: 'CovidTestPassEvidenceDocument',
testType: getTestType(),
testCenter: valauth,
healthProfessionalAdministered: getHealthAdmin(),
testedPerson: patient,
testResult: getStatus(),
testDetails: test
};
return example;
};
module.exports = { getCovidTestPassEvidenceDocument };