Skip to content

Commit 3a94f8e

Browse files
committed
constants
1 parent 8322e52 commit 3a94f8e

File tree

14 files changed

+39
-120
lines changed

14 files changed

+39
-120
lines changed

lambdas/backend/src/authorisation/authoriser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from authorisation.api_operation_code import ApiOperationCode
66
from common.clients import logger
7-
from common.models.api_constants import SUPPLIER_PERMISSIONS_HASH_KEY
7+
from common.models.constants import SUPPLIER_PERMISSIONS_HASH_KEY
88
from common.redis_client import get_redis_client
99

1010

lambdas/backend/src/controller/fhir_api_exception_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import Callable, Type
66

77
from common.clients import logger
8-
from common.models.api_constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE
8+
from common.models.constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE
99
from common.models.api_errors import (
1010
Code,
1111
InconsistentIdentifierError,

lambdas/backend/src/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Functions for filtering a FHIR Immunization Resource"""
22

3-
from common.models.api_constants import Urls
3+
from common.models.constants import Urls
44
from common.models.utils.generic_utils import (
55
get_contained_patient,
66
get_contained_practitioner,

lambdas/backend/src/search_imms_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from aws_lambda_typing import context as context_
1010
from aws_lambda_typing import events
1111

12-
from common.models.api_constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE, MAX_RESPONSE_SIZE_BYTES
12+
from common.models.constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE, MAX_RESPONSE_SIZE_BYTES
1313
from common.models.api_errors import Code, Severity, create_operation_outcome
1414
from controller.aws_apig_response_utils import create_response
1515
from controller.fhir_controller import FhirController, make_controller

lambdas/backend/tests/service/test_fhir_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
from authorisation.api_operation_code import ApiOperationCode
1515
from authorisation.authoriser import Authoriser
16-
from common.models.api_constants import NHS_NUMBER_USED_IN_SAMPLE_DATA
16+
from common.models.constants import NHS_NUMBER_USED_IN_SAMPLE_DATA
1717
from common.models.api_errors import (
1818
InconsistentIdentifierError,
1919
InconsistentResourceVersion,

lambdas/backend/tests/test_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from copy import deepcopy
55
from uuid import uuid4
66

7-
from common.models.api_constants import Urls
7+
from common.models.constants import Urls
88
from filter import (
99
Filter,
1010
add_use_to_identifier,

lambdas/backend/tests/test_search_imms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44
from unittest.mock import create_autospec, patch
55

6-
from common.models.api_constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE
6+
from common.models.constants import GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE
77
from common.models.api_errors import Code, Severity, create_operation_outcome
88
from controller.fhir_controller import FhirController
99
from search_imms_handler import search_imms

lambdas/recordprocessor/src/models/utils.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

lambdas/shared/src/common/models/api_constants.py

Lines changed: 0 additions & 28 deletions
This file was deleted.

lambdas/shared/src/common/models/constants.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,31 @@ class Constants:
5858
DISEASES_TO_VACCINE_TYPE_HASH_KEY = "diseases_to_vacc"
5959

6060
REINSTATED_RECORD_STATUS = "reinstated"
61+
62+
63+
# Constants for use within the test
64+
VALID_NHS_NUMBER = "1345678940" # Valid for pre, FHIR and post validators
65+
NHS_NUMBER_USED_IN_SAMPLE_DATA = "9000000009"
66+
ADDRESS_UNKNOWN_POSTCODE = "ZZ99 3WZ"
67+
68+
69+
class Urls:
70+
"""Urls which are expected to be used within the FHIR Immunization Resource json data"""
71+
72+
nhs_number = "https://fhir.nhs.uk/Id/nhs-number"
73+
vaccination_procedure = "https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-VaccinationProcedure"
74+
snomed = "http://snomed.info/sct" # NOSONAR(S5332)
75+
nhs_number_verification_status_structure_definition = (
76+
"https://fhir.hl7.org.uk/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus"
77+
)
78+
nhs_number_verification_status_code_system = (
79+
"https://fhir.hl7.org.uk/CodeSystem/UKCore-NHSNumberVerificationStatusEngland"
80+
)
81+
ods_organization_code = "https://fhir.nhs.uk/Id/ods-organization-code"
82+
urn_school_number = "https://fhir.hl7.org.uk/Id/urn-school-number"
83+
84+
85+
GENERIC_SERVER_ERROR_DIAGNOSTICS_MESSAGE = "Unable to process request. Issue may be transient."
86+
SUPPLIER_PERMISSIONS_HASH_KEY = "supplier_permissions"
87+
# Maximum response size for an AWS Lambda function
88+
MAX_RESPONSE_SIZE_BYTES = 6 * 1024 * 1024

0 commit comments

Comments
 (0)