diff --git a/erpnext/config/desktop.py b/erpnext/config/desktop.py
index f98731674a0..117b4c3a67c 100644
--- a/erpnext/config/desktop.py
+++ b/erpnext/config/desktop.py
@@ -304,13 +304,13 @@ def get_data():
"hidden": 1
},
{
- "module_name": "Consultation",
+ "module_name": "Patient Encounter",
"color": "#2ecc71",
"icon": "fa fa-stethoscope",
- "doctype": "Consultation",
+ "doctype": "Patient Encounter",
"type": "link",
- "link": "List/Consultation",
- "label": _("Consultation"),
+ "link": "List/Patient Encounter",
+ "label": _("Patient Encounter"),
"hidden": 1
},
{
diff --git a/erpnext/config/healthcare.py b/erpnext/config/healthcare.py
index f1339a7b113..ae36f9c93c8 100644
--- a/erpnext/config/healthcare.py
+++ b/erpnext/config/healthcare.py
@@ -15,8 +15,8 @@ def get_data():
},
{
"type": "doctype",
- "name": "Consultation",
- "label": _("Consultation"),
+ "name": "Patient Encounter",
+ "label": _("Patient Encounter"),
},
{
"type": "doctype",
@@ -74,13 +74,13 @@ def get_data():
},
{
"type": "doctype",
- "name": "Physician",
- "label": _("Physician"),
+ "name": "Healthcare Practitioner",
+ "label": _("Healthcare Practitioner"),
},
{
"type": "doctype",
- "name": "Physician Schedule",
- "label": _("Physician Schedule"),
+ "name": "Practitioner Schedule",
+ "label": _("Practitioner Schedule"),
},
{
"type": "doctype",
diff --git a/erpnext/demo/data/physician.json b/erpnext/demo/data/practitioner.json
similarity index 62%
rename from erpnext/demo/data/physician.json
rename to erpnext/demo/data/practitioner.json
index 3afea993e60..39c960fcd7e 100644
--- a/erpnext/demo/data/physician.json
+++ b/erpnext/demo/data/practitioner.json
@@ -1,16 +1,16 @@
[
{
- "doctype": "Physician",
+ "doctype": "Healthcare Practitioner",
"first_name": "Eddie Jessup",
"department": "Pathology"
},
{
- "doctype": "Physician",
+ "doctype": "Healthcare Practitioner",
"first_name": "Deepshi Garg",
"department": "ENT"
},
{
- "doctype": "Physician",
+ "doctype": "Healthcare Practitioner",
"first_name": "Amit Jain",
"department": "Microbiology"
}
diff --git a/erpnext/demo/setup/healthcare.py b/erpnext/demo/setup/healthcare.py
index b48e0bcbc17..3ddb2ae19de 100644
--- a/erpnext/demo/setup/healthcare.py
+++ b/erpnext/demo/setup/healthcare.py
@@ -16,12 +16,12 @@ def setup_data():
make_consulation()
make_appointment()
consulation_on_appointment()
- lab_test_on_consultation()
+ lab_test_on_encounter()
frappe.db.commit()
frappe.clear_cache()
def make_masters():
- import_json("Physician")
+ import_json("Healthcare Practitioner")
import_drug()
frappe.db.commit()
@@ -46,8 +46,8 @@ def make_patient():
def make_appointment():
i = 1
while i <= 4:
- physician = get_random("Physician")
- department = frappe.get_value("Physician", physician, "department")
+ practitioner = get_random("Healthcare Practitioner")
+ department = frappe.get_value("Healthcare Practitioner", practitioner, "department")
patient = get_random("Patient")
patient_sex = frappe.get_value("Patient", patient, "sex")
appointment = frappe.new_doc("Patient Appointment")
@@ -59,92 +59,92 @@ def make_appointment():
appointment.appointment_date = appointment_datetime
appointment.patient = patient
appointment.patient_sex = patient_sex
- appointment.physician = physician
+ appointment.practitioner = practitioner
appointment.department = department
appointment.save(ignore_permissions = True)
i += 1
def make_consulation():
for i in range(3):
- physician = get_random("Physician")
- department = frappe.get_value("Physician", physician, "department")
+ practitioner = get_random("Healthcare Practitioner")
+ department = frappe.get_value("Healthcare Practitioner", practitioner, "department")
patient = get_random("Patient")
patient_sex = frappe.get_value("Patient", patient, "sex")
- consultation = set_consultation(patient, patient_sex, physician, department, getdate(), i)
- consultation.save(ignore_permissions=True)
+ encounter = set_encounter(patient, patient_sex, practitioner, department, getdate(), i)
+ encounter.save(ignore_permissions=True)
def consulation_on_appointment():
for i in range(3):
appointment = get_random("Patient Appointment")
appointment = frappe.get_doc("Patient Appointment",appointment)
- consultation = set_consultation(appointment.patient, appointment.patient_sex, appointment.physician, appointment.department, appointment.appointment_date, i)
- consultation.appointment = appointment.name
- consultation.save(ignore_permissions=True)
+ encounter = set_encounter(appointment.patient, appointment.patient_sex, appointment.practitioner, appointment.department, appointment.appointment_date, i)
+ encounter.appointment = appointment.name
+ encounter.save(ignore_permissions=True)
-def set_consultation(patient, patient_sex, physician, department, consultation_date, i):
- consultation = frappe.new_doc("Consultation")
- consultation.patient = patient
- consultation.patient_sex = patient_sex
- consultation.physician = physician
- consultation.visit_department = department
- consultation.consultation_date = consultation_date
+def set_encounter(patient, patient_sex, practitioner, department, encounter_date, i):
+ encounter = frappe.new_doc("Patient Encounter")
+ encounter.patient = patient
+ encounter.patient_sex = patient_sex
+ encounter.practitioner = practitioner
+ encounter.visit_department = department
+ encounter.encounter_date = encounter_date
if i > 2 and patient_sex=='Female':
- consultation.symptoms = "Having chest pains for the last week."
- consultation.diagnosis = """This patient's description of dull, aching,
+ encounter.symptoms = "Having chest pains for the last week."
+ encounter.diagnosis = """This patient's description of dull, aching,
exertion related substernal chest pain is suggestive of ischemic
cardiac origin. Her findings of a FH of early ASCVD, hypertension,
and early surgical menopause are pertinent risk factors for development
of coronary artery disease. """
else:
- consultation = append_drug_rx(consultation)
- consultation = append_test_rx(consultation)
- return consultation
+ encounter = append_drug_rx(encounter)
+ encounter = append_test_rx(encounter)
+ return encounter
def make_lab_test():
- physician = get_random("Physician")
+ practitioner = get_random("Healthcare Practitioner")
patient = get_random("Patient")
patient_sex = frappe.get_value("Patient", patient, "sex")
template = get_random("Lab Test Template")
- set_lab_test(patient, patient_sex, physician, template)
+ set_lab_test(patient, patient_sex, practitioner, template)
-def lab_test_on_consultation():
+def lab_test_on_encounter():
i = 1
while i <= 2:
test_rx = get_random("Lab Prescription", filters={'test_created': 0})
test_rx = frappe.get_doc("Lab Prescription", test_rx)
- consultation = frappe.get_doc("Consultation", test_rx.parent)
- set_lab_test(consultation.patient, consultation.patient_sex, consultation.physician, test_rx.test_code, test_rx.name)
+ encounter = frappe.get_doc("Patient Encounter", test_rx.parent)
+ set_lab_test(encounter.patient, encounter.patient_sex, encounter.practitioner, test_rx.test_code, test_rx.name)
i += 1
-def set_lab_test(patient, patient_sex, physician, template, rx=None):
+def set_lab_test(patient, patient_sex, practitioner, template, rx=None):
lab_test = frappe.new_doc("Lab Test")
- lab_test.physician = physician
+ lab_test.practitioner = practitioner
lab_test.patient = patient
lab_test.patient_sex = patient_sex
lab_test.template = template
lab_test.prescription = rx
create_test_from_template(lab_test)
-def append_test_rx(consultation):
+def append_test_rx(encounter):
i = 1
while i <= 2:
- test_rx = consultation.append("test_prescription")
+ test_rx = encounter.append("test_prescription")
test_rx.test_code = get_random("Lab Test Template")
i += 1
- return consultation
+ return encounter
-def append_drug_rx(consultation):
+def append_drug_rx(encounter):
i = 1
while i <= 3:
drug = get_random("Item", filters={"item_group":"Drug"})
drug = frappe.get_doc("Item", drug)
- drug_rx = consultation.append("drug_prescription")
+ drug_rx = encounter.append("drug_prescription")
drug_rx.drug_code = drug.item_code
drug_rx.drug_name = drug.item_name
drug_rx.dosage = get_random("Prescription Dosage")
drug_rx.period = get_random("Prescription Duration")
i += 1
- return consultation
+ return encounter
def random_date(start,l):
current = start
diff --git a/erpnext/domains/healthcare.py b/erpnext/domains/healthcare.py
index 3c54b01d424..5a54cf67d0f 100644
--- a/erpnext/domains/healthcare.py
+++ b/erpnext/domains/healthcare.py
@@ -2,7 +2,7 @@ data = {
'desktop_icons': [
'Patient',
'Patient Appointment',
- 'Consultation',
+ 'Patient Encounter',
'Lab Test',
'Healthcare',
'Accounts',
@@ -26,4 +26,4 @@ data = {
insert_after='customer')
},
'on_setup': 'erpnext.healthcare.setup.setup_healthcare'
-}
\ No newline at end of file
+}
diff --git a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
index aac42240e1e..35c0ff5f387 100644
--- a/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
+++ b/erpnext/healthcare/doctype/clinical_procedure_template/clinical_procedure_template.json
@@ -725,7 +725,7 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "Medical Administrator",
+ "role": "Healthcare Administrator",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
@@ -781,4 +781,4 @@
"title_field": "template",
"track_changes": 1,
"track_seen": 1
-}
\ No newline at end of file
+}
diff --git a/erpnext/healthcare/doctype/consultation/test_consultation.py b/erpnext/healthcare/doctype/consultation/test_consultation.py
deleted file mode 100644
index 24dc011c361..00000000000
--- a/erpnext/healthcare/doctype/consultation/test_consultation.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, ESS LLP and Contributors
-# See license.txt
-from __future__ import unicode_literals
-import unittest
-
-# test_records = frappe.get_test_records('Consultation')
-
-class TestConsultation(unittest.TestCase):
- pass
diff --git a/erpnext/healthcare/doctype/fee_validity/fee_validity.json b/erpnext/healthcare/doctype/fee_validity/fee_validity.json
index 595539cd852..802f04a359c 100644
--- a/erpnext/healthcare/doctype/fee_validity/fee_validity.json
+++ b/erpnext/healthcare/doctype/fee_validity/fee_validity.json
@@ -14,11 +14,12 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "physician",
+ "fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -27,10 +28,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Physician",
+ "label": "Healthcare Practitioner",
"length": 0,
"no_copy": 0,
- "options": "Physician",
+ "options": "Healthcare Practitioner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -41,10 +42,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -72,10 +75,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -102,10 +107,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -132,10 +139,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -162,10 +171,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -193,6 +204,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -206,7 +218,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-05 11:26:35.292841",
+ "modified": "2018-07-16 12:43:45.635230",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Fee Validity",
@@ -215,7 +227,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -238,11 +249,11 @@
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Healthcare",
- "search_fields": "physician,patient",
+ "search_fields": "practitioner, patient",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
- "title_field": "physician",
+ "title_field": "practitioner",
"track_changes": 0,
"track_seen": 0
}
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
index ed852f1ed14..64222adac3b 100644
--- a/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
+++ b/erpnext/healthcare/doctype/fee_validity/test_fee_validity.py
@@ -13,7 +13,7 @@ from frappe.utils import nowdate, add_days
class TestFeeValidity(unittest.TestCase):
def test_fee_validity(self):
patient = get_random("Patient")
- physician = get_random("Physician")
+ practitioner = get_random("Healthcare Practitioner")
department = get_random("Medical Department")
if not patient:
@@ -29,36 +29,36 @@ class TestFeeValidity(unittest.TestCase):
medical_department.save(ignore_permissions=True)
department = medical_department.name
- if not physician:
- physician = frappe.new_doc("Physician")
- physician.first_name = "Amit Jain"
- physician.department = department
- physician.save(ignore_permissions=True)
- physician = physician.name
+ if not practitioner:
+ practitioner = frappe.new_doc("Healthcare Practitioner")
+ practitioner.first_name = "Amit Jain"
+ practitioner.department = department
+ practitioner.save(ignore_permissions=True)
+ practitioner = practitioner.name
frappe.db.set_value("Healthcare Settings", None, "max_visit", 2)
frappe.db.set_value("Healthcare Settings", None, "valid_days", 7)
- appointment = create_appointment(patient, physician, nowdate(), department)
+ appointment = create_appointment(patient, practitioner, nowdate(), department)
invoice = frappe.db.get_value("Patient Appointment", appointment.name, "sales_invoice")
self.assertEqual(invoice, None)
invoice_appointment(appointment)
- appointment = create_appointment(patient, physician, add_days(nowdate(), 4), department)
+ appointment = create_appointment(patient, practitioner, add_days(nowdate(), 4), department)
invoice = frappe.db.get_value("Patient Appointment", appointment.name, "sales_invoice")
self.assertTrue(invoice)
- appointment = create_appointment(patient, physician, add_days(nowdate(), 5), department)
+ appointment = create_appointment(patient, practitioner, add_days(nowdate(), 5), department)
invoice = frappe.db.get_value("Patient Appointment", appointment.name, "sales_invoice")
self.assertEqual(invoice, None)
- appointment = create_appointment(patient, physician, add_days(nowdate(), 10), department)
+ appointment = create_appointment(patient, practitioner, add_days(nowdate(), 10), department)
invoice = frappe.db.get_value("Patient Appointment", appointment.name, "sales_invoice")
self.assertEqual(invoice, None)
-def create_appointment(patient, physician, appointment_date, department):
+def create_appointment(patient, practitioner, appointment_date, department):
appointment = frappe.new_doc("Patient Appointment")
appointment.patient = patient
- appointment.physician = physician
+ appointment.practitioner = practitioner
appointment.department = department
appointment.appointment_date = appointment_date
appointment.company = "_Test Company"
diff --git a/erpnext/healthcare/doctype/consultation/__init__.py b/erpnext/healthcare/doctype/healthcare_practitioner/__init__.py
similarity index 100%
rename from erpnext/healthcare/doctype/consultation/__init__.py
rename to erpnext/healthcare/doctype/healthcare_practitioner/__init__.py
diff --git a/erpnext/healthcare/doctype/physician/physician.js b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.js
old mode 100755
new mode 100644
similarity index 91%
rename from erpnext/healthcare/doctype/physician/physician.js
rename to erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.js
index 0b1a077e243..f2dc849150a
--- a/erpnext/healthcare/doctype/physician/physician.js
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.js
@@ -1,7 +1,7 @@
// Copyright (c) 2016, ESS LLP and contributors
// For license information, please see license.txt
-frappe.ui.form.on('Physician', {
+frappe.ui.form.on('Healthcare Practitioner', {
setup: function(frm) {
frm.set_query('account', 'accounts', function(doc, cdt, cdn) {
var d = locals[cdt][cdn];
@@ -15,11 +15,11 @@ frappe.ui.form.on('Physician', {
});
},
refresh: function(frm) {
- frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Physician'};
+ frappe.dynamic_link = {doc: frm.doc, fieldname: 'name', doctype: 'Healthcare Practitioner'};
if(!frm.is_new()) {
frappe.contacts.render_address_and_contact(frm);
}
- frm.set_query("service_unit", "physician_schedules", function(){
+ frm.set_query("service_unit", "practitioner_schedules", function(){
return {
filters: {
"is_group": false,
@@ -30,7 +30,7 @@ frappe.ui.form.on('Physician', {
}
});
-frappe.ui.form.on("Physician", "user_id",function(frm) {
+frappe.ui.form.on("Healthcare Practitioner", "user_id",function(frm) {
if(frm.doc.user_id){
frappe.call({
"method": "frappe.client.get",
@@ -64,7 +64,7 @@ frappe.ui.form.on("Physician", "user_id",function(frm) {
}
});
-frappe.ui.form.on("Physician", "employee", function(frm) {
+frappe.ui.form.on("Healthcare Practitioner", "employee", function(frm) {
if(frm.doc.employee){
frappe.call({
"method": "frappe.client.get",
diff --git a/erpnext/healthcare/doctype/physician/physician.json b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
similarity index 95%
rename from erpnext/healthcare/doctype/physician/physician.json
rename to erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
index 7fb1a564d78..e7c575da9c4 100644
--- a/erpnext/healthcare/doctype/physician/physician.json
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.json
@@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -45,6 +46,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -76,6 +78,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -107,6 +110,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -138,6 +142,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -170,6 +175,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -202,6 +208,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -234,6 +241,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -266,6 +274,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -296,6 +305,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -327,6 +337,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -358,6 +369,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -389,6 +401,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -420,6 +433,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -451,11 +465,12 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "physician_schedules",
+ "fieldname": "practitioner_schedules",
"fieldtype": "Table",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -464,10 +479,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Physician Schedules",
+ "label": "Practitioner Schedules",
"length": 0,
"no_copy": 0,
- "options": "Physician Service Unit Schedule",
+ "options": "Practitioner Service Unit Schedule",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -483,6 +498,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -514,6 +530,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -546,6 +563,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -577,6 +595,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -608,6 +627,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -638,6 +658,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -669,6 +690,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -700,6 +722,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -732,6 +755,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -774,16 +798,15 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-03-09 15:25:43.166877",
+ "modified": "2018-07-10 11:18:58.760297",
"modified_by": "Administrator",
"module": "Healthcare",
- "name": "Physician",
+ "name": "Healthcare Practitioner",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 0,
@@ -803,7 +826,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
@@ -823,7 +845,6 @@
},
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/healthcare/doctype/physician/physician.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
similarity index 63%
rename from erpnext/healthcare/doctype/physician/physician.py
rename to erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
index eb03083a498..753ecd148a1 100644
--- a/erpnext/healthcare/doctype/physician/physician.py
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py
@@ -10,12 +10,12 @@ from frappe.utils import cstr
from erpnext.accounts.party import validate_party_accounts
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
-class Physician(Document):
+class HealthcarePractitioner(Document):
def onload(self):
load_address_and_contact(self)
def autoname(self):
- # physician first_name and last_name
+ # practitioner first_name and last_name
self.name = " ".join(filter(None,
[cstr(self.get(f)).strip() for f in ["first_name","middle_name","last_name"]]))
@@ -25,20 +25,20 @@ class Physician(Document):
if self.user_id:
self.validate_for_enabled_user_id()
self.validate_duplicate_user_id()
- existing_user_id = frappe.db.get_value("Physician", self.name, "user_id")
+ existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
if self.user_id != existing_user_id:
frappe.permissions.remove_user_permission(
- "Physician", self.name, existing_user_id)
+ "Healthcare Practitioner", self.name, existing_user_id)
else:
- existing_user_id = frappe.db.get_value("Physician", self.name, "user_id")
+ existing_user_id = frappe.db.get_value("Healthcare Practitioner", self.name, "user_id")
if existing_user_id:
frappe.permissions.remove_user_permission(
- "Physician", self.name, existing_user_id)
+ "Healthcare Practitioner", self.name, existing_user_id)
def on_update(self):
if self.user_id:
- frappe.permissions.add_user_permission("Physician", self.name, self.user_id)
+ frappe.permissions.add_user_permission("Healthcare Practitioner", self.name, self.user_id)
def validate_for_enabled_user_id(self):
@@ -49,11 +49,11 @@ class Physician(Document):
frappe.throw(_("User {0} is disabled").format(self.user_id))
def validate_duplicate_user_id(self):
- physician = frappe.db.sql_list("""select name from `tabPhysician` where
+ practitioner = frappe.db.sql_list("""select name from `tabHealthcare Practitioner` where
user_id=%s and name!=%s""", (self.user_id, self.name))
- if physician:
- throw(_("User {0} is already assigned to Physician {1}").format(
- self.user_id, physician[0]), frappe.DuplicateEntryError)
+ if practitioner:
+ throw(_("User {0} is already assigned to Healthcare Practitioner {1}").format(
+ self.user_id, practitioner[0]), frappe.DuplicateEntryError)
def on_trash(self):
- delete_contact_and_address('Physician', self.name)
+ delete_contact_and_address('Healthcare Practitioner', self.name)
diff --git a/erpnext/healthcare/doctype/physician/physician_dashboard.py b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
similarity index 57%
rename from erpnext/healthcare/doctype/physician/physician_dashboard.py
rename to erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
index ee8f774cf50..3c01ab02d8f 100644
--- a/erpnext/healthcare/doctype/physician/physician_dashboard.py
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/healthcare_practitioner_dashboard.py
@@ -3,12 +3,12 @@ from frappe import _
def get_data():
return {
'heatmap': True,
- 'heatmap_message': _('This is based on transactions against this Physician.'),
- 'fieldname': 'physician',
+ 'heatmap_message': _('This is based on transactions against this Healthcare Practitioner.'),
+ 'fieldname': 'practitioner',
'transactions': [
{
- 'label': _('Appointments and Consultations'),
- 'items': ['Patient Appointment', 'Consultation']
+ 'label': _('Appointments and Patient Encounters'),
+ 'items': ['Patient Appointment', 'Patient Encounter']
},
{
'label': _('Lab Tests'),
diff --git a/erpnext/healthcare/doctype/physician/test_physician.js b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.js
similarity index 67%
rename from erpnext/healthcare/doctype/physician/test_physician.js
rename to erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.js
index 43750acaacf..75aa208ec16 100644
--- a/erpnext/healthcare/doctype/physician/test_physician.js
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Physician", function (assert) {
+QUnit.test("test: Healthcare Practitioner", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
- // insert a new Physician
- () => frappe.tests.make('Physician', [
+ // insert a new Healthcare Practitioner
+ () => frappe.tests.make('Healthcare Practitioner', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py
new file mode 100644
index 00000000000..de8201b1517
--- /dev/null
+++ b/erpnext/healthcare/doctype/healthcare_practitioner/test_healthcare_practitioner.py
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+import unittest
+
+class TestHealthcarePractitioner(unittest.TestCase):
+ pass
diff --git a/erpnext/healthcare/doctype/physician/__init__.py b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/__init__.py
similarity index 100%
rename from erpnext/healthcare/doctype/physician/__init__.py
rename to erpnext/healthcare/doctype/healthcare_schedule_time_slot/__init__.py
diff --git a/erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.json b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.json
similarity index 94%
rename from erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.json
rename to erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.json
index 8aece2bf952..9faa5b2f037 100644
--- a/erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.json
+++ b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.json
@@ -41,6 +41,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -71,6 +72,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
@@ -101,6 +103,7 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -114,10 +117,10 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2017-07-12 14:28:01.985998",
+ "modified": "2018-05-08 13:45:57.226530",
"modified_by": "Administrator",
"module": "Healthcare",
- "name": "Physician Schedule Time Slot",
+ "name": "Healthcare Schedule Time Slot",
"name_case": "",
"owner": "rmehta@gmail.com",
"permissions": [],
diff --git a/erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.py b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py
similarity index 61%
rename from erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.py
rename to erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py
index abdce51b9a5..e58ea53c2cd 100644
--- a/erpnext/healthcare/doctype/physician_schedule_time_slot/physician_schedule_time_slot.py
+++ b/erpnext/healthcare/doctype/healthcare_schedule_time_slot/healthcare_schedule_time_slot.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
-class PhysicianScheduleTimeSlot(Document):
+class HealthcareScheduleTimeSlot(Document):
pass
diff --git a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.json b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.json
index d11ecdc0535..dbb5b20fd6b 100644
--- a/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.json
+++ b/erpnext/healthcare/doctype/healthcare_service_unit/healthcare_service_unit.json
@@ -380,7 +380,7 @@
"print": 1,
"read": 1,
"report": 1,
- "role": "Medical Administrator",
+ "role": "Healthcare Administrator",
"set_user_permissions": 0,
"share": 1,
"submit": 0,
@@ -417,4 +417,4 @@
"title_field": "healthcare_service_unit_name",
"track_changes": 1,
"track_seen": 0
-}
\ No newline at end of file
+}
diff --git a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
index 7d9f2c78513..0bd8534f95b 100644
--- a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
+++ b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.json
@@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,10 +41,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +74,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -103,10 +108,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -134,10 +141,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -163,10 +172,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -193,10 +204,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -225,10 +238,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -242,7 +257,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Consultations in valid days",
+ "label": "Patient Encounters in valid days",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -255,10 +270,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -285,10 +302,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -315,10 +334,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -345,10 +366,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -377,10 +400,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -407,15 +432,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "default": "Hello {{doc.patient}}, You have scheduled an appointment with {{doc.physician}} by {{doc.start_dt}} at {{doc.company}}.\nThank you, Good day!",
+ "default": "Hello {{doc.patient}}, You have scheduled an appointment with {{doc.practitioner}} by {{doc.start_dt}} at {{doc.company}}.\nThank you, Good day!",
"depends_on": "app_con",
"fieldname": "app_con_msg",
"fieldtype": "Small Text",
@@ -439,10 +466,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -471,10 +500,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -500,10 +531,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -530,15 +563,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "default": "Hello {{doc.patient}}, You have an appointment with {{doc.physician}} by {{doc.appointment_time}} at {{doc.company}}.\nThank you, Good day!\n",
+ "default": "Hello {{doc.patient}}, You have an appointment with {{doc.practitioner}} by {{doc.appointment_time}} at {{doc.company}}.\nThank you, Good day!\n",
"depends_on": "app_rem",
"fieldname": "app_rem_msg",
"fieldtype": "Small Text",
@@ -562,10 +597,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -593,15 +630,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
- "description": "Default income accounts to be used if not set in Physician to book Consultation charges.",
+ "description": "Default income accounts to be used if not set in Healthcare Practitioner to book Appointment charges.",
"fieldname": "sb_in_ac",
"fieldtype": "Section Break",
"hidden": 0,
@@ -624,10 +663,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -655,15 +696,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
"columns": 0,
- "description": "Default receivable accounts to be used if not set in Patient to book Consultation charges.",
+ "description": "Default receivable accounts to be used if not set in Patient to book Appointment charges.",
"fieldname": "sb_r_ac",
"fieldtype": "Section Break",
"hidden": 0,
@@ -686,10 +729,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -717,10 +762,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -747,10 +794,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -778,10 +827,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -808,10 +859,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -837,10 +890,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -868,10 +923,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -899,10 +956,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -929,10 +988,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -960,10 +1021,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -989,10 +1052,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -1020,6 +1085,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -1033,7 +1099,7 @@
"issingle": 1,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-05 11:36:44.087182",
+ "modified": "2018-07-16 14:00:04.171717",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Healthcare Settings",
@@ -1042,7 +1108,6 @@
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py
index ae7c4c58a63..3a142f55dcf 100644
--- a/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py
+++ b/erpnext/healthcare/doctype/healthcare_settings/healthcare_settings.py
@@ -50,9 +50,9 @@ def get_receivable_account(company):
return receivable_account
return frappe.db.get_value("Company", company, "default_receivable_account")
-def get_income_account(physician, company):
- if(physician):
- income_account = get_account("Physician", None, physician, company)
+def get_income_account(practitioner, company):
+ if(practitioner):
+ income_account = get_account("Healthcare Practitioner", None, practitioner, company)
if income_account:
return income_account
income_account = get_account(None, "income_account", "Healthcare Settings", company)
diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.js b/erpnext/healthcare/doctype/lab_test/lab_test.js
index 02aa001127c..c3b069d049a 100644
--- a/erpnext/healthcare/doctype/lab_test/lab_test.js
+++ b/erpnext/healthcare/doctype/lab_test/lab_test.js
@@ -30,7 +30,7 @@ frappe.ui.form.on('Lab Test', {
});
}
if(frm.doc.__islocal){
- frm.add_custom_button(__('Get from Consultation'), function () {
+ frm.add_custom_button(__('Get from Patient Encounter'), function () {
get_lab_test_prescribed(frm);
});
}
@@ -60,7 +60,7 @@ frappe.ui.form.on('Lab Test', {
},
onload: function (frm) {
- frm.add_fetch("physician", "department", "department");
+ frm.add_fetch("practitioner", "department", "department");
if(frm.doc.employee){
frappe.call({
method: "frappe.client.get",
@@ -160,21 +160,21 @@ var show_lab_tests = function(frm, result){
$.each(result, function(x, y){
var row = $(repl('
', {name:y[0], procedure_template: y[1],
- consultation:y[2], consulting_physician:y[3], consultation_date:y[4],
- physician:y[5]? y[5]:'', date: y[6]? y[6]:'', department: y[7]? y[7]:''})).appendTo(html_field);
+ encounter:y[2], consulting_practitioner:y[3], encounter_date:y[4],
+ practitioner:y[5]? y[5]:'', date: y[6]? y[6]:'', department: y[7]? y[7]:''})).appendTo(html_field);
row.find("a").click(function() {
frm.doc.procedure_template = $(this).attr("data-procedure-template");
frm.doc.procedure_prescription = $(this).attr("data-name");
- frm.doc.physician = $(this).attr("data-physician");
+ frm.doc.practitioner = $(this).attr("data-practitioner");
frm.doc.appointment_date = $(this).attr("data-date");
frm.doc.department = $(this).attr("data-department");
refresh_field("procedure_template");
refresh_field("procedure_prescription");
refresh_field("appointment_date");
- refresh_field("physician");
+ refresh_field("practitioner");
refresh_field("department");
d.hide();
return false;
@@ -295,10 +295,10 @@ var btn_create_procedure = function(frm){
});
};
-var btn_create_consultation = function(frm){
+var btn_create_encounter = function(frm){
var doc = frm.doc;
frappe.call({
- method:"erpnext.healthcare.doctype.patient_appointment.patient_appointment.create_consultation",
+ method:"erpnext.healthcare.doctype.patient_appointment.patient_appointment.create_encounter",
args: {appointment: doc.name},
callback: function(data){
if(!data.exc){
@@ -338,7 +338,7 @@ var btn_update_status = function(frm, status){
);
};
-var btn_invoice_consultation = function(frm){
+var btn_invoice_encounter = function(frm){
frappe.call({
doc: frm.doc,
method:"create_invoice",
@@ -353,13 +353,13 @@ var btn_invoice_consultation = function(frm){
});
};
-frappe.ui.form.on("Patient Appointment", "physician", function(frm) {
- if(frm.doc.physician){
+frappe.ui.form.on("Patient Appointment", "practitioner", function(frm) {
+ if(frm.doc.practitioner){
frappe.call({
"method": "frappe.client.get",
args: {
- doctype: "Physician",
- name: frm.doc.physician
+ doctype: "Healthcare Practitioner",
+ name: frm.doc.practitioner
},
callback: function (data) {
frappe.model.set_value(frm.doctype,frm.docname, "department",data.message.department);
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
index 3c087eaf437..f88a1e09784 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.json
@@ -15,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -42,11 +43,12 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -74,16 +76,17 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "physician",
+ "fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
@@ -92,10 +95,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
- "label": "Physician",
+ "label": "Healthcare Practitioner",
"length": 0,
"no_copy": 0,
- "options": "Physician",
+ "options": "Healthcare Practitioner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -106,16 +109,17 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "get_procedure_from_consultation",
+ "fieldname": "get_procedure_from_encounter",
"fieldtype": "Button",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -137,11 +141,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -169,11 +174,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -201,11 +207,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -232,11 +239,12 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -263,11 +271,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -295,11 +304,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -327,11 +337,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -359,11 +370,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -391,17 +403,18 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"depends_on": "",
- "fetch_from": "patient.patient_name",
+ "fetch_from": "patient.patient_name",
"fieldname": "patient_name",
"fieldtype": "Data",
"hidden": 0,
@@ -425,16 +438,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "patient.sex",
+ "fetch_from": "patient.sex",
"fieldname": "patient_sex",
"fieldtype": "Data",
"hidden": 0,
@@ -458,11 +472,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -490,11 +505,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -523,11 +539,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -555,11 +572,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -586,11 +604,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -617,11 +636,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -647,11 +667,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -679,11 +700,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -711,11 +733,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -742,11 +765,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -773,16 +797,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "referring_physician",
+ "fieldname": "referring_practitioner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 1,
@@ -791,10 +816,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Referring Physician",
+ "label": "Referring Practitioner",
"length": 0,
"no_copy": 0,
- "options": "Physician",
+ "options": "Healthcare Practitioner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -805,11 +830,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 1,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -837,7 +863,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -851,7 +877,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-05-16 22:43:39.359254",
+ "modified": "2018-07-16 12:48:28.394133",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Patient Appointment",
@@ -920,7 +946,7 @@
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Healthcare",
- "search_fields": "patient, physician, department, appointment_date, appointment_time",
+ "search_fields": "patient, practitioner, department, appointment_date, appointment_time",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
index a9561a0f234..d535beca569 100755
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment.py
@@ -28,7 +28,7 @@ class PatientAppointment(Document):
frappe.db.set_value("Procedure Prescription", self.procedure_prescription, "appointment_booked", True)
# Check fee validity exists
appointment = self
- validity_exist = validity_exists(appointment.physician, appointment.patient)
+ validity_exist = validity_exists(appointment.practitioner, appointment.patient)
if validity_exist:
fee_validity = frappe.get_doc("Fee Validity", validity_exist[0][0])
@@ -64,11 +64,11 @@ def appointment_cancel(appointment_id):
@frappe.whitelist()
-def get_availability_data(date, physician):
+def get_availability_data(date, practitioner):
"""
- Get availability data of 'physician' on 'date'
+ Get availability data of 'practitioner' on 'date'
:param date: Date to check in schedule
- :param physician: Name of the physician
+ :param practitioner: Name of the practitioner
:return: dict containing a list of available slots, list of appointments and time of appointments
"""
@@ -77,21 +77,21 @@ def get_availability_data(date, physician):
available_slots = []
slot_details = []
- physician_schedule = None
+ practitioner_schedule = None
employee = None
- physician_obj = frappe.get_doc("Physician", physician)
+ practitioner_obj = frappe.get_doc("Healthcare Practitioner", practitioner)
- # Get Physician employee relation
- if physician_obj.employee:
- employee = physician_obj.employee
- elif physician_obj.user_id:
+ # Get practitioner employee relation
+ if practitioner_obj.employee:
+ employee = practitioner_obj.employee
+ elif practitioner_obj.user_id:
if frappe.db.exists({
"doctype": "Employee",
- "user_id": physician_obj.user_id
+ "user_id": practitioner_obj.user_id
}):
- employee = frappe.get_doc("Employee", {"user_id": physician_obj.user_id}).name
+ employee = frappe.get_doc("Employee", {"user_id": practitioner_obj.user_id}).name
if employee:
# Check if it is Holiday
@@ -104,21 +104,21 @@ def get_availability_data(date, physician):
and docstatus = 1""", (employee, date), as_dict=True)
if leave_record:
if leave_record[0].half_day:
- frappe.throw(_("Dr {0} on Half day Leave on {1}").format(physician, date))
+ frappe.throw(_("{0} on Half day Leave on {1}").format(practitioner, date))
else:
- frappe.throw(_("Dr {0} on Leave on {1}").format(physician, date))
+ frappe.throw(_("{0} on Leave on {1}").format(practitioner, date))
- # get physicians schedule
- if physician_obj.physician_schedules:
- for schedule in physician_obj.physician_schedules:
+ # get practitioners schedule
+ if practitioner_obj.practitioner_schedules:
+ for schedule in practitioner_obj.practitioner_schedules:
if schedule.schedule:
- physician_schedule = frappe.get_doc("Physician Schedule", schedule.schedule)
+ practitioner_schedule = frappe.get_doc("Practitioner Schedule", schedule.schedule)
else:
- frappe.throw(_("Dr {0} does not have a Physician Schedule. Add it in Physician master".format(physician)))
+ frappe.throw(_("{0} does not have a Healthcare Practitioner Schedule. Add it in Healthcare Practitioner master".format(practitioner)))
- if physician_schedule:
+ if practitioner_schedule:
available_slots = []
- for t in physician_schedule.time_slots:
+ for t in practitioner_schedule.time_slots:
if weekday == t.day:
available_slots.append(t)
@@ -129,10 +129,10 @@ def get_availability_data(date, physician):
slot_name = schedule.schedule+" - "+schedule.service_unit
allow_overlap = frappe.get_value('Healthcare Service Unit', schedule.service_unit, 'overlap_appointments')
if allow_overlap:
- # fetch all appointments to physician by service unit
+ # fetch all appointments to practitioner by service unit
appointments = frappe.get_all(
"Patient Appointment",
- filters={"physician": physician, "service_unit": schedule.service_unit, "appointment_date": date, "status": ["not in",["Cancelled"]]},
+ filters={"practitioner": practitioner, "service_unit": schedule.service_unit, "appointment_date": date, "status": ["not in",["Cancelled"]]},
fields=["name", "appointment_time", "duration", "status"])
else:
# fetch all appointments to service unit
@@ -142,21 +142,21 @@ def get_availability_data(date, physician):
fields=["name", "appointment_time", "duration", "status"])
else:
slot_name = schedule.schedule
- # fetch all appointments to physician without service unit
+ # fetch all appointments to practitioner without service unit
appointments = frappe.get_all(
"Patient Appointment",
- filters={"physician": physician, "service_unit": '', "appointment_date": date, "status": ["not in",["Cancelled"]]},
+ filters={"practitioner": practitioner, "service_unit": '', "appointment_date": date, "status": ["not in",["Cancelled"]]},
fields=["name", "appointment_time", "duration", "status"])
slot_details.append({"slot_name":slot_name, "service_unit":schedule.service_unit,
"avail_slot":available_slots, 'appointments': appointments})
else:
- frappe.throw(_("Dr {0} does not have a Physician Schedule. Add it in Physician master".format(physician)))
+ frappe.throw(_("{0} does not have a Healthcare Practitioner Schedule. Add it in Healthcare Practitioner master".format(practitioner)))
if not available_slots and not slot_details:
# TODO: return available slots in nearby dates
- frappe.throw(_("Physician not available on {0}").format(weekday))
+ frappe.throw(_("Healthcare Practitioner not available on {0}").format(weekday))
return {
"slot_details": slot_details
@@ -210,37 +210,37 @@ def invoice_appointment(appointment_doc):
sales_invoice.company = appointment_doc.company
sales_invoice.debit_to = get_receivable_account(appointment_doc.company)
- fee_validity = get_fee_validity(appointment_doc.physician, appointment_doc.patient, appointment_doc.appointment_date)
+ fee_validity = get_fee_validity(appointment_doc.practitioner, appointment_doc.patient, appointment_doc.appointment_date)
procedure_template = False
if appointment_doc.procedure_template:
procedure_template = appointment_doc.procedure_template
- create_invoice_items(appointment_doc.physician, appointment_doc.company, sales_invoice, procedure_template)
+ create_invoice_items(appointment_doc.practitioner, appointment_doc.company, sales_invoice, procedure_template)
sales_invoice.save(ignore_permissions=True)
frappe.db.sql("""update `tabPatient Appointment` set sales_invoice=%s where name=%s""", (sales_invoice.name, appointment_doc.name))
frappe.db.set_value("Fee Validity", fee_validity.name, "ref_invoice", sales_invoice.name)
- consultation = frappe.db.exists({
- "doctype": "Consultation",
+ encounter = frappe.db.exists({
+ "doctype": "Patient Encounter",
"appointment": appointment_doc.name})
- if consultation:
- frappe.db.set_value("Consultation", consultation[0][0], "invoice", sales_invoice.name)
+ if encounter:
+ frappe.db.set_value("Patient Encounter", encounter[0][0], "invoice", sales_invoice.name)
return sales_invoice.name
-def get_fee_validity(physician, patient, date):
- validity_exist = validity_exists(physician, patient)
+def get_fee_validity(practitioner, patient, date):
+ validity_exist = validity_exists(practitioner, patient)
if validity_exist:
fee_validity = frappe.get_doc("Fee Validity", validity_exist[0][0])
fee_validity = update_fee_validity(fee_validity, date)
else:
- fee_validity = create_fee_validity(physician, patient, date)
+ fee_validity = create_fee_validity(practitioner, patient, date)
return fee_validity
-def validity_exists(physician, patient):
+def validity_exists(practitioner, patient):
return frappe.db.exists({
"doctype": "Fee Validity",
- "physician": physician,
+ "practitioner": practitioner,
"patient": patient})
@@ -260,15 +260,15 @@ def update_fee_validity(fee_validity, date):
return fee_validity
-def create_fee_validity(physician, patient, date):
+def create_fee_validity(practitioner, patient, date):
fee_validity = frappe.new_doc("Fee Validity")
- fee_validity.physician = physician
+ fee_validity.practitioner = practitioner
fee_validity.patient = patient
fee_validity = update_fee_validity(fee_validity, date)
return fee_validity
-def create_invoice_items(physician, company, invoice, procedure_template):
+def create_invoice_items(practitioner, company, invoice, procedure_template):
item_line = invoice.append("items")
if procedure_template:
procedure_template_obj = frappe.get_doc("Clinical Procedure Template", procedure_template)
@@ -277,11 +277,11 @@ def create_invoice_items(physician, company, invoice, procedure_template):
item_line.description = procedure_template_obj.description
else:
item_line.item_name = "Consulting Charges"
- item_line.description = "Consulting Charges: " + physician
+ item_line.description = "Consulting Charges: " + practitioner
item_line.uom = "Nos"
item_line.conversion_factor = 1
- item_line.income_account = get_income_account(physician, company)
- op_consulting_charge = frappe.db.get_value("Physician", physician, "op_consulting_charge")
+ item_line.income_account = get_income_account(practitioner, company)
+ op_consulting_charge = frappe.db.get_value("Healthcare Practitioner", practitioner, "op_consulting_charge")
if op_consulting_charge:
item_line.rate = op_consulting_charge
item_line.amount = op_consulting_charge
@@ -292,18 +292,18 @@ def create_invoice_items(physician, company, invoice, procedure_template):
@frappe.whitelist()
-def create_consultation(appointment):
+def create_encounter(appointment):
appointment = frappe.get_doc("Patient Appointment", appointment)
- consultation = frappe.new_doc("Consultation")
- consultation.appointment = appointment.name
- consultation.patient = appointment.patient
- consultation.physician = appointment.physician
- consultation.visit_department = appointment.department
- consultation.patient_sex = appointment.patient_sex
- consultation.consultation_date = appointment.appointment_date
+ encounter = frappe.new_doc("Patient Encounter")
+ encounter.appointment = appointment.name
+ encounter.patient = appointment.patient
+ encounter.practitioner = appointment.practitioner
+ encounter.visit_department = appointment.department
+ encounter.patient_sex = appointment.patient_sex
+ encounter.encounter_date = appointment.appointment_date
if appointment.sales_invoice:
- consultation.invoice = appointment.sales_invoice
- return consultation.as_dict()
+ encounter.invoice = appointment.sales_invoice
+ return encounter.as_dict()
def remind_appointment():
@@ -347,7 +347,7 @@ def get_events(start, end, filters=None):
"""
from frappe.desk.calendar import get_event_conditions
conditions = get_event_conditions("Patient Appointment", filters)
- data = frappe.db.sql("""select `tabPatient Appointment`.name, patient, physician, status,
+ data = frappe.db.sql("""select `tabPatient Appointment`.name, patient, practitioner, status,
duration, timestamp(appointment_date, appointment_time) as 'start', type.color as 'color'
from `tabPatient Appointment`
left join `tabAppointment Type` as type on `tabPatient Appointment`.appointment_type=type.name
@@ -360,8 +360,8 @@ def get_events(start, end, filters=None):
return data
@frappe.whitelist()
def get_procedure_prescribed(patient):
- return frappe.db.sql("""select pp.name, pp.procedure, pp.parent, ct.physician,
- ct.consultation_date, pp.physician, pp.date, pp.department
- from tabConsultation ct, `tabProcedure Prescription` pp
+ return frappe.db.sql("""select pp.name, pp.procedure, pp.parent, ct.practitioner,
+ ct.encounter_date, pp.practitioner, pp.date, pp.department
+ from `tabPatient Encounter` ct, `tabProcedure Prescription` pp
where ct.patient='{0}' and pp.parent=ct.name and pp.appointment_booked=0
order by ct.creation desc""".format(patient))
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
index dfff5a4f6eb..fc674a8a3e1 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_calendar.js
@@ -14,9 +14,9 @@ frappe.views.calendar["Patient Appointment"] = {
filters: [
{
'fieldtype': 'Link',
- 'fieldname': 'physician',
- 'options': 'Physician',
- 'label': __('Physician')
+ 'fieldname': 'practitioner',
+ 'options': 'Healthcare Practitioner',
+ 'label': __('Healthcare Practitioner')
},
{
'fieldtype': 'Link',
@@ -43,4 +43,4 @@ frappe.views.calendar["Patient Appointment"] = {
'label': __('Status')
}
]
-};
\ No newline at end of file
+};
diff --git a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
index 1862915cfca..f9ef1cbe779 100644
--- a/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
+++ b/erpnext/healthcare/doctype/patient_appointment/patient_appointment_dashboard.py
@@ -9,7 +9,7 @@ def get_data():
'transactions': [
{
'label': _('Consultations'),
- 'items': ['Consultation', 'Vital Signs', 'Patient Medical Record']
+ 'items': ['Patient Encounter', 'Vital Signs', 'Patient Medical Record']
},
{
'label': _('Billing'),
diff --git a/erpnext/healthcare/doctype/physician_schedule/__init__.py b/erpnext/healthcare/doctype/patient_encounter/__init__.py
similarity index 100%
rename from erpnext/healthcare/doctype/physician_schedule/__init__.py
rename to erpnext/healthcare/doctype/patient_encounter/__init__.py
diff --git a/erpnext/healthcare/doctype/consultation/consultation.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js
similarity index 86%
rename from erpnext/healthcare/doctype/consultation/consultation.js
rename to erpnext/healthcare/doctype/patient_encounter/patient_encounter.js
index 727d1754088..a9b45ac4e7b 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.js
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.js
@@ -1,7 +1,7 @@
// Copyright (c) 2016, ESS LLP and contributors
// For license information, please see license.txt
-frappe.ui.form.on('Consultation', {
+frappe.ui.form.on('Patient Encounter', {
setup: function(frm) {
frm.get_field('drug_prescription').grid.editable_fields = [
{fieldname: 'drug_code', columns: 2},
@@ -75,7 +75,7 @@ frappe.ui.form.on('Consultation', {
});
if(!frm.doc.__islocal && !frm.doc.invoice && (frappe.user.has_role("Accounts User"))){
frm.add_custom_button(__('Invoice'), function() {
- btn_invoice_consultation(frm);
+ btn_invoice_encounter(frm);
},__("Create"));
}
frm.set_df_property("appointment", "read_only", frm.doc.__islocal ? 0:1);
@@ -83,19 +83,19 @@ frappe.ui.form.on('Consultation', {
frm.set_df_property("patient_age", "read_only", frm.doc.__islocal ? 0:1);
frm.set_df_property("patient_sex", "read_only", frm.doc.__islocal ? 0:1);
frm.set_df_property("type", "read_only", frm.doc.__islocal ? 0:1);
- frm.set_df_property("physician", "read_only", frm.doc.__islocal ? 0:1);
+ frm.set_df_property("practitioner", "read_only", frm.doc.__islocal ? 0:1);
frm.set_df_property("visit_department", "read_only", frm.doc.__islocal ? 0:1);
- frm.set_df_property("consultation_date", "read_only", frm.doc.__islocal ? 0:1);
- frm.set_df_property("consultation_time", "read_only", frm.doc.__islocal ? 0:1);
+ frm.set_df_property("encounter_date", "read_only", frm.doc.__islocal ? 0:1);
+ frm.set_df_property("encounter_time", "read_only", frm.doc.__islocal ? 0:1);
}
});
-var btn_invoice_consultation = function(frm){
+var btn_invoice_encounter = function(frm){
var doc = frm.doc;
frappe.call({
method:
- "erpnext.healthcare.doctype.consultation.consultation.create_invoice",
- args: {company: doc.company, patient: doc.patient, physician: doc.physician, consultation_id: doc.name },
+ "erpnext.healthcare.doctype.encounter.encounter.create_invoice",
+ args: {company: doc.company, patient: doc.patient, practitioner: doc.practitioner, encounter_id: doc.name },
callback: function(data){
if(!data.exc){
if(data.message){
@@ -142,7 +142,7 @@ var btn_create_procedure = function (frm) {
frappe.new_doc("Clinical Procedure");
};
-frappe.ui.form.on("Consultation", "appointment", function(frm){
+frappe.ui.form.on("Patient Encounter", "appointment", function(frm){
if(frm.doc.appointment){
frappe.call({
"method": "frappe.client.get",
@@ -153,20 +153,20 @@ frappe.ui.form.on("Consultation", "appointment", function(frm){
callback: function (data) {
frappe.model.set_value(frm.doctype,frm.docname, "patient", data.message.patient);
frappe.model.set_value(frm.doctype,frm.docname, "type", data.message.appointment_type);
- frappe.model.set_value(frm.doctype,frm.docname, "physician", data.message.physician);
+ frappe.model.set_value(frm.doctype,frm.docname, "practitioner", data.message.practitioner);
frappe.model.set_value(frm.doctype,frm.docname, "invoice", data.message.sales_invoice);
}
});
}
});
-frappe.ui.form.on("Consultation", "physician", function(frm) {
- if(frm.doc.physician){
+frappe.ui.form.on("Patient Encounter", "practitioner", function(frm) {
+ if(frm.doc.practitioner){
frappe.call({
"method": "frappe.client.get",
args: {
- doctype: "Physician",
- name: frm.doc.physician
+ doctype: "Healthcare Practitioner",
+ name: frm.doc.practitioner
},
callback: function (data) {
frappe.model.set_value(frm.doctype,frm.docname, "visit_department",data.message.department);
@@ -175,7 +175,7 @@ frappe.ui.form.on("Consultation", "physician", function(frm) {
}
});
-frappe.ui.form.on("Consultation", "symptoms_select", function(frm) {
+frappe.ui.form.on("Patient Encounter", "symptoms_select", function(frm) {
if(frm.doc.symptoms_select){
var symptoms = null;
if(frm.doc.symptoms)
@@ -186,7 +186,7 @@ frappe.ui.form.on("Consultation", "symptoms_select", function(frm) {
frappe.model.set_value(frm.doctype,frm.docname, "symptoms_select", null);
}
});
-frappe.ui.form.on("Consultation", "diagnosis_select", function(frm) {
+frappe.ui.form.on("Patient Encounter", "diagnosis_select", function(frm) {
if(frm.doc.diagnosis_select){
var diagnosis = null;
if(frm.doc.diagnosis)
@@ -198,7 +198,7 @@ frappe.ui.form.on("Consultation", "diagnosis_select", function(frm) {
}
});
-frappe.ui.form.on("Consultation", "patient", function(frm) {
+frappe.ui.form.on("Patient Encounter", "patient", function(frm) {
if(frm.doc.patient){
frappe.call({
"method": "erpnext.healthcare.doctype.patient.patient.get_patient_detail",
diff --git a/erpnext/healthcare/doctype/consultation/consultation.json b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json
similarity index 91%
rename from erpnext/healthcare/doctype/consultation/consultation.json
rename to erpnext/healthcare/doctype/patient_encounter/patient_encounter.json
index 2f6de0cb4a9..1373503d803 100644
--- a/erpnext/healthcare/doctype/consultation/consultation.json
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.json
@@ -15,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -40,10 +41,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -71,10 +74,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -103,10 +108,12 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -134,10 +141,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -165,10 +174,12 @@
"reqd": 1,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -196,10 +207,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -227,15 +240,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "physician",
+ "fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -244,10 +259,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 1,
- "label": "Doctor",
+ "label": "Healthcare Practitioner",
"length": 0,
"no_copy": 0,
- "options": "Physician",
+ "options": "Healthcare Practitioner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -258,10 +273,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -289,10 +306,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -318,10 +337,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -349,16 +370,18 @@
"reqd": 0,
"search_index": 1,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "Today",
- "fieldname": "consultation_date",
+ "fieldname": "encounter_date",
"fieldtype": "Date",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -367,7 +390,7 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Consultation Date",
+ "label": "Encounter Date",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -380,16 +403,18 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
"default": "",
- "fieldname": "consultation_time",
+ "fieldname": "encounter_time",
"fieldtype": "Time",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -398,7 +423,7 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Consultation Time",
+ "label": "Encounter Time",
"length": 0,
"no_copy": 0,
"permlevel": 0,
@@ -411,10 +436,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -442,10 +469,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -472,10 +501,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -503,10 +534,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -533,10 +566,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -564,10 +599,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -594,10 +631,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -626,10 +665,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -657,10 +698,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -689,10 +732,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 1,
@@ -719,10 +764,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -750,10 +797,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -780,10 +829,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -811,10 +862,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -841,10 +894,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -872,10 +927,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -902,10 +959,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -933,15 +992,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "consultation_comment",
+ "fieldname": "encounter_comment",
"fieldtype": "Small Text",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -963,10 +1024,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -983,7 +1046,7 @@
"label": "Amended From",
"length": 0,
"no_copy": 1,
- "options": "Consultation",
+ "options": "Patient Encounter",
"permlevel": 0,
"print_hide": 1,
"print_hide_if_no_value": 0,
@@ -993,6 +1056,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -1006,16 +1070,15 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-03-19 11:35:13.826577",
+ "modified": "2018-07-16 12:51:13.487000",
"modified_by": "Administrator",
"module": "Healthcare",
- "name": "Consultation",
+ "name": "Patient Encounter",
"name_case": "",
"owner": "Administrator",
"permissions": [
{
"amend": 1,
- "apply_user_permissions": 0,
"cancel": 1,
"create": 1,
"delete": 1,
@@ -1038,7 +1101,7 @@
"read_only": 0,
"read_only_onload": 0,
"restrict_to_domain": "Healthcare",
- "search_fields": "patient, physician, visit_department, consultation_date, consultation_time",
+ "search_fields": "patient, practitioner, visit_department, encounter_date, encounter_time",
"show_name_in_global_search": 1,
"sort_field": "modified",
"sort_order": "DESC",
diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
old mode 100755
new mode 100644
similarity index 71%
rename from erpnext/healthcare/doctype/consultation/consultation.py
rename to erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
index ace5ac09b95..3d8f95298bb
--- a/erpnext/healthcare/doctype/consultation/consultation.py
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter.py
@@ -9,14 +9,14 @@ from frappe.utils import getdate, cstr
import json
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
-class Consultation(Document):
+class PatientEncounter(Document):
def on_update(self):
if(self.appointment):
frappe.db.set_value("Patient Appointment", self.appointment, "status", "Closed")
- update_consultation_to_medical_record(self)
+ update_encounter_to_medical_record(self)
def after_insert(self):
- insert_consultation_to_medical_record(self)
+ insert_encounter_to_medical_record(self)
def on_cancel(self):
if(self.appointment):
@@ -62,8 +62,8 @@ def create_drug_invoice(company, patient, prescriptions):
return sales_invoice.as_dict()
@frappe.whitelist()
-def create_invoice(company, patient, physician, consultation_id):
- if not consultation_id:
+def create_invoice(company, patient, practitioner, encounter_id):
+ if not encounter_id:
return False
sales_invoice = frappe.new_doc("Sales Invoice")
sales_invoice.customer = frappe.get_value("Patient", patient, "customer")
@@ -71,61 +71,61 @@ def create_invoice(company, patient, physician, consultation_id):
sales_invoice.is_pos = '0'
sales_invoice.debit_to = get_receivable_account(company)
- create_invoice_items(physician, sales_invoice, company)
+ create_invoice_items(practitioner, sales_invoice, company)
sales_invoice.save(ignore_permissions=True)
- frappe.db.sql("""update tabConsultation set invoice=%s where name=%s""", (sales_invoice.name, consultation_id))
- appointment = frappe.db.get_value("Consultation", consultation_id, "appointment")
+ frappe.db.sql("""update `tabPatient Encounter` set invoice=%s where name=%s""", (sales_invoice.name, encounter_id))
+ appointment = frappe.db.get_value("Patient Encounter", encounter_id, "appointment")
if appointment:
frappe.db.set_value("Patient Appointment", appointment, "sales_invoice", sales_invoice.name)
return sales_invoice.name
-def create_invoice_items(physician, invoice, company):
+def create_invoice_items(practitioner, invoice, company):
item_line = invoice.append("items")
item_line.item_name = "Consulting Charges"
- item_line.description = "Consulting Charges: " + physician
+ item_line.description = "Consulting Charges: " + practitioner
item_line.qty = 1
item_line.uom = "Nos"
item_line.conversion_factor = 1
- item_line.income_account = get_income_account(physician, company)
- op_consulting_charge = frappe.get_value("Physician", physician, "op_consulting_charge")
+ item_line.income_account = get_income_account(practitioner, company)
+ op_consulting_charge = frappe.get_value("Healthcare Practitioner", practitioner, "op_consulting_charge")
if op_consulting_charge:
item_line.rate = op_consulting_charge
item_line.amount = op_consulting_charge
return invoice
-def insert_consultation_to_medical_record(doc):
+def insert_encounter_to_medical_record(doc):
subject = set_subject_field(doc)
medical_record = frappe.new_doc("Patient Medical Record")
medical_record.patient = doc.patient
medical_record.subject = subject
medical_record.status = "Open"
- medical_record.communication_date = doc.consultation_date
- medical_record.reference_doctype = "Consultation"
+ medical_record.communication_date = doc.encounter_date
+ medical_record.reference_doctype = "Patient Encounter"
medical_record.reference_name = doc.name
medical_record.reference_owner = doc.owner
medical_record.save(ignore_permissions=True)
-def update_consultation_to_medical_record(consultation):
- medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s", (consultation.name))
+def update_encounter_to_medical_record(encounter):
+ medical_record_id = frappe.db.sql("select name from `tabPatient Medical Record` where reference_name=%s", (encounter.name))
if medical_record_id and medical_record_id[0][0]:
- subject = set_subject_field(consultation)
+ subject = set_subject_field(encounter)
frappe.db.set_value("Patient Medical Record", medical_record_id[0][0], "subject", subject)
else:
- insert_consultation_to_medical_record(consultation)
+ insert_encounter_to_medical_record(encounter)
-def delete_medical_record(consultation):
- frappe.db.sql("""delete from `tabPatient Medical Record` where reference_name = %s""", (consultation.name))
+def delete_medical_record(encounter):
+ frappe.db.sql("""delete from `tabPatient Medical Record` where reference_name = %s""", (encounter.name))
-def set_subject_field(consultation):
+def set_subject_field(encounter):
subject = "No Diagnosis "
- if(consultation.diagnosis):
- subject = "Diagnosis: \n"+ cstr(consultation.diagnosis)+". "
- if(consultation.drug_prescription):
+ if(encounter.diagnosis):
+ subject = "Diagnosis: \n"+ cstr(encounter.diagnosis)+". "
+ if(encounter.drug_prescription):
subject +="\nDrug(s) Prescribed. "
- if(consultation.test_prescription):
+ if(encounter.test_prescription):
subject += "\nTest(s) Prescribed."
- if(consultation.procedure_prescription):
+ if(encounter.procedure_prescription):
subject += "\nProcedure(s) Prescribed."
return subject
diff --git a/erpnext/healthcare/doctype/consultation/consultation_dashboard.py b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
similarity index 88%
rename from erpnext/healthcare/doctype/consultation/consultation_dashboard.py
rename to erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
index 61708919f63..ec3521175bf 100644
--- a/erpnext/healthcare/doctype/consultation/consultation_dashboard.py
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_dashboard.py
@@ -2,7 +2,7 @@ from frappe import _
def get_data():
return {
- 'fieldname': 'consultation',
+ 'fieldname': 'encounter',
'non_standard_fieldnames': {
'Patient Medical Record': 'reference_name'
},
diff --git a/erpnext/healthcare/doctype/consultation/consultation_list.js b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_list.js
old mode 100755
new mode 100644
similarity index 54%
rename from erpnext/healthcare/doctype/consultation/consultation_list.js
rename to erpnext/healthcare/doctype/patient_encounter/patient_encounter_list.js
index ea3906db7e7..93c02f60c5c
--- a/erpnext/healthcare/doctype/consultation/consultation_list.js
+++ b/erpnext/healthcare/doctype/patient_encounter/patient_encounter_list.js
@@ -1,7 +1,6 @@
/*
(c) ESS 2015-16
*/
-frappe.listview_settings['Consultation'] = {
+frappe.listview_settings['Patient Encounter'] = {
filters:[["docstatus","!=","1"]]
};
-
diff --git a/erpnext/healthcare/doctype/consultation/test_consultation.js b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.js
similarity index 70%
rename from erpnext/healthcare/doctype/consultation/test_consultation.js
rename to erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.js
index 803e73c3814..1baabf7eef7 100644
--- a/erpnext/healthcare/doctype/consultation/test_consultation.js
+++ b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Consultation", function (assert) {
+QUnit.test("test: Patient Encounter", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
- // insert a new Consultation
- () => frappe.tests.make('Consultation', [
+ // insert a new Patient Encounter
+ () => frappe.tests.make('Patient Encounter', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py
new file mode 100644
index 00000000000..f5df152050f
--- /dev/null
+++ b/erpnext/healthcare/doctype/patient_encounter/test_patient_encounter.py
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+import unittest
+
+class TestPatientEncounter(unittest.TestCase):
+ pass
diff --git a/erpnext/healthcare/doctype/physician/test_physician.py b/erpnext/healthcare/doctype/physician/test_physician.py
deleted file mode 100644
index 2fbf5741cf9..00000000000
--- a/erpnext/healthcare/doctype/physician/test_physician.py
+++ /dev/null
@@ -1,20 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2015, ESS LLP and Contributors
-# See license.txt
-from __future__ import unicode_literals
-import unittest
-import frappe
-
-test_dependencies = ['Physician Schedule']
-
-
-class TestPhysician(unittest.TestCase):
- def tearDown(self):
- frappe.delete_doc_if_exists('Physician', '_Testdoctor2', force=1)
-
- def test_new_physician_without_schedule(self):
- physician = frappe.new_doc('Physician')
- physician.first_name = '_Testdoctor2'
-
- physician.insert()
- self.assertEqual(frappe.get_value('Physician', '_Testdoctor2', 'first_name'), '_Testdoctor2')
diff --git a/erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.py b/erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.py
deleted file mode 100644
index ece357882a6..00000000000
--- a/erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.py
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
-# See license.txt
-from __future__ import unicode_literals
-import unittest
-
-class TestPhysicianSchedule(unittest.TestCase):
- pass
diff --git a/erpnext/healthcare/doctype/physician_schedule/test_records.json b/erpnext/healthcare/doctype/physician_schedule/test_records.json
deleted file mode 100644
index 1e6230dd98d..00000000000
--- a/erpnext/healthcare/doctype/physician_schedule/test_records.json
+++ /dev/null
@@ -1,8 +0,0 @@
-[
- {
- "schedule_name": "_Testdoctor1 Schedule"
- },
- {
- "schedule_name": "_Testdoctor2 Schedule"
- }
-]
\ No newline at end of file
diff --git a/erpnext/healthcare/doctype/physician_schedule_time_slot/__init__.py b/erpnext/healthcare/doctype/practitioner_schedule/__init__.py
similarity index 100%
rename from erpnext/healthcare/doctype/physician_schedule_time_slot/__init__.py
rename to erpnext/healthcare/doctype/practitioner_schedule/__init__.py
diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.js
similarity index 97%
rename from erpnext/healthcare/doctype/physician_schedule/physician_schedule.js
rename to erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.js
index c1b5581ff3c..f247856b92f 100644
--- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.js
+++ b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.js
@@ -1,7 +1,7 @@
-// Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
-frappe.ui.form.on('Physician Schedule', {
+frappe.ui.form.on('Practitioner Schedule', {
refresh: function(frm) {
cur_frm.fields_dict["time_slots"].grid.wrapper.find('.grid-add-row').hide();
cur_frm.fields_dict["time_slots"].grid.add_custom_button(__('Add Time Slots'), () => {
diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.json
similarity index 91%
rename from erpnext/healthcare/doctype/physician_schedule/physician_schedule.json
rename to erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.json
index b1b31290217..08a1b86969c 100644
--- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.json
+++ b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.json
@@ -15,6 +15,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,10 +42,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -61,7 +64,7 @@
"label": "Time Slots",
"length": 0,
"no_copy": 0,
- "options": "Physician Schedule Time Slot",
+ "options": "Healthcare Schedule Time Slot",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -72,10 +75,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -102,6 +107,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -115,16 +121,15 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2017-10-05 11:21:54.488194",
+ "modified": "2018-06-29 14:55:34.795995",
"modified_by": "Administrator",
"module": "Healthcare",
- "name": "Physician Schedule",
+ "name": "Practitioner Schedule",
"name_case": "",
"owner": "rmehta@gmail.com",
"permissions": [
{
"amend": 0,
- "apply_user_permissions": 0,
"cancel": 0,
"create": 1,
"delete": 1,
diff --git a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py
similarity index 68%
rename from erpnext/healthcare/doctype/physician_schedule/physician_schedule.py
rename to erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py
index 167e9cd4b82..8bd0937948b 100644
--- a/erpnext/healthcare/doctype/physician_schedule/physician_schedule.py
+++ b/erpnext/healthcare/doctype/practitioner_schedule/practitioner_schedule.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
-
-class PhysicianSchedule(Document):
+class PractitionerSchedule(Document):
def autoname(self):
self.name = self.schedule_name
diff --git a/erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.js b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.js
similarity index 68%
rename from erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.js
rename to erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.js
index c397f18398c..32dac2c6526 100644
--- a/erpnext/healthcare/doctype/physician_schedule/test_physician_schedule.js
+++ b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.js
@@ -2,15 +2,15 @@
// rename this file from _test_[name] to test_[name] to activate
// and remove above this line
-QUnit.test("test: Physician Schedule", function (assert) {
+QUnit.test("test: Practitioner Schedule", function (assert) {
let done = assert.async();
// number of asserts
assert.expect(1);
frappe.run_serially([
- // insert a new Physician Schedule
- () => frappe.tests.make('Physician Schedule', [
+ // insert a new Practitioner Schedule
+ () => frappe.tests.make('Practitioner Schedule', [
// values to be set
{key: 'value'}
]),
diff --git a/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py
new file mode 100644
index 00000000000..52638cb618e
--- /dev/null
+++ b/erpnext/healthcare/doctype/practitioner_schedule/test_practitioner_schedule.py
@@ -0,0 +1,8 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
+# See license.txt
+from __future__ import unicode_literals
+import unittest
+
+class TestPractitionerSchedule(unittest.TestCase):
+ pass
diff --git a/erpnext/healthcare/doctype/physician_service_unit_schedule/__init__.py b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/__init__.py
similarity index 100%
rename from erpnext/healthcare/doctype/physician_service_unit_schedule/__init__.py
rename to erpnext/healthcare/doctype/practitioner_service_unit_schedule/__init__.py
diff --git a/erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.json b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.json
similarity index 91%
rename from erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.json
rename to erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.json
index 7fff2beef1d..f4a80ab0658 100644
--- a/erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.json
+++ b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.json
@@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -30,7 +31,7 @@
"label": "Schedule",
"length": 0,
"no_copy": 0,
- "options": "Physician Schedule",
+ "options": "Practitioner Schedule",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -46,6 +47,7 @@
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -87,10 +89,10 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-02 03:38:09.935153",
+ "modified": "2018-06-29 15:14:18.647514",
"modified_by": "Administrator",
"module": "Healthcare",
- "name": "Physician Service Unit Schedule",
+ "name": "Practitioner Service Unit Schedule",
"name_case": "",
"owner": "Administrator",
"permissions": [],
diff --git a/erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.py b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py
similarity index 60%
rename from erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.py
rename to erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py
index 7aaec4de138..c18a4406cab 100644
--- a/erpnext/healthcare/doctype/physician_service_unit_schedule/physician_service_unit_schedule.py
+++ b/erpnext/healthcare/doctype/practitioner_service_unit_schedule/practitioner_service_unit_schedule.py
@@ -1,9 +1,9 @@
# -*- coding: utf-8 -*-
-# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and contributors
+# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
-class PhysicianServiceUnitSchedule(Document):
+class PractitionerServiceUnitSchedule(Document):
pass
diff --git a/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.json b/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.json
index 73bcf3f1ed6..b4c453280e9 100644
--- a/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.json
+++ b/erpnext/healthcare/doctype/procedure_prescription/procedure_prescription.json
@@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,16 +42,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "procedure.template",
+ "fetch_from": "procedure.template",
"fieldname": "procedure_name",
"fieldtype": "Data",
"hidden": 0,
@@ -74,11 +76,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -106,16 +109,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "physician",
+ "fieldname": "practitioner",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -124,10 +128,10 @@
"in_global_search": 0,
"in_list_view": 1,
"in_standard_filter": 0,
- "label": "Physician",
+ "label": "Referral",
"length": 0,
"no_copy": 0,
- "options": "Physician",
+ "options": "Healthcare Practitioner",
"permlevel": 0,
"precision": "",
"print_hide": 0,
@@ -138,11 +142,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -169,11 +174,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -200,11 +206,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -231,7 +238,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -245,7 +252,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
- "modified": "2018-05-16 22:43:37.924984",
+ "modified": "2018-07-16 13:08:15.499491",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Procedure Prescription",
diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.json b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
index 70a04fa7dc0..761ae6d9145 100644
--- a/erpnext/healthcare/doctype/vital_signs/vital_signs.json
+++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.json
@@ -14,6 +14,7 @@
"fields": [
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -41,16 +42,17 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fetch_from": "patient.patient_name",
+ "fetch_from": "patient.patient_name",
"fieldname": "patient_name",
"fieldtype": "Data",
"hidden": 0,
@@ -74,11 +76,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -106,16 +109,17 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
"columns": 0,
- "fieldname": "consultation",
+ "fieldname": "encounter",
"fieldtype": "Link",
"hidden": 0,
"ignore_user_permissions": 0,
@@ -124,10 +128,10 @@
"in_global_search": 0,
"in_list_view": 0,
"in_standard_filter": 0,
- "label": "Consultation",
+ "label": "Patient Encounter",
"length": 0,
"no_copy": 1,
- "options": "Consultation",
+ "options": "Patient Encounter",
"permlevel": 0,
"precision": "",
"print_hide": 1,
@@ -138,11 +142,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -168,11 +173,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -200,11 +206,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -230,11 +237,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -262,11 +270,12 @@
"reqd": 1,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -293,11 +302,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -325,11 +335,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -357,11 +368,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -389,11 +401,78 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "tongue",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Tongue",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nCoated\nVery Coated\nNormal\nFurry\nCuts",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "abdomen",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Abdomen",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nBloated\nFull\nFluid\nConstipated",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -419,11 +498,45 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
+ "allow_on_submit": 0,
+ "bold": 0,
+ "collapsible": 0,
+ "columns": 0,
+ "fieldname": "reflexes",
+ "fieldtype": "Select",
+ "hidden": 0,
+ "ignore_user_permissions": 0,
+ "ignore_xss_filter": 0,
+ "in_filter": 0,
+ "in_global_search": 0,
+ "in_list_view": 0,
+ "in_standard_filter": 0,
+ "label": "Reflexes",
+ "length": 0,
+ "no_copy": 0,
+ "options": "\nNormal\nHyper\nVery Hyper\nOne Sided",
+ "permlevel": 0,
+ "precision": "",
+ "print_hide": 0,
+ "print_hide_if_no_value": 0,
+ "read_only": 0,
+ "remember_last_selected_value": 0,
+ "report_hide": 0,
+ "reqd": 0,
+ "search_index": 0,
+ "set_only_once": 0,
+ "translatable": 0,
+ "unique": 0
+ },
+ {
+ "allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -450,11 +563,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -482,11 +596,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -514,11 +629,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -545,11 +661,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -576,11 +693,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -607,11 +725,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -638,11 +757,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -670,11 +790,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -700,11 +821,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -731,11 +853,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -763,11 +886,12 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
},
{
"allow_bulk_edit": 0,
+ "allow_in_quick_entry": 0,
"allow_on_submit": 0,
"bold": 0,
"collapsible": 0,
@@ -794,7 +918,7 @@
"reqd": 0,
"search_index": 0,
"set_only_once": 0,
- "translatable": 0,
+ "translatable": 0,
"unique": 0
}
],
@@ -808,7 +932,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
- "modified": "2018-05-16 22:42:54.580491",
+ "modified": "2018-07-16 14:04:09.604470",
"modified_by": "Administrator",
"module": "Healthcare",
"name": "Vital Signs",
diff --git a/erpnext/healthcare/page/appointment_analytic/appointment_analytic.js b/erpnext/healthcare/page/appointment_analytic/appointment_analytic.js
index aeab4fcfd62..9f2e552efcb 100644
--- a/erpnext/healthcare/page/appointment_analytic/appointment_analytic.js
+++ b/erpnext/healthcare/page/appointment_analytic/appointment_analytic.js
@@ -14,7 +14,7 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
title: __("Appointment Analytics"),
parent: $(wrapper).find('.layout-main'),
page: wrapper.page,
- doctypes: ["Patient Appointment", "Physician", "Medical Department", "Appointment Type", "Patient"],
+ doctypes: ["Patient Appointment", "Healthcare Practitioner", "Medical Department", "Appointment Type", "Patient"],
tree_grid: { show: true }
});
@@ -22,16 +22,16 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
"Medical Department": {
label: __("Department"),
show: true,
- item_key: "physician",
+ item_key: "practitioner",
parent_field: "department",
formatter: function(item) {
return item.name;
}
},
- "Physician": {
- label: __("Physician"),
+ "Healthcare Practitioner": {
+ label: __("Healthcare Practitioner"),
show: true,
- item_key: "physician",
+ item_key: "practitioner",
formatter: function(item) {
return item.name;
}
@@ -52,7 +52,7 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
},
filters: [
{fieldtype:"Select", label: __("Tree Type"), fieldname: "tree_type",
- options:["Physician", "Medical Department"], filter: function(val, item, opts, me) {
+ options:["Healthcare Practitioner", "Medical Department"], filter: function(val, item, opts, me) {
return me.apply_zero_filter(val, item, opts, me);}},
{fieldtype:"Select", label: __("Status"), fieldname: "status",
options:[
@@ -64,10 +64,10 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
{label: __("Cancelled"), value: "Cancelled"}]},
{fieldtype:"Select", label: __("Type"), link:"Appointment Type", fieldname: "type",
default_value: __("Select Type...")},
- {fieldtype:"Select", label: __("Physician"), link:"Physician", fieldname: "physician",
- default_value: __("Select Physician..."), filter: function(val, item, opts) {
+ {fieldtype:"Select", label: __("Healthcare Practitioner"), link:"Healthcare Practitioner", fieldname: "practitioner",
+ default_value: __("Select Healthcare Practitioner..."), filter: function(val, item, opts) {
return val == opts.default_value || item.name == val || item._show;
- }, link_formatter: {filter_input: "physician"}},
+ }, link_formatter: {filter_input: "practitioner"}},
{fieldtype:"Select", label: __("Department"), link:"Medical Department", fieldname: "department",
default_value: __("Select Department..."), filter: function(val, item, opts) {
return val == opts.default_value || item.department == val || item._show;
@@ -81,7 +81,7 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
],
setup_filters: function() {
this._super();
- this.trigger_refresh_on_change(["tree_type", "physician", "department", "status", "type"]);
+ this.trigger_refresh_on_change(["tree_type", "practitioner", "department", "status", "type"]);
// this.show_zero_check()
},
@@ -96,10 +96,10 @@ erpnext.AppointmentAnalytics = frappe.views.TreeGridReport.extend({
}
if(!this.data || me.item_type != me.tree_type) {
var items = null;
- if(me.tree_type=='Physician') {
- items = frappe.report_dump.data["Physician"];
+ if(me.tree_type=='Healthcare Practitioner') {
+ items = frappe.report_dump.data["Healthcare Practitioner"];
} if(me.tree_type=='Medical Department') {
- items = this.prepare_tree("Physician", "Medical Department");
+ items = this.prepare_tree("Healthcare Practitioner", "Medical Department");
}
me.item_type = me.tree_type;
me.parent_map = {};
diff --git a/erpnext/healthcare/print_format/consultation_print/consultation_print.json b/erpnext/healthcare/print_format/consultation_print/consultation_print.json
deleted file mode 100644
index 05b8b43bf3f..00000000000
--- a/erpnext/healthcare/print_format/consultation_print/consultation_print.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "align_labels_left": 0,
- "creation": "2017-04-10 14:05:53.355863",
- "custom_format": 1,
- "disabled": 0,
- "doc_type": "Consultation",
- "docstatus": 0,
- "doctype": "Print Format",
- "font": "Default",
- "html": "
\n {% if letter_head and not no_letterhead -%}\n
{{ letter_head }}
\n
\n {% else %}\n
\n
{{doc.name}} \n \n {%- endif %}\n
\n
\n {% if doc.appointment %}\n\t
\n\t\t\t
\n\t\t\tAppointment \n\t\t\t
\n\t\t\t
\n\t\t\t: {{doc.appointment}}\n\t\t\t
\n\t\t
\n\t\t{%- endif -%}\n\n
\n\t\t
\n\t\t\t Patient \n\t\t
\n {% if doc.patient %}\n\t\t
\n\t\t\t : {{doc.patient}}\n\t\t
\n {% else %}\n
\n\t\t\t : Patient Name \n\t\t
\n {%- endif -%}\n\t\t
\n\t
\n\t\t\t
\n\t\t\t\tAge \n\t\t\t
\n\t\t\t
\n\t\t\t : {{doc.patient_age}}\n\t\t\t
\n\t\t
\n\n
\n
\n\t\t\t\tGender \n\t\t\t
\n\t\t\t
\n\t\t\t : {{doc.patient_sex}}\n\t\t\t
\n
\n\n
\n
\n\n
\n\t
\n\t\t Doctor \n\t
\n {% if doc.physician %}\n\t
\n\t\t\t: {{doc.physician}}\n\t
\n {%- endif -%}\n\t
\n\n {% if doc.consultation_date %}\n\t
\n\t\t
\n\t\tDate \n\t\t
\n\t\t
\n\t\t: {{doc.consultation_date}}\n\t\t
\n
\n\t {%- endif -%}\n {% if doc.consultation_time %}\n\t
\n\t\t
\n\t\tTime \n\t\t
\n\t\t
\n\t\t: {{doc.consultation_time}}\n\t\t
\n
\n\t {%- endif -%}\n {% if doc.visit_department %}\n\t
\n\t\t
\n\t\tDepartment \n\t\t
\n\t\t
\n\t\t: {{doc.visit_department}}\n\t\t
\n
\n {%- endif -%}\n
\n\n
\n\n
\n
\n
\n {% if doc.symptoms_in_print%}\n {% if doc.symptoms %}\n Complaints:\n {{doc.symptoms}} \n \t \n {%- endif -%}\n {%- endif -%}\n\n {% if doc.diagnosis_in_print%}\n {% if doc.diagnosis %}\n \t Diagnosis:\n {{doc.diagnosis}} \n \n {%- endif -%}\n {%- endif -%}\n\n\n\n
\n {% if doc.drug_prescription %}\n
\n Rx,\n
\n \n \n\n {%- for row in doc.drug_prescription -%}\n \n \n {%- if row.drug_name -%}{{ row.drug_name }} {%- endif -%}\n \n \t\n {%- if row.dosage -%}{{ row.dosage }}{%- endif -%}\n \n \t\n {%- if row.period -%}{{ row.period }}{%- endif -%}\n\t\t \n \n\t\t\t \n {%- if row.comment -%}{{ row.comment }}{%- endif -%}\n
\n\t\t \n \n\t {%- endfor -%}\n \n
\n\n\n {%- endif -%}\n
\n\n\n
\n {% if doc.test_prescription %}\n Investigations,\n
\n \n \n\n {%- for row in doc.test_prescription -%}\n \n \n {%- if row.test_name -%}{{ row.test_name }} {%- endif -%}\n \n \n\t\t\t \n {%- if row.test_comment -%}{{ row.test_comment }}{%- endif -%}\n
\n\t\t \n \n\n\t {%- endfor -%}\n \n
\n\n\n {%- endif -%}\n
\n
\n {% if doc.consultation_comment %}\n \n {{doc.consultation_comment}}\n {%- endif -%}\n
\n",
- "idx": 0,
- "line_breaks": 0,
- "modified": "2017-05-15 16:36:06.034909",
- "modified_by": "Administrator",
- "module": "Healthcare",
- "name": "Consultation Print",
- "owner": "Administrator",
- "print_format_builder": 0,
- "print_format_type": "Server",
- "show_section_headings": 0,
- "standard": "Yes"
-}
\ No newline at end of file
diff --git a/erpnext/healthcare/print_format/consultation_print/__init__.py b/erpnext/healthcare/print_format/encounter_print/__init__.py
similarity index 100%
rename from erpnext/healthcare/print_format/consultation_print/__init__.py
rename to erpnext/healthcare/print_format/encounter_print/__init__.py
diff --git a/erpnext/healthcare/print_format/encounter_print/encounter_print.json b/erpnext/healthcare/print_format/encounter_print/encounter_print.json
new file mode 100644
index 00000000000..b33c777939d
--- /dev/null
+++ b/erpnext/healthcare/print_format/encounter_print/encounter_print.json
@@ -0,0 +1,22 @@
+{
+ "align_labels_right": 0,
+ "creation": "2017-04-10 14:05:53.355863",
+ "custom_format": 1,
+ "disabled": 0,
+ "doc_type": "Patient Encounter",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "font": "Default",
+ "html": "
\n {% if letter_head and not no_letterhead -%}\n
{{ letter_head }}
\n
\n {% else %}\n
\n
{{doc.name}} \n \n {%- endif %}\n
\n
\n {% if doc.appointment %}\n\t
\n\t\t\t
\n\t\t\tAppointment \n\t\t\t
\n\t\t\t
\n\t\t\t: {{doc.appointment}}\n\t\t\t
\n\t\t
\n\t\t{%- endif -%}\n\n
\n\t\t
\n\t\t\t Patient \n\t\t
\n {% if doc.patient %}\n\t\t
\n\t\t\t : {{doc.patient}}\n\t\t
\n {% else %}\n
\n\t\t\t : Patient Name \n\t\t
\n {%- endif -%}\n\t\t
\n\t
\n\t\t\t
\n\t\t\t\tAge \n\t\t\t
\n\t\t\t
\n\t\t\t : {{doc.patient_age}}\n\t\t\t
\n\t\t
\n\n
\n
\n\t\t\t\tGender \n\t\t\t
\n\t\t\t
\n\t\t\t : {{doc.patient_sex}}\n\t\t\t
\n
\n\n
\n
\n\n
\n\t
\n\t\t Healthcare Practitioner \n\t
\n {% if doc.practitioner %}\n\t
\n\t\t\t: {{doc.practitioner}}\n\t
\n {%- endif -%}\n\t
\n\n {% if doc.encounter_date %}\n\t
\n\t\t
\n\t\tDate \n\t\t
\n\t\t
\n\t\t: {{doc.encounter_date}}\n\t\t
\n
\n\t {%- endif -%}\n {% if doc.encounter_time %}\n\t
\n\t\t
\n\t\tTime \n\t\t
\n\t\t
\n\t\t: {{doc.encounter_time}}\n\t\t
\n
\n\t {%- endif -%}\n {% if doc.visit_department %}\n\t
\n\t\t
\n\t\tDepartment \n\t\t
\n\t\t
\n\t\t: {{doc.visit_department}}\n\t\t
\n
\n {%- endif -%}\n
\n\n
\n\n
\n
\n
\n {% if doc.symptoms_in_print%}\n {% if doc.symptoms %}\n Complaints:\n {{doc.symptoms}} \n \t \n {%- endif -%}\n {%- endif -%}\n\n {% if doc.diagnosis_in_print%}\n {% if doc.diagnosis %}\n \t Diagnosis:\n {{doc.diagnosis}} \n \n {%- endif -%}\n {%- endif -%}\n\n\n\n
\n {% if doc.drug_prescription %}\n
\n Rx,\n
\n \n \n\n {%- for row in doc.drug_prescription -%}\n \n \n {%- if row.drug_name -%}{{ row.drug_name }} {%- endif -%}\n \n \t\n {%- if row.dosage -%}{{ row.dosage }}{%- endif -%}\n \n \t\n {%- if row.period -%}{{ row.period }}{%- endif -%}\n\t\t \n \n\t\t\t \n {%- if row.comment -%}{{ row.comment }}{%- endif -%}\n
\n\t\t \n \n\t {%- endfor -%}\n \n
\n\n\n {%- endif -%}\n
\n\n\n
\n {% if doc.test_prescription %}\n Investigations,\n
\n \n \n\n {%- for row in doc.test_prescription -%}\n \n \n {%- if row.test_name -%}{{ row.test_name }} {%- endif -%}\n \n \n\t\t\t \n {%- if row.test_comment -%}{{ row.test_comment }}{%- endif -%}\n
\n\t\t \n \n\n\t {%- endfor -%}\n \n
\n\n\n {%- endif -%}\n
\n
\n {% if doc.encounter_comment %}\n \n {{doc.encounter_comment}}\n {%- endif -%}\n
\n",
+ "idx": 0,
+ "line_breaks": 0,
+ "modified": "2018-07-10 18:52:10.970448",
+ "modified_by": "Administrator",
+ "module": "Healthcare",
+ "name": "Encounter Print",
+ "owner": "Administrator",
+ "print_format_builder": 0,
+ "print_format_type": "Server",
+ "show_section_headings": 0,
+ "standard": "Yes"
+}
\ No newline at end of file
diff --git a/erpnext/healthcare/print_format/lab_test_print/lab_test_print.json b/erpnext/healthcare/print_format/lab_test_print/lab_test_print.json
index e3e21a71ceb..2f85ff6378f 100644
--- a/erpnext/healthcare/print_format/lab_test_print/lab_test_print.json
+++ b/erpnext/healthcare/print_format/lab_test_print/lab_test_print.json
@@ -1,22 +1,22 @@
{
- "align_labels_left": 0,
- "creation": "2017-04-24 15:38:45.332473",
- "custom_format": 1,
- "disabled": 0,
- "doc_type": "Lab Test",
- "docstatus": 0,
- "doctype": "Print Format",
- "font": "Default",
- "html": "
\n {% if letter_head and not no_letterhead -%}\n
{{ letter_head }}
\n
\n {%- endif %}\n\n {% if (doc.docstatus != 1) %}\n
Lab Tests have to be Submitted for Print .. ! \n {% elif (frappe.db.get_value(\"Healthcare Settings\", \"None\", \"require_test_result_approval\") == '1' and doc.approval_status != \"Approved\") %}\n
Lab Tests have to be Approved for Print .. ! \n {%- else -%}\n
\n
\n {% if doc.invoice %}\n
\n
\n Order No. \n
\n
\n : {{doc.invoice}}\n
\n
\n {%- endif -%}\n\n
\n
\n Patient \n
\n {% if doc.patient %}\n
\n : {{doc.patient}}\n
\n {% else %}\n
\n : Patient Name \n
\n {%- endif -%}\n
\n\n
\n
\n Age \n
\n
\n : {{doc.patient_age}}\n
\n
\n\n
\n
\n Gender \n
\n
\n : {{doc.patient_sex}}\n
\n
\n\n
\n\n
\n\n
\n
\n Doctor \n
\n {% if doc.physician %}\n
\n : {{doc.physician}}\n
\n {%- endif -%}\n
\n\n {% if doc.sample_date %}\n
\n
\n Sample Date \n
\n
\n : {{doc.sample_date}}\n
\n
\n {%- endif -%}\n\n {% if doc.result_date %}\n
\n
\n Result Date \n
\n
\n : {{doc.result_date}}\n
\n
\n {%- endif -%}\n\n
\n\n
\n\n
\n
Department of {{doc.department}} \n \n\n
\n \n {%- if doc.normal_test_items -%}\n \n Name of Test \n Result \n Normal Range \n \n\n {%- if doc.normal_test_items|length > 1 %}\n {{ doc.test_name }} \n {%- endif -%}\n\n {%- for row in doc.normal_test_items -%}\n \n \n {%- if doc.normal_test_items|length > 1 %} {%- endif -%}\n {%- if row.test_name -%}{{ row.test_name }} \n {%- else -%} {%- endif -%}\n {%- if row.test_event -%} {{ row.test_event }}{%- endif -%}\n \n\n \n {%- if row.result_value -%}{{ row.result_value }}{%- endif -%} \n {%- if row.test_uom -%}{{ row.test_uom }}{%- endif -%}\n \n\n \n \n {%- if row.normal_range -%}{{ row.normal_range }}{%- endif -%}\n
\n \n \n\n {%- endfor -%}\n {%- endif -%}\n \n
\n\n
\n \n {%- if doc.special_test_items -%}\n \n Name of Test \n Result \n \n {{ doc.test_name }} \n {%- for row in doc.special_test_items -%}\n \n {{ row.test_particulars }} \n \n {%- if row.result_value -%}{{ row.result_value }}{%- endif -%}\n \n \n\n {%- endfor -%}\n {%- endif -%}\n\n {%- if doc.sensitivity_test_items -%}\n \n Antibiotic \n Sensitivity \n \n {%- for row in doc.sensitivity_test_items -%}\n \n {{ row.antibiotic }} \n {{ row.antibiotic_sensitivity }} \n \n\n {%- endfor -%}\n {%- endif -%}\n\n \n
\n {%- endif -%}\n\n
\n {%- if (frappe.db.get_value(\"Healthcare Settings\", \"None\", \"employee_name_and_designation_in_print\") == '1') -%}\n
{{doc.employee_name}} \n {{doc.employee_designation}} \n {%- else -%}\n {{frappe.db.get_value(\"Healthcare Settings\", \"None\", \"custom_signature_in_print\") }} \n {%- endif -%}\n \n
\n",
- "idx": 0,
- "line_breaks": 0,
- "modified": "2017-04-27 12:11:58.342145",
- "modified_by": "Administrator",
- "module": "Healthcare",
- "name": "Lab Test Print",
- "owner": "Administrator",
- "print_format_builder": 0,
- "print_format_type": "Server",
- "show_section_headings": 0,
+ "align_labels_right": 0,
+ "creation": "2017-04-24 15:38:45.332473",
+ "custom_format": 1,
+ "disabled": 0,
+ "doc_type": "Lab Test",
+ "docstatus": 0,
+ "doctype": "Print Format",
+ "font": "Default",
+ "html": "
\n {% if letter_head and not no_letterhead -%}\n
{{ letter_head }}
\n
\n {%- endif %}\n\n {% if (doc.docstatus != 1) %}\n
Lab Tests have to be Submitted for Print .. ! \n {% elif (frappe.db.get_value(\"Healthcare Settings\", \"None\", \"require_test_result_approval\") == '1' and doc.approval_status != \"Approved\") %}\n
Lab Tests have to be Approved for Print .. ! \n {%- else -%}\n
\n
\n {% if doc.invoice %}\n
\n
\n Order No. \n
\n
\n : {{doc.invoice}}\n
\n
\n {%- endif -%}\n\n
\n
\n Patient \n
\n {% if doc.patient %}\n
\n : {{doc.patient}}\n
\n {% else %}\n
\n : Patient Name \n
\n {%- endif -%}\n
\n\n
\n
\n Age \n
\n
\n : {{doc.patient_age}}\n
\n
\n\n
\n
\n Gender \n
\n
\n : {{doc.patient_sex}}\n
\n
\n\n
\n\n
\n\n
\n
\n Healthcare Practitioner \n
\n {% if doc.practitioner %}\n
\n : {{doc.practitioner}}\n
\n {%- endif -%}\n
\n\n {% if doc.sample_date %}\n
\n
\n Sample Date \n
\n
\n : {{doc.sample_date}}\n
\n
\n {%- endif -%}\n\n {% if doc.result_date %}\n
\n
\n Result Date \n
\n
\n : {{doc.result_date}}\n
\n
\n {%- endif -%}\n\n
\n\n
\n\n
\n
Department of {{doc.department}} \n \n\n
\n \n {%- if doc.normal_test_items -%}\n \n Name of Test \n Result \n Normal Range \n \n\n {%- if doc.normal_test_items|length > 1 %}\n {{ doc.test_name }} \n {%- endif -%}\n\n {%- for row in doc.normal_test_items -%}\n \n \n {%- if doc.normal_test_items|length > 1 %} {%- endif -%}\n {%- if row.test_name -%}{{ row.test_name }} \n {%- else -%} {%- endif -%}\n {%- if row.test_event -%} {{ row.test_event }}{%- endif -%}\n \n\n \n {%- if row.result_value -%}{{ row.result_value }}{%- endif -%} \n {%- if row.test_uom -%}{{ row.test_uom }}{%- endif -%}\n \n\n \n \n {%- if row.normal_range -%}{{ row.normal_range }}{%- endif -%}\n
\n \n \n\n {%- endfor -%}\n {%- endif -%}\n \n
\n\n
\n \n {%- if doc.special_test_items -%}\n \n Name of Test \n Result \n \n {{ doc.test_name }} \n {%- for row in doc.special_test_items -%}\n \n {{ row.test_particulars }} \n \n {%- if row.result_value -%}{{ row.result_value }}{%- endif -%}\n \n \n\n {%- endfor -%}\n {%- endif -%}\n\n {%- if doc.sensitivity_test_items -%}\n \n Antibiotic \n Sensitivity \n \n {%- for row in doc.sensitivity_test_items -%}\n \n {{ row.antibiotic }} \n {{ row.antibiotic_sensitivity }} \n \n\n {%- endfor -%}\n {%- endif -%}\n\n \n
\n {%- endif -%}\n\n
\n {%- if (frappe.db.get_value(\"Healthcare Settings\", \"None\", \"employee_name_and_designation_in_print\") == '1') -%}\n
{{doc.employee_name}} \n {{doc.employee_designation}} \n {%- else -%}\n {{frappe.db.get_value(\"Healthcare Settings\", \"None\", \"custom_signature_in_print\") }} \n {%- endif -%}\n \n
\n",
+ "idx": 0,
+ "line_breaks": 0,
+ "modified": "2018-07-10 11:29:24.167265",
+ "modified_by": "Administrator",
+ "module": "Healthcare",
+ "name": "Lab Test Print",
+ "owner": "Administrator",
+ "print_format_builder": 0,
+ "print_format_type": "Server",
+ "show_section_headings": 0,
"standard": "Yes"
-}
+}
\ No newline at end of file
diff --git a/erpnext/healthcare/report/lab_test_report/lab_test_report.py b/erpnext/healthcare/report/lab_test_report/lab_test_report.py
index 61769f82b9a..e4771c56bbc 100644
--- a/erpnext/healthcare/report/lab_test_report/lab_test_report.py
+++ b/erpnext/healthcare/report/lab_test_report/lab_test_report.py
@@ -17,7 +17,7 @@ def execute(filters=None):
data = []
for lab_test in lab_test_list:
- row = [ lab_test.test_name, lab_test.patient, lab_test.physician, lab_test.invoice, lab_test.status, lab_test.result_date, lab_test.department]
+ row = [ lab_test.test_name, lab_test.patient, lab_test.practitioner, lab_test.invoice, lab_test.status, lab_test.result_date, lab_test.department]
data.append(row)
return columns, data
@@ -27,7 +27,7 @@ def get_columns():
columns = [
_("Test") + ":Data:120",
_("Patient") + ":Link/Patient:180",
- _("Doctor") + ":Link/Physician:120",
+ _("Healthcare Practitioner") + ":Link/Healthcare Practitioner:120",
_("Invoice") + ":Link/Sales Invoice:120",
_("Status") + ":Data:120",
_("Result Date") + ":Date:120",
@@ -52,7 +52,7 @@ def get_conditions(filters):
def get_lab_test(filters):
conditions = get_conditions(filters)
- return frappe.db.sql("""select name, patient, test_name, patient_name, status, result_date, physician, invoice, department
+ return frappe.db.sql("""select name, patient, test_name, patient_name, status, result_date, practitioner, invoice, department
from `tabLab Test`
where docstatus<2 %s order by submitted_date desc, name desc""" %
conditions, filters, as_dict=1)
diff --git a/erpnext/healthcare/web_form/lab_test/lab_test.json b/erpnext/healthcare/web_form/lab_test/lab_test.json
index fec34b6dbcc..89029fac75a 100644
--- a/erpnext/healthcare/web_form/lab_test/lab_test.json
+++ b/erpnext/healthcare/web_form/lab_test/lab_test.json
@@ -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
},
diff --git a/erpnext/healthcare/web_form/patient_appointments/patient_appointments.json b/erpnext/healthcare/web_form/patient_appointments/patient_appointments.json
index 613e3673e38..e9cf7a8c97f 100644
--- a/erpnext/healthcare/web_form/patient_appointments/patient_appointments.json
+++ b/erpnext/healthcare/web_form/patient_appointments/patient_appointments.json
@@ -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
},
diff --git a/erpnext/healthcare/web_form/personal_details/__init__.py b/erpnext/healthcare/web_form/personal_details/__init__.py
new file mode 100644
index 00000000000..e69de29bb2d
diff --git a/erpnext/healthcare/web_form/personal_details/personal_details.js b/erpnext/healthcare/web_form/personal_details/personal_details.js
new file mode 100644
index 00000000000..f09e5409192
--- /dev/null
+++ b/erpnext/healthcare/web_form/personal_details/personal_details.js
@@ -0,0 +1,3 @@
+frappe.ready(function() {
+ // bind events here
+});
diff --git a/erpnext/healthcare/web_form/personal_details/personal_details.json b/erpnext/healthcare/web_form/personal_details/personal_details.json
new file mode 100644
index 00000000000..aad987aeb9e
--- /dev/null
+++ b/erpnext/healthcare/web_form/personal_details/personal_details.json
@@ -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
+ }
+ ]
+}
diff --git a/erpnext/healthcare/web_form/personal_details/personal_details.py b/erpnext/healthcare/web_form/personal_details/personal_details.py
new file mode 100644
index 00000000000..aa68c423ffe
--- /dev/null
+++ b/erpnext/healthcare/web_form/personal_details/personal_details.py
@@ -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
diff --git a/erpnext/healthcare/web_form/prescription/prescription.json b/erpnext/healthcare/web_form/prescription/prescription.json
index 5f251a31e85..a2aabd154bd 100644
--- a/erpnext/healthcare/web_form/prescription/prescription.json
+++ b/erpnext/healthcare/web_form/prescription/prescription.json
@@ -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",
diff --git a/erpnext/healthcare/web_form/prescription/prescription.py b/erpnext/healthcare/web_form/prescription/prescription.py
index 73b035071c1..efdeaa906ae 100644
--- a/erpnext/healthcare/web_form/prescription/prescription.py
+++ b/erpnext/healthcare/web_form/prescription/prescription.py
@@ -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")
diff --git a/erpnext/hooks.py b/erpnext/hooks.py
index be73b3a5df2..3a276d5b84e 100644
--- a/erpnext/hooks.py
+++ b/erpnext/hooks.py
@@ -133,6 +133,7 @@ website_route_rules = [
]
standard_portal_menu_items = [
+ {"title": _("Personal Details"), "route": "/personal-details", "reference_doctype": "Patient", "role": "Patient"},
{"title": _("Projects"), "route": "/project", "reference_doctype": "Project"},
{"title": _("Request for Quotations"), "route": "/rfq", "reference_doctype": "Request for Quotation", "role": "Supplier"},
{"title": _("Supplier Quotation"), "route": "/supplier-quotations", "reference_doctype": "Supplier Quotation", "role": "Supplier"},
@@ -145,7 +146,7 @@ standard_portal_menu_items = [
{"title": _("Timesheets"), "route": "/timesheets", "reference_doctype": "Timesheet", "role":"Customer"},
{"title": _("Timesheets"), "route": "/timesheets", "reference_doctype": "Timesheet", "role":"Customer"},
{"title": _("Lab Test"), "route": "/lab-test", "reference_doctype": "Lab Test", "role":"Patient"},
- {"title": _("Prescription"), "route": "/prescription", "reference_doctype": "Consultation", "role":"Patient"},
+ {"title": _("Prescription"), "route": "/prescription", "reference_doctype": "Patient Encounter", "role":"Patient"},
{"title": _("Patient Appointment"), "route": "/patient-appointments", "reference_doctype": "Patient Appointment", "role":"Patient"},
{"title": _("Fees"), "route": "/fees", "reference_doctype": "Fees", "role":"Student"},
{"title": _("Newsletter"), "route": "/newsletters", "reference_doctype": "Newsletter"},
@@ -168,8 +169,9 @@ has_website_permission = {
"Issue": "erpnext.support.doctype.issue.issue.has_website_permission",
"Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission",
"Lab Test": "erpnext.healthcare.web_form.lab_test.lab_test.has_website_permission",
- "Consultation": "erpnext.healthcare.web_form.prescription.prescription.has_website_permission",
- "Patient Appointment": "erpnext.healthcare.web_form.patient_appointments.patient_appointments.has_website_permission"
+ "Patient Encounter": "erpnext.healthcare.web_form.prescription.prescription.has_website_permission",
+ "Patient Appointment": "erpnext.healthcare.web_form.patient_appointments.patient_appointments.has_website_permission",
+ "Patient": "erpnext.healthcare.web_form.personal_details.personal_details.has_website_permission"
}
dump_report_map = "erpnext.startup.report_data_map.data_map"
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index a7fc349adfa..bd6d1c3bfe5 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -555,4 +555,5 @@ execute:frappe.db.sql("update `tabDesktop Icon` set type = 'module' where module
erpnext.patches.v11_0.set_salary_component_properties
erpnext.patches.v11_0.set_user_permissions_for_department
erpnext.patches.v11_0.hr_ux_cleanups
-erpnext.patches.v11_0.update_allow_transfer_for_manufacture
\ No newline at end of file
+erpnext.patches.v11_0.update_allow_transfer_for_manufacture
+erpnext.patches.v11_0.rename_healthcare_doctype_and_fields
diff --git a/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py
new file mode 100644
index 00000000000..3a77f10aa83
--- /dev/null
+++ b/erpnext/patches/v11_0/rename_healthcare_doctype_and_fields.py
@@ -0,0 +1,56 @@
+import frappe
+from frappe.model.rename_doc import rename_doc
+from frappe.model.utils.rename_field import rename_field
+from frappe.modules import scrub, get_doctype_module
+
+field_rename_map = {
+ "Patient Encounter": [
+ ["consultation_time", "encounter_time"],
+ ["consultation_date", "encounter_date"],
+ ["consultation_comment", "encounter_comment"],
+ ["physician", "practitioner"]
+ ],
+ "Fee Validity": [
+ ["physician", "practitioner"]
+ ],
+ "Lab Test": [
+ ["physician", "practitioner"]
+ ],
+ "Patient Appointment": [
+ ["physician", "practitioner"],
+ ["referring_physician", "referring_practitioner"]
+ ],
+ "Procedure Prescription": [
+ ["physician", "practitioner"]
+ ]
+}
+
+doc_rename_map = {
+ "Physician Schedule Time Slot": "Healthcare Schedule Time Slot",
+ "Physician Schedule": "Practitioner Schedule",
+ "Physician Service Unit Schedule": "Practitioner Service Unit Schedule",
+ "Consultation": "Patient Encounter",
+ "Physician": "Healthcare Practitioner"
+}
+
+def execute():
+ for dt in doc_rename_map:
+ if frappe.db.exists('DocType', dt):
+ rename_doc('DocType', dt, doc_rename_map[dt], force=True)
+
+ for dn in field_rename_map:
+ if frappe.db.exists('DocType', dn):
+ frappe.reload_doc(get_doctype_module(dn), "doctype", scrub(dn))
+
+ for dt, field_list in field_rename_map.items():
+ if frappe.db.exists('DocType', dt):
+ for field in field_list:
+ if frappe.db.has_column(dt, field[0]):
+ rename_field(dt, field[0], field[1])
+
+ if frappe.db.exists('DocType', 'Practitioner Service Unit Schedule'):
+ if frappe.db.has_column('Practitioner Service Unit Schedule', 'parentfield'):
+ frappe.db.sql("""
+ update `tabPractitioner Service Unit Schedule` set parentfield = 'practitioner_schedules'
+ where parentfield = 'physician_schedules' and parenttype = 'Healthcare Practitioner'
+ """)
diff --git a/erpnext/startup/notifications.py b/erpnext/startup/notifications.py
index 49b770bc46d..8e880dc42e0 100644
--- a/erpnext/startup/notifications.py
+++ b/erpnext/startup/notifications.py
@@ -60,7 +60,7 @@ def get_notification_config():
"Lab Test": {"docstatus": 0},
"Sample Collection": {"docstatus": 0},
"Patient Appointment": {"status": "Open"},
- "Consultation": {"docstatus": 0}
+ "Patient Encounter": {"docstatus": 0}
},
"targets": {
diff --git a/erpnext/startup/report_data_map.py b/erpnext/startup/report_data_map.py
index 5de7998c7d4..fec2deaf41d 100644
--- a/erpnext/startup/report_data_map.py
+++ b/erpnext/startup/report_data_map.py
@@ -298,14 +298,14 @@ data_map = {
}
},
"Patient Appointment": {
- "columns": ["name", "appointment_type", "patient", "physician", "appointment_date", "department", "status", "company"],
+ "columns": ["name", "appointment_type", "patient", "practitioner", "appointment_date", "department", "status", "company"],
"order_by": "name",
"links": {
- "physician": ["Physician", "name"],
+ "practitioner": ["Healthcare Practitioner", "name"],
"appointment_type": ["Appointment Type", "name"]
}
},
- "Physician": {
+ "Healthcare Practitioner": {
"columns": ["name", "department"],
"order_by": "name",
"links": {
diff --git a/erpnext/templates/includes/healthcare/appointment_row_template.html b/erpnext/templates/includes/healthcare/appointment_row_template.html
index 53be5e67647..b369c2a2bcf 100644
--- a/erpnext/templates/includes/healthcare/appointment_row_template.html
+++ b/erpnext/templates/includes/healthcare/appointment_row_template.html
@@ -7,7 +7,7 @@
{% if doc.department %}{{ doc.department }}{% endif %}
diff --git a/erpnext/templates/includes/healthcare/lab_test_row_template.html b/erpnext/templates/includes/healthcare/lab_test_row_template.html
index d6c9b54b09c..b67f2bdad7d 100644
--- a/erpnext/templates/includes/healthcare/lab_test_row_template.html
+++ b/erpnext/templates/includes/healthcare/lab_test_row_template.html
@@ -10,7 +10,7 @@
{{ doc.test_name }}
{{ frappe.format_date(doc.result_date) }}
diff --git a/erpnext/templates/includes/healthcare/prescription_row_template.html b/erpnext/templates/includes/healthcare/prescription_row_template.html
index 13ce3bc16b8..22ef6e41467 100644
--- a/erpnext/templates/includes/healthcare/prescription_row_template.html
+++ b/erpnext/templates/includes/healthcare/prescription_row_template.html
@@ -5,10 +5,10 @@
{{ doc.name }}
- {{ frappe.format_date(doc.consultation_date) }}
+ {{ frappe.format_date(doc.encounter_date) }}