From be8825e340777e90819265991aa21a9a6a018576 Mon Sep 17 00:00:00 2001 From: Anoop Kurungadam Date: Sat, 28 Oct 2023 06:36:20 +0530 Subject: [PATCH 1/2] fix: uodate pyproject.toml --- pyproject.toml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 8043dd9906..c95a3fe7f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,25 @@ +[project] +name = "healthcare" +description = "Modern, Open Source HIS built on Frappe and ERPNext" +authors = [ + { name = "earthians Health Informatics Pvt. Ltd.", email = "info@earthianslive.com" } +] +readme = "README.md" +dynamic = ["version"] + +dependencies = [ + "responses==0.20.0", +] + +[build-system] +requires = ["flit_core >=3.4,<4"] +build-backend = "flit_core.buildapi" + [tool.black] line-length = 99 [tool.isort] +profile = "black" line_length = 99 multi_line_output = 3 include_trailing_comma = true @@ -9,3 +27,7 @@ force_grid_wrap = 0 use_parentheses = true ensure_newline_before_comments = true indent = "\t" +known_frappe = ["frappe"] +known_erpnext = ["erpnext"] +known_healthcare = ["healthcare"] +sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FRAPPE", "ERPNEXT", "HEALTHCARE", "FIRSTPARTY", "LOCALFOLDER"] \ No newline at end of file From ca8f511a3f57e207d93aa674a46f77788311dc57 Mon Sep 17 00:00:00 2001 From: Anoop Kurungadam Date: Sat, 28 Oct 2023 06:42:10 +0530 Subject: [PATCH 2/2] fix: linter auto fixes skip isort on setup.py --- healthcare/controllers/service_request_controller.py | 1 + healthcare/healthcare/custom_doctype/sales_invoice.py | 1 + .../doctype/clinical_procedure/clinical_procedure.py | 5 +++-- .../healthcare/doctype/fee_validity/test_fee_validity.py | 3 ++- .../healthcare_practitioner/healthcare_practitioner.py | 3 ++- .../inpatient_medication_entry.py | 3 ++- .../healthcare/doctype/nursing_task/nursing_task.py | 6 ++++-- healthcare/healthcare/doctype/patient/patient.py | 8 +++++--- .../doctype/patient_appointment/patient_appointment.py | 3 ++- .../patient_appointment/test_patient_appointment.py | 3 ++- .../patient_medical_record/test_patient_medical_record.py | 3 ++- .../healthcare/doctype/service_request/service_request.py | 3 ++- .../doctype/service_request/test_service_request.py | 3 ++- .../report/diagnosis_trends/diagnosis_trends.py | 3 ++- .../patient_appointment_analytics.py | 3 ++- healthcare/healthcare/utils.py | 3 ++- .../v15_0/check_version_compatibility_with_frappe.py | 1 + healthcare/regional/india/abdm/test_abdm.py | 3 ++- healthcare/regional/india/abdm/utils.py | 3 ++- healthcare/setup.py | 1 + healthcare/uninstall.py | 1 + setup.py | 1 + 22 files changed, 44 insertions(+), 20 deletions(-) diff --git a/healthcare/controllers/service_request_controller.py b/healthcare/controllers/service_request_controller.py index 04be3e9e13..7e76649ef9 100644 --- a/healthcare/controllers/service_request_controller.py +++ b/healthcare/controllers/service_request_controller.py @@ -1,6 +1,7 @@ from __future__ import unicode_literals import dateutil + import frappe from frappe import _ from frappe.model.document import Document diff --git a/healthcare/healthcare/custom_doctype/sales_invoice.py b/healthcare/healthcare/custom_doctype/sales_invoice.py index 56abe19e8d..1a814c0455 100644 --- a/healthcare/healthcare/custom_doctype/sales_invoice.py +++ b/healthcare/healthcare/custom_doctype/sales_invoice.py @@ -1,4 +1,5 @@ import frappe + from erpnext.accounts.doctype.sales_invoice.sales_invoice import SalesInvoice diff --git a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py index b7a9815952..3330d8a743 100644 --- a/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py +++ b/healthcare/healthcare/doctype/clinical_procedure/clinical_procedure.py @@ -3,13 +3,14 @@ # For license information, please see license.txt import frappe -from erpnext.stock.get_item_details import get_item_details -from erpnext.stock.stock_ledger import get_previous_sle from frappe import _ from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import flt, get_link_to_form, now_datetime, nowdate, nowtime +from erpnext.stock.get_item_details import get_item_details +from erpnext.stock.stock_ledger import get_previous_sle + from healthcare.healthcare.doctype.healthcare_settings.healthcare_settings import get_account from healthcare.healthcare.doctype.lab_test.lab_test import create_sample_doc from healthcare.healthcare.doctype.nursing_task.nursing_task import NursingTask diff --git a/healthcare/healthcare/doctype/fee_validity/test_fee_validity.py b/healthcare/healthcare/doctype/fee_validity/test_fee_validity.py index fba83333c0..b886501bc0 100644 --- a/healthcare/healthcare/doctype/fee_validity/test_fee_validity.py +++ b/healthcare/healthcare/doctype/fee_validity/test_fee_validity.py @@ -4,10 +4,11 @@ import frappe -from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from frappe.tests.utils import FrappeTestCase from frappe.utils import add_days, nowdate +from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile + from healthcare.healthcare.doctype.patient_appointment.test_patient_appointment import ( create_appointment, create_healthcare_docs, diff --git a/healthcare/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py b/healthcare/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py index 9a0dc6d45c..2e4b65c764 100644 --- a/healthcare/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py +++ b/healthcare/healthcare/doctype/healthcare_practitioner/healthcare_practitioner.py @@ -4,7 +4,6 @@ import frappe -from erpnext.accounts.party import validate_party_accounts from frappe import _ from frappe.contacts.address_and_contact import ( delete_contact_and_address, @@ -14,6 +13,8 @@ from frappe.model.naming import append_number_if_name_exists from frappe.utils import get_link_to_form +from erpnext.accounts.party import validate_party_accounts + class HealthcarePractitioner(Document): def onload(self): diff --git a/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py b/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py index 377748e7b6..16114139df 100644 --- a/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py +++ b/healthcare/healthcare/doctype/inpatient_medication_entry/inpatient_medication_entry.py @@ -5,11 +5,12 @@ import datetime import frappe -from erpnext.stock.utils import get_latest_stock_qty from frappe import _ from frappe.model.document import Document from frappe.utils import flt, get_link_to_form, get_time, getdate +from erpnext.stock.utils import get_latest_stock_qty + from healthcare.healthcare.doctype.healthcare_settings.healthcare_settings import get_account diff --git a/healthcare/healthcare/doctype/nursing_task/nursing_task.py b/healthcare/healthcare/doctype/nursing_task/nursing_task.py index 769e55d9b5..33ed5e1502 100644 --- a/healthcare/healthcare/doctype/nursing_task/nursing_task.py +++ b/healthcare/healthcare/doctype/nursing_task/nursing_task.py @@ -2,12 +2,14 @@ # For license information, please see license.txt import json +from six import string_types + import frappe -from erpnext import get_default_company from frappe import _ from frappe.model.document import Document from frappe.utils import add_to_date, get_datetime, getdate, now_datetime, time_diff_in_seconds -from six import string_types + +from erpnext import get_default_company class NursingTask(Document): diff --git a/healthcare/healthcare/doctype/patient/patient.py b/healthcare/healthcare/doctype/patient/patient.py index 9f13b1ee54..a212803cbf 100644 --- a/healthcare/healthcare/doctype/patient/patient.py +++ b/healthcare/healthcare/doctype/patient/patient.py @@ -4,10 +4,8 @@ import dateutil + import frappe -from erpnext import get_default_currency -from erpnext.accounts.party import get_dashboard_info -from erpnext.selling.doctype.customer.customer import make_address from frappe import _ from frappe.contacts.address_and_contact import load_address_and_contact from frappe.contacts.doctype.contact.contact import get_default_contact @@ -16,6 +14,10 @@ from frappe.utils import cint, cstr, getdate from frappe.utils.nestedset import get_root_of +from erpnext import get_default_currency +from erpnext.accounts.party import get_dashboard_info +from erpnext.selling.doctype.customer.customer import make_address + from healthcare.healthcare.doctype.healthcare_settings.healthcare_settings import ( get_income_account, get_receivable_account, diff --git a/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py b/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py index 6c617cb799..b38b64dfc5 100755 --- a/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py +++ b/healthcare/healthcare/doctype/patient_appointment/patient_appointment.py @@ -7,13 +7,14 @@ import json import frappe -from erpnext.setup.doctype.employee.employee import is_holiday from frappe import _ from frappe.core.doctype.sms_settings.sms_settings import send_sms from frappe.model.document import Document from frappe.model.mapper import get_mapped_doc from frappe.utils import flt, format_date, get_link_to_form, get_time, getdate +from erpnext.setup.doctype.employee.employee import is_holiday + from healthcare.healthcare.doctype.fee_validity.fee_validity import ( check_fee_validity, get_fee_validity, diff --git a/healthcare/healthcare/doctype/patient_appointment/test_patient_appointment.py b/healthcare/healthcare/doctype/patient_appointment/test_patient_appointment.py index b71277c9f3..bb8870a5e0 100644 --- a/healthcare/healthcare/doctype/patient_appointment/test_patient_appointment.py +++ b/healthcare/healthcare/doctype/patient_appointment/test_patient_appointment.py @@ -6,10 +6,11 @@ import datetime import frappe -from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from frappe.tests.utils import FrappeTestCase from frappe.utils import add_days, flt, get_time, getdate, now_datetime, nowdate +from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile + from healthcare.healthcare.doctype.patient_appointment.patient_appointment import ( check_is_new_patient, check_payment_reqd, diff --git a/healthcare/healthcare/doctype/patient_medical_record/test_patient_medical_record.py b/healthcare/healthcare/doctype/patient_medical_record/test_patient_medical_record.py index 8f57d31bf1..b19a34b414 100644 --- a/healthcare/healthcare/doctype/patient_medical_record/test_patient_medical_record.py +++ b/healthcare/healthcare/doctype/patient_medical_record/test_patient_medical_record.py @@ -4,10 +4,11 @@ import frappe -from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile from frappe.tests.utils import FrappeTestCase from frappe.utils import add_days, nowdate +from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile + from healthcare.healthcare.doctype.patient_appointment.test_patient_appointment import ( create_appointment, create_encounter, diff --git a/healthcare/healthcare/doctype/service_request/service_request.py b/healthcare/healthcare/doctype/service_request/service_request.py index 693ce463e5..e6da5d3fe5 100644 --- a/healthcare/healthcare/doctype/service_request/service_request.py +++ b/healthcare/healthcare/doctype/service_request/service_request.py @@ -6,9 +6,10 @@ import json +from six import string_types + import frappe from frappe import _ -from six import string_types from healthcare.controllers.service_request_controller import ServiceRequestController diff --git a/healthcare/healthcare/doctype/service_request/test_service_request.py b/healthcare/healthcare/doctype/service_request/test_service_request.py index 9397b978a9..8e4c2f42ce 100644 --- a/healthcare/healthcare/doctype/service_request/test_service_request.py +++ b/healthcare/healthcare/doctype/service_request/test_service_request.py @@ -5,10 +5,11 @@ import unittest -import erpnext import frappe from frappe.utils import getdate, nowtime +import erpnext + from healthcare.healthcare.doctype.healthcare_settings.healthcare_settings import ( get_income_account, get_receivable_account, diff --git a/healthcare/healthcare/report/diagnosis_trends/diagnosis_trends.py b/healthcare/healthcare/report/diagnosis_trends/diagnosis_trends.py index 6515fbc076..9bf92ca8cf 100644 --- a/healthcare/healthcare/report/diagnosis_trends/diagnosis_trends.py +++ b/healthcare/healthcare/report/diagnosis_trends/diagnosis_trends.py @@ -2,11 +2,12 @@ # For license information, please see license.txt import frappe -from erpnext.accounts.utils import get_fiscal_year from frappe import _, scrub from frappe.database.query import OPERATOR_MAP from frappe.utils import add_days, add_to_date, flt, getdate +from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): return DiagnosisTrends(filters).run() diff --git a/healthcare/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py b/healthcare/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py index 2b5aed0e20..9e3fc8277a 100644 --- a/healthcare/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py +++ b/healthcare/healthcare/report/patient_appointment_analytics/patient_appointment_analytics.py @@ -3,10 +3,11 @@ import frappe -from erpnext.accounts.utils import get_fiscal_year from frappe import _, scrub from frappe.utils import add_days, add_to_date, flt, getdate +from erpnext.accounts.utils import get_fiscal_year + def execute(filters=None): return Analytics(filters).run() diff --git a/healthcare/healthcare/utils.py b/healthcare/healthcare/utils.py index 1b0acdd3e0..f5a87aece4 100644 --- a/healthcare/healthcare/utils.py +++ b/healthcare/healthcare/utils.py @@ -7,11 +7,12 @@ import math import frappe -from erpnext.setup.utils import insert_record from frappe import _ from frappe.utils import cstr, flt, get_link_to_form, rounded, time_diff_in_hours from frappe.utils.formatters import format_value +from erpnext.setup.utils import insert_record + from healthcare.healthcare.doctype.healthcare_settings.healthcare_settings import ( get_income_account, ) diff --git a/healthcare/patches/v15_0/check_version_compatibility_with_frappe.py b/healthcare/patches/v15_0/check_version_compatibility_with_frappe.py index 67ca8c7b6b..a273943354 100644 --- a/healthcare/patches/v15_0/check_version_compatibility_with_frappe.py +++ b/healthcare/patches/v15_0/check_version_compatibility_with_frappe.py @@ -1,4 +1,5 @@ import click + import frappe diff --git a/healthcare/regional/india/abdm/test_abdm.py b/healthcare/regional/india/abdm/test_abdm.py index d7a2feaffe..fb8a6b1409 100644 --- a/healthcare/regional/india/abdm/test_abdm.py +++ b/healthcare/regional/india/abdm/test_abdm.py @@ -1,5 +1,6 @@ -import frappe import responses + +import frappe from frappe.tests.utils import FrappeTestCase from healthcare.regional.india.abdm.utils import abdm_request diff --git a/healthcare/regional/india/abdm/utils.py b/healthcare/regional/india/abdm/utils.py index f164ae3c7c..42888d73a0 100644 --- a/healthcare/regional/india/abdm/utils.py +++ b/healthcare/regional/india/abdm/utils.py @@ -1,8 +1,9 @@ import json -import frappe import requests +import frappe + from healthcare.regional.india.abdm.abdm_config import get_url diff --git a/healthcare/setup.py b/healthcare/setup.py index 6297cea0c9..24973c250f 100644 --- a/healthcare/setup.py +++ b/healthcare/setup.py @@ -1,3 +1,4 @@ +# isort: skip_file import frappe from erpnext.setup.utils import insert_record from frappe import _ diff --git a/healthcare/uninstall.py b/healthcare/uninstall.py index d9058e6f96..9c714bcd17 100644 --- a/healthcare/uninstall.py +++ b/healthcare/uninstall.py @@ -1,4 +1,5 @@ import click + import frappe from healthcare.setup import before_uninstall as remove_customizations diff --git a/setup.py b/setup.py index 1706aa6e93..2ebd405dbd 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,4 @@ +# isort: skip_file from setuptools import find_packages, setup with open("requirements.txt") as f: