File tree Expand file tree Collapse file tree 2 files changed +48
-0
lines changed
Expand file tree Collapse file tree 2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 1+ from enum import Enum
2+ from typing import Optional , Dict
3+
4+
5+ class EpisodeType (Enum ):
6+ FOBT = (11350 , "FOBT" )
7+ Fobt = (11350 , "FOBT Screening" )
8+ BowelScope = (200640 , "Bowel Scope" )
9+ Surveillance = (11351 , "Surveillance" )
10+ LYNCH_SURVEILLANCE = (305633 , "Lynch Surveillance" )
11+ Lynch = (305633 , "Lynch" )
12+
13+ def __init__ (self , valid_value_id , description ):
14+ self ._valid_value_id = valid_value_id
15+ self ._description = description
16+
17+ @property
18+ def valid_value_id (self ) -> int :
19+ return self ._valid_value_id
20+
21+ @property
22+ def description (self ) -> str :
23+ return self ._description
24+
25+ @classmethod
26+ def by_description (cls , description : str ) -> Optional ["EpisodeType" ]:
27+ for member in cls :
28+ if member .description == description :
29+ return member
30+ return None
31+
32+ @classmethod
33+ def by_description_case_insensitive (
34+ cls , description : str
35+ ) -> Optional ["EpisodeType" ]:
36+ for member in cls :
37+ if member .description .lower () == description .lower ():
38+ return member
39+ return None
40+
41+ @classmethod
42+ def by_valid_value_id (cls , valid_value_id : int ) -> Optional ["EpisodeType" ]:
43+ for member in cls :
44+ if member .valid_value_id == valid_value_id :
45+ return member
46+ return None
Original file line number Diff line number Diff line change 99from classes .clinical_cease_reason_type import ClinicalCeaseReasonType
1010from classes .date_description import DateDescription
1111from classes .event_status_type import EventStatusType
12+ from classes .episode_type import EpisodeType
1213from classes .has_gp_practice import HasGPPractice
1314from classes .has_unprocessed_sspi_updates import HasUnprocessedSSPIUpdates
1415from classes .has_user_dob_update import HasUserDobUpdate
@@ -267,6 +268,7 @@ def _add_variable_selection_criteria(
267268 self ._add_criteria_has_unprocessed_sspi_updates ()
268269 case SubjectSelectionCriteriaKey .SUBJECT_HAS_USER_DOB_UPDATES :
269270 self ._add_criteria_has_user_dob_update ()
271+ # TODO: Add more case statemented here, copying the Java code
270272
271273 except Exception :
272274 raise SelectionBuilderException (
You can’t perform that action at this time.
0 commit comments