changeset 3514:9d301371e42f

HMIS node : Fix bug #57695: Traceback when creating a page of life associated to an empty evaluation
author Luis Falcon <falcon@gnuhealth.org>
date Wed, 29 Jan 2020 18:47:33 +0000
parents 9dddbdaf22e4
children 3f626fe3b3f7
files tryton/health/health.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health/health.py
+++ b/tryton/health/health.py
@@ -5342,12 +5342,15 @@
         Pol = Pool().get('gnuhealth.pol')
         pol = []
 
+        assessment = (evaluation.diagnosis and
+            evaluation.diagnosis.rec_name) or ''
+
         # Summarize the encounter note taking as SOAP
         soap = \
             "S: " + evaluation.chief_complaint + "\n--\n" + \
                     evaluation.present_illness +"\n" + \
             "O: " + evaluation.evaluation_summary + "\n" + \
-            "A: " + evaluation.diagnosis.rec_name + "\n" + \
+            "A: " + assessment + "\n" + \
             "P: " + evaluation.directions
 
         vals = {