@@ -19,7 +19,7 @@ class DiagnosisDateReasonType(Enum):
1919 PATIENT_CHOICE = (305522 , "Patient choice" )
2020 PATIENT_COULD_NOT_BE_CONTACTED = (305505 , "Patient could not be contacted" )
2121 PATIENT_DECEASED = (305503 , "Patient deceased" )
22- PATIENT_DECLINIED_ALL_APPOINTMENTS = (305520 , "Patient declined all appointments" )
22+ PATIENT_DECLINED_ALL_APPOINTMENTS = (305520 , "Patient declined all appointments" )
2323 PATIENT_EMIGRATED = (305504 , "Patient emigrated" )
2424 REOPENED_OLD_EPISODE_DATE_UNKNOWN = (305502 , "Reopened old episode, date unknown" )
2525 SSPI_UPDATE_PATIENT_DECEASED = (305525 , "SSPI update - patient deceased" )
@@ -47,6 +47,12 @@ def description(self) -> str:
4747
4848 @classmethod
4949 def _build_maps (cls ) -> None :
50+ """
51+ Initializes internal lookup maps for DiagnosisDateReasonType enum members.
52+
53+ It ensures these maps are built only once per class, using `hasattr` to prevent
54+ redundant reinitialization.
55+ """
5056 if not hasattr (cls , "_descriptions" ):
5157 cls ._descriptions : Dict [str , DiagnosisDateReasonType ] = {}
5258 cls ._lowercase_descriptions : Dict [str , DiagnosisDateReasonType ] = {}
0 commit comments