Allow for grabbing of single kit if only one exists for submission type.

This commit is contained in:
lwark
2024-11-13 13:36:03 -06:00
parent 816a0a45f8
commit 514781fd29
9 changed files with 59 additions and 28 deletions

View File

@@ -683,6 +683,11 @@ class SubmissionType(BaseClass):
"""
return f"<SubmissionType({self.name})>"
@classmethod
def retrieve_template_file(cls):
submission_type = cls.query(name="Bacterial Culture")
return submission_type.template_file
def get_template_file_sheets(self) -> List[str]:
logger.debug(f"Submission type to get sheets for: {self.name}")
"""
@@ -779,6 +784,12 @@ class SubmissionType(BaseClass):
tmap = {}
yield item.tip_role.name, tmap
def get_default_kit(self) -> KitType | None:
if len(self.kit_types) == 1:
return self.kit_types[0]
else:
return None
def get_equipment(self, extraction_kit: str | KitType | None = None) -> Generator['PydEquipmentRole', None, None]:
"""
Returns PydEquipmentRole of all equipment associated with this SubmissionType