[Enhance][Fix] Healthcare - DocType and Fields renaming (#14861)

* Rename DT - Physician Schedule Time Slot to Healthcare Schedule Time Slot

* Role name change

* Rename DT - Physician Schedule to Practitioner Schedule

* Rename DT - Physician Service Unit Schedule

* Rename DT - Physician to Practitioner

* Lab Test Template - field disabled in standard filter

* Patient - customer creation fix

* Rename DT - Consultation - Encounter

* Patches.txt updated for rename doctypes and fields in Healthcare

* Patch - Rename doctypes and fields in Healthcare Domain

* Fix - Patch - rename_healthcare_doctype_and_fields

* Vital Signs - New Fields - Abdomen, Tongue and Reflexes

* Web Form - Patient - Personal Details

* Rename DocType Physician to Healthcare Practitioner

* Rename DocType Consultation to Patient Encounter

* Web Form - Personal Details - Fix

* Web Form - Personal Details - Codacy Fix

* Healthcare patch run for all domain

* Rename label Practitioner to Healthcare Practitioner

* Rename Encounter to Patient Encounter
This commit is contained in:
Jamsheer
2018-07-16 18:08:53 +05:30
committed by Nabin Hait
parent 14e94f824e
commit f926911399
78 changed files with 1173 additions and 619 deletions

View File

@@ -18,7 +18,7 @@
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2017-06-07 16:03:06.781364",
"modified": "2018-07-16 13:10:47.940128",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "lab-test",
@@ -77,13 +77,13 @@
"reqd": 0
},
{
"fieldname": "physician",
"fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"label": "Doctor",
"label": "Healthcare Practitioner",
"max_length": 0,
"max_value": 0,
"options": "Physician",
"options": "Healthcare Practitioner",
"read_only": 0,
"reqd": 0
},

View File

@@ -18,7 +18,7 @@
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2017-06-07 15:57:27.196428",
"modified": "2018-07-16 13:11:08.626316",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "patient-appointments",
@@ -43,13 +43,13 @@
"reqd": 1
},
{
"fieldname": "physician",
"fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"label": "Physician",
"label": "Healthcare Practitioner",
"max_length": 0,
"max_value": 0,
"options": "Physician",
"options": "Healthcare Practitioner",
"read_only": 0,
"reqd": 1
},

View File

@@ -0,0 +1,3 @@
frappe.ready(function() {
// bind events here
});

View File

@@ -0,0 +1,87 @@
{
"accept_payment": 0,
"allow_comments": 0,
"allow_delete": 0,
"allow_edit": 1,
"allow_incomplete": 0,
"allow_multiple": 0,
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
"creation": "2018-07-03 19:33:23.332661",
"currency": "INR",
"doc_type": "Patient",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
"introduction_text": "",
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2018-07-04 17:22:28.936442",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "personal-details",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"published": 1,
"route": "personal-details",
"show_sidebar": 1,
"sidebar_items": [],
"success_url": "/personal-details",
"title": "Personal Details",
"web_form_fields": [
{
"fieldname": "patient_name",
"fieldtype": "Data",
"hidden": 0,
"label": "Full Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "sex",
"fieldtype": "Select",
"hidden": 0,
"label": "Gender",
"max_length": 0,
"max_value": 0,
"options": "\nMale\nFemale\nOther",
"read_only": 0,
"reqd": 1
},
{
"fieldname": "dob",
"fieldtype": "Date",
"hidden": 0,
"label": "Date of birth",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1
},
{
"fieldname": "mobile",
"fieldtype": "Data",
"hidden": 0,
"label": "Mobile",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0
},
{
"fieldname": "email",
"fieldtype": "Data",
"hidden": 0,
"label": "Email",
"max_length": 0,
"max_value": 0,
"options": "Email",
"read_only": 1,
"reqd": 0
}
]
}

View File

@@ -0,0 +1,28 @@
from __future__ import unicode_literals
import frappe
from frappe import _
no_cache = 1
no_sitemap = 1
def get_context(context):
if frappe.session.user=='Guest':
frappe.throw(_("You need to be logged in to access this page"), frappe.PermissionError)
context.show_sidebar=True
if frappe.db.exists("Patient", {'email': frappe.session.user}):
patient = frappe.get_doc("Patient", {'email': frappe.session.user})
context.doc = patient
frappe.form_dict.new = 0
frappe.form_dict.name = patient.name
def get_patient():
return frappe.get_value("Patient",{"email": frappe.session.user}, "name")
def has_website_permission(doc, ptype, user, verbose=False):
if doc.name == get_patient():
return True
else:
return False

View File

@@ -10,7 +10,7 @@
"amount_based_on_field": 0,
"creation": "2017-06-06 17:13:19.101374",
"currency": "INR",
"doc_type": "Consultation",
"doc_type": "Patient Encounter",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
@@ -18,13 +18,13 @@
"is_standard": 1,
"login_required": 1,
"max_attachment_size": 0,
"modified": "2017-06-20 11:56:05.132154",
"modified": "2018-07-16 13:11:28.057697",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "prescription",
"owner": "Administrator",
"payment_button_label": "Buy Now",
"print_format": "Consultation Print",
"print_format": "Encounter Print",
"published": 1,
"route": "prescription",
"show_sidebar": 1,
@@ -33,13 +33,13 @@
"title": "Prescription",
"web_form_fields": [
{
"fieldname": "physician",
"fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"label": "Doctor",
"label": "Healthcare Practitioner",
"max_length": 0,
"max_value": 0,
"options": "Physician",
"options": "Healthcare Practitioner",
"read_only": 0,
"reqd": 1
},
@@ -56,10 +56,10 @@
},
{
"default": "Today",
"fieldname": "consultation_date",
"fieldname": "encounter_date",
"fieldtype": "Date",
"hidden": 0,
"label": "Consultation Date",
"label": "Encounter Date",
"max_length": 0,
"max_value": 0,
"read_only": 0,
@@ -67,10 +67,10 @@
},
{
"default": "",
"fieldname": "consultation_time",
"fieldname": "encounter_time",
"fieldtype": "Data",
"hidden": 0,
"label": "Consultation Time",
"label": "Encounter Time",
"max_length": 0,
"max_value": 0,
"read_only": 0,
@@ -99,7 +99,7 @@
"reqd": 0
},
{
"fieldname": "consultation_comment",
"fieldname": "encounter_comment",
"fieldtype": "Small Text",
"hidden": 0,
"label": "Review Details",

View File

@@ -7,13 +7,13 @@ def get_context(context):
def get_list_context(context):
context.row_template = "erpnext/templates/includes/healthcare/prescription_row_template.html"
context.get_list = get_consultation_list
context.get_list = get_encounter_list
def get_consultation_list(doctype, txt, filters, limit_start, limit_page_length = 20, order_by='modified desc'):
def get_encounter_list(doctype, txt, filters, limit_start, limit_page_length = 20, order_by='modified desc'):
patient = get_patient()
consultations = frappe.db.sql("""select * from `tabConsultation`
encounters = frappe.db.sql("""select * from `tabPatient Encounter`
where patient = %s order by creation desc""", patient, as_dict = True)
return consultations
return encounters
def get_patient():
return frappe.get_value("Patient",{"email": frappe.session.user}, "name")