Skip to content

Commit 1dbb70f

Browse files
authored
DS-3730 Remove DSPs from palliative z-code quality report checks (#1083)
# Task Branch Pull Request **<https://nhsd-jira.digital.nhs.uk/browse/DS-3730>** ## Description of Changes Remove DSP from invalid palliative care type check, as it valid for them to have it. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Development Checklist - [x] I have performed a self-review of my own code - [x] Tests have added that prove my fix is effective or that my feature works (Integration tests) - [x] I have updated Dependabot to include my changes (if applicable) ## Code Reviewer Checklist - [x] I can confirm the changes have been tested or approved by a tester
1 parent 438b08d commit 1dbb70f

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

application/common/constants.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
CLOSED_AND_HIDDEN_STATUSES = ["HIDDEN", "CLOSED"]
44

5-
PHARMACY_SERVICE_TYPE_IDS = [13, 131, 132, 134, 137, 148, 149]
5+
DISTANCE_SELLING_PHARMACY_ID = 134
6+
PHARMACY_SERVICE_TYPE_IDS = [13, 131, 132, DISTANCE_SELLING_PHARMACY_ID, 137, 148, 149]
67
PHARMACY_ORGANISATION_SUB_TYPES = ["Community", "DistanceSelling"]
78
PHARMACY_ODSCODE_LENGTH = 5
89
PHARMACY_SERVICE_TYPE_ID = 13

application/quality_checker/search_dos.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
from aws_lambda_powertools.logging import Logger
44
from psycopg import Connection
55

6-
from common.commissioned_service_type import CommissionedServiceType
7-
from common.constants import DOS_ACTIVE_STATUS_ID, PHARMACY_SERVICE_TYPE_IDS
6+
from common.commissioned_service_type import PALLIATIVE_CARE, CommissionedServiceType
7+
from common.constants import DISTANCE_SELLING_PHARMACY_ID, DOS_ACTIVE_STATUS_ID, PHARMACY_SERVICE_TYPE_IDS
88
from common.dos import DoSService
99
from common.dos_db_connection import query_dos_db
1010

@@ -83,6 +83,9 @@ def search_for_incorrectly_profiled_z_code_on_incorrect_type(
8383
list[DoSService]: List of matching services.
8484
"""
8585
matchable_service_types = PHARMACY_SERVICE_TYPE_IDS.copy()
86+
if service_type == PALLIATIVE_CARE:
87+
# Remove DSPs from check, as it's valid for the palliative z-code to be present on them
88+
matchable_service_types.remove(DISTANCE_SELLING_PHARMACY_ID)
8689
matchable_service_types.remove(service_type.DOS_TYPE_ID)
8790
starting_character = getenv("ODSCODE_STARTING_CHARACTER") or "f"
8891
cursor = query_dos_db(

test/integration/features/F008_Quality_Checker.feature

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Feature: F008. Check DoS data quality
22

3-
@complete @slack_and_infrastructure
3+
@complete @slack_and_infrastructure @quality_checker
44
Scenario Outline: F008SX01. Check for too many services
55
Given <service_count> <service_status> services of type <service_type> for an odscode starting with A
66
When the quality checker is run
@@ -11,7 +11,7 @@ Feature: F008. Check DoS data quality
1111
| 2 | active | 148 | Multiple 'Pharmacy' type services found (type 148) |
1212
| 2 | active | 149 | Multiple 'Pharmacy' type services found (type 149) |
1313

14-
@complete @slack_and_infrastructure
14+
@complete @slack_and_infrastructure @quality_checker
1515
Scenario Outline: F008SX02. Check for not too many services
1616
Given <service_count> <service_status> services of type <service_type> for an odscode starting with A
1717
When the quality checker is run
@@ -24,7 +24,7 @@ Feature: F008. Check DoS data quality
2424
| 2 | closed | 149 | Multiple 'Pharmacy' type services found (type 149) |
2525
| 2 | commissioning | 149 | Multiple 'Pharmacy' type services found (type 149) |
2626

27-
@complete @slack_and_infrastructure
27+
@complete @slack_and_infrastructure @quality_checker
2828
Scenario Outline: F008SX03. Palliative on correct service type with incorrect odscode length
2929
Given an active service of type <service_type> for a <character_count> character odscode starting with A
3030
And the service in DoS supports palliative care
@@ -36,7 +36,7 @@ Feature: F008. Check DoS data quality
3636
| 13 | 6 | Palliative Care ZCode is on the correct service type, but the service is incorrectly profiled |
3737

3838

39-
@complete @slack_and_infrastructure
39+
@complete @slack_and_infrastructure @quality_checker
4040
Scenario Outline: F008SX04. Blood Pressure/Contraception/Palliative Care on a non-blood pressure/non-contraception/non-palliative care service type does report
4141
Given <service_count> <service_status> services of type <service_type> for an odscode starting with A
4242
And the DoS service has <commissioned_service> Z code
@@ -59,13 +59,12 @@ Feature: F008. Check DoS data quality
5959
| contraception | 148 | 1 | active | Contraception ZCode is on invalid service type |
6060
| palliative care | 131 | 1 | active | Palliative Care ZCode is on invalid service type |
6161
| palliative care | 132 | 1 | active | Palliative Care ZCode is on invalid service type |
62-
| palliative care | 134 | 1 | active | Palliative Care ZCode is on invalid service type |
6362
| palliative care | 137 | 1 | active | Palliative Care ZCode is on invalid service type |
6463
| palliative care | 148 | 1 | active | Palliative Care ZCode is on invalid service type |
6564
| palliative care | 149 | 1 | active | Palliative Care ZCode is on invalid service type |
6665

6766

68-
@complete @slack_and_infrastructure
67+
@complete @slack_and_infrastructure @quality_checker
6968
Scenario Outline: F008SX05. Blood Pressure/Contraception on a blood pressure/contraception service type does not report
7069
Given <service_count> <service_status> services of type <service_type> for an odscode starting with A
7170
And the DoS service has <commissioned_service> Z code
@@ -77,9 +76,10 @@ Feature: F008. Check DoS data quality
7776
| blood pressure | 148 | 1 | active | Blood Pressure ZCode is on invalid service type |
7877
| contraception | 149 | 1 | active | Contraception ZCode is on invalid service type |
7978
| palliative care | 13 | 1 | active | Palliative Care ZCode is on invalid service type |
79+
| palliative care | 134 | 1 | active | Palliative Care ZCode is on invalid service type |
8080

8181

82-
@complete @slack_and_infrastructure
82+
@complete @slack_and_infrastructure @quality_checker
8383
Scenario Outline: F008SX06. Palliative on correct service type with correct odscode length does not report
8484
Given an active service of type <service_type> for a <character_count> character odscode starting with A
8585
And the service in DoS supports palliative care

0 commit comments

Comments
 (0)