diff --git a/medical_lab_management/README.rst b/medical_lab_management/README.rst new file mode 100644 index 000000000..23492279c --- /dev/null +++ b/medical_lab_management/README.rst @@ -0,0 +1,37 @@ +========================== +Medical Lab Management v10 +========================== + +Helps You To Manage Medical Lab Operations. + +Installation +============ + +Just install the module from apps list. + +Configuration +============= +#1.Create test units for lab test. +#2.Create test contents for lab test. +#3.Create lab test, add the contents and their units and normal range for the contents. +#4.Create patients. +#5.When a particular patient comes first create the patient and from the + super button in the patient name called 'Lab Appointments' create the appointment for the patient. +#6.When we confirm the appointment an email will be sent to the patient with the appointment Details. +#7.When we click on 'Request LAb' button lab test request will be created. +#8.Select the particular lab request and add the result when we complete the test. +#9.The request tree view will show green color if the test state is in Sample collection or Test in progress. +#10.The request tree view will show grey color if the test is cancelled ,it show blue color if the request is in draft stage and + it show black color if the test is completed. +#11.When the test request are completed the Appointment state will be in 'Test Result' state . +#12.Create invoice for the lab test. +#13.There is two type of users 'Lab technician' and 'lab User'. Lab technician have the right to create,delete,read lab test unit,test content,lab test + while the lab user have only read permission on these records. The other rights are same to both the user. + +Credits +======= +Anusha P P @ cybrosys, anusha@cybrosys.in + +Author +======= +Cybrosys Techno Solutions www.cybrosys.com diff --git a/medical_lab_management/__init__.py b/medical_lab_management/__init__.py new file mode 100644 index 000000000..32edcd174 --- /dev/null +++ b/medical_lab_management/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Anusha P P() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +from . import models diff --git a/medical_lab_management/__manifest__.py b/medical_lab_management/__manifest__.py new file mode 100644 index 000000000..a36266c29 --- /dev/null +++ b/medical_lab_management/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Anusha P P() +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### +{ + 'name': "Medical Lab Management", + 'version': '10.0.1.0.0', + 'summary': """Manage Medical Lab Operations.""", + 'description': """Manage Medical Lab General Operations.""", + 'author': "Cybrosys Techno Solutions", + 'maintainer': 'Cybrosys Techno Solutions', + 'company': "Cybrosys Techno Solutions", + 'website': "https://www.cybrosys.com", + 'category': 'Industries', + 'depends': ['base', 'mail', 'account'], + 'data': [ + 'security/lab_users.xml', + 'security/ir.model.access.csv', + 'views/res_partner.xml', + 'views/lab_patient_view.xml', + 'views/test_unit_view.xml', + 'views/lab_test_type.xml', + 'views/lab_test_content_type.xml', + 'views/physician_specialty.xml', + 'views/physician_details.xml', + 'views/lab_request.xml', + 'views/lab_appointment.xml', + 'views/account_invoice.xml', + 'report/report.xml', + 'report/lab_test_report.xml', + 'report/lab_patient_card.xml', + ], + 'images': ['static/description/banner.jpg'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/medical_lab_management/models/__init__.py b/medical_lab_management/models/__init__.py new file mode 100644 index 000000000..e67de0e89 --- /dev/null +++ b/medical_lab_management/models/__init__.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +from . import physician_speciality +from . import res_partner +from . import lab_patient +from . import testing_unit +from . import lab_test_type +from . import lab_test_content_type +from . import lab_appointment +from . import lab_request +from . import account_invoice + + diff --git a/medical_lab_management/models/account_invoice.py b/medical_lab_management/models/account_invoice.py new file mode 100644 index 000000000..6a8732915 --- /dev/null +++ b/medical_lab_management/models/account_invoice.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +from odoo import models, fields, api + + +class LabRequestInvoices(models.Model): + _inherit = 'account.invoice' + + is_lab_invoice = fields.Boolean(string="Is Lab Invoice") + lab_request = fields.Many2one('lab.appointment', string="Lab Appointment", help="Source Document") + + @api.multi + def action_invoice_paid(self): + res = super(LabRequestInvoices, self).action_invoice_paid() + lab_app_obj = self.env['lab.appointment'].search([('id', '=', self.lab_request.id)]) + for obj in lab_app_obj: + obj.write({'state': 'invoiced'}) + return res diff --git a/medical_lab_management/models/lab_appointment.py b/medical_lab_management/models/lab_appointment.py new file mode 100644 index 000000000..e295326b6 --- /dev/null +++ b/medical_lab_management/models/lab_appointment.py @@ -0,0 +1,180 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +import datetime +from odoo.exceptions import UserError +from odoo import fields, models, api, _ + + +class Appointment(models.Model): + _name = 'lab.appointment' + _inherit = ['mail.thread', 'ir.needaction_mixin'] + _rec_name = 'name' + _description = "Appointment" + _order = 'appointment_date' + + user_id = fields.Many2one('res.users', 'Responsible', readonly=True) + patient_id = fields.Many2one('lab.patient', string='Patient', required=True, select=True, + help='Patient Name') + name = fields.Char(string='Appointment ID', readonly=True, default=lambda self: _('New')) + date = fields.Datetime(string='Requested Date', default=lambda s: fields.Datetime.now(), + help="This is the date in which patient appointment is noted") + appointment_date = fields.Datetime(string='Appointment Date', default=lambda s: fields.Datetime.now(), + help="This is the appointment date") + physician_id = fields.Many2one('res.partner', string='Referred By', select=True) + comment = fields.Text(string='Comments') + appointment_lines = fields.One2many('lab.appointment.lines', 'test_line_appointment', string="Test Request") + + request_count = fields.Integer(compute="_compute_state", string='# of Requests', copy=False, default=0) + inv_count = fields.Integer(compute="_compute_state", string='# of Invoices', copy=False, default=0) + state = fields.Selection([ + ('draft', 'Draft'), + ('confirm', 'Confirmed'), + ('request_lab', 'Lab Requested'), + ('completed', 'Test Result'), + ('to_invoice', 'To Invoice'), + ('invoiced', 'Done'), + ('cancel', 'Cancelled'), + ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft', + ) + + priority = fields.Selection([ + ('0', 'Low'), + ('1', 'Normal'), + ('2', 'High') + ], size=1) + + _defaults = { + 'priority': '0', + } + + @api.model + def create(self, vals): + if vals: + vals['name'] = self.env['ir.sequence'].next_by_code('lab.appointment') or _('New') + result = super(Appointment, self).create(vals) + return result + + @api.multi + def _compute_state(self): + for obj in self: + obj.request_count = self.env['lab.request'].search_count([('app_id', '=', obj.id)]) + obj.inv_count = self.env['account.invoice'].search_count([('lab_request', '=', obj.id)]) + + @api.multi + def create_invoice(self): + invoice_obj = self.env["account.invoice"] + invoice_line_obj = self.env["account.invoice.line"] + for lab in self: + lab.write({'state': 'to_invoice'}) + if lab.patient_id: + curr_invoice = { + 'partner_id': lab.patient_id.patient.id, + 'account_id': lab.patient_id.patient.property_account_receivable_id.id, + 'state': 'draft', + 'type': 'out_invoice', + 'date_invoice': datetime.datetime.now(), + 'origin': "Lab Test# : " + lab.name, + 'target': 'new', + 'lab_request': lab.id, + 'is_lab_invoice': True + } + + inv_ids = invoice_obj.create(curr_invoice) + inv_id = inv_ids.id + + if inv_ids: + journal = self.env['account.journal'].search([('type', '=', 'sale')], limit=1) + prd_account_id = journal.default_credit_account_id.id + if lab.appointment_lines: + for line in lab.appointment_lines: + curr_invoice_line = { + 'name': line.lab_test.lab_test, + 'price_unit': line.cost or 0, + 'quantity': 1.0, + 'account_id': prd_account_id, + 'invoice_id': inv_id, + } + invoice_line_obj.create(curr_invoice_line) + + # self.write({'state': 'invoiced'}) + form_view_ref = self.env.ref('account.invoice_form', False) + tree_view_ref = self.env.ref('account.invoice_tree', False) + + return { + 'domain': "[('id', '=', " + str(inv_id) + ")]", + 'name': 'Lab Invoices', + 'view_mode': 'form', + 'res_model': 'account.invoice', + 'type': 'ir.actions.act_window', + 'views': [(tree_view_ref.id, 'tree'), (form_view_ref.id, 'form')], + } + + @api.multi + def action_request(self): + if self.appointment_lines: + for line in self.appointment_lines: + data = self.env['lab.test'].search([('lab_test', '=', line.lab_test.lab_test)]) + self.env['lab.request'].create({'lab_request_id': self.name, + 'app_id': self.id, + 'lab_requestor': self.patient_id.id, + 'lab_requesting_date': self.appointment_date, + 'test_request': line.lab_test.id, + 'request_line': [(6, 0, [x.id for x in data.test_lines])], + }) + self.state = 'request_lab' + else: + raise UserError(_('Please Select Lab Test.')) + + @api.multi + def confirm_appointment(self): + + message_body = "Dear " + self.patient_id.patient.name + "," + "
Your Appointment Has been Confirmed " \ + + "
Appointment ID : " + self.name + "
Date : " + self.appointment_date + \ + '

