[view] Add table view for drug take, see #3341081
authorVincent Michel <vincent.michel@logilab.fr>
Mon, 09 Dec 2013 08:03:20 +0000
changeset 548 cfceb5c8c70e
parent 539 a64da0e12a4c
child 549 3cd1bc677939
[view] Add table view for drug take, see #3341081
views/tableviews.py
--- a/views/tableviews.py	Mon Dec 02 15:47:06 2013 +0100
+++ b/views/tableviews.py	Mon Dec 09 08:03:20 2013 +0000
@@ -104,3 +104,17 @@
 
     columns = ['definition', 'text', 'value']
     column_renderers = {'definition': RelationColRenderer(role='subject')}
+
+
+###############################################################################
+### DRUG TAKES ################################################################
+###############################################################################
+class DrugTakeTableView(EntityTableView):
+    __select__ = EntityTableView.__select__ & is_instance('DrugTake')
+    __regid__ = 'drugtake-table-view'
+
+    columns = ['drug', 'taken_in_therapy', 'start_taking_date', 'stop_taking_date',
+               'take_order', 'dosis', 'unit', 'number_of_cycles', 'dosis_percentage',
+               'reduced_dosis']
+    column_renderers = {'taken_in_therapy': RelationColRenderer(role='subject', vid='incontext'),
+                        'drug': RelationColRenderer(role='subject')}