Skip to content

Commit

Permalink
[MIG] medical_clinical_procedure: Migration to 16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luisDIXMIT committed Apr 23, 2024
1 parent 2241229 commit 892a2da
Show file tree
Hide file tree
Showing 12 changed files with 117 additions and 257 deletions.
78 changes: 0 additions & 78 deletions medical_clinical_procedure/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,10 @@
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3

=================
Medical Procedure
=================

A **Procedure Request** is a record of a request for a procedure to be
planned, proposed, or performed with or on a patient.

The **Procedure** represents an action that is or was performed on a patient.
This can be a physical intervention like an operation, or less invasive like
counseling or hypnotherapy.

This resource is used to record the details of procedures performed on a
patient. A procedure is an activity that is performed with or on a patient as
part of the provision of care. Examples include surgical procedures,
diagnostic procedures, endoscopic procedures, biopsies, counseling,
physiotherapy, exercise, etc.

This resource provides summary information about the occurrence of the
procedure and is not intended to provide real-time snapshots of a procedure
as it unfolds, though for long-running procedures such as psychotherapy, it
could represent summary level information about overall progress. The
creation of a resource to support detailed real-time procedure information
awaits the identification of a specific implementation use-case to share such
information.

For more information about the FHIR Procedure Request visit: https://www.hl7.org/fhir/procedurerequest.html
For further information about the FHIR Procedure visit: https://www.hl7.org/fhir/procedure.html

Installation
============

To install this module, go to 'Medical / Configuration / Settings' and inside
'Clinical' activate 'Procedures & Procedure requests'.

Usage
=====

#. Go to 'Medical / Clinical / Requests / Procedure Requests'
#. Click 'Create'.
#. Fill in the information.
#. Click 'Save' and press the button 'Activate'.
#. Go to 'Action / Create Procedure' to generate the according Procedure.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/159/11.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.

Credits
=======

Images
------

* Clker-Free-Vector-Images: `Medical Icon <https://pixabay.com/es/de-salud-medicina-serpiente-alas-304919/>`_
* Odoo Community Association: `Odoo Icon <https://odoo-community.org/logo.png>`_.

Contributors
------------

* Enric Tobella <[email protected]>
* Roser Garcia <[email protected]>
* Jordi Ballester <[email protected]>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
1 change: 0 additions & 1 deletion medical_clinical_procedure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import models
from . import wizard
3 changes: 1 addition & 2 deletions medical_clinical_procedure/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "Medical Clinical Procedure",
"summary": "Medical Procedures and Procedure requests",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"author": "CreuBlanca, ForgeFlow, Odoo Community Association (OCA), Tegin",
"category": "Medical",
"website": "https://github.com/tegin/medical-fhir",
Expand All @@ -18,7 +18,6 @@
"security/medical_security.xml",
"security/ir.model.access.csv",
"data/ir_sequence.xml",
"wizard/medical_procedure_request_make_procedure_view.xml",
"views/medical_request_views.xml",
"views/medical_procedure_view.xml",
"views/medical_procedure_request_view.xml",
Expand Down
122 changes: 57 additions & 65 deletions medical_clinical_procedure/demo/medical_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,69 +4,61 @@
Copyright 2017 CreuBlanca
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl).
-->
<odoo>
<data noupdate="1">
<record id="machine_time_product" model="product.product">
<field name="name">Time on machine service</field>
<field name="type">service</field>
</record>
<record id="medical_report_product" model="product.product">
<field name="name">Medical report</field>
<field name="type">service</field>
</record>
<record id="quality_check_product" model="product.product">
<field name="name">Quality check</field>
<field name="type">service</field>
</record>
<record id="machine_time_activity" model="workflow.activity.definition">
<field name="name">MACT</field>
<field name="description">Machine time</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="machine_time_product" />
<field name="quantity">1</field>
</record>
<record id="medical_report_activity" model="workflow.activity.definition">
<field name="name">REP</field>
<field name="description">Medical report</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="medical_report_product" />
<field name="quantity">1</field>
</record>
<record id="quality_check_activity" model="workflow.activity.definition">
<field name="name">QC</field>
<field name="description">Quality check</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="quality_check_product" />
<field name="quantity">1</field>
</record>
<record id="mr_report_action" model="workflow.plan.definition.action">
<field name="name">REP</field>
<field name="activity_definition_id" ref="machine_time_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.mr_knee" />
</record>
<record id="mr_machine_time_action" model="workflow.plan.definition.action">
<field name="name">MACT</field>
<field name="activity_definition_id" ref="medical_report_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.mr_knee" />
</record>
<record id="ct_report_action" model="workflow.plan.definition.action">
<field name="name">REP</field>
<field name="activity_definition_id" ref="medical_report_activity" />
<field
name="direct_plan_definition_id"
ref="medical_workflow.ct_abdominal"
/>
</record>
<record id="ct_machine_time_action" model="workflow.plan.definition.action">
<field name="name">MACT</field>
<field name="activity_definition_id" ref="machine_time_activity" />
<field
name="direct_plan_definition_id"
ref="medical_workflow.ct_abdominal"
/>
</record>
</data>
<odoo noupdate="1">
<record id="machine_time_product" model="product.product">
<field name="name">Time on machine service</field>
<field name="type">service</field>
</record>
<record id="medical_report_product" model="product.product">
<field name="name">Medical report</field>
<field name="type">service</field>
</record>
<record id="quality_check_product" model="product.product">
<field name="name">Quality check</field>
<field name="type">service</field>
</record>
<record id="machine_time_activity" model="workflow.activity.definition">
<field name="name">MACT</field>
<field name="description">Machine time</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="machine_time_product" />
<field name="quantity">1</field>
</record>
<record id="medical_report_activity" model="workflow.activity.definition">
<field name="name">REP</field>
<field name="description">Medical report</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="medical_report_product" />
<field name="quantity">1</field>
</record>
<record id="quality_check_activity" model="workflow.activity.definition">
<field name="name">QC</field>
<field name="description">Quality check</field>
<field name="model_id" ref="model_medical_procedure_request" />
<field name="state">active</field>
<field name="service_id" ref="quality_check_product" />
<field name="quantity">1</field>
</record>
<record id="mr_report_action" model="workflow.plan.definition.action">
<field name="name">REP</field>
<field name="activity_definition_id" ref="machine_time_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.mr_knee" />
</record>
<record id="mr_machine_time_action" model="workflow.plan.definition.action">
<field name="name">MACT</field>
<field name="activity_definition_id" ref="medical_report_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.mr_knee" />
</record>
<record id="ct_report_action" model="workflow.plan.definition.action">
<field name="name">REP</field>
<field name="activity_definition_id" ref="medical_report_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.ct_abdominal" />
</record>
<record id="ct_machine_time_action" model="workflow.plan.definition.action">
<field name="name">MACT</field>
<field name="activity_definition_id" ref="machine_time_activity" />
<field name="direct_plan_definition_id" ref="medical_workflow.ct_abdominal" />
</record>
</odoo>
23 changes: 23 additions & 0 deletions medical_clinical_procedure/readme/CONTEXT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
A **Procedure Request** is a record of a request for a procedure to be
planned, proposed, or performed with or on a patient.

