Skip to content

Commit b89b04c

Browse files
committed
remove redundant imports
1 parent be8bf6d commit b89b04c

File tree

3 files changed

+12
-18
lines changed

3 files changed

+12
-18
lines changed

lambdas/shared/src/common/validator/constants/enums.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,10 @@ class ExceptionLevels(IntEnum):
5454
ExceptionLevels.PARENT_FAILED: "Parent Failed [%s]: %s",
5555
ExceptionLevels.KEY_CHECK_FAILED: "Key Check Failed [%s]: %s",
5656
}
57+
58+
59+
class DataType(StrEnum):
60+
FHIR = "FHIR"
61+
FHIRJSON = "FHIRJSON"
62+
CSV = "CSV"
63+
CSVROW = "CSVROW"

lambdas/shared/src/common/validator/expression_checker.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,19 @@
22
import datetime
33
import re
44
import uuid
5-
from enum import StrEnum
65

76
from common.validator.constants.enums import MESSAGES
87
from common.validator.constants.enums import ExceptionLevels
8+
from common.validator.constants.enums import MessageLabel
99
from common.validator.lookup_expressions.key_data import KeyData
1010
from common.validator.lookup_expressions.lookup_data import LookUpData
1111
from common.validator.record_error import ErrorReport
1212
from common.validator.record_error import RecordError
1313

1414

15-
class MessageLabel(StrEnum):
16-
EXPECTED_LABEL = "Expected- "
17-
FOUND_LABEL = "Found- "
18-
VALUE_MISMATCH_MSG = "Value does not equal expected value, "
19-
20-
2115
class ExpressionChecker:
16+
""" """
17+
2218
def __init__(self, data_parser, summarise, report_unexpected_exception):
2319
self.data_parser = data_parser # FHIR data parser for additional functions
2420
self.data_look_up = LookUpData() # used for generic look up

lambdas/shared/src/common/validator/validator.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
3. Collects all error records and builds the final error report
55
"""
66

7-
from enum import Enum
8-
97
from common.validator.constants.enums import MESSAGES
8+
from common.validator.constants.enums import DataType
109
from common.validator.constants.enums import ErrorLevels
1110
from common.validator.constants.enums import ExceptionLevels
1211
from common.validator.expression_checker import ExpressionChecker
@@ -18,13 +17,6 @@
1817
from common.validator.reporter.dq_reporter import DQReporter
1918

2019

21-
class DataType(Enum):
22-
FHIR = "FHIR"
23-
FHIRJSON = "FHIRJSON"
24-
CSV = "CSV"
25-
CSVROW = "CSVROW"
26-
27-
2820
class Validator:
2921
def __init__(self, schema_file="", data_type: DataType = None, filepath=""):
3022
self.filepath = filepath
@@ -171,7 +163,7 @@ def run_validation(
171163
try:
172164
self.error_records.clear()
173165

174-
match self.data_type: # 'FHIR', 'FHIRJSON', 'CSV', 'CSVROW'
166+
match self.data_type:
175167
case DataType.FHIR:
176168
self.data_parser = self._get_fhir_parser(self.filepath)
177169
self.is_csv = False
@@ -217,7 +209,6 @@ def run_validation(
217209

218210
return self.error_records
219211

220-
# Report Generation
221212
# Build the error Report
222213
def build_error_report(self, event_id):
223214
occurrence_date_time = self.data_parser.get_fhir_value("occurrenceDateTime")

0 commit comments

Comments
 (0)