import DISNET.objects.DisnetObject as DisnetObject class SymptomObject(DisnetObject.DisnetObject): """Class to instance objects of type Symptom""" def __init__(self, cui: str, name: str, semanticTypes: list[str]): DisnetObject.DisnetObject.__init__(self, cui) self.__name = name self.__semanticTypes = semanticTypes def getName(self) -> str: """Returns the name of the Symptom""" return self.__name def getSemanticTypes(self) -> list[str]: """Returns the semantic types of the Symptom""" return self.__semanticTypes def info(self) -> str: """Returns the information of the Symptom as a string""" return "SymptomObject: [name: " + self.__name + ", cui: " + self.getId() + ", semanticTypes: " + \ str(self.__semanticTypes) + "]" def __eq__(self, other) -> bool: """Compares to other Symptom""" if isinstance(other, SymptomObject): equalName = self.__name == other.getName() equalCui = self.getId() == other.getId() equalSemanticTypes = self.__semanticTypes == other.getSemanticTypes() return equalCui and equalName and equalSemanticTypes else: return False