mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 23:22:52 +00:00
chore: Cleanup imports (#27320)
* chore: Added isort to pre-commit config * chore: Sort imports with isort * chore: Remove imports with pycln * chore: Sort imports with isort * chore: Fix import issues * chore: Fix sider issues * chore: linting * chore: linting / sorting import from ecommerce refactor merge * ci: dont allow unused imports * chore: sort / clean ecommerce imports Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
This commit is contained in:
@@ -2,9 +2,11 @@
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.utils.dashboard import cache_source
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
@cache_source
|
||||
def get(chart_name = None, chart = None, no_cache = None, filters = None, from_date = None,
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Antibiotic(Document):
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestAntibiotic(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe.model.document import Document
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class AppointmentType(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'appointment_type',
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class AppointmentTypeServiceItem(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class BodyPart(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestBodyPart(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class BodyPartLink(Document):
|
||||
pass
|
||||
|
||||
@@ -3,15 +3,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt, nowdate, nowtime, cstr
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import flt, nowdate, nowtime
|
||||
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account
|
||||
from erpnext.healthcare.doctype.lab_test.lab_test import create_sample_doc
|
||||
from erpnext.stock.stock_ledger import get_previous_sle
|
||||
from erpnext.stock.get_item_details import get_item_details
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from erpnext.stock.stock_ledger import get_previous_sle
|
||||
|
||||
|
||||
class ClinicalProcedure(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -4,8 +4,13 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_healthcare_docs, create_clinical_procedure_template
|
||||
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import (
|
||||
create_clinical_procedure_template,
|
||||
create_healthcare_docs,
|
||||
)
|
||||
|
||||
test_dependencies = ['Item']
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ClinicalProcedureItem(Document):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.rename_doc import rename_doc
|
||||
|
||||
|
||||
class ClinicalProcedureTemplate(Document):
|
||||
def validate(self):
|
||||
self.enable_disable_item()
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'procedure_template',
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, earthians and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestClinicalProcedureTemplate(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class CodificationTable(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Complaint(Document):
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestComplaint(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DescriptiveTestResult(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DescriptiveTestTemplate(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Diagnosis(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DosageForm(Document):
|
||||
pass
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestDosageForm(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DosageStrength(Document):
|
||||
pass
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class DrugPrescription(Document):
|
||||
def get_quantity(self):
|
||||
quantity = 0
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Exercise(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ExerciseDifficultyLevel(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestExerciseDifficultyLevel(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ExerciseType(Document):
|
||||
def autoname(self):
|
||||
if self.difficulty_level:
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestExerciseType(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ExerciseTypeStep(Document):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe.model.document import Document
|
||||
import frappe
|
||||
from frappe.utils import getdate
|
||||
|
||||
import datetime
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate
|
||||
|
||||
|
||||
class FeeValidity(Document):
|
||||
def validate(self):
|
||||
self.update_status()
|
||||
|
||||
@@ -3,11 +3,17 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
from frappe.utils import nowdate, add_days
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_healthcare_docs, create_appointment, create_healthcare_service_items
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_days, nowdate
|
||||
|
||||
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import (
|
||||
create_appointment,
|
||||
create_healthcare_docs,
|
||||
create_healthcare_service_items,
|
||||
)
|
||||
|
||||
test_dependencies = ["Company"]
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class FeeValidityReference(Document):
|
||||
pass
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
def get_data():
|
||||
|
||||
return []
|
||||
|
||||
@@ -3,13 +3,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from erpnext.accounts.party import validate_party_accounts
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact, delete_contact_and_address
|
||||
from frappe.contacts.address_and_contact import (
|
||||
delete_contact_and_address,
|
||||
load_address_and_contact,
|
||||
)
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import append_number_if_name_exists
|
||||
from frappe.desk.reportview import build_match_conditions, get_filters_cond
|
||||
|
||||
from erpnext.accounts.party import validate_party_accounts
|
||||
|
||||
|
||||
class HealthcarePractitioner(Document):
|
||||
def onload(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestHealthcarePractitioner(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class HealthcareScheduleTimeSlot(Document):
|
||||
pass
|
||||
|
||||
@@ -4,11 +4,12 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
from frappe.utils import cint, cstr
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import json
|
||||
from frappe.utils import cint, cstr
|
||||
from frappe.utils.nestedset import NestedSet
|
||||
|
||||
|
||||
class HealthcareServiceUnit(NestedSet):
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestHealthcareServiceUnit(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.rename_doc import rename_doc
|
||||
|
||||
|
||||
class HealthcareServiceUnitType(Document):
|
||||
def validate(self):
|
||||
if self.allow_appointments and self.inpatient_occupancy:
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'service_unit_type',
|
||||
|
||||
@@ -2,9 +2,12 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
class TestHealthcareServiceUnitType(unittest.TestCase):
|
||||
def test_item_creation(self):
|
||||
unit_type = get_unit_type()
|
||||
|
||||
@@ -3,11 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.core.doctype.sms_settings.sms_settings import send_sms
|
||||
import json
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class HealthcareSettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestHealthcareSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import flt, get_link_to_form, getdate, nowtime
|
||||
from erpnext.stock.utils import get_latest_stock_qty
|
||||
from frappe.utils import flt, get_link_to_form
|
||||
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account
|
||||
from erpnext.stock.utils import get_latest_stock_qty
|
||||
|
||||
|
||||
class InpatientMedicationEntry(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'against_imoe',
|
||||
|
||||
@@ -3,14 +3,32 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_days, getdate, now_datetime
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import create_patient, create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge
|
||||
from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import create_ipmo, create_ipme
|
||||
from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_drug_shortage_map, make_difference_stock_entry
|
||||
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_account
|
||||
from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import (
|
||||
get_drug_shortage_map,
|
||||
make_difference_stock_entry,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_medication_order.test_inpatient_medication_order import (
|
||||
create_ipme,
|
||||
create_ipmo,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import (
|
||||
admit_patient,
|
||||
discharge_patient,
|
||||
schedule_discharge,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import (
|
||||
create_inpatient,
|
||||
create_patient,
|
||||
get_healthcare_service_unit,
|
||||
mark_invoiced_inpatient_occupancy,
|
||||
)
|
||||
|
||||
|
||||
class TestInpatientMedicationEntry(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class InpatientMedicationEntryDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr
|
||||
|
||||
from erpnext.healthcare.doctype.patient_encounter.patient_encounter import get_prescription_dates
|
||||
|
||||
|
||||
class InpatientMedicationOrder(Document):
|
||||
def validate(self):
|
||||
self.validate_inpatient()
|
||||
|
||||
@@ -3,11 +3,23 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import add_days, getdate, now_datetime
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import create_patient, create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge
|
||||
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import (
|
||||
admit_patient,
|
||||
discharge_patient,
|
||||
schedule_discharge,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import (
|
||||
create_inpatient,
|
||||
create_patient,
|
||||
get_healthcare_service_unit,
|
||||
mark_invoiced_inpatient_occupancy,
|
||||
)
|
||||
|
||||
|
||||
class TestInpatientMedicationOrder(unittest.TestCase):
|
||||
def setUp(self):
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class InpatientMedicationOrderEntry(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class InpatientOccupancy(Document):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import today, now_datetime, getdate, get_datetime, get_link_to_form
|
||||
from frappe.model.document import Document
|
||||
from frappe.desk.reportview import get_match_cond
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_datetime, get_link_to_form, getdate, now_datetime, today
|
||||
|
||||
|
||||
class InpatientRecord(Document):
|
||||
def after_insert(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'inpatient_record',
|
||||
|
||||
@@ -3,14 +3,21 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import now_datetime, today
|
||||
from frappe.utils.make_random import get_random
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge
|
||||
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import (
|
||||
admit_patient,
|
||||
discharge_patient,
|
||||
schedule_discharge,
|
||||
)
|
||||
from erpnext.healthcare.doctype.lab_test.test_lab_test import create_patient_encounter
|
||||
from erpnext.healthcare.utils import get_encounters_to_invoice
|
||||
|
||||
|
||||
class TestInpatientRecord(unittest.TestCase):
|
||||
def test_admit_and_discharge(self):
|
||||
frappe.db.sql("""delete from `tabInpatient Record`""")
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LabPrescription(Document):
|
||||
pass
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import getdate, cstr, get_link_to_form
|
||||
from frappe.utils import get_link_to_form, getdate
|
||||
|
||||
|
||||
class LabTest(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -2,13 +2,22 @@
|
||||
# Copyright (c) 2015, ESS LLP and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils import getdate, nowtime
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient
|
||||
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import (
|
||||
get_income_account,
|
||||
get_receivable_account,
|
||||
)
|
||||
from erpnext.healthcare.doctype.lab_test.lab_test import create_multiple
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
|
||||
from erpnext.healthcare.doctype.patient_medical_record.test_patient_medical_record import create_lab_test_template as create_blood_test_template
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient
|
||||
from erpnext.healthcare.doctype.patient_medical_record.test_patient_medical_record import (
|
||||
create_lab_test_template as create_blood_test_template,
|
||||
)
|
||||
|
||||
|
||||
class TestLabTest(unittest.TestCase):
|
||||
def test_lab_test_item(self):
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LabTestGroupTemplate(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LabTestSample(Document):
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestLabTestSample(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,10 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, json
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.rename_doc import rename_doc
|
||||
from frappe import _
|
||||
|
||||
|
||||
class LabTestTemplate(Document):
|
||||
def after_insert(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'template',
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Copyright (c) 2015, ESS and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Lab Test Template')
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class LabTestUOM(Document):
|
||||
pass
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Copyright (c) 2015, ESS and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Lab Test UOM')
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class MedicalCode(Document):
|
||||
def autoname(self):
|
||||
self.name = self.medical_code_standard+" "+self.code
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMedicalCode(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class MedicalCodeStandard(Document):
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2017, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestMedicalCodeStandard(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class MedicalDepartment(Document):
|
||||
pass
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# Copyright (c) 2015, ESS LLP and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Medical Department')
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class NormalTestResult(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class NormalTestTemplate(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class Organism(Document):
|
||||
pass
|
||||
|
||||
@@ -2,7 +2,9 @@
|
||||
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestOrganism(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class OrganismTestItem(Document):
|
||||
pass
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class OrganismTestResult(Document):
|
||||
pass
|
||||
|
||||
@@ -3,18 +3,25 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import dateutil
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cint, cstr, getdate
|
||||
import dateutil
|
||||
from frappe.contacts.address_and_contact import load_address_and_contact
|
||||
from frappe.contacts.doctype.contact.contact import get_default_contact
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import set_name_by_naming_series
|
||||
from frappe.utils import cint, cstr, getdate
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
|
||||
from erpnext import get_default_currency
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account, send_registration_sms
|
||||
from erpnext.accounts.party import get_dashboard_info
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import (
|
||||
get_income_account,
|
||||
get_receivable_account,
|
||||
send_registration_sms,
|
||||
)
|
||||
|
||||
|
||||
class Patient(Document):
|
||||
def onload(self):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'heatmap': True,
|
||||
|
||||
@@ -4,9 +4,12 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.healthcare.doctype.patient_appointment.test_patient_appointment import create_patient
|
||||
|
||||
|
||||
class TestPatient(unittest.TestCase):
|
||||
def test_customer_created(self):
|
||||
frappe.db.sql("""delete from `tabPatient`""")
|
||||
|
||||
@@ -3,17 +3,28 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
import json
|
||||
from frappe.utils import getdate, get_time, flt, get_link_to_form
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe import _
|
||||
|
||||
import datetime
|
||||
import json
|
||||
|
||||
import frappe
|
||||
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, get_link_to_form, get_time, getdate
|
||||
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import (
|
||||
get_income_account,
|
||||
get_receivable_account,
|
||||
)
|
||||
from erpnext.healthcare.utils import (
|
||||
check_fee_validity,
|
||||
get_service_item_and_practitioner_charge,
|
||||
manage_fee_validity,
|
||||
)
|
||||
from erpnext.hr.doctype.employee.employee import is_holiday
|
||||
from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account
|
||||
from erpnext.healthcare.utils import check_fee_validity, get_service_item_and_practitioner_charge, manage_fee_validity
|
||||
|
||||
|
||||
class MaximumCapacityError(frappe.ValidationError):
|
||||
pass
|
||||
@@ -100,7 +111,9 @@ class PatientAppointment(Document):
|
||||
|
||||
def validate_service_unit(self):
|
||||
if self.inpatient_record and self.service_unit:
|
||||
from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import get_current_healthcare_service_unit
|
||||
from erpnext.healthcare.doctype.inpatient_medication_entry.inpatient_medication_entry import (
|
||||
get_current_healthcare_service_unit,
|
||||
)
|
||||
|
||||
is_inpatient_occupancy_unit = frappe.db.get_value('Healthcare Service Unit', self.service_unit,
|
||||
'inpatient_occupancy')
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'appointment',
|
||||
|
||||
@@ -2,12 +2,19 @@
|
||||
# Copyright (c) 2015, ESS LLP and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from erpnext.healthcare.doctype.patient_appointment.patient_appointment import update_status, make_encounter, check_payment_fields_reqd, check_is_new_patient
|
||||
from frappe.utils import nowdate, add_days, now_datetime
|
||||
from frappe.utils.make_random import get_random
|
||||
from frappe.utils import add_days, now_datetime, nowdate
|
||||
|
||||
from erpnext.accounts.doctype.pos_profile.test_pos_profile import make_pos_profile
|
||||
from erpnext.healthcare.doctype.patient_appointment.patient_appointment import (
|
||||
check_is_new_patient,
|
||||
check_payment_fields_reqd,
|
||||
make_encounter,
|
||||
update_status,
|
||||
)
|
||||
|
||||
|
||||
class TestPatientAppointment(unittest.TestCase):
|
||||
@@ -131,9 +138,16 @@ class TestPatientAppointment(unittest.TestCase):
|
||||
self.assertEqual(frappe.db.get_value('Sales Invoice', sales_invoice_name, 'status'), 'Cancelled')
|
||||
|
||||
def test_appointment_booking_for_admission_service_unit(self):
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import \
|
||||
create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import (
|
||||
admit_patient,
|
||||
discharge_patient,
|
||||
schedule_discharge,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import (
|
||||
create_inpatient,
|
||||
get_healthcare_service_unit,
|
||||
mark_invoiced_inpatient_occupancy,
|
||||
)
|
||||
|
||||
frappe.db.sql("""delete from `tabInpatient Record`""")
|
||||
patient, practitioner = create_healthcare_docs()
|
||||
@@ -157,9 +171,16 @@ class TestPatientAppointment(unittest.TestCase):
|
||||
discharge_patient(ip_record1, now_datetime())
|
||||
|
||||
def test_invalid_healthcare_service_unit_validation(self):
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import admit_patient, discharge_patient, schedule_discharge
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import \
|
||||
create_inpatient, get_healthcare_service_unit, mark_invoiced_inpatient_occupancy
|
||||
from erpnext.healthcare.doctype.inpatient_record.inpatient_record import (
|
||||
admit_patient,
|
||||
discharge_patient,
|
||||
schedule_discharge,
|
||||
)
|
||||
from erpnext.healthcare.doctype.inpatient_record.test_inpatient_record import (
|
||||
create_inpatient,
|
||||
get_healthcare_service_unit,
|
||||
mark_invoiced_inpatient_occupancy,
|
||||
)
|
||||
|
||||
frappe.db.sql("""delete from `tabInpatient Record`""")
|
||||
patient, practitioner = create_healthcare_docs()
|
||||
@@ -238,7 +259,10 @@ class TestPatientAppointment(unittest.TestCase):
|
||||
self.assertRaises(OverlapError, appointment.save)
|
||||
|
||||
def test_service_unit_capacity(self):
|
||||
from erpnext.healthcare.doctype.patient_appointment.patient_appointment import MaximumCapacityError, OverlapError
|
||||
from erpnext.healthcare.doctype.patient_appointment.patient_appointment import (
|
||||
MaximumCapacityError,
|
||||
OverlapError,
|
||||
)
|
||||
practitioner = create_practitioner()
|
||||
capacity = 3
|
||||
overlap_service_unit_type = create_service_unit_type(id=10, allow_appointments=1, overlap_appointments=1)
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
|
||||
|
||||
class PatientAssessment(Document):
|
||||
def validate(self):
|
||||
self.set_total_score()
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPatientAssessment(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientAssessmentDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientAssessmentParameter(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPatientAssessmentParameter(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientAssessmentSheet(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientAssessmentTemplate(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestPatientAssessmentTemplate(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import cstr, getdate, add_days
|
||||
from frappe.model.mapper import get_mapped_doc
|
||||
from frappe.utils import add_days, getdate
|
||||
|
||||
|
||||
class PatientEncounter(Document):
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe import _
|
||||
|
||||
|
||||
def get_data():
|
||||
return {
|
||||
'fieldname': 'encounter',
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.healthcare.doctype.patient_encounter.patient_encounter import PatientEncounter
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientEncounterDiagnosis(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientEncounterSymptom(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class PatientHistoryCustomDocumentType(Document):
|
||||
pass
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user