Thank you' + + template_obj = self.env['mail.mail'] + template_data = { + 'subject': 'Appointment Confirmation', + 'body_html': message_body, + 'email_from': self.env.user.company_id.email, + 'email_to': self.patient_id.email + } + template_id = template_obj.create(template_data) + template_obj.send(template_id) + self.write({'state': 'confirm'}) + + @api.multi + def cancel_appointment(self): + return self.write({'state': 'cancel'}) + + +class LabAppointmentLines(models.Model): + _name = 'lab.appointment.lines' + + lab_test = fields.Many2one('lab.test', string="Test") + cost = fields.Char(string="Cost") + requesting_date = fields.Date(string="Date") + test_line_appointment = fields.Many2one('lab.appointment', string="Appointment") + + @api.onchange('lab_test') + def cost_update(self): + if self.lab_test: + self.cost = self.lab_test.test_cost + + +class LabPatientInherit(models.Model): + _inherit = 'lab.patient' + + app_count = fields.Integer(compute="_compute_state", string='# of Appointments', copy=False, default=0) + + @api.multi + def _compute_state(self): + for obj in self: + obj.app_count = self.env['lab.appointment'].search_count([('patient_id', '=', obj.id)]) + diff --git a/medical_lab_management/models/lab_patient.py b/medical_lab_management/models/lab_patient.py new file mode 100644 index 000000000..715710564 --- /dev/null +++ b/medical_lab_management/models/lab_patient.py @@ -0,0 +1,66 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## + +from dateutil.relativedelta import relativedelta +from odoo import models, fields, api, _ + + +class LabPatient(models.Model): + _name = 'lab.patient' + _rec_name = 'patient' + _description = 'Patient' + + patient = fields.Many2one('res.partner', string='Partner', required=True) + patient_image = fields.Binary(string='Photo') + patient_id = fields.Char(string='Patient ID', readonly=True) + name = fields.Char(string='Patient ID', default=lambda self: _('New')) + title = fields.Selection([ + ('ms', 'Miss'), + ('mister', 'Mister'), + ('mrs', 'Mrs'), + ], string='Title', default='mister', required=True) + emergency_contact = fields.Many2one( + 'res.partner', string='Emergency Contact') + gender = fields.Selection( + [('m', 'Male'), ('f', 'Female'), + ('ot', 'Other')], 'Gender', required=True) + dob = fields.Date(string='Date Of Birth', required=True) + age = fields.Char(string='Age', compute='compute_age') + blood_group = fields.Selection( + [('A+', 'A+ve'), ('B+', 'B+ve'), ('O+', 'O+ve'), ('AB+', 'AB+ve'), + ('A-', 'A-ve'), ('B-', 'B-ve'), ('O-', 'O-ve'), ('AB-', 'AB-ve')], + 'Blood Group') + visa_info = fields.Char(string='Visa Info', size=64) + id_proof_number = fields.Char(string='ID Proof Number') + note = fields.Text(string='Note') + date = fields.Datetime(string='Date Requested', default=lambda s: fields.Datetime.now(), invisible=True) + phone = fields.Char(string="Phone", required=True) + email = fields.Char(string="Email", required=True) + + @api.multi + def compute_age(self): + for data in self: + if data.dob: + dob = fields.Datetime.from_string(data.dob) + date = fields.Datetime.from_string(data.date) + delta = relativedelta(date, dob) + data.age = str(delta.years) + ' years' + + @api.model + def create(self, vals): + sequence = self.env['ir.sequence'].next_by_code('lab.patient') + vals['name'] = sequence or _('New') + result = super(LabPatient, self).create(vals) + return result + + @api.onchange('patient') + def detail_get(self): + self.phone = self.patient.phone + self.email = self.patient.email + diff --git a/medical_lab_management/models/lab_request.py b/medical_lab_management/models/lab_request.py new file mode 100644 index 000000000..8651d6451 --- /dev/null +++ b/medical_lab_management/models/lab_request.py @@ -0,0 +1,117 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +import datetime +from odoo import models, fields, api + + +class LabRequest(models.Model): + _name = 'lab.request' + _inherit = ['mail.thread', 'ir.needaction_mixin'] + _rec_name = 'lab_request_id' + _description = 'Lab Request' + + name = fields.Char(string='Lab Test', size=16, readonly=True, required=True, help="Lab result ID", default=lambda *a: '#') + lab_request_id = fields.Char(string='Appointment ID', help="Lab appointment ID") + app_id = fields.Many2one('lab.appointment', string='Appointment') + lab_requestor = fields.Many2one('lab.patient', string='Patient', required=True, select=True, + help='Patient Name') + test_request = fields.Many2one('lab.test', string='Test') + lab_requesting_date = fields.Datetime(string='Requested Date') + comment = fields.Text('Comment') + request_line = fields.One2many('lab.test.attribute', 'test_request_reverse', string="Test Lines") + state = fields.Selection([ + ('draft', 'Draft'), + ('sample_collection', 'Sample Collected'), + ('test_in_progress', 'Test In Progress'), + ('completed', 'Completed'), + ('cancel', 'Cancelled'), + + ], string='Status', readonly=True, copy=False, index=True, track_visibility='onchange', default='draft') + + @api.model + def create(self, vals): + sequence = self.env['ir.sequence'].next_by_code('lab.request') + vals['name'] = sequence or '/' + return super(LabRequest, self).create(vals) + + @api.multi + def set_to_sample_collection(self): + return self.write({'state': 'sample_collection'}) + + @api.multi + def set_to_test_in_progress(self): + return self.write({'state': 'test_in_progress'}) + + @api.multi + def cancel_lab_test(self): + return self.write({'state': 'cancel'}) + + @api.multi + def set_to_test_completed(self): + req_obj = self.env['lab.request'].search_count([('app_id', '=', self.app_id.id), + ('id', '!=', self.id)]) + req_obj_count = self.env['lab.request'].search_count([('app_id', '=', self.app_id.id), + ('id', '!=', self.id), + ('state', '=', 'completed')]) + if req_obj == req_obj_count: + app_obj = self.env['lab.appointment'].search([('id', '=', self.app_id.id)]) + app_obj.write({'state': 'completed'}) + return self.write({'state': 'completed'}) + + @api.multi + def print_lab_test(self): + return self.env['report'].get_action(self, 'medical_lab_management.report_patient_labtest') + + @api.multi + def lab_invoice_create(self): + invoice_obj = self.env["account.invoice"] + invoice_line_obj = self.env["account.invoice.line"] + for lab in self: + if lab.lab_requestor: + curr_invoice = { + 'partner_id': lab.lab_requestor.patient.id, + 'account_id': lab.lab_requestor.patient.property_account_receivable_id.id, + 'state': 'draft', + 'type': 'out_invoice', + 'date_invoice': datetime.datetime.now(), + 'origin': "Lab Test# : " + lab.name, + 'target': 'new', + 'lab_request': lab.id, + 'is_lab_invoice': True + } + + inv_ids = invoice_obj.create(curr_invoice) + inv_id = inv_ids.id + + if inv_ids: + journal = self.env['account.journal'].search([('type', '=', 'sale')], limit=1) + prd_account_id = journal.default_credit_account_id.id + if lab.test_request: + curr_invoice_line = { + 'name': "Charge for lab test", + 'price_unit': lab.test_request.test_cost or 0, + 'quantity': 1.0, + 'account_id': prd_account_id, + 'invoice_id': inv_id, + } + + invoice_line_obj.create(curr_invoice_line) + + self.write({'state': 'invoiced'}) + form_view_ref = self.env.ref('account.invoice_form', False) + tree_view_ref = self.env.ref('account.invoice_tree', False) + + return { + 'domain': "[('id', '=', " + str(inv_id) + ")]", + 'name': 'Lab Invoices', + 'view_mode': 'form', + 'res_model': 'account.invoice', + 'type': 'ir.actions.act_window', + 'views': [(tree_view_ref.id, 'tree'), (form_view_ref.id, 'form')], + } diff --git a/medical_lab_management/models/lab_test_content_type.py b/medical_lab_management/models/lab_test_content_type.py new file mode 100644 index 000000000..9a9a4d79f --- /dev/null +++ b/medical_lab_management/models/lab_test_content_type.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## + +from odoo import models, fields + + +class LabTestContentType(models.Model): + _name = 'lab.test.content_type' + _rec_name = 'content_type_name' + _description = "Content" + + content_type_name = fields.Char(string="Name", required=True, help="Content type name") + content_type_code = fields.Char(string="Code") + parent_test = fields.Many2one('lab.test', string="Test Category") + + + + diff --git a/medical_lab_management/models/lab_test_type.py b/medical_lab_management/models/lab_test_type.py new file mode 100644 index 000000000..960343b59 --- /dev/null +++ b/medical_lab_management/models/lab_test_type.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +from odoo import models, fields + + +class LabTestType(models.Model): + _name = 'lab.test' + _rec_name = 'lab_test' + _inherit = ['mail.thread', 'ir.needaction_mixin'] + + lab_test = fields.Char(string="Test Name", required=True, help="Name of lab test ") + lab_test_code = fields.Char(string="Test Code", required=True) + test_lines = fields.One2many('lab.test.attribute', 'test_line_reverse', string="Attribute") + test_cost = fields.Integer(string="Cost", required=True) + + +class LabTestAttribute(models.Model): + _name = 'lab.test.attribute' + + test_content = fields.Many2one('lab.test.content_type', string="Content") + result = fields.Char(string="Result") + unit = fields.Many2one('test.unit', string="Unit") + interval = fields.Char(string="Reference Intervals") + test_line_reverse = fields.Many2one('lab.test', string="Attribute") + test_request_reverse = fields.Many2one('lab.request', string="Request") diff --git a/medical_lab_management/models/physician_speciality.py b/medical_lab_management/models/physician_speciality.py new file mode 100644 index 000000000..1c808fb1a --- /dev/null +++ b/medical_lab_management/models/physician_speciality.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## + +from odoo import models, fields + + +class PhysicianSpeciality(models.Model): + _name = 'physician.speciality' + _description = 'Medical Specialty' + + code = fields.Char(string='ID') + name = fields.Char(string='Specialty', help='Name of the specialty', required=True) + + _sql_constraints = [ + ('name_uniq', 'UNIQUE(name)', 'Name must be unique!'), + ] diff --git a/medical_lab_management/models/res_partner.py b/medical_lab_management/models/res_partner.py new file mode 100644 index 000000000..6670771dd --- /dev/null +++ b/medical_lab_management/models/res_partner.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## +from odoo import models, fields + + +class ResPartnerPatient(models.Model): + _inherit = 'res.partner' + + is_patient = fields.Boolean(string='Is Patient') + is_physician = fields.Boolean(string='Is Physician') + speciality = fields.Many2one('physician.speciality', string='Speciality') + hospital = fields.Many2one('res.partner', string='Hospital') + + diff --git a/medical_lab_management/models/testing_unit.py b/medical_lab_management/models/testing_unit.py new file mode 100644 index 000000000..5cc299166 --- /dev/null +++ b/medical_lab_management/models/testing_unit.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Maintainer: Cybrosys Technologies () +# +############################################################################## + +from odoo import models, fields + + +class TestingUnit(models.Model): + _name = 'test.unit' + _rec_name = 'code' + _description = "Test Unit" + + unit = fields.Char(string="Unit", required=True) + code = fields.Char(string="code", required=True) diff --git a/medical_lab_management/report/lab_patient_card.xml b/medical_lab_management/report/lab_patient_card.xml new file mode 100644 index 000000000..c204355ae --- /dev/null +++ b/medical_lab_management/report/lab_patient_card.xml @@ -0,0 +1,60 @@ + + + + + + \ No newline at end of file diff --git a/medical_lab_management/report/lab_test_report.xml b/medical_lab_management/report/lab_test_report.xml new file mode 100644 index 000000000..4a0fcacee --- /dev/null +++ b/medical_lab_management/report/lab_test_report.xml @@ -0,0 +1,54 @@ + + + + + + diff --git a/medical_lab_management/report/report.xml b/medical_lab_management/report/report.xml new file mode 100644 index 000000000..f69032334 --- /dev/null +++ b/medical_lab_management/report/report.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/medical_lab_management/security/ir.model.access.csv b/medical_lab_management/security/ir.model.access.csv new file mode 100644 index 000000000..d694f8b26 --- /dev/null +++ b/medical_lab_management/security/ir.model.access.csv @@ -0,0 +1,19 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_lab_request_user,lab.request,model_lab_request,group_lab_management_user,1,1,1,1 +access_lab_patient_user,lab.patient,model_lab_patient,group_lab_management_user,1,1,1,1 +access_lab_appointment_user,lab.appointment,model_lab_appointment,group_lab_management_user,1,1,1,1 +access_test_unit_user,test.unit,model_test_unit,group_lab_management_user,1,0,0,0 +access_lab_physician_user,physician.speciality,model_physician_speciality,group_lab_management_user,1,1,1,1 +access_lab_test_user,lab.test,model_lab_test,group_lab_management_user,1,0,0,0 +access_lab_appointment_line_user,lab.appointment.lines,model_lab_appointment_lines,group_lab_management_user,1,1,1,1 +access_lab_test_content_type_user,lab.test.content_type,model_lab_test_content_type,group_lab_management_user,1,0,0,0 +access_lab_test_attribute_user,lab.test.attribute,model_lab_test_attribute,group_lab_management_user,1,1,1,1 +access_lab_request_technician,lab.request,model_lab_request,group_lab_management_technician,1,1,1,1 +access_lab_patient_technician,lab.patient,model_lab_patient,group_lab_management_technician,1,1,1,1 +access_lab_appointment_technician,lab.appointment,model_lab_appointment,group_lab_management_technician,1,1,1,1 +access_test_unit_technician,test.unit,model_test_unit,group_lab_management_technician,1,1,1,1 +access_lab_physician_technician,physician.speciality,model_physician_speciality,group_lab_management_technician,1,0,0,0 +access_lab_test_technician,lab.test,model_lab_test,group_lab_management_technician,1,1,1,1 +access_lab_test_content_type_technician,lab.test.content_type,model_lab_test_content_type,group_lab_management_technician,1,1,1,1 +access_lab_appointment_line_technician,lab.appointment.lines,model_lab_appointment_lines,group_lab_management_technician,1,1,1,1 +access_lab_test_attribute_technician,lab.test.attribute,model_lab_test_attribute,group_lab_management_technician,1,1,1,1 \ No newline at end of file diff --git a/medical_lab_management/security/lab_users.xml b/medical_lab_management/security/lab_users.xml new file mode 100644 index 000000000..7f66355af --- /dev/null +++ b/medical_lab_management/security/lab_users.xml @@ -0,0 +1,17 @@ + + + + Lab Management + + + + Lab Technician + + + + + Lab User + + + + \ No newline at end of file diff --git a/medical_lab_management/static/description/app.png b/medical_lab_management/static/description/app.png new file mode 100644 index 000000000..032e2abc1 Binary files /dev/null and b/medical_lab_management/static/description/app.png differ diff --git a/medical_lab_management/static/description/banner.jpg b/medical_lab_management/static/description/banner.jpg new file mode 100644 index 000000000..2a8c39329 Binary files /dev/null and b/medical_lab_management/static/description/banner.jpg differ diff --git a/medical_lab_management/static/description/card.png b/medical_lab_management/static/description/card.png new file mode 100644 index 000000000..39be5f524 Binary files /dev/null and b/medical_lab_management/static/description/card.png differ diff --git a/medical_lab_management/static/description/content.png b/medical_lab_management/static/description/content.png new file mode 100644 index 000000000..095acad9b Binary files /dev/null and b/medical_lab_management/static/description/content.png differ diff --git a/medical_lab_management/static/description/cybro_logo.png b/medical_lab_management/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/medical_lab_management/static/description/cybro_logo.png differ diff --git a/medical_lab_management/static/description/icon.png b/medical_lab_management/static/description/icon.png new file mode 100644 index 000000000..9024512da Binary files /dev/null and b/medical_lab_management/static/description/icon.png differ diff --git a/medical_lab_management/static/description/index.html b/medical_lab_management/static/description/index.html new file mode 100644 index 000000000..54910f5dc --- /dev/null +++ b/medical_lab_management/static/description/index.html @@ -0,0 +1,270 @@ +
+
+

