Skip to content

Commit

Permalink
Man 219 correct no risk score and dates (#242)
Browse files Browse the repository at this point in the history
* MAN-219: Fixed updated dates and tidy up
  • Loading branch information
pmcphee77 authored Dec 20, 2024
1 parent bb5c9ea commit 5ed99eb
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 68 deletions.
2 changes: 1 addition & 1 deletion server/views/_components/mappa-widget/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<strong>{% if isNotNull(params.mappa.category) %}Cat {{ params.mappa.category }}/{% endif %}{% if isNotNull(params.mappa.level) %}Level {{ params.mappa.level }}{% else %}No{% endif %}</strong> MAPPA</h2>
<p class="govuk-body-m govuk-!-margin-bottom-2">Multi-agency public protection arrangements</p>
{% if params.mappa.level and params.lastUpdatedDate %}
<p class="text-secondary govuk-body-s govuk-!-margin-bottom-0">Last updated: {{ params.lastUpdatedDate }}</p>
<p class="text-secondary govuk-!-margin-bottom-0 govuk-hint">Last updated (NDelius): {{ params.lastUpdatedDate }}</p>
{% endif %}
{% else %}
<h2 class="govuk-heading-m text-uppercase"><strong>Unknown</strong> MAPPA</h2>
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion server/views/_components/rosh-widget/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
{% else %}
<div class="rosh-widget {{ getOverallRiskLevelClass(roshSummary.overallRisk) }}">
<h3 class="govuk-heading-m" data-qa="overallRiskValue"><strong>{{ getRiskLevelText(roshSummary.overallRisk) }}</strong> RoSH</h3>
<p class="govuk-body-m">Risk of serious harm<br><span class="govuk-body-s govuk-hint">Last updated: {{ roshSummary.assessedOn | dateWithYear | default("Not known") }}</span></p>
<p class="govuk-body-m">Risk of serious harm<br><span class="govuk-body-s govuk-hint">Last updated (OASys): {{ roshSummary.assessedOn | dateWithYearShortMonth | default("Not known") }}</span></p>
<table class="govuk-table rosh-widget__table">
<caption class="govuk-visually-hidden">Risk of serious harm in Community</caption>
<thead class="govuk-table__head">
Expand Down
103 changes: 39 additions & 64 deletions server/views/pages/risk.njk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
{% set highScoring = groupNeeds("SEVERE", needs.identifiedNeeds) %}
{% set lowScoring = groupNeeds("STANDARD", needs.identifiedNeeds) %}
{% set withoutScore = needs.notIdentifiedNeeds %}

{% if risks.assessedOn %}
{% set lastUpdatedDate = 'Last updated (OASys):' + risks.assessedOn | dateWithYear %}
{% endif %}

{% set highScoringNeeds %}
{% if highScoring.length > 0 %}
Expand Down Expand Up @@ -87,10 +89,6 @@
<h2 class="govuk-heading-m score-header govuk-!-margin-bottom-0" data-analytics-event-scroll="RSR score">
Criminogenic needs
</h2>
<div class="text-secondary govuk-body govuk-!-margin-bottom-2 govuk-hint">
Last updated (OASys): {{ risks.assessedOn | dateWithYear }}
</div>

{{ govukSummaryList({
rows: [
{
Expand All @@ -115,9 +113,6 @@
<h2 class="govuk-heading-m score-header govuk-!-margin-bottom-0" data-analytics-event-scroll="RSR score">
RSR (risk of serious recidivism)
</h2>
<div class="text-secondary govuk-body govuk-!-margin-bottom-2 govuk-hint">
Last updated (OASys): {{ predictorScores.date }}
</div>
<div aria-hidden="true">
{{ predictorScore(predictorScores.scores.RSR) }}
</div>
Expand All @@ -127,30 +122,24 @@
<h2 class="govuk-heading-m score-header govuk-!-margin-bottom-1" data-analytics-event-scroll="OGRS score">
OGRS (offender group reconviction scale)
</h2>
<div class="text-secondary govuk-body govuk-!-margin-bottom-6 govuk-hint">
Last updated (OASys): {{ predictorScores.date }}
</div>
{% endif %}

{% if predictorScores.scores.OGRS %}
<div class="govuk-grid-row govuk-!-margin-bottom-4">
<div class="govuk-grid-column-three-quarters-from-desktop">
<div class="flex-mobile">
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>1 year</h3>
<div class='govuk-body' data-qa='ogrs-1yr'>{{ predictorScores.scores.OGRS.oneYear }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>2 year</h3>
<div class='govuk-body' data-qa='ogrs-2yr'>{{ predictorScores.scores.OGRS.twoYears }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>Level</h3>
<div class='govuk-body' data-qa='ogrs-level'>{{ riskLevelLabel(predictorScores.scores.OGRS.level) }}</div>
<div class="govuk-grid-row govuk-!-margin-bottom-4">
<div class="govuk-grid-column-three-quarters-from-desktop">
<div class="flex-mobile">
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>1 year</h3>
<div class='govuk-body' data-qa='ogrs-1yr'>{{ predictorScores.scores.OGRS.oneYear }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>2 year</h3>
<div class='govuk-body' data-qa='ogrs-2yr'>{{ predictorScores.scores.OGRS.twoYears }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>Level</h3>
<div class='govuk-body' data-qa='ogrs-level'>{{ riskLevelLabel(predictorScores.scores.OGRS.level) }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}

{% if predictorScores.scores.OSPI.score or predictorScores.scores.OSPC.score %}
Expand All @@ -163,9 +152,6 @@
<h3 class="govuk-heading-s score-header govuk-!-margin-bottom-0" data-analytics-event-scroll="OSP/I score">
OSP/I (internet-related offences) or OSP/IIC (internet-involved child offences)
</h3>
<div class="text-secondary govuk-body govuk-!-margin-bottom-2 govuk-hint">
Last updated (OASys): {{ predictorScores.date }}
</div>
<div aria-hidden="true">
{{ predictorScore(predictorScores.scores.OSPI) }}
</div>
Expand All @@ -176,9 +162,6 @@
<h3 class="govuk-heading-s score-header govuk-!-margin-bottom-0" data-analytics-event-scroll="OSP/C score">
OSP/C (contact-related sexual reoffending) or OSP/DC (direct contact)
</h3>
<div class="text-secondary govuk-body govuk-!-margin-bottom-2 govuk-hint">
Last updated (OASys): {{ predictorScores.date }}
</div>
<div aria-hidden="true">
{{ predictorScore(predictorScores.scores.OSPC) }}
</div>
Expand All @@ -189,9 +172,6 @@
<h2 class="govuk-heading-m score-header govuk-!-margin-bottom-1" data-analytics-event-scroll="OVP score">
OVP (OASys violent predictor score)
</h2>
<div class="text-secondary govuk-body govuk-!-margin-bottom-6 govuk-hint">
Last updated (OASys): {{ predictorScores.date }}
</div>
<div class="govuk-grid-row govuk-!-margin-bottom-4">
<div class="govuk-grid-column-three-quarters-from-desktop">
<div class="flex-mobile">
Expand All @@ -216,34 +196,29 @@
<h2 class="govuk-heading-m score-header govuk-!-margin-bottom-0" data-analytics-event-scroll="OGP score">
OGP (OASys general predictor score)
</h2>
<div class="text-secondary govuk-body govuk-!-margin-bottom-6">
Last updated (OASys): {{ predictorScores.date }}
</div>
<div class="govuk-grid-row govuk-!-margin-bottom-4">
<div class="govuk-grid-column-three-quarters-from-desktop">
<div class="flex-mobile">
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>1 year</h3>
<div class='govuk-body' data-qa='ogp-1yr'>{{ predictorScores.scores.OGP.oneYear }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>2 year</h3>
<div class='govuk-body' data-qa='ogp-2yr'>{{ predictorScores.scores.OGP.twoYears }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>Level</h3>
<div class='govuk-body' data-qa='ogp-level'>{{ riskLevelLabel(predictorScores.scores.OGP.level) }}</div>
<div class="govuk-grid-row govuk-!-margin-bottom-4">
<div class="govuk-grid-column-three-quarters-from-desktop">
<div class="flex-mobile">
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>1 year</h3>
<div class='govuk-body' data-qa='ogp-1yr'>{{ predictorScores.scores.OGP.oneYear }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>2 year</h3>
<div class='govuk-body' data-qa='ogp-2yr'>{{ predictorScores.scores.OGP.twoYears }}%</div>
</div>
<div class='flex__item-one-third-mobile'>
<h3 class='govuk-heading-s govuk-!-margin-bottom-1'>Level</h3>
<div class='govuk-body' data-qa='ogp-level'>{{ riskLevelLabel(predictorScores.scores.OGP.level) }}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{% endif %}

{% else %}
<p>Some data is unavailable because {{ personRisk.personSummary.name.forename }} has a level one risk assessment in OASys.</p>
{% set html %}
<h2 class="govuk-heading-m">There is no OASys risk assessment for {{ personRisk.personSummary.name | fullName }}</h2>
<h2 class="govuk-heading-m">There is no OASys Layer 3 risk assessment for {{ personRisk.personSummary.name | fullName }}</h2>
{% include './risk/_no-oasys-risk-assessment.njk' %}
{% endset %}
{{ govukNotificationBanner({ html: html }) }}
Expand All @@ -257,7 +232,7 @@
</h2>
{% if personRisk.opd.eligible === true %}
<div class="text-secondary govuk-body govuk-!-margin-bottom-2 govuk-hint">
Last updated (OASys): {{ personRisk.opd.date | dateWithYear }}
Last updated (NDelius): {{ personRisk.opd.date | dateWithYear }}
</div>
<p class='govuk-body' data-qa='ogp-missing'>Eligible</p>
{% else %}
Expand All @@ -266,9 +241,9 @@
</div>
<div class="govuk-grid-column-one-third">
{{ roshWidget(risksWidget) }}
{{ mappaWidget({ mappa: personRisk.mappa, lastUpdatedDate: personRisk.mappa.startDate | dateWithYear }) }}
{{ mappaWidget({ mappa: personRisk.mappa, lastUpdatedDate: personRisk.mappa.startDate | dateWithYearShortMonth }) }}
<div class="govuk-body predictor-timeline__heading">
<h2 class="govuk-heading-m govuk-!-margin-bottom-2">Scores history</h2>
<h2 class="govuk-heading-m govuk-!-margin-bottom-2">OASys score history</h2>
{% if predictorScores.error and caseSummary.roshHistory.error %}
<p class='govuk-body' data-qa='timeline-missing'>RoSH levels and predictor scores cannot be retrieved from NDelius or OASys. Double-check NDelius and OASys.</p>
{% elseif predictorScores.error %}
Expand Down
2 changes: 1 addition & 1 deletion server/views/pages/risk/_risk-flags.njk
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<thead class="govuk-table__head">
<tr class="govuk-table__row">
<th class="govuk-table__header">Flag</th>
<th class="govuk-table__header" >Notes</th>
<th class="govuk-table__header">Notes</th>
<th class="govuk-table__header">Date added</th>
<th class="govuk-table__header">Next review</th>
</tr>
Expand Down
8 changes: 7 additions & 1 deletion server/views/partials/case.njk
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,15 @@
</div>
{% include "../partials/case-nav.njk" %}
{% if currentSectionName %}
<h1 class="govuk-heading-l govuk-!-margin-bottom-7" data-qa="pageHeading">{{ currentSectionName }}</h1>
{% if lastUpdatedDate %}
<h1 class="govuk-heading-l govuk-!-margin-bottom-3" data-qa="pageHeading">{{ currentSectionName }}</h1>
<div class="govuk-inset-text govuk-!-margin-top-0">{{ lastUpdatedDate }}</div>
{% else %}
<h1 class="govuk-heading-l govuk-!-margin-bottom-7" data-qa="pageHeading">{{ currentSectionName }}</h1>
{% endif %}
{% endif %}


{% set errors = [] %}
{% if risks.errors.length > 0 %}
{% set errors = errors.concat(risks.errors) %}
Expand Down

0 comments on commit 5ed99eb

Please sign in to comment.