Merge branch 'hotfix'
This commit is contained in:
commit
8854438830
@ -4,7 +4,7 @@ import inspect
|
|||||||
import frappe
|
import frappe
|
||||||
from erpnext.hooks import regional_overrides
|
from erpnext.hooks import regional_overrides
|
||||||
|
|
||||||
__version__ = '9.1.3'
|
__version__ = '9.1.4'
|
||||||
|
|
||||||
def get_default_company(user=None):
|
def get_default_company(user=None):
|
||||||
'''Get default company for user'''
|
'''Get default company for user'''
|
||||||
|
@ -844,7 +844,7 @@
|
|||||||
"issingle": 0,
|
"issingle": 0,
|
||||||
"istable": 0,
|
"istable": 0,
|
||||||
"max_attachments": 0,
|
"max_attachments": 0,
|
||||||
"modified": "2017-10-03 17:20:26.919630",
|
"modified": "2017-10-10 17:28:10.105561",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "Subscription",
|
"name": "Subscription",
|
||||||
|
@ -48,6 +48,7 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
this.prepare_menu();
|
this.prepare_menu();
|
||||||
this.set_online_status();
|
this.set_online_status();
|
||||||
},
|
},
|
||||||
|
() => this.setup_company(),
|
||||||
() => this.setup_pos_profile(),
|
() => this.setup_pos_profile(),
|
||||||
() => this.make_new_invoice(),
|
() => this.make_new_invoice(),
|
||||||
() => {
|
() => {
|
||||||
@ -101,16 +102,13 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
if (!this.payment) {
|
if (!this.payment) {
|
||||||
this.make_payment_modal();
|
this.make_payment_modal();
|
||||||
} else {
|
} else {
|
||||||
const mop_field = this.payment.default_mop;
|
|
||||||
let amount = 0.0;
|
|
||||||
this.frm.doc.payments.map(p => {
|
this.frm.doc.payments.map(p => {
|
||||||
if (p.mode_of_payment == mop_field) {
|
if (p.amount) {
|
||||||
amount = p.amount;
|
this.payment.dialog.set_value(p.mode_of_payment, p.amount);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.payment.dialog.set_value(mop_field, flt(amount));
|
this.payment.set_title();
|
||||||
}
|
}
|
||||||
this.payment.open_modal();
|
this.payment.open_modal();
|
||||||
}
|
}
|
||||||
@ -286,21 +284,40 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setup_pos_profile() {
|
setup_pos_profile() {
|
||||||
return frappe.call({
|
return new Promise(resolve => {
|
||||||
method: 'erpnext.stock.get_item_details.get_pos_profile',
|
frappe.call({
|
||||||
args: {
|
method: 'erpnext.stock.get_item_details.get_pos_profile',
|
||||||
company: frappe.sys_defaults.company
|
args: {
|
||||||
}
|
company: this.company
|
||||||
}).then(r => {
|
}
|
||||||
this.pos_profile = r.message;
|
}).then(r => {
|
||||||
|
this.pos_profile = r.message;
|
||||||
|
|
||||||
if (!this.pos_profile) {
|
if (!this.pos_profile) {
|
||||||
this.pos_profile = {
|
this.pos_profile = {
|
||||||
currency: frappe.defaults.get_default('currency'),
|
company: this.company,
|
||||||
selling_price_list: frappe.defaults.get_default('selling_price_list')
|
currency: frappe.defaults.get_default('currency'),
|
||||||
};
|
selling_price_list: frappe.defaults.get_default('selling_price_list')
|
||||||
|
};
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
setup_company() {
|
||||||
|
this.company = frappe.sys_defaults.company;
|
||||||
|
return new Promise(resolve => {
|
||||||
|
if(!this.company) {
|
||||||
|
frappe.prompt({fieldname:"company", options: "Company", fieldtype:"Link",
|
||||||
|
label: __("Select Company"), reqd: 1}, (data) => {
|
||||||
|
this.company = data.company;
|
||||||
|
resolve(this.company);
|
||||||
|
}, __("Select Company"));
|
||||||
|
} else {
|
||||||
|
resolve(this.company);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
make_new_invoice() {
|
make_new_invoice() {
|
||||||
@ -322,22 +339,25 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
const doctype = 'Sales Invoice';
|
const doctype = 'Sales Invoice';
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
if (this.frm) {
|
if (this.frm) {
|
||||||
this.frm = get_frm(this.frm);
|
this.frm = get_frm(this.pos_profile, this.frm);
|
||||||
resolve();
|
resolve();
|
||||||
} else {
|
} else {
|
||||||
frappe.model.with_doctype(doctype, () => {
|
frappe.model.with_doctype(doctype, () => {
|
||||||
this.frm = get_frm();
|
this.frm = get_frm(this.pos_profile);
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
function get_frm(_frm) {
|
function get_frm(pos_profile, _frm) {
|
||||||
const page = $('<div>');
|
const page = $('<div>');
|
||||||
const frm = _frm || new _f.Frm(doctype, page, false);
|
const frm = _frm || new _f.Frm(doctype, page, false);
|
||||||
const name = frappe.model.make_new_doc_and_get_name(doctype, true);
|
const name = frappe.model.make_new_doc_and_get_name(doctype, true);
|
||||||
frm.refresh(name);
|
frm.refresh(name);
|
||||||
frm.doc.items = [];
|
frm.doc.items = [];
|
||||||
|
if(!frm.doc.company) {
|
||||||
|
frm.set_value('company', pos_profile.company);
|
||||||
|
}
|
||||||
frm.set_value('is_pos', 1);
|
frm.set_value('is_pos', 1);
|
||||||
frm.meta.default_print_format = 'POS Invoice';
|
frm.meta.default_print_format = 'POS Invoice';
|
||||||
return frm;
|
return frm;
|
||||||
@ -1185,16 +1205,13 @@ class Payment {
|
|||||||
|
|
||||||
make() {
|
make() {
|
||||||
this.set_flag();
|
this.set_flag();
|
||||||
|
|
||||||
let title = __('Total Amount {0}',
|
|
||||||
[format_currency(this.frm.doc.grand_total, this.frm.doc.currency)]);
|
|
||||||
|
|
||||||
this.dialog = new frappe.ui.Dialog({
|
this.dialog = new frappe.ui.Dialog({
|
||||||
title: title,
|
|
||||||
fields: this.get_fields(),
|
fields: this.get_fields(),
|
||||||
width: 800
|
width: 800
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.set_title();
|
||||||
|
|
||||||
this.$body = this.dialog.body;
|
this.$body = this.dialog.body;
|
||||||
|
|
||||||
this.numpad = new NumberPad({
|
this.numpad = new NumberPad({
|
||||||
@ -1213,6 +1230,13 @@ class Payment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_title() {
|
||||||
|
let title = __('Total Amount {0}',
|
||||||
|
[format_currency(this.frm.doc.grand_total, this.frm.doc.currency)]);
|
||||||
|
|
||||||
|
this.dialog.set_title(title);
|
||||||
|
}
|
||||||
|
|
||||||
bind_events() {
|
bind_events() {
|
||||||
var me = this;
|
var me = this;
|
||||||
$(this.dialog.body).find('.input-with-feedback').focusin(function() {
|
$(this.dialog.body).find('.input-with-feedback').focusin(function() {
|
||||||
@ -1234,10 +1258,6 @@ class Payment {
|
|||||||
const me = this;
|
const me = this;
|
||||||
|
|
||||||
let fields = this.frm.doc.payments.map(p => {
|
let fields = this.frm.doc.payments.map(p => {
|
||||||
if (p.default) {
|
|
||||||
this.default_mop = p.mode_of_payment;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
fieldtype: 'Currency',
|
fieldtype: 'Currency',
|
||||||
label: __(p.mode_of_payment),
|
label: __(p.mode_of_payment),
|
||||||
|
@ -9,6 +9,8 @@ from frappe.utils.nestedset import get_root_of
|
|||||||
def get_items(start, page_length, price_list, item_group, search_value=""):
|
def get_items(start, page_length, price_list, item_group, search_value=""):
|
||||||
serial_no = ""
|
serial_no = ""
|
||||||
batch_no = ""
|
batch_no = ""
|
||||||
|
barcode = ""
|
||||||
|
|
||||||
item_code = search_value
|
item_code = search_value
|
||||||
if not frappe.db.exists('Item Group', item_group):
|
if not frappe.db.exists('Item Group', item_group):
|
||||||
item_group = get_root_of('Item Group')
|
item_group = get_root_of('Item Group')
|
||||||
@ -24,7 +26,12 @@ def get_items(start, page_length, price_list, item_group, search_value=""):
|
|||||||
if batch_no_data:
|
if batch_no_data:
|
||||||
batch_no, item_code = batch_no_data
|
batch_no, item_code = batch_no_data
|
||||||
|
|
||||||
item_code, condition = get_conditions(item_code, serial_no, batch_no)
|
if not serial_no and not batch_no:
|
||||||
|
barcode_data = frappe.db.get_value('Item', {'barcode': search_value}, ['name', 'barcode'])
|
||||||
|
if barcode_data:
|
||||||
|
item_code, barcode = barcode_data
|
||||||
|
|
||||||
|
item_code, condition = get_conditions(item_code, serial_no, batch_no, barcode)
|
||||||
|
|
||||||
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
|
lft, rgt = frappe.db.get_value('Item Group', item_group, ['lft', 'rgt'])
|
||||||
# locate function is used to sort by closest match from the beginning of the value
|
# locate function is used to sort by closest match from the beginning of the value
|
||||||
@ -62,12 +69,12 @@ def get_items(start, page_length, price_list, item_group, search_value=""):
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def get_conditions(item_code, serial_no, batch_no):
|
def get_conditions(item_code, serial_no, batch_no, barcode):
|
||||||
if serial_no or batch_no:
|
if serial_no or batch_no or barcode:
|
||||||
return frappe.db.escape(item_code), "i.item_code = %(item_code)s"
|
return frappe.db.escape(item_code), "i.item_code = %(item_code)s"
|
||||||
|
|
||||||
condition = """(i.item_code like %(item_code)s
|
condition = """(i.item_code like %(item_code)s
|
||||||
or i.item_name like %(item_code)s or i.barcode like %(item_code)s)"""
|
or i.item_name like %(item_code)s)"""
|
||||||
|
|
||||||
return '%%%s%%'%(frappe.db.escape(item_code)), condition
|
return '%%%s%%'%(frappe.db.escape(item_code)), condition
|
||||||
|
|
||||||
|
@ -29,48 +29,53 @@ def make_custom_fields():
|
|||||||
|
|
||||||
|
|
||||||
def create_medical_departments():
|
def create_medical_departments():
|
||||||
depts = ["Accident and emergency care" ,"Anaesthetics", "Biochemistry", "Cardiology", "Dermatology",
|
departments = [
|
||||||
"Diagnostic imaging", "ENT", "Gastroenterology", "General Surgery", "Gynaecology",
|
"Accident And Emergency Care" ,"Anaesthetics", "Biochemistry", "Cardiology", "Dermatology",
|
||||||
"Haematology", "Maternity", "Microbiology", "Nephrology", "Neurology", "Oncology",
|
"Diagnostic Imaging", "ENT", "Gastroenterology", "General Surgery", "Gynaecology",
|
||||||
"Orthopaedics", "Pathology", "Physiotherapy", "Rheumatology", "Serology", "Urology"]
|
"Haematology", "Maternity", "Microbiology", "Nephrology", "Neurology", "Oncology",
|
||||||
for d in depts:
|
"Orthopaedics", "Pathology", "Physiotherapy", "Rheumatology", "Serology", "Urology"
|
||||||
|
]
|
||||||
|
for department in departments:
|
||||||
mediacal_department = frappe.new_doc("Medical Department")
|
mediacal_department = frappe.new_doc("Medical Department")
|
||||||
mediacal_department.department = d
|
mediacal_department.department = _(department)
|
||||||
try:
|
try:
|
||||||
mediacal_department.save()
|
mediacal_department.save()
|
||||||
except frappe.DuplicateEntryError:
|
except frappe.DuplicateEntryError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def create_antibiotics():
|
def create_antibiotics():
|
||||||
abt = ["Amoxicillin", "Ampicillin", "Bacampicillin", "Carbenicillin", "Cloxacillin", "Dicloxacillin",
|
abt = [
|
||||||
"Flucloxacillin", "Mezlocillin", "Nafcillin", "Oxacillin", "Penicillin G", "Penicillin V",
|
"Amoxicillin", "Ampicillin", "Bacampicillin", "Carbenicillin", "Cloxacillin", "Dicloxacillin",
|
||||||
"Piperacillin", "Pivampicillin", "Pivmecillinam", "Ticarcillin", "Cefacetrile (cephacetrile)",
|
"Flucloxacillin", "Mezlocillin", "Nafcillin", "Oxacillin", "Penicillin G", "Penicillin V",
|
||||||
"Cefadroxil (cefadroxyl)", "Cefalexin (cephalexin)", "Cefaloglycin (cephaloglycin)",
|
"Piperacillin", "Pivampicillin", "Pivmecillinam", "Ticarcillin", "Cefacetrile (cephacetrile)",
|
||||||
"Cefalonium (cephalonium)", "Cefaloridine (cephaloradine)", "Cefalotin (cephalothin)",
|
"Cefadroxil (cefadroxyl)", "Cefalexin (cephalexin)", "Cefaloglycin (cephaloglycin)",
|
||||||
"Cefapirin (cephapirin)", "Cefatrizine", "Cefazaflur", "Cefazedone", "Cefazolin (cephazolin)",
|
"Cefalonium (cephalonium)", "Cefaloridine (cephaloradine)", "Cefalotin (cephalothin)",
|
||||||
"Cefradine (cephradine)", "Cefroxadine", "Ceftezole", "Cefaclor", "Cefamandole", "Cefmetazole",
|
"Cefapirin (cephapirin)", "Cefatrizine", "Cefazaflur", "Cefazedone", "Cefazolin (cephazolin)",
|
||||||
"Cefonicid", "Cefotetan", "Cefoxitin", "Cefprozil (cefproxil)", "Cefuroxime", "Cefuzonam",
|
"Cefradine (cephradine)", "Cefroxadine", "Ceftezole", "Cefaclor", "Cefamandole", "Cefmetazole",
|
||||||
"Cefcapene", "Cefdaloxime", "Cefdinir", "Cefditoren", "Cefetamet", "Cefixime", "Cefmenoxime",
|
"Cefonicid", "Cefotetan", "Cefoxitin", "Cefprozil (cefproxil)", "Cefuroxime", "Cefuzonam",
|
||||||
"Cefodizime", "Cefotaxime", "Cefpimizole", "Cefpodoxime", "Cefteram", "Ceftibuten", "Ceftiofur",
|
"Cefcapene", "Cefdaloxime", "Cefdinir", "Cefditoren", "Cefetamet", "Cefixime", "Cefmenoxime",
|
||||||
"Ceftiolene", "Ceftizoxime", "Ceftriaxone", "Cefoperazone", "Ceftazidime", "Cefclidine", "Cefepime",
|
"Cefodizime", "Cefotaxime", "Cefpimizole", "Cefpodoxime", "Cefteram", "Ceftibuten", "Ceftiofur",
|
||||||
"Cefluprenam", "Cefoselis", "Cefozopran", "Cefpirome", "Cefquinome", "Ceftobiprole", "Ceftaroline",
|
"Ceftiolene", "Ceftizoxime", "Ceftriaxone", "Cefoperazone", "Ceftazidime", "Cefclidine", "Cefepime",
|
||||||
"Cefaclomezine","Cefaloram", "Cefaparole", "Cefcanel", "Cefedrolor", "Cefempidone", "Cefetrizole",
|
"Cefluprenam", "Cefoselis", "Cefozopran", "Cefpirome", "Cefquinome", "Ceftobiprole", "Ceftaroline",
|
||||||
"Cefivitril", "Cefmatilen", "Cefmepidium", "Cefovecin", "Cefoxazole", "Cefrotil", "Cefsumide",
|
"Cefaclomezine","Cefaloram", "Cefaparole", "Cefcanel", "Cefedrolor", "Cefempidone", "Cefetrizole",
|
||||||
"Cefuracetime", "Ceftioxide", "Ceftazidime/Avibactam", "Ceftolozane/Tazobactam", "Aztreonam",
|
"Cefivitril", "Cefmatilen", "Cefmepidium", "Cefovecin", "Cefoxazole", "Cefrotil", "Cefsumide",
|
||||||
"Imipenem", "Imipenem/cilastatin", "Doripenem", "Meropenem", "Ertapenem", "Azithromycin",
|
"Cefuracetime", "Ceftioxide", "Ceftazidime/Avibactam", "Ceftolozane/Tazobactam", "Aztreonam",
|
||||||
"Erythromycin", "Clarithromycin", "Dirithromycin", "Roxithromycin", "Telithromycin", "Clindamycin",
|
"Imipenem", "Imipenem/cilastatin", "Doripenem", "Meropenem", "Ertapenem", "Azithromycin",
|
||||||
"Lincomycin", "Pristinamycin", "Quinupristin/dalfopristin", "Amikacin", "Gentamicin", "Kanamycin",
|
"Erythromycin", "Clarithromycin", "Dirithromycin", "Roxithromycin", "Telithromycin", "Clindamycin",
|
||||||
"Neomycin", "Netilmicin", "Paromomycin", "Streptomycin", "Tobramycin", "Flumequine", "Nalidixic acid",
|
"Lincomycin", "Pristinamycin", "Quinupristin/dalfopristin", "Amikacin", "Gentamicin", "Kanamycin",
|
||||||
"Oxolinic acid", "Piromidic acid", "Pipemidic acid", "Rosoxacin", "Ciprofloxacin", "Enoxacin",
|
"Neomycin", "Netilmicin", "Paromomycin", "Streptomycin", "Tobramycin", "Flumequine", "Nalidixic acid",
|
||||||
"Lomefloxacin", "Nadifloxacin", "Norfloxacin", "Ofloxacin", "Pefloxacin", "Rufloxacin", "Balofloxacin",
|
"Oxolinic acid", "Piromidic acid", "Pipemidic acid", "Rosoxacin", "Ciprofloxacin", "Enoxacin",
|
||||||
"Gatifloxacin", "Grepafloxacin", "Levofloxacin", "Moxifloxacin", "Pazufloxacin", "Sparfloxacin",
|
"Lomefloxacin", "Nadifloxacin", "Norfloxacin", "Ofloxacin", "Pefloxacin", "Rufloxacin", "Balofloxacin",
|
||||||
"Temafloxacin", "Tosufloxacin", "Besifloxacin", "Clinafloxacin", "Gemifloxacin",
|
"Gatifloxacin", "Grepafloxacin", "Levofloxacin", "Moxifloxacin", "Pazufloxacin", "Sparfloxacin",
|
||||||
"Sitafloxacin", "Trovafloxacin", "Prulifloxacin", "Sulfamethizole", "Sulfamethoxazole",
|
"Temafloxacin", "Tosufloxacin", "Besifloxacin", "Clinafloxacin", "Gemifloxacin",
|
||||||
"Sulfisoxazole", "Trimethoprim-Sulfamethoxazole", "Demeclocycline", "Doxycycline", "Minocycline",
|
"Sitafloxacin", "Trovafloxacin", "Prulifloxacin", "Sulfamethizole", "Sulfamethoxazole",
|
||||||
"Oxytetracycline", "Tetracycline", "Tigecycline", "Chloramphenicol", "Metronidazole",
|
"Sulfisoxazole", "Trimethoprim-Sulfamethoxazole", "Demeclocycline", "Doxycycline", "Minocycline",
|
||||||
"Tinidazole", "Nitrofurantoin", "Vancomycin", "Teicoplanin", "Telavancin", "Linezolid",
|
"Oxytetracycline", "Tetracycline", "Tigecycline", "Chloramphenicol", "Metronidazole",
|
||||||
"Cycloserine 2", "Rifampin", "Rifabutin", "Rifapentine", "Rifalazil", "Bacitracin", "Polymyxin B",
|
"Tinidazole", "Nitrofurantoin", "Vancomycin", "Teicoplanin", "Telavancin", "Linezolid",
|
||||||
"Viomycin", "Capreomycin"]
|
"Cycloserine 2", "Rifampin", "Rifabutin", "Rifapentine", "Rifalazil", "Bacitracin", "Polymyxin B",
|
||||||
|
"Viomycin", "Capreomycin"
|
||||||
|
]
|
||||||
|
|
||||||
for a in abt:
|
for a in abt:
|
||||||
antibiotic = frappe.new_doc("Antibiotic")
|
antibiotic = frappe.new_doc("Antibiotic")
|
||||||
antibiotic.antibiotic_name = a
|
antibiotic.antibiotic_name = a
|
||||||
@ -190,21 +195,21 @@ def create_healthcare_item_groups():
|
|||||||
|
|
||||||
def create_lab_test_items():
|
def create_lab_test_items():
|
||||||
records = [
|
records = [
|
||||||
{"doctype": "Item", "item_code": "MCH", "item_name": "MCH", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "MCH", "item_name": "MCH", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "LDL", "item_name": "LDL", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "LDL", "item_name": "LDL", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "GTT", "item_name": "GTT", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "GTT", "item_name": "GTT", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "HDL", "item_name": "HDL", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "HDL", "item_name": "HDL", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "BILT", "item_name": "BILT", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "BILT", "item_name": "BILT", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "BILD", "item_name": "BILD", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "BILD", "item_name": "BILD", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "BP", "item_name": "BP", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "BP", "item_name": "BP", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1},
|
||||||
{"doctype": "Item", "item_code": "BS", "item_name": "BS", "item_group": "Laboratory",
|
{"doctype": "Item", "item_code": "BS", "item_name": "BS", "item_group": _("Laboratory"),
|
||||||
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}
|
"stock_uom": _("Unit"), "is_stock_item": 0, "is_purchase_item": 0, "is_sales_item": 1}
|
||||||
]
|
]
|
||||||
insert_record(records)
|
insert_record(records)
|
||||||
@ -212,43 +217,43 @@ def create_lab_test_items():
|
|||||||
def create_lab_test_template():
|
def create_lab_test_template():
|
||||||
records = [
|
records = [
|
||||||
{"doctype": "Lab Test Template", "name": "MCH","test_name": "MCH","test_code": "MCH",
|
{"doctype": "Lab Test Template", "name": "MCH","test_name": "MCH","test_code": "MCH",
|
||||||
"test_group": "Laboratory","department": "Haematology","item": "MCH",
|
"test_group": _("Laboratory"),"department": _("Haematology"),"item": "MCH",
|
||||||
"test_template_type": "Single","is_billable": 1,"test_rate": 0.0,"test_uom": "Microgram",
|
"test_template_type": "Single","is_billable": 1,"test_rate": 0.0,"test_uom": "Microgram",
|
||||||
"test_normal_range": "27 - 32 Microgram",
|
"test_normal_range": "27 - 32 Microgram",
|
||||||
"sensitivity": 0,"test_description": "Mean Corpuscular Hemoglobin"},
|
"sensitivity": 0,"test_description": "Mean Corpuscular Hemoglobin"},
|
||||||
{"doctype": "Lab Test Template", "name": "LDL","test_name": "LDL (Serum)","test_code": "LDL",
|
{"doctype": "Lab Test Template", "name": "LDL","test_name": "LDL (Serum)","test_code": "LDL",
|
||||||
"test_group": "Laboratory","department": "Biochemistry",
|
"test_group": _("Laboratory"),"department": _("Biochemistry"),
|
||||||
"item": "LDL","test_template_type": "Single",
|
"item": "LDL","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "70 - 160 mg/dlLow-density Lipoprotein (LDL)",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "70 - 160 mg/dlLow-density Lipoprotein (LDL)",
|
||||||
"sensitivity": 0,"test_description": "Low-density Lipoprotein (LDL)"},
|
"sensitivity": 0,"test_description": "Low-density Lipoprotein (LDL)"},
|
||||||
{"doctype": "Lab Test Template", "name": "GTT","test_name": "GTT","test_code": "GTT",
|
{"doctype": "Lab Test Template", "name": "GTT","test_name": "GTT","test_code": "GTT",
|
||||||
"test_group": "Laboratory","department": "Haematology",
|
"test_group": _("Laboratory"),"department": _("Haematology"),
|
||||||
"item": "GTT","test_template_type": "Single",
|
"item": "GTT","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "Less than 85 mg/dl",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "Less than 85 mg/dl",
|
||||||
"sensitivity": 0,"test_description": "Glucose Tolerance Test"},
|
"sensitivity": 0,"test_description": "Glucose Tolerance Test"},
|
||||||
{"doctype": "Lab Test Template", "name": "HDL","test_name": "HDL (Serum)","test_code": "HDL",
|
{"doctype": "Lab Test Template", "name": "HDL","test_name": "HDL (Serum)","test_code": "HDL",
|
||||||
"test_group": "Laboratory","department": "Biochemistry",
|
"test_group": _("Laboratory"),"department": _("Biochemistry"),
|
||||||
"item": "HDL","test_template_type": "Single",
|
"item": "HDL","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "35 - 65 mg/dl",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "35 - 65 mg/dl",
|
||||||
"sensitivity": 0,"test_description": "High-density Lipoprotein (HDL)"},
|
"sensitivity": 0,"test_description": "High-density Lipoprotein (HDL)"},
|
||||||
{"doctype": "Lab Test Template", "name": "BILT","test_name": "Bilirubin Total","test_code": "BILT",
|
{"doctype": "Lab Test Template", "name": "BILT","test_name": "Bilirubin Total","test_code": "BILT",
|
||||||
"test_group": "Laboratory","department": "Biochemistry",
|
"test_group": _("Laboratory"),"department": _("Biochemistry"),
|
||||||
"item": "BILT","test_template_type": "Single",
|
"item": "BILT","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.2 - 1.2 mg / dl",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.2 - 1.2 mg / dl",
|
||||||
"sensitivity": 0,"test_description": "Bilirubin Total"},
|
"sensitivity": 0,"test_description": "Bilirubin Total"},
|
||||||
{"doctype": "Lab Test Template", "name": "BILD","test_name": "Bilirubin Direct","test_code": "BILD",
|
{"doctype": "Lab Test Template", "name": "BILD","test_name": "Bilirubin Direct","test_code": "BILD",
|
||||||
"test_group": "Laboratory","department": "Biochemistry",
|
"test_group": _("Laboratory"),"department": _("Biochemistry"),
|
||||||
"item": "BILD","test_template_type": "Single",
|
"item": "BILD","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.4 mg / dl",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "mg / dl","test_normal_range": "0.4 mg / dl",
|
||||||
"sensitivity": 0,"test_description": "Bilirubin Direct"},
|
"sensitivity": 0,"test_description": "Bilirubin Direct"},
|
||||||
|
|
||||||
{"doctype": "Lab Test Template", "name": "BP","test_name": "Bile Pigment","test_code": "BP",
|
{"doctype": "Lab Test Template", "name": "BP","test_name": "Bile Pigment","test_code": "BP",
|
||||||
"test_group": "Laboratory","department": "Pathology",
|
"test_group": _("Laboratory"),"department": _("Pathology"),
|
||||||
"item": "BP","test_template_type": "Single",
|
"item": "BP","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
|
||||||
"sensitivity": 0,"test_description": "Bile Pigment"},
|
"sensitivity": 0,"test_description": "Bile Pigment"},
|
||||||
{"doctype": "Lab Test Template", "name": "BS","test_name": "Bile Salt","test_code": "BS",
|
{"doctype": "Lab Test Template", "name": "BS","test_name": "Bile Salt","test_code": "BS",
|
||||||
"test_group": "Laboratory","department": "Pathology",
|
"test_group": _("Laboratory"),"department": _("Pathology"),
|
||||||
"item": "BS","test_template_type": "Single",
|
"item": "BS","test_template_type": "Single",
|
||||||
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
|
"is_billable": 1,"test_rate": 0.0,"test_uom": "","test_normal_range": "",
|
||||||
"sensitivity": 0,"test_description": "Bile Salt"}
|
"sensitivity": 0,"test_description": "Bile Salt"}
|
||||||
@ -257,12 +262,12 @@ def create_lab_test_template():
|
|||||||
|
|
||||||
def create_sensitivity():
|
def create_sensitivity():
|
||||||
records = [
|
records = [
|
||||||
{"doctype": "Sensitivity", "sensitivity": "Low Sensitivity"},
|
{"doctype": "Sensitivity", "sensitivity": _("Low Sensitivity")},
|
||||||
{"doctype": "Sensitivity", "sensitivity": "High Sensitivity"},
|
{"doctype": "Sensitivity", "sensitivity": _("High Sensitivity")},
|
||||||
{"doctype": "Sensitivity", "sensitivity": "Moderate Sensitivity"},
|
{"doctype": "Sensitivity", "sensitivity": _("Moderate Sensitivity")},
|
||||||
{"doctype": "Sensitivity", "sensitivity": "Susceptible"},
|
{"doctype": "Sensitivity", "sensitivity": _("Susceptible")},
|
||||||
{"doctype": "Sensitivity", "sensitivity": "Resistant"},
|
{"doctype": "Sensitivity", "sensitivity": _("Resistant")},
|
||||||
{"doctype": "Sensitivity", "sensitivity": "Intermediate"}
|
{"doctype": "Sensitivity", "sensitivity": _("Intermediate")}
|
||||||
]
|
]
|
||||||
insert_record(records)
|
insert_record(records)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user