Medical Lab Management

+

Manage Lab Activities

+

Cybrosys Technologies

+
+
+

Features:

+
+ Manage Patients.
+ Issue Patient Card.
+ Manage Referrals of Patients.
+ Manage Appointments.
+ Mail Notification For Appointments.
+ Manage Lab Requests.
+ Print Lab Test Result Of Patient.
+
+
+
+ +
+
+
+

Overview

+

+ This app helps the user to systematically perform the activities of a Medical Laboratory. + The app simplifies the activities like Patient Management, Appointment Management, Test Requests Management, Lab Results Management, and so on. +

+
+
+
+ +
+
+
+

+

Patients

+

+

+
+ Create patients. +
+ +
+
+
+
+ +
+
+
+

+

Patient Card

+

+
+
+ Go to Laboratory -> Patient -> Print -> Patient Card. +
+ +
+
+
+
+ +
+
+
+

+

Appointments

+

+
+
+ Go to Laboratory -> Appointments->Create Appointments. +
+ +
+
+
+
+ +
+
+
+

+

Mail Notification on Appointment

+

+
+
+ When we confirm the appointment the appointment details will be sent through E-Mail. + +
+ +
+
+
+
+ +
+
+
+

+

Lab Request

+

+
+
+
+ +
+
+
+
+ +
+
+
+

