Skip to content

Commit

Permalink
Fix rebase error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Plowman committed Oct 12, 2023
1 parent 05be00b commit d8a39c7
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 12 deletions.
12 changes: 7 additions & 5 deletions application/quality_checker/check_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
search_for_matching_services,
search_for_pharmacy_ods_codes,
)
from common.commissioned_service_type import BLOOD_PRESSURE, CONTRACEPTION, CommissionedServiceType
from common.dos import DoSService
from common.service_type import BLOOD_PRESSURE, CONTRACEPTION, ServiceType

logger = Logger(child=True)

Expand All @@ -26,12 +26,12 @@ def check_pharmacy_profiling(connection: Connection) -> None:
check_for_multiple_of_service_type(matched_services, CONTRACEPTION)


def check_incorrect_zcode_profiling(connection: Connection, service_type: ServiceType) -> None:
def check_incorrect_zcode_profiling(connection: Connection, service_type: CommissionedServiceType) -> None:
"""Check the palliative care profiling data quality of the dos database.
Args:
connection (Connection): Connection to the DoS DB.
service_type (ServiceType): Service type to check for.
service_type (CommissionedServiceType): Service type to check for.
"""
if incorrectly_profiled_services := search_for_incorrectly_profiled_z_code(connection, service_type):
logger.info(
Expand All @@ -46,12 +46,14 @@ def check_incorrect_zcode_profiling(connection: Connection, service_type: Servic
)


def check_for_multiple_of_service_type(matched_services: list[DoSService], service_type: ServiceType) -> None:
def check_for_multiple_of_service_type(
matched_services: list[DoSService], service_type: CommissionedServiceType,
) -> None:
"""Check for multiple of service type.
Args:
matched_services (list[DoSService]): List of matched services.
service_type (ServiceType): Service type to check for.
service_type (CommissionedServiceType): Service type to check for.
"""
matched_service_types = [service for service in matched_services if service.typeid == service_type.DOS_TYPE_ID]
if len(matched_service_types) > 1:
Expand Down
2 changes: 1 addition & 1 deletion application/quality_checker/quality_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
check_incorrect_zcode_profiling,
check_pharmacy_profiling,
)
from common.commissioned_service_type import BLOOD_PRESSURE, CONTRACEPTION, PALLIATIVE_CARE
from common.dos_db_connection import connect_to_dos_db_replica
from common.middlewares import unhandled_exception_logging
from common.service_type import BLOOD_PRESSURE, CONTRACEPTION, PALLIATIVE_CARE

logger = Logger()
tracer = Tracer()
Expand Down
9 changes: 6 additions & 3 deletions application/quality_checker/search_dos.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from aws_lambda_powertools.logging import Logger
from psycopg import Connection

from common.commissioned_service_type import CommissionedServiceType
from common.constants import DOS_ACTIVE_STATUS_ID, PHARMACY_SERVICE_TYPE_IDS
from common.dos import DoSService
from common.dos_db_connection import query_dos_db
from common.service_type import ServiceType

logger = Logger(child=True)

Expand Down Expand Up @@ -55,12 +55,15 @@ def search_for_matching_services(connection: Connection, odscode: str) -> list[D
return services


def search_for_incorrectly_profiled_z_code(connection: Connection, service_type: ServiceType) -> list[DoSService]:
def search_for_incorrectly_profiled_z_code(
connection: Connection,
service_type: CommissionedServiceType,
) -> list[DoSService]:
"""Search for matching services in DoS DB using odscode.
Args:
connection (Connection): Connection to the DoS DB.
service_type (ServiceType): Service type to check for.
service_type (CommissionedServiceType): Service type to check for.
Returns:
list[DoSService]: List of matching services.
Expand Down
2 changes: 1 addition & 1 deletion application/quality_checker/tests/test_check_dos.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from unittest.mock import MagicMock, call, patch

from application.common.service_type import BLOOD_PRESSURE, CONTRACEPTION
from application.common.commissioned_service_type import BLOOD_PRESSURE, CONTRACEPTION
from application.quality_checker.check_dos import (
check_for_multiple_of_service_type,
check_incorrect_zcode_profiling,
Expand Down
2 changes: 1 addition & 1 deletion application/quality_checker/tests/test_quality_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from aws_lambda_powertools.utilities.typing import LambdaContext

from application.common.service_type import BLOOD_PRESSURE, CONTRACEPTION, PALLIATIVE_CARE
from application.common.commissioned_service_type import BLOOD_PRESSURE, CONTRACEPTION, PALLIATIVE_CARE
from application.quality_checker.quality_checker import check_dos_data_quality, lambda_handler

FILE_PATH = "application.quality_checker.quality_checker"
Expand Down
2 changes: 1 addition & 1 deletion application/quality_checker/tests/test_search_dos.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
search_for_matching_services,
search_for_pharmacy_ods_codes,
)
from common.commissioned_service_type import BLOOD_PRESSURE
from common.constants import DOS_ACTIVE_STATUS_ID, PHARMACY_SERVICE_TYPE_IDS
from common.dos import DoSService
from common.service_type import BLOOD_PRESSURE

FILE_PATH = "application.quality_checker.search_dos"

Expand Down

0 comments on commit d8a39c7

Please sign in to comment.