Merge pull request #1054 from dod-ccpo/clin-summary-page

Refactor CLIN summary page
This commit is contained in:
graham-dds
2019-09-04 13:40:44 -04:00
committed by GitHub
7 changed files with 71 additions and 55 deletions

View File

@@ -35,6 +35,10 @@ class CLIN(Base, mixins.TimestampsMixin):
JEDICLINType.JEDI_CLIN_3,
]
@property
def type(self):
return "Base" if self.number[0] == "0" else "Option"
@property
def is_completed(self):
return all(

View File

@@ -47,6 +47,10 @@ class TaskOrder(Base, mixins.TimestampsMixin):
"CLIN", back_populates="task_order", cascade="all, delete-orphan"
)
@property
def sorted_clins(self):
return sorted(self.clins, key=lambda clin: (clin.number[1:], clin.number[0]))
@hybrid_property
def pdf(self):
return self._pdf