+

Lab Test Result

+

+
+
+
+ +
+
+
+
+ +
+
+
+

+

Lab Test Invoice

+

+
+
+ Create invoice for lab test. +
+ +
+
+
+
+ + + +
+
+
+

+

Today's Appointments

+

+
+
+ You can see today's appointments here. +
+ +
+
+
+
+ +
+
+
+

+

Lab Test

+

+
+
+ Go to Laboratory -> Configuration -> Lab test. +
+ +
+
+
+
+ +
+
+
+

+

Test Contents

+

+
+
+ Go to Laboratory -> Configuration -> Test Contents. +
+ +
+
+
+
+ + +
+
+
+

+

Lab Test Units

+

+
+
+ Go to Laboratory -> Configuration -> Testing Unit. +
+ +
+
+
+
+ +
+
+
+

+

Referrals Details

+

+
+
+ We can add referral physician details. +
+ +
+
+
+
+ + +
+
+
+

+

Users

+

+
+
+ There are two type users. +
+ +
+
+
+
+ + +
+

Need Any Help?

+ +
+ diff --git a/medical_lab_management/static/description/invoice.png b/medical_lab_management/static/description/invoice.png new file mode 100644 index 000000000..c1ee21f64 Binary files /dev/null and b/medical_lab_management/static/description/invoice.png differ diff --git a/medical_lab_management/static/description/mail.png b/medical_lab_management/static/description/mail.png new file mode 100644 index 000000000..8095b4c79 Binary files /dev/null and b/medical_lab_management/static/description/mail.png differ diff --git a/medical_lab_management/static/description/patient.png b/medical_lab_management/static/description/patient.png new file mode 100644 index 000000000..be87527df Binary files /dev/null and b/medical_lab_management/static/description/patient.png differ diff --git a/medical_lab_management/static/description/phy.png b/medical_lab_management/static/description/phy.png new file mode 100644 index 000000000..47733b7ff Binary files /dev/null and b/medical_lab_management/static/description/phy.png differ diff --git a/medical_lab_management/static/description/request1.png b/medical_lab_management/static/description/request1.png new file mode 100644 index 000000000..c90200cdf Binary files /dev/null and b/medical_lab_management/static/description/request1.png differ diff --git a/medical_lab_management/static/description/request2.png b/medical_lab_management/static/description/request2.png new file mode 100644 index 000000000..144ff0738 Binary files /dev/null and b/medical_lab_management/static/description/request2.png differ diff --git a/medical_lab_management/static/description/result.png b/medical_lab_management/static/description/result.png new file mode 100644 index 000000000..ea6aa03da Binary files /dev/null and b/medical_lab_management/static/description/result.png differ diff --git a/medical_lab_management/static/description/test.png b/medical_lab_management/static/description/test.png new file mode 100644 index 000000000..341db05c2 Binary files /dev/null and b/medical_lab_management/static/description/test.png differ diff --git a/medical_lab_management/static/description/today.png b/medical_lab_management/static/description/today.png new file mode 100644 index 000000000..b5c98662c Binary files /dev/null and b/medical_lab_management/static/description/today.png differ diff --git a/medical_lab_management/static/description/unit.png b/medical_lab_management/static/description/unit.png new file mode 100644 index 000000000..01ace39c5 Binary files /dev/null and b/medical_lab_management/static/description/unit.png differ diff --git a/medical_lab_management/static/description/user.png b/medical_lab_management/static/description/user.png new file mode 100644 index 000000000..9ae7a7013 Binary files /dev/null and b/medical_lab_management/static/description/user.png differ diff --git a/medical_lab_management/views/account_invoice.xml b/medical_lab_management/views/account_invoice.xml new file mode 100644 index 000000000..ef491e5b9 --- /dev/null +++ b/medical_lab_management/views/account_invoice.xml @@ -0,0 +1,30 @@ + + + + + account.invoice.cust.invoice_form + account.invoice + + + + + + + + + + + account.invoice.cust.invoice_filter_form + account.invoice + + + + + + + + + + + + \ No newline at end of file diff --git a/medical_lab_management/views/lab_appointment.xml b/medical_lab_management/views/lab_appointment.xml new file mode 100644 index 000000000..2e6548759 --- /dev/null +++ b/medical_lab_management/views/lab_appointment.xml @@ -0,0 +1,232 @@ + + + + + Invoices + account.invoice + form + tree,form,kanban,calendar,graph,pivot + + [('is_lab_invoice','=',True)] + + +

