mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-08 15:42:52 +00:00
fix: patch and tests
This commit is contained in:
@@ -59,8 +59,9 @@ class TestPatientAppointment(unittest.TestCase):
|
||||
|
||||
def create_healthcare_docs():
|
||||
patient = get_random('Patient')
|
||||
practitioner = get_random('Healthcare Practitioner')
|
||||
medical_department = get_random('Medical Department')
|
||||
practitioner = frappe.db.exists('Healthcare Practitioner', '_Test Healthcare Practitioner')
|
||||
medical_department = frappe.db.exists('Medical Department', '_Test Medical Department')
|
||||
|
||||
if not patient:
|
||||
patient = frappe.new_doc('Patient')
|
||||
patient.first_name = '_Test Patient'
|
||||
@@ -80,6 +81,7 @@ def create_healthcare_docs():
|
||||
practitioner.gender = 'Female'
|
||||
practitioner.department = medical_department
|
||||
practitioner.op_consulting_charge = 500
|
||||
practitioner.inpatient_visit_charge = 500
|
||||
practitioner.save(ignore_permissions=True)
|
||||
practitioner = practitioner.name
|
||||
|
||||
@@ -98,7 +100,9 @@ def create_encounter(appointment=None):
|
||||
return encounter
|
||||
|
||||
def create_appointment(patient, practitioner, appointment_date, invoice=0, procedure_template=0):
|
||||
create_healthcare_service_items()
|
||||
item = create_healthcare_service_items()
|
||||
frappe.db.set_value('Healthcare Settings', None, 'inpatient_visit_charge_item', item)
|
||||
frappe.db.set_value('Healthcare Settings', None, 'op_consulting_charge_item', item)
|
||||
appointment = frappe.new_doc('Patient Appointment')
|
||||
appointment.patient = patient
|
||||
appointment.practitioner = practitioner
|
||||
|
||||
@@ -581,7 +581,7 @@ erpnext.patches.v11_0.rename_bom_wo_fields
|
||||
erpnext.patches.v12_0.set_default_homepage_type
|
||||
erpnext.patches.v11_0.rename_additional_salary_component_additional_salary
|
||||
erpnext.patches.v11_0.renamed_from_to_fields_in_project
|
||||
erpnext.patches.v11_0.add_permissions_in_gst_settings
|
||||
erpnext.patches.v11_0.add_permissions_in_gst_settings #2020-04-04
|
||||
erpnext.patches.v11_1.setup_guardian_role
|
||||
execute:frappe.delete_doc('DocType', 'Notification Control')
|
||||
erpnext.patches.v12_0.set_gst_category
|
||||
@@ -630,6 +630,7 @@ execute:frappe.reload_doc('desk', 'doctype','dashboard_chart_link')
|
||||
execute:frappe.reload_doc('desk', 'doctype', 'dashboard')
|
||||
execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart_source')
|
||||
execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart')
|
||||
execute:frappe.reload_doc('desk', 'doctype', 'dashboard_chart_field')
|
||||
erpnext.patches.v12_0.add_default_dashboards
|
||||
erpnext.patches.v12_0.remove_bank_remittance_custom_fields
|
||||
erpnext.patches.v12_0.generate_leave_ledger_entries
|
||||
@@ -660,4 +661,8 @@ erpnext.patches.v12_0.set_job_offer_applicant_email
|
||||
erpnext.patches.v12_0.create_irs_1099_field_united_states
|
||||
erpnext.patches.v12_0.move_bank_account_swift_number_to_bank
|
||||
erpnext.patches.v12_0.rename_bank_reconciliation_fields # 2020-01-22
|
||||
erpnext.patches.v12_0.set_received_qty_in_material_request_as_per_stock_uom
|
||||
erpnext.patches.v12_0.set_received_qty_in_material_request_as_per_stock_uom
|
||||
erpnext.patches.v12_0.recalculate_requested_qty_in_bin
|
||||
erpnext.patches.v12_0.update_healthcare_refactored_changes
|
||||
|
||||
|
||||
@@ -55,20 +55,23 @@ def execute():
|
||||
rename_field(dt, field[0], field[1])
|
||||
|
||||
# first name mandatory in Patient
|
||||
patients = frappe.get_all('Patient', fields=['name', 'patient_name'])
|
||||
frappe.reload_doctype('Patient')
|
||||
if frappe.db.exists('DocType', 'Patient'):
|
||||
patients = frappe.db.sql("select name, patient_name from `tabPatient`", as_dict=1)
|
||||
frappe.reload_doc('healthcare', 'doctype', 'patient')
|
||||
for entry in patients:
|
||||
name = entry.patient_name.split(' ')
|
||||
frappe.db.set_value('Patient', entry.name, 'first_name', name[0])
|
||||
|
||||
# mark Healthcare Practitioner status as Disabled
|
||||
if frappe.db.exists('DocType', 'Healthcare Practitioner'):
|
||||
practitioners = frappe.db.sql("select name from `tabHealthcare Practitioner` where 'active'= 0", as_dict=1)
|
||||
practitioners_lst = [p.name for p in practitioners]
|
||||
frappe.reload_doctype('Healthcare Practitioner')
|
||||
frappe.reload_doc('healthcare', 'doctype', 'healthcare_practitioner')
|
||||
frappe.db.sql("update `tabHealthcare Practitioner` set status = 'Disabled' where name IN %(practitioners)s""", {"practitioners": practitioners_lst})
|
||||
|
||||
# set Clinical Procedure status
|
||||
frappe.reload_doctype('Clinical Procedure')
|
||||
if frappe.db.exists('DocType', 'Clinical Procedure'):
|
||||
frappe.reload_doc('healthcare', 'doctype', 'clinical_procedure')
|
||||
frappe.db.sql("""
|
||||
UPDATE
|
||||
`tabClinical Procedure`
|
||||
@@ -80,6 +83,7 @@ def execute():
|
||||
""")
|
||||
|
||||
# set complaints and diagnosis in table multiselect in Patient Encounter
|
||||
if frappe.db.exists('DocType', 'Patient Encounter'):
|
||||
field_list = [
|
||||
['visit_department', 'medical_department'],
|
||||
['type', 'appointment_type']
|
||||
@@ -120,6 +124,7 @@ def execute():
|
||||
row.db_update()
|
||||
doc.db_update()
|
||||
|
||||
if frappe.db.exists('DocType', 'Fee Validity'):
|
||||
# update fee validity status
|
||||
frappe.db.sql("""
|
||||
UPDATE
|
||||
|
||||
Reference in New Issue
Block a user