Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #29 from corona-warn-app/update-test-cases1
Browse files Browse the repository at this point in the history
Adapted testcases to latest descissions
  • Loading branch information
mlenkeit authored Feb 18, 2022
2 parents 5dd14e7 + ea407d3 commit 7b0e224
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 86 deletions.
88 changes: 67 additions & 21 deletions lib/ccl/functions/__analyzeDccWallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,24 +317,6 @@ const descriptor = {
}
]
},
{
assign: [
'it.__isTemporarilyEqualToBoosterWithoutContext',
{
and: [
{ var: 'it.__isSeriesComplete' },
{
'===': [
{ var: 'it.hcert.v.0.dn' },
2
]
},
{ var: 'it.__isOlderThan14Days' },
{ var: 'it.__isYoungerThan91Days' }
]
}
]
},
{
assign: [
'it.__isRecoveryVaccinationWithoutContext',
Expand Down Expand Up @@ -367,6 +349,34 @@ const descriptor = {
}
]
},
{
assign: [
'it.__isTemporarilyEqualToBoosterWithoutContext',
{
or: [
{
and: [
{ var: 'it.__isSeriesComplete' },
{
'===': [
{ var: 'it.hcert.v.0.dn' },
2
]
},
{ var: 'it.__isOlderThan14Days' },
{ var: 'it.__isYoungerThan91Days' }
]
},
{
and: [
{ var: 'it.__isRecoveryVaccinationWithoutContext' },
{ var: 'it.__isYoungerThan91Days' }
]
}
]
}
]
},
{
assign: [
'it.__isFullImmunizationWithoutContext',
Expand Down Expand Up @@ -531,6 +541,27 @@ const descriptor = {
}
]
},
{
assign: [
'it.__isTemporarilyEqualToBooster',
{
or: [
{ var: 'it.__isTemporarilyEqualToBoosterWithoutContext' },
{
and: [
{
or: [
{ var: 'it.__isRecoveryVaccination' },
{ var: 'it.__isRecoveryVaccinationWithoutContext' } // TODO: fixme, this should be redundant
]
},
{ var: 'it.__isYoungerThan91Days' }
]
}
]
}
]
},
{
assign: [
'it.__isBooster',
Expand All @@ -543,6 +574,22 @@ const descriptor = {
{
or: [
{ var: 'it.__hasPreviousRecoveryVaccination' },
// new 2/1 notation
{
and: [
{
'>': [
{ var: 'it.hcert.v.0.dn' },
{ var: 'it.hcert.v.0.sd' }
]
},
{
'!': [
{ var: 'it.__hasSomePreviousVaccination' }
]
}
]
},
{
and: [
{
Expand Down Expand Up @@ -834,7 +881,7 @@ const descriptor = {
{
filter: [
{ var: 'allRelevantVCsAndRCsAnnotatedWithContext' },
{ var: 'it.__isTemporarilyEqualToBoosterWithoutContext' },
{ var: 'it.__isTemporarilyEqualToBooster' },
'it'
]
}
Expand Down Expand Up @@ -1582,9 +1629,8 @@ const descriptor = {
{
init: [
'object',
'__allRelevantVCsAnnotated', { var: 'allRelevantVCsAnnotated' },
// '__allRelevantVCsAnnotated', { var: 'allRelevantVCsAnnotated' },
'__allRelevantVCsAndRCsAnnotatedWithContext', { var: 'allRelevantVCsAndRCsAnnotatedWithContext' },

// '__allVCsAndRCsWithFullImmunization', { var: 'allVCsAndRCsWithFullImmunization' },
// '__allBoosterVCs', { var: 'allBoosterVCs' },
'__allTCsWithValidRAT', { var: 'allTCsWithValidRAT' },
Expand Down
16 changes: 8 additions & 8 deletions lib/ccl/functions/__sortCertificatesByDate.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const descriptor = {
{ var: 'a.hcert.v.0' },
{ var: 'a.hcert.v.0.dt' },
{ var: 'a.hcert.r.0' },
{ var: 'a.hcert.r.0.df' },
{ var: 'a.hcert.r.0.fr' },
{ var: 'a.hcert.t.0' },
{ var: 'a.hcert.t.0.sc' },
null
Expand All @@ -36,7 +36,7 @@ const descriptor = {
{ var: 'b.hcert.v.0' },
{ var: 'b.hcert.v.0.dt' },
{ var: 'b.hcert.r.0' },
{ var: 'b.hcert.r.0.df' },
{ var: 'b.hcert.r.0.fr' },
{ var: 'b.hcert.t.0' },
{ var: 'b.hcert.t.0.sc' },
null
Expand All @@ -59,7 +59,7 @@ const descriptor = {
{ var: 'a.hcert.v.0' },
{ var: 'a.hcert.v.0.dt' },
{ var: 'a.hcert.r.0' },
{ var: 'a.hcert.r.0.df' },
{ var: 'a.hcert.r.0.fr' },
{ var: 'a.hcert.t.0' },
{ var: 'a.hcert.t.0.sc' },
null
Expand All @@ -70,7 +70,7 @@ const descriptor = {
{ var: 'b.hcert.v.0' },
{ var: 'b.hcert.v.0.dt' },
{ var: 'b.hcert.r.0' },
{ var: 'b.hcert.r.0.df' },
{ var: 'b.hcert.r.0.fr' },
{ var: 'b.hcert.t.0' },
{ var: 'b.hcert.t.0.sc' },
null
Expand All @@ -95,7 +95,7 @@ const descriptor = {
{ var: 'a.hcert.v.0' },
{ var: 'a.hcert.v.0.dt' },
{ var: 'a.hcert.r.0' },
{ var: 'a.hcert.r.0.df' },
{ var: 'a.hcert.r.0.fr' },
{ var: 'a.hcert.t.0' },
{ var: 'a.hcert.t.0.sc' },
null
Expand All @@ -106,7 +106,7 @@ const descriptor = {
{ var: 'b.hcert.v.0' },
{ var: 'b.hcert.v.0.dt' },
{ var: 'b.hcert.r.0' },
{ var: 'b.hcert.r.0.df' },
{ var: 'b.hcert.r.0.fr' },
{ var: 'b.hcert.t.0' },
{ var: 'b.hcert.t.0.sc' },
null
Expand All @@ -129,7 +129,7 @@ const descriptor = {
{ var: 'a.hcert.v.0' },
{ var: 'a.hcert.v.0.dt' },
{ var: 'a.hcert.r.0' },
{ var: 'a.hcert.r.0.df' },
{ var: 'a.hcert.r.0.fr' },
{ var: 'a.hcert.t.0' },
{ var: 'a.hcert.t.0.sc' },
null
Expand All @@ -140,7 +140,7 @@ const descriptor = {
{ var: 'b.hcert.v.0' },
{ var: 'b.hcert.v.0.dt' },
{ var: 'b.hcert.r.0' },
{ var: 'b.hcert.r.0.df' },
{ var: 'b.hcert.r.0.fr' },
{ var: 'b.hcert.t.0' },
{ var: 'b.hcert.t.0.sc' },
null
Expand Down
29 changes: 9 additions & 20 deletions test/fixtures/ccl/dcc-series-janssen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,35 +254,24 @@
# Complete vaccination is not yet valid
- time: janssen2/1
assertions:
admissionState: OTHER
mostRelevantCertificate: janssen2/1
vaccinationState: COMPLETE_IMMUNIZATION_PENDING
vaccinationValidFrom: janssen2/1+P15D
mostRecentVaccination: janssen2/1
hasBooster: false
verificationCertificates:
- certificate: janssen2/1
# Complete vaccination still not valid after 14 days
- time: janssen2/1+P14D
assertions:
admissionState: OTHER
admissionState: 2G_PLUS
mostRelevantCertificate: janssen2/1
vaccinationState: COMPLETE_IMMUNIZATION_PENDING
vaccinationValidFrom: janssen2/1+P15D
vaccinationState: COMPLETE_IMMUNIZATION
vaccinationValidFrom: janssen2/1
mostRecentVaccination: janssen2/1
hasBooster: false
hasBooster: true # we assume the better result for 2/1 if in doubt
verificationCertificates:
- certificate: janssen2/1
# Complete vaccination valid after 15 days counts as 2G+ for 90 days
- time: janssen2/1+P15D
# Admission State still 2G+ after 91 days (because this could be a vacc. after recovery vacc.
- time: janssen2/1+P91D
assertions:
admissionState: 2G_PLUS
mostRelevantCertificate: janssen2/1
vaccinationState: COMPLETE_IMMUNIZATION
vaccinationValidFrom: janssen2/1+P15D
vaccinationValidFrom: janssen2/1
mostRecentVaccination: janssen2/1
hasBooster: false
hasBoosterEquivalent: true
hasBooster: true # we assume the better result for 2/1 if in doubt
hasBoosterEquivalent: false
verificationCertificates:
- certificate: janssen2/1
# 2Booster on J&J
Expand Down
Loading

0 comments on commit 7b0e224

Please sign in to comment.