Mercurial > hgweb > health
changeset 3274:1deffd26078b
Task #15167: Add orthanc studies to imaging test results
| author | Chris Zimmerman <chris@teffalump.com> |
|---|---|
| date | Sat, 30 Mar 2019 18:26:48 -0700 |
| parents | d9d96607433d |
| children | 05c03e643b59 |
| files | tryton/health_orthanc/__init__.py tryton/health_orthanc/health_orthanc.py tryton/health_orthanc/health_orthanc_view.xml tryton/health_orthanc/view/imaging_form.xml tryton/health_orthanc/view/study_form.xml |
| diffstat | 5 files changed, 39 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/tryton/health_orthanc/__init__.py +++ b/tryton/health_orthanc/__init__.py @@ -31,7 +31,8 @@ OrthancServerConfig, OrthancStudy, OrthancPatient, - Orthanc, + TestResult, + Patient, module="health_orthanc", type_="model", )
--- a/tryton/health_orthanc/health_orthanc.py +++ b/tryton/health_orthanc/health_orthanc.py @@ -29,7 +29,13 @@ import logging import pendulum -__all__ = ["OrthancServerConfig", "OrthancPatient", "OrthancStudy", "Orthanc"] +__all__ = [ + "OrthancServerConfig", + "OrthancPatient", + "OrthancStudy", + "Patient", + "TestResult", +] logger = logging.getLogger(__name__) @@ -326,6 +332,7 @@ link = fields.Function( fields.Char("URL", help="Link to study in Orthanc Explorer"), "get_link" ) + imaging_test = fields.Many2One("gnuhealth.imaging.test.result", "Test") def get_link(self, name): pre = "".join([self.server.domain.rstrip("/"), "/"]) @@ -429,7 +436,17 @@ cls.create(entries) -class Orthanc(ModelSQL, ModelView): +class TestResult(ModelSQL, ModelView): + """Add Orthanc imaging studies to imaging test result""" + + __name__ = "gnuhealth.imaging.test.result" + + studies = fields.One2Many( + "gnuhealth.orthanc.study", "imaging_test", "Studies", readonly=True + ) + + +class Patient(ModelSQL, ModelView): """Add Orthanc patient(s) to the main patient data""" __name__ = "gnuhealth.patient"
--- a/tryton/health_orthanc/health_orthanc_view.xml +++ b/tryton/health_orthanc/health_orthanc_view.xml @@ -20,6 +20,13 @@ <field name="name">study_form</field> </record> + <!-- Add Studies to Imaging Result Form --> + <record model="ir.ui.view" id="imaging_study_view_orthanc"> + <field name="model">gnuhealth.imaging.test.result</field> + <field name="inherit" ref="health_imaging.view_imaging_test_result_form"/> + <field name="name">imaging_form</field> + </record> + <!-- Orthanc Patient --> <record model="ir.ui.view" id="orthanc_view_patient_tree"> <field name="model">gnuhealth.orthanc.patient</field>
new file mode 100644 --- /dev/null +++ b/tryton/health_orthanc/view/imaging_form.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<data> + <xpath expr="/form/notebook/page[@id="images_page"]" position="before"> + <page string="Studies" id="studies_page"> + <field name="studies" colspan="4"/> + </page> + </xpath> +</data> +
