[fix] Healthcare field and desktop icon (#15638)

* Test Inpatient Record - Fix

* Test Inpatient Record - Fix

* Healthcare - Patch rename_healthcare_doctype_and_fields - Updated

* Healthcare - Desktop Icons - Updated

* Healthcare - Patch change  in healthcare desktop icons

* Healthcare Util - fix - appointments valid in fee validity

* Healthcare Settings - field label change

* Patient allow rename

* fix: remove unused variable
This commit is contained in:
Jamsheer 2018-10-10 14:44:36 +05:30 committed by Nabin Hait
parent 99c064305f
commit 14c6ab0ee9
9 changed files with 2777 additions and 2665 deletions

View File

@ -293,6 +293,16 @@ def get_data():
"label": _("Patient"), "label": _("Patient"),
"hidden": 1 "hidden": 1
}, },
{
"module_name": "Healthcare Practitioner",
"color": "#2ecc71",
"icon": "fa fa-user-md",
"doctype": "Healthcare Practitioner",
"type": "link",
"link": "List/Healthcare Practitioner",
"label": _("Healthcare Practitioner"),
"hidden": 1
},
{ {
"module_name": "Patient Appointment", "module_name": "Patient Appointment",
"color": "#934F92", "color": "#934F92",
@ -322,6 +332,36 @@ def get_data():
"link": "List/Lab Test", "link": "List/Lab Test",
"label": _("Lab Test"), "label": _("Lab Test"),
"hidden": 1 "hidden": 1
},
{
"module_name": "Vital Signs",
"color": "#2ecc71",
"icon": "fa fa-thermometer-empty",
"doctype": "Vital Signs",
"type": "list",
"link": "List/Vital Signs",
"label": _("Vital Signs"),
"hidden": 1
},
{
"module_name": "Clinical Procedure",
"color": "#FF888B",
"icon": "fa fa-medkit",
"doctype": "Clinical Procedure",
"type": "list",
"link": "List/Clinical Procedure",
"label": _("Clinical Procedure"),
"hidden": 1
},
{
"module_name": "Inpatient Record",
"color": "#7578f6",
"icon": "fa fa-list-alt",
"doctype": "Inpatient Record",
"type": "list",
"link": "List/Inpatient Record",
"label": _("Inpatient Record"),
"hidden": 1
}, },
{ {
"module_name": "Hub", "module_name": "Hub",

View File

@ -5,6 +5,9 @@ data = {
'Patient Encounter', 'Patient Encounter',
'Lab Test', 'Lab Test',
'Healthcare', 'Healthcare',
'Vital Signs',
'Clinical Procedure',
'Inpatient Record',
'Accounts', 'Accounts',
'Buying', 'Buying',
'Stock', 'Stock',

File diff suppressed because it is too large Load Diff

View File

@ -342,6 +342,8 @@ def manage_fee_validity(appointment_name, method, ref_invoice=None):
def appointments_valid_in_fee_validity(appointment, invoiced): def appointments_valid_in_fee_validity(appointment, invoiced):
valid_days = frappe.db.get_value("Healthcare Settings", None, "valid_days") valid_days = frappe.db.get_value("Healthcare Settings", None, "valid_days")
max_visit = frappe.db.get_value("Healthcare Settings", None, "max_visit") max_visit = frappe.db.get_value("Healthcare Settings", None, "max_visit")
if int(max_visit) < 1:
max_visit = 1
valid_days_date = add_days(getdate(appointment.appointment_date), int(valid_days)) valid_days_date = add_days(getdate(appointment.appointment_date), int(valid_days))
return frappe.get_list("Patient Appointment",{'patient': appointment.patient, 'invoiced': invoiced, return frappe.get_list("Patient Appointment",{'patient': appointment.patient, 'invoiced': invoiced,
'appointment_date':("<=", valid_days_date), 'appointment_date':(">=", getdate(appointment.appointment_date)), 'appointment_date':("<=", valid_days_date), 'appointment_date':(">=", getdate(appointment.appointment_date)),

View File

@ -498,7 +498,6 @@ execute:frappe.delete_doc('DocType', 'Production Planning Tool', ignore_missing=
erpnext.patches.v10_0.migrate_daily_work_summary_settings_to_daily_work_summary_group erpnext.patches.v10_0.migrate_daily_work_summary_settings_to_daily_work_summary_group
erpnext.patches.v10_0.add_default_cash_flow_mappers erpnext.patches.v10_0.add_default_cash_flow_mappers
erpnext.patches.v11_0.make_quality_inspection_template erpnext.patches.v11_0.make_quality_inspection_template
erpnext.patches.v10_0.remove_and_copy_fields_in_physician
erpnext.patches.v10_0.update_status_for_multiple_source_in_po erpnext.patches.v10_0.update_status_for_multiple_source_in_po
erpnext.patches.v10_0.set_auto_created_serial_no_in_stock_entry erpnext.patches.v10_0.set_auto_created_serial_no_in_stock_entry
erpnext.patches.v10_0.update_territory_and_customer_group erpnext.patches.v10_0.update_territory_and_customer_group
@ -569,3 +568,4 @@ erpnext.patches.v11_0.remove_land_unit_icon
erpnext.patches.v11_0.add_default_dispatch_notification_template erpnext.patches.v11_0.add_default_dispatch_notification_template
erpnext.patches.v11_0.add_market_segments erpnext.patches.v11_0.add_market_segments
erpnext.patches.v11_0.add_sales_stages erpnext.patches.v11_0.add_sales_stages
erpnext.patches.v11_0.change_healthcare_desktop_icons

View File

@ -1,13 +0,0 @@
import frappe
def execute():
if frappe.db.exists("DocType", "Physician"):
frappe.reload_doc("healthcare", "doctype", "physician")
frappe.reload_doc("healthcare", "doctype", "physician_service_unit_schedule")
if frappe.db.has_column('Physician', 'physician_schedules'):
for doc in frappe.get_all('Physician'):
_doc = frappe.get_doc('Physician', doc.name)
if _doc.physician_schedule:
_doc.append('physician_schedules', {'schedule': _doc.physician_schedule})
_doc.save()

View File

@ -0,0 +1,68 @@
import frappe
from frappe import _
def execute():
change_healthcare_desktop_icons()
def change_healthcare_desktop_icons():
change_icons_map = [
{
"module_name": "Patient",
"color": "#6BE273",
"icon": "fa fa-user",
"doctype": "Patient",
"type": "link",
"link": "List/Patient",
"label": _("Patient")
},
{
"module_name": "Patient Encounter",
"color": "#2ecc71",
"icon": "fa fa-stethoscope",
"doctype": "Patient Encounter",
"type": "link",
"link": "List/Patient Encounter",
"label": _("Patient Encounter"),
},
{
"module_name": "Healthcare Practitioner",
"color": "#2ecc71",
"icon": "fa fa-user-md",
"doctype": "Healthcare Practitioner",
"type": "link",
"link": "List/Healthcare Practitioner",
"label": _("Healthcare Practitioner")
},
{
"module_name": "Patient Appointment",
"color": "#934F92",
"icon": "fa fa-calendar-plus-o",
"doctype": "Patient Appointment",
"type": "link",
"link": "List/Patient Appointment",
"label": _("Patient Appointment")
},
{
"module_name": "Lab Test",
"color": "#7578f6",
"icon": "octicon octicon-beaker",
"doctype": "Lab Test",
"type": "link",
"link": "List/Lab Test",
"label": _("Lab Test")
}
]
for spec in change_icons_map:
frappe.db.sql("""
update `tabDesktop Icon`
set module_name = '{0}', color = '{1}', icon = '{2}', _doctype = '{3}', type = '{4}',
link = '{5}', label = '{6}'
where _doctype = '{7}'
""".format(spec['module_name'], spec['color'], spec['icon'], spec['doctype'], spec['type'], spec['link'], spec['label'], spec['doctype']))
frappe.db.sql("""
update `tabDesktop Icon`
set color = '#FF888B', icon = 'fa fa-heartbeat'
where module_name = 'Healthcare' and type = 'module'
""")

View File

@ -54,3 +54,13 @@ def execute():
update `tabPractitioner Service Unit Schedule` set parentfield = 'practitioner_schedules' update `tabPractitioner Service Unit Schedule` set parentfield = 'practitioner_schedules'
where parentfield = 'physician_schedules' and parenttype = 'Healthcare Practitioner' where parentfield = 'physician_schedules' and parenttype = 'Healthcare Practitioner'
""") """)
if frappe.db.exists("DocType", "Healthcare Practitioner"):
frappe.reload_doc("healthcare", "doctype", "healthcare_practitioner")
frappe.reload_doc("healthcare", "doctype", "practitioner_service_unit_schedule")
if frappe.db.has_column('Healthcare Practitioner', 'physician_schedule'):
for doc in frappe.get_all('Healthcare Practitioner'):
_doc = frappe.get_doc('Healthcare Practitioner', doc.name)
if _doc.physician_schedule:
_doc.append('practitioner_schedules', {'schedule': _doc.physician_schedule})
_doc.save()