mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 12:19:12 +00:00
[domain] Healthcare (#10664)
* Medical module for erpnext * Changes in core for Medical module * patient registration updated * fix - appointment invioce - fields missing * pages- indicator instead of bg-color * Lab Test field renamed service type * Department added Lab Test * procedure name in prescription * fixes sample collection * filter disabled patient * fix patient admission * updated patient age * availability check msg updated * fixes, removed procedure from invoice * sample print renamed * fixes, validation * service desk physician in filter * refactor scheduler * Appointment -field property - set only once = 1 * Appointment - Mark closed and pending buttons removed * Appointment - readonly = 1 if value set * Appointment - availabilty * Appointment - Cancel - info - cancel invoice * Appointment - set pending appointments * Dosage form - new DT * Drug Prescription - Dosage form added * Facility - Floor - removed from Fecility * Floor - removed * Lab Test Template - item creation validation * Procedure - Create Procedure * Procedure Appointment - new DT * Service Unit - Floor reference removed * Zone Fcilities - Unused DT removed * Appointment Desk - fixed * Service Desk - method pointing from procedure changed to procedure_appointment * Consultation print - got featured * Consultation - removed patient refernce to procedure prescription * Procedure Prescription - removed patient refernce * Lab Test - Changed field properties and value * Lab Test - field property changed * Lab Test - methods rewrite - lab test doc creation * Lab Test - create lab test from invoice and consultaion - got changed * Button History changed to Medical Record * Service Desk - Updated * Notification - Procedure Appointment * fix-get procedure prescription * fix field added to test prescription * msgprint on invoice creation * fix data on install * Merge branch erpnext/develop * fixes- minor * Setup wizard - Create Sensitivity * Appointment - Validate and Save if there is no schedule for Physician * Consultation - Button create vital signs and medical record * Review Type - New DocType * Review Detail and Treatment Plan - Childs - Consultation * Patient Medical Record - field Attach doc * Consultation - New Fields * Consultation - Manage new Fields - Medical record add action * Patient Relation - Child DocType - Patient * Patient - Patient Relation added * Patient - collapsible = 1 * Laboratory Settings - fields - message for lab test * Laboratory Settings - get message for lab test * SMS text for lab test and invoice test report * Procedure Stock Detail - Stock detail for Procedure and Template * Template Stage Detail - Stage detail for Procedure Template * Procedure Stage Detail - Stage detail for Procedure * Service Unit - field - warehouse * Scheduler - msg - content changed * Laboratory Settings - defualt - msg content * Invoice Test Report - msg print * Print Format-Changed-Consultation-Invoice Test Report-Lab Test * OP Settings - Expnse Account for Stock Entry in Procedure * Procedure and Procedure Template - Manage Stock Stage and Sample Collection * Procedure Appointment - Manage Stock and Stage * Lab Test - fixed - resource not find * Invoice Test Report - fixed - resource not find * Procedure - doc reload after insert * Patient Medical Record - fixed - refernce missed * Create Vital Signs -on client side * Rename module Medical to Healthcare * Remove In Patient (IP) Feature. * Rename - Procedure to Clinical Procedure * Remove spaces in Naming Series * Rename Duration to Drug Prescription Duration * Duration to Drug Prescription Duration * Merge All Settings to Healthcare Settings * Healthcare settings - import fixed * Procedure related documents are removed * Appointment Desk and Sevrvice Desk are removed * Consultation - minimal * Consultation - minimal * Consultation - minimal - patient detials in collapsible section * Message Print to Alerts * Patient - some fields removed * Patient - create consultation - message print to alerts * Consultation - show patient details updated * Setup wizard - Duration to Drug Prescritpion Duration * Healthcare Settings - patient registration - fee collection * Lab Test - Create Sales Invoice bug fixed * Healthcare menu rearranged * Healthcare Settings - Optimised and Rearragnged * Healthcare Settings - Expense account removed * Receivable account removed from patient * Patient - Optimised and Rearragnged * Removed Referring Physician * Healthcare Settings - bold headings removed * Physician - Patient - Fields are Segregated * Remove Service Unit * Remove - Service Type * Consultation invoice * Lab Test - invoice * Patient - Invoice * Rename Appointment to Patient Appointment * wip * Patient Dashboard, Physician Form cleanup * Dosage renamed to Prescription Dosage * Renamed Drug Prescription Duration to Prescription Duration * Patient Appointment booking modal * Patient Age - calculate by dob * Remove - scheduler * Consultation - Appointment to Patient Appointment * Patient Dashboard - rearranged * Patient Appointment * Removed rer_physician from lab test and consultation * Patient Appontment Changes * Appointment and Consultation - optimized * Patient Appointment - fee validity code optimized * Consultation and Patient Appointment - Invoice validate two side * fix: #13 remove relation to admission * Healthcare - Patient Portal * fix import error * domain Healthcare added on install * Removed - Invoice Test Report * Physician Schedule - menu * Consultation - patient details - re write * New Doctype-Medical Code * Consultation - Daignosis codification * Medical Code - Codification - Settings * Medical Code Standard - Medical Code - Codification - Settings * fix appointment calendar * fix appointment analytics * Menu Medical Code Standard * New Doctype - Medical Code Standard * Set Physician Role insted of IP Physician and OP Physician Role * fixed some json files * Medical code - permission to physician * Unused Childs - Work Schedule and User List - Removed * Label Procedure to Lab Test * Lab Test and Patient - code optimised * Add Item Groups - setup wizard * Healthcare Settings - add Role - Medical Administrator * Healthcare - Demo setup - Make Demo * Fee Validity - Logic Test * Test Fee Validity - Optimised * Healthcare Doctypes - Restricted to Domain Healthcare * Domainify - remove Healthcare Roles - Other Domains * Healthcare doctypes - beta checked * Codacy fixes * Codacy - fixes * Codacy - fixes * Codacy - fixes * Codacy - fixes * Codacy - fixes * Lab Test - print hide =1 for some fields * Consultation - Codification field label to Medical Coding * Codacy fixes - import frappe and etc. * Codacy fixes - import frappe in test_vital_signs * Codacy fixes * Codacy fixes * Codacy fixes and remove delete perm for patient * send_sms - import form frappe * Healthcare Settings * Lab Prescription - Consultation - Test Code - read_only = 0 * Portal fixes * Patient Appointment - filter physician - if has schedule * Physician - IP Charge - Removed * test - files * Web Form - Patient Profile - removed * Role Medical Administrator to Healthcare Administrator * WIP healthcare documentation * Coday - fixes * Travis - fixes * Lab Test Report - menu * Reorder Healthcare settings - group lab config to bottom * Sample Collection - New - allow Sample and patient Selection * Rate - similar behaviour and Label as in Item Standard Selling Rate * Healthcare documentation * Lab Test Samples to Lab Test sample * Commplaints to Complaint * Commplaints to Complaint * Antibiotics to Antibiotic * Appointment Token Number - remove * View - Medical record * Codacy fixes * update healthcare docs * Cleanup Docs - Search, quick entry, trsck change, etc. * [minor] ux changes
This commit is contained in:
committed by
Makarand Bauskar
parent
ff667695ad
commit
f056974bc5
0
erpnext/healthcare/web_form/__init__.py
Normal file
0
erpnext/healthcare/web_form/__init__.py
Normal file
0
erpnext/healthcare/web_form/lab_test/__init__.py
Normal file
0
erpnext/healthcare/web_form/lab_test/__init__.py
Normal file
34
erpnext/healthcare/web_form/lab_test/lab_test.js
Normal file
34
erpnext/healthcare/web_form/lab_test/lab_test.js
Normal file
@@ -0,0 +1,34 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
var normal_test_items = $('div[data-fieldname = "normal_test_items"]');
|
||||
var normal_test_items_add_btn = $('button[data-fieldname = "normal_test_items"]');
|
||||
var special_test_items = $('div[data-fieldname = "special_test_items"]');
|
||||
var special_test_items_add_btn = $('button[data-fieldname = "special_test_items"]');
|
||||
var sensitivity_test_items = $('div[data-fieldname = "sensitivity_test_items"]');
|
||||
var sensitivity_test_items_add_btn = $('button[data-fieldname = "sensitivity_test_items"]');
|
||||
var sensitivity_toggle = $('input[name = "sensitivity_toggle"]');
|
||||
var special_toggle = $('input[name = "special_toggle"]');
|
||||
var normal_toggle = $('input[name = "normal_toggle"]');
|
||||
if(normal_toggle.val() == 1){
|
||||
// normal_test_items[0].style.display = "none";
|
||||
// normal_test_items[0].setAttribute("hidden", true);
|
||||
// normal_test_items_add_btn[0].style.visibility = "hidden";
|
||||
special_test_items[0].style.display = "none";
|
||||
special_test_items_add_btn[0].style.display = "none";
|
||||
sensitivity_test_items[0].style.display = "none";
|
||||
sensitivity_test_items_add_btn[0].style.display = "none";
|
||||
normal_test_items_add_btn[0].style.display = "none";
|
||||
}else if(sensitivity_toggle.val() == 1){
|
||||
special_test_items[0].style.display = "none";
|
||||
special_test_items_add_btn[0].style.display = "none";
|
||||
normal_test_items[0].style.display = "none";
|
||||
normal_test_items_add_btn[0].style.display = "none";
|
||||
sensitivity_test_items_add_btn[0].style.display = "none";
|
||||
}else if(special_toggle.val() == 1){
|
||||
normal_test_items[0].style.display = "none";
|
||||
normal_test_items_add_btn[0].style.display = "none";
|
||||
sensitivity_test_items[0].style.display = "none";
|
||||
sensitivity_test_items_add_btn[0].style.display = "none";
|
||||
special_test_items_add_btn[0].style.display = "none";
|
||||
}
|
||||
});
|
||||
235
erpnext/healthcare/web_form/lab_test/lab_test.json
Normal file
235
erpnext/healthcare/web_form/lab_test/lab_test.json
Normal file
@@ -0,0 +1,235 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 1,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 1,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"creation": "2017-06-06 16:12:33.052258",
|
||||
"currency": "INR",
|
||||
"doc_type": "Lab Test",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "Lab Test",
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2017-06-07 16:03:06.781364",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Healthcare",
|
||||
"name": "lab-test",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"print_format": "Lab Test Print",
|
||||
"published": 1,
|
||||
"route": "lab-test",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/lab-test",
|
||||
"title": "Lab Test",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Series",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "LP-",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "invoice",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Invoice",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Sales Invoice",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "patient",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Patient",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Patient",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "patient_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Patient Name",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "patient.patient_name",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "physician",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Doctor",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Physician",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Status",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Draft\nCompleted\nApproved\nRejected\nCancelled",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "department",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Department",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Medical Department",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "sample",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Sample ID",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Sample Collection",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"fieldname": "result_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"label": "Result Date",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "report_preference",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Report Preference",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "test_name",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Test Name",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "normal_test_items",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Normal Test Items",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "special_test_items",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Special Test Items",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "sensitivity_test_items",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Sensitivity Test Items",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "test_comment",
|
||||
"fieldtype": "Text",
|
||||
"hidden": 0,
|
||||
"label": "Comments",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "custom_result",
|
||||
"fieldtype": "Text Editor",
|
||||
"hidden": 0,
|
||||
"label": "Custom Result",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "sensitivity_toggle",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "special_toggle",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
"fieldname": "normal_toggle",
|
||||
"fieldtype": "Check",
|
||||
"hidden": 1,
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
25
erpnext/healthcare/web_form/lab_test/lab_test.py
Normal file
25
erpnext/healthcare/web_form/lab_test/lab_test.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
context.read_only = 1
|
||||
|
||||
def get_list_context(context):
|
||||
context.row_template = "erpnext/templates/includes/healthcare/lab_test_row_template.html"
|
||||
context.get_list = get_lab_test_list
|
||||
|
||||
def get_lab_test_list(doctype, txt, filters, limit_start, limit_page_length = 20, order_by='modified desc'):
|
||||
patient = get_patient()
|
||||
lab_tests = frappe.db.sql("""select * from `tabLab Test`
|
||||
where patient = %s order by result_date""", patient, as_dict = True)
|
||||
return lab_tests
|
||||
|
||||
def get_patient():
|
||||
return frappe.get_value("Patient",{"email": frappe.session.user}, "name")
|
||||
|
||||
def has_website_permission(doc, ptype, user, verbose=False):
|
||||
if doc.patient == get_patient():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
@@ -0,0 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
});
|
||||
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 1,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 1,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"creation": "2017-06-07 15:30:44.984832",
|
||||
"currency": "INR",
|
||||
"doc_type": "Patient Appointment",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "Patient Appointments",
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2017-06-07 15:57:27.196428",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Healthcare",
|
||||
"name": "patient-appointments",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"published": 1,
|
||||
"route": "patient-appointments",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/patient-appointments",
|
||||
"title": "Patient Appointments",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"fieldname": "patient",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Patient",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Patient",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "physician",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Physician",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Physician",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "appointment_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"label": "Date",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "appointment_time",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Time",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "department",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Department",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Medical Department",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "appointment_type",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Type",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Appointment Type",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "Scheduled",
|
||||
"fieldname": "status",
|
||||
"fieldtype": "Select",
|
||||
"hidden": 0,
|
||||
"label": "Status",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "\nScheduled\nOpen\nClosed\nPending\nCancelled",
|
||||
"read_only": 1,
|
||||
"reqd": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
context.read_only = 1
|
||||
|
||||
def get_list_context(context):
|
||||
context.row_template = "erpnext/templates/includes/healthcare/appointment_row_template.html"
|
||||
context.get_list = get_appointment_list
|
||||
|
||||
def get_appointment_list(doctype, txt, filters, limit_start, limit_page_length = 20, order_by='modified desc'):
|
||||
patient = get_patient()
|
||||
lab_tests = frappe.db.sql("""select * from `tabPatient Appointment`
|
||||
where patient = %s and (status = 'Open' or status = 'Scheduled') order by appointment_date""", patient, as_dict = True)
|
||||
return lab_tests
|
||||
|
||||
def get_patient():
|
||||
return frappe.get_value("Patient",{"email": frappe.session.user}, "name")
|
||||
|
||||
def has_website_permission(doc, ptype, user, verbose=False):
|
||||
if doc.patient == get_patient():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
3
erpnext/healthcare/web_form/prescription/prescription.js
Normal file
3
erpnext/healthcare/web_form/prescription/prescription.js
Normal file
@@ -0,0 +1,3 @@
|
||||
frappe.ready(function() {
|
||||
// bind events here
|
||||
});
|
||||
112
erpnext/healthcare/web_form/prescription/prescription.json
Normal file
112
erpnext/healthcare/web_form/prescription/prescription.json
Normal file
@@ -0,0 +1,112 @@
|
||||
{
|
||||
"accept_payment": 0,
|
||||
"allow_comments": 0,
|
||||
"allow_delete": 0,
|
||||
"allow_edit": 1,
|
||||
"allow_incomplete": 0,
|
||||
"allow_multiple": 1,
|
||||
"allow_print": 1,
|
||||
"amount": 0.0,
|
||||
"amount_based_on_field": 0,
|
||||
"creation": "2017-06-06 17:13:19.101374",
|
||||
"currency": "INR",
|
||||
"doc_type": "Consultation",
|
||||
"docstatus": 0,
|
||||
"doctype": "Web Form",
|
||||
"idx": 0,
|
||||
"introduction_text": "Patient Prescriptions",
|
||||
"is_standard": 1,
|
||||
"login_required": 1,
|
||||
"max_attachment_size": 0,
|
||||
"modified": "2017-06-20 11:56:05.132154",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Healthcare",
|
||||
"name": "prescription",
|
||||
"owner": "Administrator",
|
||||
"payment_button_label": "Buy Now",
|
||||
"print_format": "Consultation Print",
|
||||
"published": 1,
|
||||
"route": "prescription",
|
||||
"show_sidebar": 1,
|
||||
"sidebar_items": [],
|
||||
"success_url": "/prescription",
|
||||
"title": "Prescription",
|
||||
"web_form_fields": [
|
||||
{
|
||||
"fieldname": "physician",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Doctor",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Physician",
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "visit_department",
|
||||
"fieldtype": "Link",
|
||||
"hidden": 0,
|
||||
"label": "Department",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Medical Department",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"default": "Today",
|
||||
"fieldname": "consultation_date",
|
||||
"fieldtype": "Date",
|
||||
"hidden": 0,
|
||||
"label": "Consultation Date",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "",
|
||||
"fieldname": "consultation_time",
|
||||
"fieldtype": "Data",
|
||||
"hidden": 0,
|
||||
"label": "Consultation Time",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"fieldname": "drug_prescription",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"label": "Drug Prescription",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Drug Prescription",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "test_prescription",
|
||||
"fieldtype": "Table",
|
||||
"hidden": 0,
|
||||
"label": "Investigations",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"options": "Lab Prescription",
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
},
|
||||
{
|
||||
"fieldname": "consultation_comment",
|
||||
"fieldtype": "Small Text",
|
||||
"hidden": 0,
|
||||
"label": "Review Details",
|
||||
"max_length": 0,
|
||||
"max_value": 0,
|
||||
"read_only": 0,
|
||||
"reqd": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
25
erpnext/healthcare/web_form/prescription/prescription.py
Normal file
25
erpnext/healthcare/web_form/prescription/prescription.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
def get_context(context):
|
||||
context.read_only = 1
|
||||
|
||||
def get_list_context(context):
|
||||
context.row_template = "erpnext/templates/includes/healthcare/prescription_row_template.html"
|
||||
context.get_list = get_consultation_list
|
||||
|
||||
def get_consultation_list(doctype, txt, filters, limit_start, limit_page_length = 20, order_by='modified desc'):
|
||||
patient = get_patient()
|
||||
consultations = frappe.db.sql("""select * from `tabConsultation`
|
||||
where patient = %s order by creation desc""", patient, as_dict = True)
|
||||
return consultations
|
||||
|
||||
def get_patient():
|
||||
return frappe.get_value("Patient",{"email": frappe.session.user}, "name")
|
||||
|
||||
def has_website_permission(doc, ptype, user, verbose=False):
|
||||
if doc.patient == get_patient():
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
Reference in New Issue
Block a user