Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

development => mester #78

Merged
merged 8 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
20 changes: 10 additions & 10 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 @@ -226,7 +226,7 @@ type Payload (metadata: MetaData.ContentMetadata, release: TimeStamp.Release) =
_itemprop "thumbnailUrl"
$"{ Generic.UrlLocation }/downloads/homepage/{ release.isoDate }/vaccinations/{ areaType.ToLower() }/"
+ getter this.metadata.metric "area_code"
+ "_75_plus_thumbnail.svg"
+ "_65_plus_thumbnail.svg"
|> _content
]
meta [
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 @@ -318,10 +318,10 @@ type Payload (metadata: MetaData.ContentMetadata, release: TimeStamp.Release) =
$"{Generic.UrlLocation}/downloads/homepage/{ release.isoDate }/vaccinations/"
+ getter this.metadata.metric "area_type"
+ "/" + getter this.metadata.metric "area_code"
+ "_75_plus_thumbnail.svg"
+ "_65_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