brotherton-erpnext/erpnext/healthcare/web_form/personal_details/personal_details.py
Jamsheer f926911399 [Enhance][Fix] Healthcare - DocType and Fields renaming (#14861)
* Rename DT - Physician Schedule Time Slot to Healthcare Schedule Time Slot

* Role name change

* Rename DT - Physician Schedule to Practitioner Schedule

* Rename DT - Physician Service Unit Schedule

* Rename DT - Physician to Practitioner

* Lab Test Template - field disabled in standard filter

* Patient - customer creation fix

* Rename DT - Consultation - Encounter

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

* Patch - Rename doctypes and fields in Healthcare Domain

* Fix - Patch - rename_healthcare_doctype_and_fields

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

* Web Form - Patient - Personal Details

* Rename DocType Physician to Healthcare Practitioner

* Rename DocType Consultation to Patient Encounter

* Web Form - Personal Details - Fix

* Web Form - Personal Details - Codacy Fix

* Healthcare patch run for all domain

* Rename label Practitioner to Healthcare Practitioner

* Rename Encounter to Patient Encounter
2018-07-16 18:08:53 +05:30

29 lines
734 B
Python

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