changeset 3194:d3d1c96d090f

Task #15167: Add requirements file, update function calls, add more help text
author Chris Zimmerman <chris@teffalump.com>
date Sat, 02 Feb 2019 20:44:38 -0800
parents d96481be0c5a
children 5099415c8a08
files tryton/health_orthanc/health_orthanc.py tryton/health_orthanc/requirements.txt
diffstat 2 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/tryton/health_orthanc/health_orthanc.py
+++ b/tryton/health_orthanc/health_orthanc.py
@@ -71,23 +71,22 @@
         study = pool.get('gnuhealth.orthanc.study')
 
         if not servers:
-            servers = cls.search(['domain', '!=', None],)
+            servers = cls.search(['domain', '!=', None])
 
         for server in servers:
-            orthanc = RestClient(server.domain)
-            a = auth(server.user, server.password)
+            orthanc = RestClient(server.domain, auth=auth(server.user, server.password))
             curr = server.last
             new_studies = []
             new_patients = []
             logger.info('Getting new changes')
             while True:
-                changes = orthanc.get_changes(params={'since': curr}, auth=a)
+                changes = orthanc.get_changes(since=curr)
                 for change in changes['Changes']:
                     if change['ChangeType'] == 'NewStudy':
-                        new_studies.append(orthanc.get_study(change['ID'], auth=a))
+                        new_studies.append(orthanc.get_study(change['ID']))
                         logger.info('New Study {}'.format(change['ID']))
                     elif change['ChangeType'] == 'NewPatient':
-                        new_patients.append(orthanc.get_patient(change['ID'], auth=a))
+                        new_patients.append(orthanc.get_patient(change['ID']))
                         logger.info('New Patient {}'.format(change['ID']))
                     else:
                         pass
@@ -117,7 +116,7 @@
 
     __name__ = 'gnuhealth.orthanc.patient'
 
-    patient = fields.Many2One('gnuhealth.patient', 'Patient')
+    patient = fields.Many2One('gnuhealth.patient', 'Patient', help="Local linked patient")
     name = fields.Char('PatientName', readonly=True)
     bd = fields.Date('Birthdate', readonly=True)
     ident = fields.Char('PatientID', readonly=True)
@@ -162,7 +161,7 @@
     description = fields.Char('Description', readonly=True)
     date = fields.Date('Date', readonly=True)
     ident = fields.Char('ID', readonly=True)
-    institution = fields.Char('Institution', readonly=True)
+    institution = fields.Char('Institution', readonly=True, help="Imaging center where study was undertaken")
     ref_phys = fields.Char('Referring Physician', readonly=True)
     req_phys = fields.Char('Requesting Physician', readonly=True)
     server = fields.Many2One('gnuhealth.orthanc.config', 'Server', readonly=True)
new file mode 100644
--- /dev/null
+++ b/tryton/health_orthanc/requirements.txt
@@ -0,0 +1,2 @@
+orthanc-rest-client>=0.4.0
+pendulum>=2.0.3