From 49cd95fb6e0355d13cd73a26912397897a16c764 Mon Sep 17 00:00:00 2001 From: Susanna Kiwala Date: Fri, 19 Jun 2020 09:34:35 -0500 Subject: [PATCH] Fix formatting for assertions without nccn_guideline --- civicpy/civic.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/civicpy/civic.py b/civicpy/civic.py index bce1756..ba6ba04 100644 --- a/civicpy/civic.py +++ b/civicpy/civic.py @@ -687,7 +687,7 @@ def csq(self, include_status=None): "", "&".join([acmg_code.code for acmg_code in assertion.acmg_codes]), str(assertion.amp_level or ''), - "{} (v{})".format(assertion.nccn_guideline, assertion.nccn_guideline_version), + assertion.format_nccn_guideline(), str(assertion.fda_regulatory_approval or ''), str(assertion.fda_companion_test or ''), ])) @@ -824,6 +824,12 @@ def evidence(self): def hpo_ids(self): return [x.hpo_id for x in self.phenotypes if x.hpo_id] + def format_nccn_guideline(self): + if self.nccn_guideline is None: + return "" + else: + return "{} (v{})".format(self.nccn_guideline, self.nccn_guideline_version) + class User(CivicRecord):