+ Create Invoices. +

+
+
+ + + 1 + tree + + + + + 2 + form + + + + + + Appointment Kanban + lab.appointment + + + + +
+
+ +
    +
  • Name :
  • +
  • Lab Request ID :
  • +
  • Appointment Date :
  • +
+
+
+
+
+
+
+
+
+ + + lab.appointment.tree + lab.appointment + + + + + + + + + + + + lab.appointment.form + lab.appointment + + +
+
+
+ +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + + lab.appointment.search + lab.appointment + + + + + + + + + + + + + + + + + + + + Appointments + ir.actions.act_window + lab.appointment + form + tree,form,kanban + + [] + {} + +

+ Create Appointments. +

+
+
+ + + + Appointments + ir.actions.act_window + lab.appointment + form + tree,form + + [('appointment_date', '>=',((datetime.date.today()- datetime.timedelta(days=0)).strftime('%Y-%m-%d 00:00:00'))), + ('appointment_date', '<=',((datetime.date.today()- datetime.timedelta(days=0)).strftime('%Y-%m-%d 23:59:59')))] + + {} + +

+ Create Appointments. +

+
+
+ + + Appointment + lab.appointment + ID + 3 + + + + + + + + + + + lab.patient.form + lab.patient + + + + + + + + + +
+
diff --git a/medical_lab_management/views/lab_patient_view.xml b/medical_lab_management/views/lab_patient_view.xml new file mode 100644 index 000000000..d58142219 --- /dev/null +++ b/medical_lab_management/views/lab_patient_view.xml @@ -0,0 +1,157 @@ + + + + + + Patient Kanban + lab.patient + + + + +
+
+ +
+
+ +
    +
  • Name :
  • +
  • Patient ID :
  • +