The **Procedure** represents an action that is or was performed on a patient.
This can be a physical intervention like an operation, or less invasive like
counseling or hypnotherapy.

This resource is used to record the details of procedures performed on a
patient. A procedure is an activity that is performed with or on a patient as
part of the provision of care. Examples include surgical procedures,
diagnostic procedures, endoscopic procedures, biopsies, counseling,
physiotherapy, exercise, etc.

This resource provides summary information about the occurrence of the
procedure and is not intended to provide real-time snapshots of a procedure
as it unfolds, though for long-running procedures such as psychotherapy, it
could represent summary level information about overall progress. The
creation of a resource to support detailed real-time procedure information
awaits the identification of a specific implementation use-case to share such
information.

For more information about the FHIR Procedure Request visit: https://www.hl7.org/fhir/procedurerequest.html
For further information about the FHIR Procedure visit: https://www.hl7.org/fhir/procedure.html
27 changes: 27 additions & 0 deletions medical_clinical_procedure/readme/CREDITS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Images
------

* Clker-Free-Vector-Images: `Medical Icon <https://pixabay.com/es/de-salud-medicina-serpiente-alas-304919/>`_
* Odoo Community Association: `Odoo Icon <https://odoo-community.org/logo.png>`_.

Contributors
------------

* Enric Tobella <[email protected]>
* Roser Garcia <[email protected]>
* Jordi Ballester <[email protected]>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
9 changes: 9 additions & 0 deletions medical_clinical_procedure/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#. Go to 'Medical / Clinical / Requests / Procedure Requests'
#. Click 'Create'.
#. Fill in the information.
#. Click 'Save' and press the button 'Activate'.
#. To generate the according Procedure mark as complete the Procedure Request.

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/159/11.0
1 change: 0 additions & 1 deletion medical_clinical_procedure/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ medical_procedure_request_display,medical_procedure_request_display,model_medica
medical_procedure_request_manager,medical_procedure_request_manager,model_medical_procedure_request,medical_base.group_medical_user,0,1,1,0
medical_procedure_display,medical_procedure_display,model_medical_procedure,medical_base.group_medical_user,1,0,0,0
medical_procedure_manager,medical_procedure_manager,model_medical_procedure,medical_base.group_medical_user,0,1,1,0
access_procedure_request_make_procedure,access_procedure_request_make_procedure,model_procedure_request_make_procedure,medical_base.group_medical_user,1,1,1,0
33 changes: 0 additions & 33 deletions medical_clinical_procedure/tests/test_procedure_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Copyright 2017 ForgeFlow
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from odoo.exceptions import UserError, Warning as Warn
from odoo.tests import TransactionCase


Expand All @@ -13,38 +12,6 @@ def setUp(self):
self.plan = self.browse_ref("medical_workflow.mr_knee")
return res

def test_procedure(self):
procedure_requests = self.env["medical.procedure.request"].search(
[("patient_id", "=", self.patient.id)]
)
self.assertEqual(len(procedure_requests), 0)
self.env["medical.add.plan.definition"].create(
{"patient_id": self.patient.id, "plan_definition_id": self.plan.id}
).run()
procedure_requests = self.env["medical.procedure.request"].search(
[("patient_id", "=", self.patient.id)]
)
self.assertGreater(len(procedure_requests), 0)
self.env["procedure.request.make.procedure"].with_context(
active_ids=procedure_requests.ids
).create({}).make_procedure()
procedures = self.env["medical.procedure"].search(
[("procedure_request_id", "in", procedure_requests.ids)]
)
self.assertEqual(len(procedure_requests), len(procedures))
with self.assertRaises(UserError):
self.env["procedure.request.make.procedure"].with_context(
active_ids=procedure_requests.ids
).create({}).make_procedure()
for request in procedure_requests:
self.assertEqual(request.procedure_count, 1)
with self.assertRaises(Warn):
request.unlink()
action = request.action_view_procedure()
self.assertEqual(
action["context"]["default_procedure_request_id"], request.id
)

def test_procedure_request_workflow(self):
request = self.env["medical.procedure.request"].create(
{"patient_id": self.patient.id}
Expand Down
5 changes: 0 additions & 5 deletions medical_clinical_procedure/wizard/__init__.py

This file was deleted.

This file was deleted.

Loading

0 comments on commit 892a2da

Please sign in to comment.