def update_testvalues(listt1, listt2): tablename = "lab_test_data" result = '' try: for i in range(len(listt1)): dbcolumn = [] htmlcolumn = [] dbcolumn.append( 'test_value' ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" dbcolumn.append('ltid') htmlcolumn.append(str(listt1[i])) htmlcolumn.append(str(listt2[i])) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) print(result) if result == 1: dbcolumn = [] htmlcolumn = [] dbcolumn.append('test_validation') dbcolumn.append('validation_date') dbcolumn.append('accession_no') htmlcolumn.append("1") htmlcolumn.append(request.form['valdate']) htmlcolumn.append(str(request.form['accno'])) result = up.UpdateData(dbcolumn, htmlcolumn, "lab_sample_collect") return result except Exception as e: return str(e)
def updateTest(): dbcolumn = [] htmlcolumn = [] tablename = "admin_addtest" result = '' try: if request.method == 'POST': dbcolumn.append('sid') dbcolumn.append('pid') dbcolumn.append('test_name') dbcolumn.append('Male_Range_min') dbcolumn.append('Male_Range_max') dbcolumn.append('Female_Range_min') dbcolumn.append('Female_Range_max') dbcolumn.append('Unit') dbcolumn.append('amount') dbcolumn.append('id') htmlcolumn.append(request.form['sample']) htmlcolumn.append(request.form['panel']) htmlcolumn.append(request.form['test_name']) htmlcolumn.append(request.form['Male_Range_min']) htmlcolumn.append(request.form['Male_Range_max']) htmlcolumn.append(request.form['Female_Range_min']) htmlcolumn.append(request.form['Female_Range_max']) htmlcolumn.append(request.form['Unit']) htmlcolumn.append(request.form['amount']) htmlcolumn.append(request.form['test_id']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateWardDressingData(): dressing_id = request.form['dressing_id'] dbcolumn = [] htmlcolumn = [] result = '' tablename = "ward_dressing" try: if request.method == 'POST': dbcolumn.append('dressing_date') dbcolumn.append('dressing_name') dbcolumn.append('dressing_amount') dbcolumn.append('dressing_doneby') dbcolumn.append( 'dressing_id' ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(request.form['dressing_date']) htmlcolumn.append(request.form['dname']) htmlcolumn.append(request.form[str('dressing_amount')]) htmlcolumn.append(request.form['dressing_doneby']) htmlcolumn.append( request.form['dressing_id'] ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn, htmlcolumn, tablename) print(result, "ooooooooooooooooooooooooooooo") return result except Exception as e: return str(e)
def opdConsultUpdateDiagnosis(): result='' tablename = "opdDiagnosis" rowno=len(request.form.getlist('did')) diaid = request.form.getlist('diaid') dtype = request.form.getlist('diagnosisType') did = request.form.getlist('did') try: if request.method == 'POST': for i in range(rowno): dbcolumn = [] htmlcolumn = [] dbcolumn.append('diagnosisId') dbcolumn.append('diagnosisType') dbcolumn.append('did') htmlcolumn.append(diaid[i]) htmlcolumn.append(dtype[i]) htmlcolumn.append(did[i]) result = up.UpdateData(dbcolumn,htmlcolumn,tablename) return result except Exception as e: return str(e)
def updateXrayDetail(uploadloc): result='' tablename = "xray" regno = request.form['regno'] print("i am regno",regno) id = request.form['id'] xdate = request.form['xdate'] xtype = request.form['xrayname'] stype = request.form['subxray'] amount = request.form['amount'] oldupload = request.form['oldupload'] checkbox = request.form.get('chkbox') try: if request.method == 'POST': dbcolumn = [] htmlcolumn = [] #Name of database Attribute dbcolumn.append('xdate') dbcolumn.append('xtype') dbcolumn.append('stype') dbcolumn.append('amount') if checkbox == 'on': xupload = request.files['uploadxray'] dbcolumn.append('upload') dbcolumn.append('id')# The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(xdate) htmlcolumn.append(xtype) htmlcolumn.append(stype) htmlcolumn.append(amount) if checkbox == 'on': fname,fileext = os.path.splitext(xupload.filename) filename=secure_filename(regno+'_'+'{0:%d-%m-%Y %H:%M:%S}'.format(datetime.datetime.now())+'_'+fname+fileext) dst_path=os.path.join(uploadloc, filename) xupload.save(dst_path) print("i m file",filename) htmlcolumn.append(filename) htmlcolumn.append(id) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn,htmlcolumn,tablename) print("i am resultup",result) if result ==1: os.remove(os.path.join(uploadloc,oldupload)) return result except Exception as e: print("ERORORORO",str(e)) return str(e)
def insertWardIntakeData(): result = '' wrd_id = request.form['wrd_id'] idate = request.form['idate'] igivenby = request.form['igivenby'] rowno = len(request.form.getlist('med_id')) itime = request.form.getlist('intime') iintaketype = request.form.getlist('intaketype') meddet_id = request.form.getlist('med_id') idose = request.form.getlist('idose') iunit = request.form.getlist('iunit') iamount = request.form.getlist('iamount') remqty = request.form.getlist('remqty') try: if request.method == 'POST': for i in range(rowno): dbcolumn = [] htmlcolumn = [] tablename = "ward_intake_chart" dbcolumn.append('wrd_id') dbcolumn.append('idate') dbcolumn.append('itime') dbcolumn.append('iintaketype') dbcolumn.append('meddet_id') dbcolumn.append('idose') dbcolumn.append('iunit') dbcolumn.append('igivenby') dbcolumn.append('iamount') htmlcolumn.append(wrd_id) htmlcolumn.append(idate) htmlcolumn.append(itime[i]) htmlcolumn.append(iintaketype[i]) htmlcolumn.append(meddet_id[i]) htmlcolumn.append(idose[i]) htmlcolumn.append(iunit[i]) htmlcolumn.append(igivenby) htmlcolumn.append(iamount[i]) # Here we are calling InsertData that have a common code for insert record. result = ins.InsertData(dbcolumn, htmlcolumn, tablename) if result == 1: dbcolumn = [] htmlcolumn = [] tablename = "medicine_outward_detail" dbcolumn.append('issued_qty') dbcolumn.append('meddet_id') htmlcolumn.append(str(remqty[i])) htmlcolumn.append(meddet_id[i]) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdatePatientTPRData(): tpr_id = request.form['tpr_id'] result = '' tablename = "ward_tpr_chart" row = len(request.form.getlist('ttemp')) ttime = request.form.getlist('ttime') ttemp = request.form.getlist('ttemp') tpulse = request.form.getlist('tpulse') tsystolic = request.form.getlist('tsystolic') tdiastolic = request.form.getlist('tdiastolic') trespiration = request.form.getlist('trespiration') tfhs = request.form.getlist('tfhs') tspo2 = request.form.getlist('tspo2') try: if request.method == 'POST': for i in range(row): dbcolumn = [] htmlcolumn = [] dbcolumn.append('tdate') dbcolumn.append('tgivenby') dbcolumn.append('ttime') dbcolumn.append('ttemp') dbcolumn.append('tpulse') dbcolumn.append('tsystolic') dbcolumn.append('tdiastolic') dbcolumn.append('trespiration') dbcolumn.append('tfhs') dbcolumn.append('tspo2') dbcolumn.append( 'tpr_id' ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(request.form['tdate']) htmlcolumn.append(request.form['tgivenby']) htmlcolumn.append(ttime[i]) htmlcolumn.append(ttemp[i]) htmlcolumn.append(tpulse[i]) htmlcolumn.append(tsystolic[i]) htmlcolumn.append(tdiastolic[i]) htmlcolumn.append(trespiration[i]) htmlcolumn.append(tfhs[i]) htmlcolumn.append(tspo2[i]) htmlcolumn.append( request.form['tpr_id'] ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateGeneralMsg(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_generalmsg' dbcolumn.append('genmsg') dbcolumn.append('genid') htmlcolumn.append(request.form['genmsg']) htmlcolumn.append(request.form['genid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateDistrict(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_district' dbcolumn.append('disname') dbcolumn.append('did') htmlcolumn.append(request.form['district']) htmlcolumn.append(request.form['did']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def DeactivateGovSchemeData(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_govsch' dbcolumn.append('deletestatus') dbcolumn.append('gsid') htmlcolumn.append("1") htmlcolumn.append(request.form['gsid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateDeathReasonData(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_deathreason' dbcolumn.append('deathreason') dbcolumn.append('deathid') htmlcolumn.append(request.form['deathreason']) htmlcolumn.append(request.form['deathid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateDeliveryMsg(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_delmsg' dbcolumn.append('delmsg') dbcolumn.append('delid') htmlcolumn.append(request.form['delmsg']) htmlcolumn.append(request.form['delid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateCompany(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_company' dbcolumn.append('cname') dbcolumn.append('cid') htmlcolumn.append(request.form['cname']) htmlcolumn.append(request.form['cid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def insertWardSugarData(): result = '' wrd_id = request.form['wrd_id'] sdate = request.form['sdate'] stime = request.form['stime'] sugarlevel = request.form['sugarlevel'] sinsuline = request.form['med_id'] sdose = request.form['sdose'] sunit = request.form['sunit'] sgivenby = request.form['givenby'] samount = request.form['sprice'] remqty = request.form['remqty'] try: if request.method == 'POST': dbcolumn = [] htmlcolumn = [] tablename = "ward_sugar_chart" dbcolumn.append('wrd_id') dbcolumn.append('sdate') dbcolumn.append('stime') dbcolumn.append('sugarlevel') dbcolumn.append('sinsuline') dbcolumn.append('sdose') dbcolumn.append('sunit') dbcolumn.append('sgivenby') dbcolumn.append('samount') htmlcolumn.append(wrd_id) htmlcolumn.append(sdate) htmlcolumn.append(stime) htmlcolumn.append(sugarlevel) htmlcolumn.append(sinsuline) htmlcolumn.append(sdose) htmlcolumn.append(sunit) htmlcolumn.append(sgivenby) htmlcolumn.append(samount) # Here we are calling InsertData that have a common code for insert record. result = ins.InsertData(dbcolumn, htmlcolumn, tablename) if result == 1: dbcolumn = [] htmlcolumn = [] tablename = "medicine_outward_detail" dbcolumn.append('issued_qty') dbcolumn.append('meddet_id') htmlcolumn.append(str(remqty)) htmlcolumn.append(sinsuline) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateNurTPRChartData(): ns_tpr_id = request.form['ns_tpr_id'] result = '' tablename = "ward_nursery_tprchart" row = len(request.form.getlist('tpr_temp')) ttime = request.form.getlist('tpr_time') ttemp = request.form.getlist('tpr_temp') trespiration = request.form.getlist('tpr_respiration') turine = request.form.getlist('tpr_urine') tstool = request.form.getlist('tpr_stool') tspo2 = request.form.getlist('tpr_spo2') tweight = request.form.getlist('tpr_weight') try: if request.method == 'POST': for i in range(row): dbcolumn = [] htmlcolumn = [] dbcolumn.append('tpr_date') dbcolumn.append('tpr_givenby') dbcolumn.append('tpr_time') dbcolumn.append('tpr_temp') dbcolumn.append('tpr_respiration') dbcolumn.append('tpr_urine') dbcolumn.append('tpr_stool') dbcolumn.append('tpr_spo2') dbcolumn.append('tpr_weight') dbcolumn.append( 'ns_tpr_id' ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(request.form['tpr_date']) htmlcolumn.append(request.form['tpr_givenby']) htmlcolumn.append(ttime[i]) htmlcolumn.append(ttemp[i]) htmlcolumn.append(trespiration[i]) htmlcolumn.append(turine[i]) htmlcolumn.append(tstool[i]) htmlcolumn.append(tspo2[i]) htmlcolumn.append(tweight[i]) htmlcolumn.append( request.form['ns_tpr_id'] ) # The column name on the basis of which we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def insertWardPoisonData(): result = '' wrd_id = request.form['wrd_id'] pdate = request.form['pdate'] ptime = request.form['ptime'] pinjection = request.form['pmed_id'] pdose = request.form['pdose'] punit = request.form['punit'] pgivenby = request.form['pgivenby'] pamount = request.form['pprice'] remqty = request.form['remqty'] try: if request.method == 'POST': dbcolumn = [] htmlcolumn = [] tablename = "ward_poision_chart" dbcolumn.append('wrd_id') dbcolumn.append('pdate') dbcolumn.append('ptime') dbcolumn.append('pinjection') dbcolumn.append('pdose') dbcolumn.append('punit') dbcolumn.append('pgivenby') dbcolumn.append('pamount') htmlcolumn.append(wrd_id) htmlcolumn.append(pdate) htmlcolumn.append(ptime) htmlcolumn.append(pinjection) htmlcolumn.append(pdose) htmlcolumn.append(punit) htmlcolumn.append(pgivenby) htmlcolumn.append(pamount) # Here we are calling InsertData that have a common code for insert record. result = ins.InsertData(dbcolumn, htmlcolumn, tablename) if result == 1: dbcolumn = [] htmlcolumn = [] tablename = "medicine_outward_detail" dbcolumn.append('issued_qty') dbcolumn.append('meddet_id') htmlcolumn.append(str(remqty)) htmlcolumn.append(pinjection) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateDressingData(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_dressing' dbcolumn.append('drsname') dbcolumn.append('drsamount') dbcolumn.append('drsid') htmlcolumn.append(request.form['drsname']) htmlcolumn.append(request.form['drsamount']) htmlcolumn.append(request.form['drsid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def UpdateTherapyData(): try: dbcolumn = [] htmlcolumn = [] tablename = 'admin_therapy' dbcolumn.append('adm_therapyname') dbcolumn.append('adm_therapyamount') dbcolumn.append('adm_therapyid') htmlcolumn.append(request.form['adm_therapyname']) htmlcolumn.append(request.form['adm_therapyamount']) htmlcolumn.append(request.form['adm_therapyid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def updateBillingDetail(): try: result = '' tablename = "billing_medicine" dbcolumn = [] htmlcolumn = [] dbcolumn.append('givenby') dbcolumn.append('billstatus') dbcolumn.append('bmid') htmlcolumn.append(request.form['mgivenby']) htmlcolumn.append(request.form['pstatus']) htmlcolumn.append(request.form['bmid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def updatePrintStatus(bmid): try: result = '' tablename = "billing_medicine" dbcolumn = [] htmlcolumn = [] dbcolumn.append('printstatus') dbcolumn.append('bmid') htmlcolumn.append("1") htmlcolumn.append(bmid) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def opdConsultUpdateHistory(): dbcolumn=[] htmlcolumn=[] result='' tablename = "opdClinicalHistory" try: dbcolumn.append('hiscli') dbcolumn.append('hcid') htmlcolumn.append(request.form['hiscli']) htmlcolumn.append(request.form['hcid']) result = up.UpdateData(dbcolumn,htmlcolumn,tablename) return result except Exception as e: return str(e)
def cancelDischargeMeRequest(wmid): try: tablename="ward_main" dbcolumn=[] htmlcolumn=[] dbcolumn.append('dischargestatus') dbcolumn.append('wrd_id') htmlcolumn.append("0") htmlcolumn.append(str(wmid)) result = up.UpdateData(dbcolumn,htmlcolumn,tablename) print("RESULT",result) return result except Exception as e: print("ERROR",str(e)) return str(e)
def insertWardConsumeData(): result = '' wrd_id = request.form['wrd_id'] wccdate = request.form['cdate'] givenby = request.form['cgivenby'] row = len(request.form.getlist('conmed_id')) wcctime = request.form.getlist('contime') conname = request.form.getlist('conmed_id') cqty = request.form.getlist('conqty') camount = request.form.getlist('conprice') remqty = request.form.getlist('remqty') try: if request.method == 'POST': for i in range(row): dbcolumn = [] htmlcolumn = [] tablename = "ward_consume_chart" dbcolumn.append('wrd_id') dbcolumn.append('wccdate') dbcolumn.append('wcctime') dbcolumn.append('cgivenby') dbcolumn.append('conname') dbcolumn.append('cqty') dbcolumn.append('camount') htmlcolumn.append(wrd_id) htmlcolumn.append(wccdate) htmlcolumn.append(wcctime[i]) htmlcolumn.append(givenby) htmlcolumn.append(conname[i]) htmlcolumn.append(cqty[i]) htmlcolumn.append(str(float(cqty[i]) * float(camount[i]))) # Here we are calling InsertData that have a common code for insert record. result = ins.InsertData(dbcolumn, htmlcolumn, tablename) if result == 1: dbcolumn = [] htmlcolumn = [] tablename = "medicine_outward_detail" dbcolumn.append('issued_qty') dbcolumn.append('meddet_id') htmlcolumn.append(str(remqty[i])) htmlcolumn.append(conname[i]) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def updateSample(): dbcolumn = [] htmlcolumn = [] tablename = "admin_addsample" result = '' try: if request.method == 'POST': dbcolumn.append( 'sample_name' ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" dbcolumn.append('id') htmlcolumn.append(request.form['samplename']) htmlcolumn.append(request.form['sid']) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def opdVisitUpdate(): dbcolumn = [] htmlcolumn = [] result = '' tablename = "opdvisit" try: if request.method == 'POST': #Name of database Attribute dbcolumn.append('vdate') dbcolumn.append('vtime') dbcolumn.append('height') dbcolumn.append('weight') dbcolumn.append('bmi') dbcolumn.append('temp') dbcolumn.append('pulse') dbcolumn.append('rrate') dbcolumn.append('systolic') dbcolumn.append('diastolic') dbcolumn.append('complaint') dbcolumn.append( 'opdid' ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" #Name of html component e.g request.form['nameofcomponenet'] htmlcolumn.append(request.form['vdate']) htmlcolumn.append(request.form['vtime']) htmlcolumn.append(request.form['height']) htmlcolumn.append(request.form['weight']) htmlcolumn.append(request.form['bmi']) htmlcolumn.append(request.form['temp']) htmlcolumn.append(request.form['pulse']) htmlcolumn.append(request.form['rrate']) htmlcolumn.append(request.form['systolic']) htmlcolumn.append(request.form['diastolic']) htmlcolumn.append(request.form['complaint']) htmlcolumn.append( request.form['opdid'] ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def visitIpdUpdate(): gscheme = request.form['gscheme'] dbcolumn = [] htmlcolumn = [] result = '' tablename = "ipdvisit" try: if request.method == 'POST': dbcolumn.append('complaint') dbcolumn.append('patientfrom') dbcolumn.append('ipddate') dbcolumn.append('ipdtime') dbcolumn.append('govscheme') dbcolumn.append('urnno') dbcolumn.append('advmoney') dbcolumn.append('moneyreceivedby') dbcolumn.append('wardid') dbcolumn.append( 'ipdid' ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(request.form['complaint']) htmlcolumn.append(request.form['patientfrom']) htmlcolumn.append(request.form['ipddate']) htmlcolumn.append(request.form['ipdtime']) if gscheme == 'eligible': htmlcolumn.append(request.form['govscheme']) else: htmlcolumn.append(request.form['gscheme']) htmlcolumn.append(request.form['urnno']) htmlcolumn.append(request.form['advmoney']) htmlcolumn.append(request.form['moneyreceivedby']) htmlcolumn.append(request.form['wardid']) htmlcolumn.append( request.form['ipdid'] ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def updateTestSampleCollect(): tablename = "lab_test_data" result = '' count = len(request.form.getlist('ltid')) ltid = request.form.getlist('ltid') tid = request.form.getlist('testname') try: for i in range(count): dbcolumn = [] htmlcolumn = [] dbcolumn.append('tid') dbcolumn.append( 'ltid' ) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(str(tid[i])) htmlcolumn.append(str(ltid[i])) result = up.UpdateData(dbcolumn, htmlcolumn, tablename) return result except Exception as e: return str(e)
def opdConsultUpdateRefer(): dbcolumn=[] htmlcolumn=[] result='' tablename = "opdreferInfo" try: dbcolumn.append('reason') dbcolumn.append('hname') dbcolumn.append('referby') dbcolumn.append('referto') dbcolumn.append('refid') htmlcolumn.append(request.form['reason']) htmlcolumn.append(request.form['hname']) htmlcolumn.append(request.form['referby']) htmlcolumn.append(request.form['referto']) htmlcolumn.append(request.form['refid']) result = up.UpdateData(dbcolumn,htmlcolumn,tablename) return result except Exception as e: return str(e)
def updatePatientAdvice(): try: tablename="ward_main" dbcolumn=[] htmlcolumn=[] dbcolumn.append('dischargestatus') dbcolumn.append('history') dbcolumn.append('diagnosis') dbcolumn.append('advice') dbcolumn.append('patientstatus') dbcolumn.append('death_refer_reason') dbcolumn.append('othernotes') dbcolumn.append('dischargeby') dbcolumn.append('wrd_id') htmlcolumn.append("2") htmlcolumn.append(request.form['history']) htmlcolumn.append(request.form['diagnosis']) htmlcolumn.append(request.form['advice']) htmlcolumn.append(request.form['patientstatus']) if request.form['patientstatus'] == "Cured": reason="Cured" elif request.form['patientstatus'] == "Refer": reason=request.form['refernote'] elif request.form['patientstatus'] == "Dead": reason=request.form['dreason'] htmlcolumn.append(reason) htmlcolumn.append(request.form['othernotes']) htmlcolumn.append(request.form['dischargeby']) htmlcolumn.append(request.form['wmid']) result = up.UpdateData(dbcolumn,htmlcolumn,tablename) print("RESULT",result) return result except Exception as e: print("ERROR",str(e)) return str(e)
def updatepartname(): xid = request.form['xid'] xrayname = request.form['xrayname'] dbcolumn = [] htmlcolumn = [] tablename = "admin_xname" result='' try: if request.method == 'POST': dbcolumn.append('xrayname') dbcolumn.append('xid') # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF dbcolumn" htmlcolumn.append(xrayname) htmlcolumn.append(xid) # The column name on the basis of we update record "MUST BE THE LAST ELEMENT OF htmlcolumn" # Here we are calling UpdateData that have a common code for update record. result = up.UpdateData(dbcolumn,htmlcolumn,tablename) return result except Exception as e: return str(e)