+
+
+
+
+
+
+
+
+ + + lab.patient.tree + lab.patient + + + + + + + + + + + + + + lab.patient.form + lab.patient + + +
+ +
+
+ +
+

+ +

+

+ + + + +
+ +
+

+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + lab.patient.search + lab.patient + + + + + + + + + + + + + + + + + + Patients + ir.actions.act_window + lab.patient + form + kanban,tree,form + + [] + {} + +

+ Create Patients. +

+
+
+ + + Patient + lab.patient + PID + 3 + + + + + + + +
+
diff --git a/medical_lab_management/views/lab_request.xml b/medical_lab_management/views/lab_request.xml new file mode 100644 index 000000000..711b9c368 --- /dev/null +++ b/medical_lab_management/views/lab_request.xml @@ -0,0 +1,121 @@ + + + + + lab.request.tree + lab.request + + + + + + + + + + + + lab.request.form + lab.request + +
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+ + lab.request.search + lab.request + + + + + + + + + + + + + + + + + Lab Request + ir.actions.act_window + lab.request + form + tree,form + + [] + {} + +

+ Create Lab request. +

+
+
+ + + Lab Request + lab.request + LR + 3 + + + + + +
+
diff --git a/medical_lab_management/views/lab_test_content_type.xml b/medical_lab_management/views/lab_test_content_type.xml new file mode 100644 index 000000000..1d9846817 --- /dev/null +++ b/medical_lab_management/views/lab_test_content_type.xml @@ -0,0 +1,72 @@ + + + + + lab.test.content_type.tree + lab.test.content_type + + + + + + + + + + + lab.test.content_type.form + lab.test.content_type + + +
+ + + + + + + + +
+
+
+ + + lab.test.content_type.search + lab.test.content_type + + + + + + + + + + + + + + + + Test Contents + ir.actions.act_window + lab.test.content_type + form + tree,form + [] + + {} + +

