def AlternateContact(): if request.method == 'POST': fname = request.form["Full Name"] mno = request.form["MobileNo"] Rship = request.form["RelationShip"] # payload=request.get_json() mydict = { 'Full Name': fname, 'MobileNo': mno, 'RelationShip': Rship } for pId in patient.find(): if session['docId'] == pId['DoctorId']: name = pId["Firstname"] + ' ' + pId["Lastname"] if request.form["Patient name"] == name: try: pId['AlternateContact'].append(mydict) patient.update_one({'_id': pId['_id']}, { '$set': { 'AlternateContact': pId['AlternateContact'] } }) except KeyError: patient.update_one( {'_id': pId['_id']}, {'$set': { 'AlternateContact': [mydict] }}) return render_template("AlternateContact.html", a='AlternateContact Add')
def patientdata(): if request.method == 'POST': data = patient.find() payload = request.get_json() print(payload) for i in data: if payload['pId'] == str(i['_id']): del i['_id'] del i['doc_ID'] response = jsonify([i]) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response else: pass response = jsonify({'status': 'no data found'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def editProfile(): if request.method == 'POST': payload = request.get_json() print(payload) for pId in patient.find(): if payload['pId'] == str(pId['_id']): del payload['pId'] patient.update_one({'_id': pId['_id']}, { '$set': { 'FirstName': payload['FirstName'], 'LastName': payload['LastName'], 'phoneno': payload['phoneno'], 'email': payload['email'] } }) response = jsonify({'status': 'save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response response = jsonify({'status': 'Not save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def patientlist(): if request.method == 'POST': data = patient.find() l = [] payload = request.get_json() print(payload, '*************23') for i in data: if i['doc_ID'] == payload['doc_ID']: pId = str(i['_id']) name = i['FirstName'] + ' ' + i['LastName'] gender = i['Gender'] email = i['email'] dob = i['Birthdate'] mob = i['phoneno'] mydict = { 'pId': pId, 'name': name, 'gen': gender, 'email': email, 'DOB': dob, 'mobile': mob } # print(mydict) l.append(mydict) # if i['Firstname']+' '+i['Lastname']=='vikash sharma': # return jsonify(l) response = jsonify(l) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def ContactDetail(): if request.method == 'POST': add = request.form["Addrass"] city = request.form["City1"] country = request.form["Country"] state = request.form["State/Provide"] Zip = request.form["ZIP/Postal Code"] ph1 = request.form["Phone1"] ph2 = request.form["Phone2"] # payload=request.get_json() for pId in patient.find(): if session['docId'] == pId['DoctorId']: name = pId["Firstname"] + ' ' + pId["Lastname"] if request.form["Patient name"] == name: patient.update_one( {'_id': pId['_id']}, { # '$set':{'name':'chandra'}, '$set': { 'adresss': { 'Addrass': add, 'City': city, 'Country': country, 'State/Provide': state, 'ZIP/Postal Code': Zip, 'Phone1': ph1, 'Phone2': ph2 } } }) return render_template("AlternateContact.html", a='Detail Submit')
def ContactDetail(): if request.method == 'POST': payload = request.get_json() for pId in patient.find(): if payload['pId'] == str(pId['_id']): del payload['pId'] patient.update_one({'_id': pId['_id']}, {'$set': { 'Adresss': payload }}) response = jsonify({'status': 'save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response response = jsonify({'status': 'Not save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def ContactDoc(): if request.method == 'POST': payload = request.get_json() for pId in patient.find(): if payload['doc_ID'] == str(pId['_id']): del payload['doc_ID'] print(payload['doc_ID']) # patient.update_one({ # '_id':pId['_id'] # },{ # # '$set':{'name':'chandra'}, # '$set':{ # 'adresss':payload # } # } # ) response = jsonify({'status': 'Save Contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response response = jsonify({'status': 'Not save Contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def personal(): if request.method == 'POST': payload = request.get_json() print(payload) for pId in patient.find(): if payload['pId'] == str(pId['_id']): del payload['pId'] patient.update_one({'_id': pId['_id']}, { '$set': { 'Gender': payload['Gender'], 'Birthdate': payload['date'], 'Blood': payload['Blood'], 'status': payload['status'] } }) response = jsonify({'status': 'save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response response = jsonify({'status': 'Not save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def AlternateContact(): if request.method == 'POST': # fname = request.form["Full Name"] # mno = request.form["MobileNo"] # Rship= request.form["RelationShip"] # mydict={'Full Name':fname,'MobileNo':mno,'RelationShip':Rship} payload = request.get_json() print(payload, "+++++") for pId in patient.find(): # if session['docId'] == pId['DoctorId']: # name=pId["Firstname"]+' '+pId["Lastname"] # if request.form["Patient name"] == name: if payload['pId'] == str(pId['_id']): del payload['pId'] try: pId['AlternateContact'].append(payload) patient.update_one({'_id': pId['_id']}, { '$set': { 'AlternateContact': pId['AlternateContact'] } }) except KeyError: patient.update_one( {'_id': pId['_id']}, { '$set': { # 'AlternateContact':[mydict] 'AlternateContact': [payload] } }) # return render_template("AlternateContact.html",a='AlternateContact Add') response = jsonify({'status': 'save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response else: pass response = jsonify({'status': 'Not save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def patientdata(): if request.method == 'GET': data = patient.find() for i in data: # if i['DoctorId']==session['docId']: a = i['Firstname'] + ' ' + i['Lastname'] print(a, '************+') if a == 'prashant katiyar': i['_id'] = str(i['_id']) return jsonify([i]) else: pass # else: # return "No data for this doctor" return "No Data found"
def Billing(): if request.method == 'POST': payload = request.get_json() print(payload) for i in patient.find(): if payload['pId'] == str(i['_id']): try: i['Billing'].append(payload) patient.update_one({'_id': i['_id']}, {'$set': { 'Billing': i['Billing'] }}) response = jsonify({'DocId': 'datagrazp'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response except KeyError: patient.update_one({'_id': i['_id']}, {'$set': { 'Billing': [payload] }}) response = jsonify({'DocId': 'datagrazp1'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response else: pass response = jsonify({'DocId': 'datagrazp2'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response, '++++******++++') print(response.headers) return response
def patientlist(): if request.method =='POST': data=patient.find() l=[] print(request.get_json(),'*************23') for i in data: # if i['DoctorId']==request.form['doc_ID']: name=i['Firstname']+' '+i['Lastname'] gender=i['Gender'] email=i['EmailId'] dob=i['Birth Date'] mob=i['Mobile_Num'] mydict={'name':name,'gen':gender,'email':email,'DOB':dob,'mobile':mob} l.append(mydict) # if i['Firstname']+' '+i['Lastname']=='vikash sharma': # return jsonify(l) response = jsonify(l)#({'DocId':str(i["_id"])}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response
def careTeamMember(): if request.method == 'POST': payload = request.get_json() print(payload, "+++++") for pId in patient.find(): if payload['pId'] == str(pId['_id']): del payload['pId'] try: pId['careTeamMember'].append(payload) patient.update_one( {'_id': pId['_id']}, {'$set': { 'careTeamMember': pId['careTeamMember'] }}) except KeyError: patient.update_one({'_id': pId['_id']}, {'$set': { 'careTeamMember': [payload] }}) response = jsonify({'status': 'save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response else: pass response = jsonify({'status': 'Not save contact'}) response.headers.add('Access-Control-Allow-Origin', '*') response.headers['Access-Control-Allow-Origin'] = '*' print(response) print(response.headers) return response