diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index ba06716faf..23ce4e4620 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -7,10 +7,8 @@ from __future__ import unicode_literals import unittest import frappe -from frappe import MandatoryError from erpnext.accounts.doctype.sales_invoice.test_sales_invoice import create_sales_invoice -from healthcare.healthcare.doctype.lab_test_template.lab_test_template import make_item_price from erpnext.selling.doctype.sales_order.test_sales_order import make_sales_order from erpnext.stock.doctype.item.test_item import make_item from erpnext.stock.get_item_details import get_item_details @@ -623,3 +621,12 @@ def delete_existing_pricing_rules(): "Pricing Rule Item Group", "Pricing Rule Brand"]: frappe.db.sql("delete from `tab{0}`".format(doctype)) + + +def make_item_price(item, price_list_name, item_price): + frappe.get_doc({ + 'doctype': 'Item Price', + 'price_list': price_list_name, + 'item_code': item, + 'price_list_rate': item_price + }).insert(ignore_permissions=True, ignore_mandatory=True) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 22aa4e5cbf..af72d30a17 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -40,7 +40,6 @@ from erpnext.assets.doctype.asset.depreciation import ( post_depreciation_entries, ) from erpnext.controllers.selling_controller import SellingController -from healthcare.healthcare.utils import manage_invoice_submit_cancel from erpnext.projects.doctype.timesheet.timesheet import get_projectwise_timesheet_data from erpnext.setup.doctype.company.company import update_company_current_month_sales from erpnext.stock.doctype.batch.batch import set_batch_nos @@ -263,13 +262,6 @@ class SalesInvoice(SellingController): if self.redeem_loyalty_points and not self.is_consolidated and self.loyalty_points: self.apply_loyalty_points() - # Healthcare Service Invoice. - domain_settings = frappe.get_doc('Domain Settings') - active_domains = [d.domain for d in domain_settings.active_domains] - - if "Healthcare" in active_domains: - manage_invoice_submit_cancel(self, "on_submit") - self.process_common_party_accounting() def validate_pos_return(self): @@ -352,12 +344,6 @@ class SalesInvoice(SellingController): unlink_inter_company_doc(self.doctype, self.name, self.inter_company_invoice_reference) - # Healthcare Service Invoice. - domain_settings = frappe.get_doc('Domain Settings') - active_domains = [d.domain for d in domain_settings.active_domains] - - if "Healthcare" in active_domains: - manage_invoice_submit_cancel(self, "on_cancel") self.unlink_sales_invoice_from_timesheets() self.ignore_linked_doctypes = ('GL Entry', 'Stock Ledger Entry', 'Repost Item Valuation') diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py index 1582d8b383..6d3ad38d99 100644 --- a/erpnext/controllers/queries.py +++ b/erpnext/controllers/queries.py @@ -684,36 +684,6 @@ def get_purchase_invoices(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql(query, filters) -@frappe.whitelist() -@frappe.validate_and_sanitize_search_inputs -def get_healthcare_service_units(doctype, txt, searchfield, start, page_len, filters): - query = """ - select name - from `tabHealthcare Service Unit` - where - is_group = 0 - and company = {company} - and name like {txt}""".format( - company = frappe.db.escape(filters.get('company')), txt = frappe.db.escape('%{0}%'.format(txt))) - - if filters and filters.get('inpatient_record'): - from healthcare.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import ( - get_current_healthcare_service_unit, - ) - service_unit = get_current_healthcare_service_unit(filters.get('inpatient_record')) - - # if the patient is admitted, then appointments should be allowed against the admission service unit, - # inspite of it being an Inpatient Occupancy service unit - if service_unit: - query += " and (allow_appointments = 1 or name = {service_unit})".format(service_unit = frappe.db.escape(service_unit)) - else: - query += " and allow_appointments = 1" - else: - query += " and allow_appointments = 1" - - return frappe.db.sql(query, filters) - - @frappe.whitelist() @frappe.validate_and_sanitize_search_inputs def get_tax_template(doctype, txt, searchfield, start, page_len, filters): diff --git a/erpnext/demo/demo.py b/erpnext/demo/demo.py index 5be24206ca..bd744b2546 100644 --- a/erpnext/demo/demo.py +++ b/erpnext/demo/demo.py @@ -6,7 +6,7 @@ import frappe import frappe.utils import erpnext -from erpnext.demo.setup import education, healthcare, manufacture, retail, setup_data +from erpnext.demo.setup import education, manufacture, retail, setup_data from erpnext.demo.user import accounts from erpnext.demo.user import education as edu from erpnext.demo.user import fixed_asset, hr, manufacturing, projects, purchase, sales, stock @@ -38,8 +38,6 @@ def make(domain='Manufacturing', days=100): retail.setup_data() elif domain== 'Education': education.setup_data() - elif domain== 'Healthcare': - healthcare.setup_data() site = frappe.local.site frappe.destroy() diff --git a/erpnext/demo/domains.py b/erpnext/demo/domains.py index b1db7b57b1..7f48b92570 100644 --- a/erpnext/demo/domains.py +++ b/erpnext/demo/domains.py @@ -16,9 +16,6 @@ data = { 'Education': { 'company_name': 'Whitmore College' }, - 'Healthcare': { - 'company_name': 'ABC Hospital Ltd.' - }, 'Agriculture': { 'company_name': 'Schrute Farms' }, diff --git a/erpnext/demo/setup/setup_data.py b/erpnext/demo/setup/setup_data.py index 42f83a3b4e..af53043385 100644 --- a/erpnext/demo/setup/setup_data.py +++ b/erpnext/demo/setup/setup_data.py @@ -196,10 +196,6 @@ def setup_user_roles(domain): 'Purchase Manager', 'Projects User', 'Manufacturing User', 'Manufacturing Manager', 'Support Team') - if domain == "Healthcare": - user.add_roles('Physician', 'Healthcare Administrator', 'Laboratory User', - 'Nursing User', 'Patient') - if domain == "Education": user.add_roles('Academics User') diff --git a/erpnext/hooks.py b/erpnext/hooks.py index bf45fed659..dff5cc62ea 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -69,7 +69,6 @@ domains = { 'Agriculture': 'erpnext.domains.agriculture', 'Distribution': 'erpnext.domains.distribution', 'Education': 'erpnext.domains.education', - 'Healthcare': 'erpnext.domains.healthcare', 'Hospitality': 'erpnext.domains.hospitality', 'Manufacturing': 'erpnext.domains.manufacturing', 'Non Profit': 'erpnext.domains.non_profit', @@ -164,7 +163,6 @@ 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"}, @@ -177,9 +175,6 @@ standard_portal_menu_items = [ {"title": _("Issues"), "route": "/issues", "reference_doctype": "Issue", "role":"Customer"}, {"title": _("Addresses"), "route": "/addresses", "reference_doctype": "Address"}, {"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": "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"}, {"title": _("Admission"), "route": "/admissions", "reference_doctype": "Student Admission", "role": "Student"}, @@ -214,10 +209,6 @@ has_website_permission = { "Delivery Note": "erpnext.controllers.website_list_for_contact.has_website_permission", "Issue": "erpnext.support.doctype.issue.issue.has_website_permission", "Timesheet": "erpnext.controllers.website_list_for_contact.has_website_permission", - "Lab Test": "healthcare.healthcare.web_form.lab_test.lab_test.has_website_permission", - "Patient Encounter": "healthcare.healthcare.web_form.prescription.prescription.has_website_permission", - "Patient Appointment": "healthcare.healthcare.web_form.patient_appointments.patient_appointments.has_website_permission", - "Patient": "healthcare.healthcare.web_form.personal_details.personal_details.has_website_permission" } dump_report_map = "erpnext.startup.report_data_map.data_map" @@ -226,15 +217,11 @@ before_tests = "erpnext.setup.utils.before_tests" standard_queries = { "Customer": "erpnext.selling.doctype.customer.customer.get_customer_list", - "Healthcare Practitioner": "healthcare.healthcare.doctype.healthcare_practitioner.healthcare_practitioner.get_practitioner_list" } doc_events = { "*": { "validate": "erpnext.support.doctype.service_level_agreement.service_level_agreement.apply", - "on_submit": "healthcare.healthcare.doctype.patient_history_settings.patient_history_settings.create_medical_record", - "on_update_after_submit": "healthcare.healthcare.doctype.patient_history_settings.patient_history_settings.update_medical_record", - "on_cancel": "healthcare.healthcare.doctype.patient_history_settings.patient_history_settings.delete_medical_record" }, "Stock Entry": { "on_submit": "erpnext.stock.doctype.material_request.material_request.update_completed_and_requested_qty", @@ -295,7 +282,6 @@ doc_events = { 'erpnext.regional.india.utils.validate_gstin_for_india', 'erpnext.regional.italy.utils.set_state_code', 'erpnext.regional.india.utils.update_gst_category', - 'healthcare.healthcare.utils.update_address_links' ], }, 'Supplier': { @@ -307,7 +293,7 @@ doc_events = { "Contact": { "on_trash": "erpnext.support.doctype.issue.issue.update_issue", "after_insert": "erpnext.telephony.doctype.call_log.call_log.link_existing_conversations", - "validate": ["erpnext.crm.utils.update_lead_phone_numbers", "healthcare.healthcare.utils.update_patient_email_and_phone_numbers"] + "validate": ["erpnext.crm.utils.update_lead_phone_numbers"] }, "Email Unsubscribe": { "after_insert": "erpnext.crm.doctype.email_campaign.email_campaign.unsubscribe_recipient" @@ -325,7 +311,6 @@ doc_events = { # if payment entry not in auto cancel exempted doctypes it will cancel payment entry. auto_cancel_exempted_doctypes= [ "Payment Entry", - "Inpatient Medication Entry" ] after_migrate = ["erpnext.setup.install.update_select_perm_after_install"] @@ -338,7 +323,6 @@ scheduler_events = { }, "all": [ "erpnext.projects.doctype.project.project.project_status_update_reminder", - "healthcare.healthcare.doctype.patient_appointment.patient_appointment.send_appointment_reminder", "erpnext.crm.doctype.social_media_post.social_media_post.process_scheduled_social_media_posts" ], "hourly": [ @@ -379,7 +363,6 @@ scheduler_events = { "erpnext.crm.doctype.email_campaign.email_campaign.send_email_to_leads_or_contacts", "erpnext.crm.doctype.email_campaign.email_campaign.set_email_campaign_status", "erpnext.selling.doctype.quotation.quotation.set_expired_status", - "healthcare.healthcare.doctype.patient_appointment.patient_appointment.update_appointment_status", "erpnext.buying.doctype.supplier_quotation.supplier_quotation.set_expired_status", "erpnext.accounts.doctype.process_statement_of_accounts.process_statement_of_accounts.send_auto_email", "erpnext.non_profit.doctype.membership.membership.set_expired_status" @@ -532,32 +515,6 @@ global_search_doctypes = { {"doctype": "Maintenance Visit", "index": 46}, {"doctype": "Warranty Claim", "index": 47}, ], - "Healthcare": [ - {'doctype': 'Patient', 'index': 1}, - {'doctype': 'Medical Department', 'index': 2}, - {'doctype': 'Vital Signs', 'index': 3}, - {'doctype': 'Healthcare Practitioner', 'index': 4}, - {'doctype': 'Patient Appointment', 'index': 5}, - {'doctype': 'Healthcare Service Unit', 'index': 6}, - {'doctype': 'Patient Encounter', 'index': 7}, - {'doctype': 'Antibiotic', 'index': 8}, - {'doctype': 'Diagnosis', 'index': 9}, - {'doctype': 'Lab Test', 'index': 10}, - {'doctype': 'Clinical Procedure', 'index': 11}, - {'doctype': 'Inpatient Record', 'index': 12}, - {'doctype': 'Sample Collection', 'index': 13}, - {'doctype': 'Patient Medical Record', 'index': 14}, - {'doctype': 'Appointment Type', 'index': 15}, - {'doctype': 'Fee Validity', 'index': 16}, - {'doctype': 'Practitioner Schedule', 'index': 17}, - {'doctype': 'Dosage Form', 'index': 18}, - {'doctype': 'Lab Test Sample', 'index': 19}, - {'doctype': 'Prescription Duration', 'index': 20}, - {'doctype': 'Prescription Dosage', 'index': 21}, - {'doctype': 'Sensitivity', 'index': 22}, - {'doctype': 'Complaint', 'index': 23}, - {'doctype': 'Medical Code', 'index': 24}, - ], "Education": [ {'doctype': 'Article', 'index': 1}, {'doctype': 'Video', 'index': 2}, diff --git a/erpnext/modules.txt b/erpnext/modules.txt index 62f5dce846..a9f94ce133 100644 --- a/erpnext/modules.txt +++ b/erpnext/modules.txt @@ -15,7 +15,6 @@ Portal Maintenance Education Regional -Healthcare Restaurant Agriculture ERPNext Integrations @@ -26,4 +25,4 @@ Quality Management Communication Loan Management Payroll -Telephony \ No newline at end of file +Telephony diff --git a/erpnext/non_profit/doctype/donation/donation.py b/erpnext/non_profit/doctype/donation/donation.py index 3a6c5ee74b..880a983df6 100644 --- a/erpnext/non_profit/doctype/donation/donation.py +++ b/erpnext/non_profit/doctype/donation/donation.py @@ -170,9 +170,6 @@ def create_donor(payment): def get_company_for_donations(): company = frappe.db.get_single_value('Non Profit Settings', 'donation_company') - if not company: - from healthcare.healthcare.setup import get_company - company = get_company() return company diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py index 173e292220..b64daa57fe 100644 --- a/erpnext/non_profit/doctype/membership/membership.py +++ b/erpnext/non_profit/doctype/membership/membership.py @@ -354,9 +354,6 @@ def process_request_data(data): def get_company_for_memberships(): company = frappe.db.get_single_value("Non Profit Settings", "company") - if not company: - from healthcare.healthcare.setup import get_company - company = get_company() return company diff --git a/erpnext/patches.txt b/erpnext/patches.txt index f7f3ddf7fd..a48daa50e1 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -30,15 +30,12 @@ erpnext.patches.v11_0.add_default_email_template_for_leave erpnext.patches.v11_0.set_default_email_template_in_hr #08-06-2018 erpnext.patches.v11_0.uom_conversion_data #30-06-2018 erpnext.patches.v11_0.update_account_type_in_party_type -erpnext.patches.v11_0.rename_healthcare_doctype_and_fields erpnext.patches.v11_0.rename_supplier_type_to_supplier_group erpnext.patches.v10_1.transfer_subscription_to_auto_repeat erpnext.patches.v11_0.update_brand_in_item_price erpnext.patches.v11_0.create_default_success_action -erpnext.patches.v11_0.add_healthcare_service_unit_tree_root erpnext.patches.v11_0.rename_field_max_days_allowed erpnext.patches.v11_0.create_salary_structure_assignments -erpnext.patches.v11_0.rename_health_insurance erpnext.patches.v11_0.rebuild_tree_for_company erpnext.patches.v11_0.create_department_records_for_each_company erpnext.patches.v11_0.make_location_from_warehouse @@ -65,9 +62,7 @@ execute:frappe.delete_doc("Page", "hub") erpnext.patches.v11_0.reset_publish_in_hub_for_all_items erpnext.patches.v11_0.update_hub_url # 2018-08-31 # 2018-09-03 erpnext.patches.v11_0.make_job_card -erpnext.patches.v11_0.redesign_healthcare_billing_work_flow erpnext.patches.v10_0.delete_hub_documents # 12-08-2018 -erpnext.patches.v11_0.rename_healthcare_fields erpnext.patches.v11_0.add_default_dispatch_notification_template erpnext.patches.v11_0.add_market_segments erpnext.patches.v11_0.add_sales_stages @@ -169,7 +164,6 @@ erpnext.patches.v12_0.add_permission_in_lower_deduction erpnext.patches.v12_0.set_received_qty_in_material_request_as_per_stock_uom erpnext.patches.v12_0.rename_account_type_doctype erpnext.patches.v12_0.recalculate_requested_qty_in_bin -erpnext.patches.v12_0.update_healthcare_refactored_changes erpnext.patches.v12_0.set_total_batch_quantity erpnext.patches.v12_0.rename_mws_settings_fields erpnext.patches.v12_0.set_updated_purpose_in_pick_list @@ -178,7 +172,6 @@ erpnext.patches.v12_0.repost_stock_ledger_entries_for_target_warehouse erpnext.patches.v12_0.update_end_date_and_status_in_email_campaign erpnext.patches.v13_0.move_tax_slabs_from_payroll_period_to_income_tax_slab #123 erpnext.patches.v12_0.fix_quotation_expired_status -erpnext.patches.v12_0.update_appointment_reminder_scheduler_entry erpnext.patches.v12_0.rename_pos_closing_doctype erpnext.patches.v13_0.replace_pos_payment_mode_table #2020-12-29 erpnext.patches.v12_0.remove_duplicate_leave_ledger_entries #2020-05-22 @@ -196,7 +189,6 @@ execute:frappe.reload_doctype('Dashboard') execute:frappe.reload_doc('desk', 'doctype', 'number_card_link') execute:frappe.delete_doc_if_exists('Dashboard', 'Accounts') erpnext.patches.v13_0.update_actual_start_and_end_date_in_wo -erpnext.patches.v13_0.set_company_field_in_healthcare_doctypes #2021-04-16 erpnext.patches.v12_0.update_bom_in_so_mr execute:frappe.delete_doc("Report", "Department Analytics") execute:frappe.rename_doc("Desk Page", "Loan Management", "Loan", force=True) @@ -222,7 +214,6 @@ erpnext.patches.v12_0.fix_percent_complete_for_projects erpnext.patches.v13_0.delete_report_requested_items_to_order erpnext.patches.v12_0.update_item_tax_template_company erpnext.patches.v13_0.move_branch_code_to_bank_account -erpnext.patches.v13_0.healthcare_lab_module_rename_doctypes erpnext.patches.v13_0.add_standard_navbar_items #2021-03-24 erpnext.patches.v13_0.stock_entry_enhancements erpnext.patches.v12_0.update_state_code_for_daman_and_diu @@ -236,7 +227,6 @@ erpnext.patches.v13_0.set_youtube_video_id erpnext.patches.v13_0.set_app_name erpnext.patches.v13_0.print_uom_after_quantity_patch erpnext.patches.v13_0.set_payment_channel_in_payment_gateway_account -erpnext.patches.v13_0.create_healthcare_custom_fields_in_stock_entry_detail erpnext.patches.v13_0.updates_for_multi_currency_payroll erpnext.patches.v13_0.update_reason_for_resignation_in_employee execute:frappe.delete_doc("Report", "Quoted Item Comparison") @@ -251,7 +241,6 @@ erpnext.patches.v13_0.create_uae_pos_invoice_fields erpnext.patches.v13_0.update_project_template_tasks erpnext.patches.v13_0.set_company_in_leave_ledger_entry erpnext.patches.v13_0.convert_qi_parameter_to_link_field -erpnext.patches.v13_0.setup_patient_history_settings_for_standard_doctypes erpnext.patches.v13_0.add_naming_series_to_old_projects # 1-02-2021 erpnext.patches.v13_0.update_payment_terms_outstanding erpnext.patches.v12_0.add_state_code_for_ladakh @@ -263,7 +252,6 @@ erpnext.patches.v13_0.rename_membership_settings_to_non_profit_settings erpnext.patches.v13_0.setup_gratuity_rule_for_india_and_uae erpnext.patches.v13_0.setup_uae_vat_fields execute:frappe.db.set_value('System Settings', None, 'app_name', 'ERPNext') -erpnext.patches.v13_0.rename_discharge_date_in_ip_record erpnext.patches.v12_0.create_taxable_value_field erpnext.patches.v12_0.add_gst_category_in_delivery_note erpnext.patches.v12_0.purchase_receipt_status diff --git a/erpnext/patches/v11_0/refactor_naming_series.py b/erpnext/patches/v11_0/refactor_naming_series.py index 9f231edea7..a124ff835b 100644 --- a/erpnext/patches/v11_0/refactor_naming_series.py +++ b/erpnext/patches/v11_0/refactor_naming_series.py @@ -27,7 +27,6 @@ doctype_series_map = { 'Fee Schedule': 'EDU-FSH-.YYYY.-', 'Fee Structure': 'EDU-FST-.YYYY.-', 'Fees': 'EDU-FEE-.YYYY.-', - 'Inpatient Record': 'HLC-INP-.YYYY.-', 'Installation Note': 'MAT-INS-.YYYY.-', 'Instructor': 'EDU-INS-.YYYY.-', 'Issue': 'ISS-.YYYY.-', @@ -43,9 +42,6 @@ doctype_series_map = { 'Member': 'NPO-MEM-.YYYY.-', 'Opportunity': 'CRM-OPP-.YYYY.-', 'Packing Slip': 'MAT-PAC-.YYYY.-', - 'Patient': 'HLC-PAT-.YYYY.-', - 'Patient Encounter': 'HLC-ENC-.YYYY.-', - 'Patient Medical Record': 'HLC-PMR-.YYYY.-', 'Payment Entry': 'ACC-PAY-.YYYY.-', 'Payment Request': 'ACC-PRQ-.YYYY.-', 'Production Plan': 'MFG-PP-.YYYY.-',