+ Create Test Contents. +

+
+
+ + +
+
diff --git a/medical_lab_management/views/lab_test_type.xml b/medical_lab_management/views/lab_test_type.xml new file mode 100644 index 000000000..02afdb958 --- /dev/null +++ b/medical_lab_management/views/lab_test_type.xml @@ -0,0 +1,102 @@ + + + + + lab.test.tree + lab.test + + + + + + + + + + + + lab.test.form + lab.test + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + lab.test.search + lab.test + + + + + + + + + + + + + + Lab Test + ir.actions.act_window + lab.test + form + tree,form + + [] + {} + +

+ Create Lab Tests. +

+
+
+ + + + + lab.test.attribute.form + lab.test.attribute + + +
+ + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/medical_lab_management/views/physician_details.xml b/medical_lab_management/views/physician_details.xml new file mode 100644 index 000000000..f7b237c7b --- /dev/null +++ b/medical_lab_management/views/physician_details.xml @@ -0,0 +1,25 @@ + + + + + Physician + ir.actions.act_window + res.partner + form + tree,form + [('is_physician','=',1)] + {'default_customer':0, 'default_supplier':0 , 'default_is_physician':1} + + +

+ Click to add physician. +

+
+
+ + + +
+
diff --git a/medical_lab_management/views/physician_specialty.xml b/medical_lab_management/views/physician_specialty.xml new file mode 100644 index 000000000..a3d5e680c --- /dev/null +++ b/medical_lab_management/views/physician_specialty.xml @@ -0,0 +1,18 @@ + + + + + physician.speciality.form + physician.speciality + + +
+ + + + +
+
+
+
+
diff --git a/medical_lab_management/views/res_partner.xml b/medical_lab_management/views/res_partner.xml new file mode 100644 index 000000000..3981f0155 --- /dev/null +++ b/medical_lab_management/views/res_partner.xml @@ -0,0 +1,22 @@ + + + + + res.partner.form + res.partner + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/medical_lab_management/views/test_unit_view.xml b/medical_lab_management/views/test_unit_view.xml new file mode 100644 index 000000000..6fc994cdd --- /dev/null +++ b/medical_lab_management/views/test_unit_view.xml @@ -0,0 +1,72 @@ + + + + + test.unit.tree + test.unit + + + + + + + + + + test.unit.form + test.unit + + +
+ + + + + + + + + + +
+
+
+ + test.unit.search + test.unit + + + + + + + + + + + + Testing Units + ir.actions.act_window + test.unit + form + tree,form + + [] + {} + +

+ Create Testing Units. +

+
+
+ + +
+
\ No newline at end of file