Skip to content

Commit

Permalink
Merge pull request #74 from UKHSA-Internal/COVP-171_add_Autumn23_metrics
Browse files Browse the repository at this point in the history
COVP-171 Add autumn23 metrics
  • Loading branch information
adebayoolabintan authored Nov 14, 2023
2 parents c847fa3 + 0eae84d commit 4c1b49c
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 19 deletions.
11 changes: 9 additions & 2 deletions coronavirus_dashboard_summary/Models/Metrics.fs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ let PostCodeMetrics =
"cumVaccinationFirstDoseUptakeByVaccinationDatePercentage"
"cumVaccinationSecondDoseUptakeByVaccinationDatePercentage"
"cumVaccinationThirdInjectionUptakeByVaccinationDatePercentage"
"cumPeopleVaccinatedSpring23ByVaccinationDate75plus"
"cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"
// "cumPeopleVaccinatedSpring23ByVaccinationDate75plus"
// "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"
"cumPeopleVaccinatedAutumn23ByVaccinationDate65plus"
"cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"
"newDeaths28DaysByDeathDate"
"newDeaths28DaysByDeathDateChange"
"newDeaths28DaysByDeathDateChangePercentage"
Expand All @@ -37,4 +39,9 @@ let PostCodeMetrics =
"newVirusTestsChangePercentage"
"newVirusTestsRollingSum"
"newVirusTestsDirection"
"newVirusTestsBySpecimenDate"
"newVirusTestsBySpecimenDateChange"
"newVirusTestsBySpecimenDateChangePercentage"
"newVirusTestsBySpecimenDateRollingSum"
"newVirusTestsBySpecimenDateDirection"
|]
4 changes: 2 additions & 2 deletions coronavirus_dashboard_summary/Models/Models.Metadata.fs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ let CardMetadata: ContentMetadata[] = [|
description = null
}
{
metric = "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"
metric = "cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"
rate = null
sum = null
caption = "Boosters"
Expand All @@ -101,7 +101,7 @@ let CardMetadata: ContentMetadata[] = [|
description = null
}
{
metric = "cumPeopleVaccinatedSpring23ByVaccinationDate75plus"
metric = "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus"
rate = null
sum = null
caption = "Boosters"
Expand Down
16 changes: 8 additions & 8 deletions coronavirus_dashboard_summary/Templates/Card.Vaccinations.fs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ let private contentMetadata =
[
("second", [
{
metric = "cumPeopleVaccinatedSpring23ByVaccinationDate75plus"
metric = "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus"
percentage = null
label = "spring booster (aged 75+)"
label = "spring booster (aged 65+)"
periodLabel = "Total"
}
{
metric = "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"
percentage = "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"
label = "Spring booster (aged 75+)"
metric = "cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"
percentage = "cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"
label = "Spring booster (aged 65+)"
periodLabel = "Percentage"
}
])
Expand Down Expand Up @@ -142,7 +142,7 @@ type private NumberItem with
] []

span [ _class "tooltiptext govuk-!-font-size-16"; _itemprop "disambiguatingDescription"] [
$"Percentage of people aged 75+ ({ this.label.ToLower() }) reported on "
$"Percentage of people aged 65+ ({ this.label.ToLower() }) reported on "
+ getter this.percentage "formattedDate"
|> encodedText
]
Expand Down Expand Up @@ -300,7 +300,7 @@ type Payload (metadata: MetaData.ContentMetadata, release: TimeStamp.Release) =

figure [ _class "visaulisation"; _ariaLabelledBy "vaccination-vis-lab" ] [
div [ _class "bottom-aligned main-caption govuk-!-font-size-16"; _id "vaccination-vis-lab" ] [
encodedText "Percentage of people aged 75+"
encodedText "Percentage of people aged 65+"
]
figcaption [] [

Expand All @@ -321,7 +321,7 @@ type Payload (metadata: MetaData.ContentMetadata, release: TimeStamp.Release) =
+ "_75_plus_thumbnail.svg"
|> _src

"Chart displaying the percentage of population aged 75+ given a spring booster in "
"Chart displaying the percentage of population aged 65+ given a spring booster in "
+ getter this.metadata.metric "area_name"
|> _alt
]
Expand Down
8 changes: 4 additions & 4 deletions coronavirus_dashboard_summary/Views/Views.HomePage.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let private selectedNestedMetricsQuery (date: TimeStamp.Release) = $"\
JOIN covid19.release_reference AS rr ON rr.id = release_id
WHERE area_name = 'England'
AND date > (DATE(@date) - INTERVAL '40 days')
AND metric IN ('cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus', 'cumPeopleVaccinatedSpring23ByVaccinationDate75plus')
AND metric IN ('cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus', 'cumPeopleVaccinatedAutumn23ByVaccinationDate65plus')
AND payload IS NOT NULL
ORDER BY rank LIMIT 2;
"
Expand Down Expand Up @@ -120,12 +120,12 @@ let index (date: Release) (redis: Redis.Client) =
|> Metrics.GeneralPayload

let keyList = [for x in dbResp.Keys -> x] // Create a list of the keys retrieved from Redis
let nestedMetrics = [|"cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"; "cumPeopleVaccinatedSpring23ByVaccinationDate75plus"|]
let nestedMetrics = [|"cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"; "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus"|]

// Now check to see if our nested metrics are in the retrieved metrics
if
(List.contains "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus" keyList) ||
(List.contains "cumPeopleVaccinatedSpring23ByVaccinationDate75plus" keyList)
(List.contains "cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus" keyList) ||
(List.contains "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus" keyList)
then
printfn "%s" "Present"
else
Expand Down
6 changes: 3 additions & 3 deletions coronavirus_dashboard_summary/Views/Views.PostCode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ type private PostCodeView(postcode, redis, telemetry) =
//printfn ("%A") dbResp

let keyList = [for x in dbResp.Keys -> x] // Create a list of the keys retrieved from Redis
let nestedMetrics = [|"cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus"; "cumPeopleVaccinatedSpring23ByVaccinationDate75plus"|]
let nestedMetrics = [|"cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus"; "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus"|]

// printfn ("%A") keyList

// Now check to see if our nested metrics are in the retrieved metrics
if
(List.contains "cumVaccinationSpring23UptakeByVaccinationDatePercentage75plus" keyList) ||
(List.contains "cumPeopleVaccinatedSpring23ByVaccinationDate75plus" keyList)
(List.contains "cumVaccinationAutumn23UptakeByVaccinationDatePercentage65plus" keyList) ||
(List.contains "cumPeopleVaccinatedAutumn23ByVaccinationDate65plus" keyList)
then
printfn "%s" "Present"
else
Expand Down

0 comments on commit 4c1b49c

Please sign in to comment.