当前位置: 首页>>代码示例>>Python>>正文


Python EMR_utilities类代码示例

本文整理汇总了Python中EMR_utilities的典型用法代码示例。如果您正苦于以下问题:Python EMR_utilities类的具体用法?Python EMR_utilities怎么用?Python EMR_utilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了EMR_utilities类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: OnEditPt

    def OnEditPt(self, event):
	self.textctrl['Insurance Co'].SetValue(self.insChoice.GetStringSelection())
	checkBoxes = ''
	if self.adv_dirYesRB.GetValue() == True:
	    checkBoxes = ' adv_dir = "1",'
	elif self.adv_dirNoRB.GetValue() == True:
	    checkBoxes = ' adv_dir = "2",'
	else:
	    checkBoxes = ' adv_dir = "0",'
	if self.proxyBox.IsChecked():
	    checkBoxes = checkBoxes + ' proxy = "1",'
	else:
	    checkBoxes = checkBoxes + ' proxy = "0",'
	if self.marriedBox.IsChecked():
	    checkBoxes = checkBoxes + ' marital_status = "1",'
	else:
	    checkBoxes = checkBoxes + ' marital_status = "0",'
	if self.inactiveBox.IsChecked():
	    checkBoxes = checkBoxes + ' inactive = "1",'
	else:
	    checkBoxes = checkBoxes + ' inactive = "0",'
	qry = 'UPDATE demographics SET' + checkBoxes
	for label, size, field in self.labels:
	    qry = ' '.join([qry, '%s = "%s",' % (field, self.textctrl[label].GetValue())])
	qry = qry.rstrip(',') + ' WHERE patient_ID = %s;' % (self.ptID)
	EMR_utilities.updateData(qry)
开发者ID:barronmo,项目名称:gecko_emr,代码行数:26,代码来源:demographics.py

示例2: OnAddPt

    def OnAddPt(self, event):
	self.textctrl['Insurance Co'].SetValue(self.insChoice.GetStringSelection())
	checkBoxes = ''
	if self.adv_dirYesRB.GetValue() == True:
	    checkBoxes = ' adv_dir = "1",'
	elif self.adv_dirNoRB.GetValue() == True:
	    checkBoxes = ' adv_dir = "2",'
	else: 
	    checkBoxes = ' adv_dir = "0",'
	if self.proxyBox.IsChecked():
	    checkBoxes = checkBoxes + ' proxy = "1",'
	if self.marriedBox.IsChecked():
	    checkBoxes = checkBoxes + ' marital_status = "1",'
	qry = 'INSERT INTO demographics SET' + checkBoxes
	for label, size, field in self.labels:
	    qry = ' '.join([qry, '%s = "%s",' % (field, self.textctrl[label].GetValue())])
	qry = qry.rstrip(',') + ';'
	#check to make sure patient doesn't already exist
	dupCheck = 'SELECT firstname, lastname, dob FROM demographics WHERE firstname = "%s" AND lastname = "%s";' \
		% (self.textctrl['First Name'].GetValue(), self.textctrl['Last Name'].GetValue())
	dupResults = EMR_utilities.getData(dupCheck)
	if dupResults:
	    wx.MessageBox("A patient with this name already exists.", 'DUPLICATE', wx.OK)
	else:
	    EMR_utilities.updateData(qry)
	    pt_ID = EMR_utilities.getData("SELECT LAST_INSERT_ID();")
	    UpdoxImporter.Importer(str(pt_ID[0]))
开发者ID:barronmo,项目名称:gecko_emr,代码行数:27,代码来源:demographics.py

示例3: OnSign

 def OnSign(self, event):
     #check to see if note has already been signed
     checkQry = 'SELECT stamp FROM notes WHERE patient_ID = "%s" AND date = "%s";' % (self.PtID, self.textctrl['Date'].GetValue())
     nullCheck = EMR_utilities.getData(checkQry)
     try:
         if nullCheck[0]:
             wx.MessageBox('Note has already been signed.', 'Message')
         else:
             #get user
             prnt = wx.GetTopLevelParent(self)
             userQry = EMR_utilities.getData('SELECT full_name FROM users WHERE user_name = "%s";' % prnt.user)
             #add signed text at bottom of note
             note = self.soapNote.GetValue() + '\n\n' + 'ELECTRONICALLY SIGNED BY %s ON %s' % (userQry[0], str(EMR_utilities.dateToday(t='sql')))
             #use timestamper
             cli = timestamping.ts_client.TimeStampClient('http://198.199.64.101:8000')
             data = str(self.PtID) + note + self.textctrl['Date'].GetValue()
             val = cli.stamp(data)
             #update the record for that note to include utctime and stamp 
             noteQry = 'UPDATE notes SET soap = %s, utctime = %s, stamp = %s  WHERE patient_ID = %s AND date = %s'
             values = (note, val['utctime'], val['stamp'], self.PtID, self.textctrl['Date'].GetValue())
             EMR_utilities.valuesUpdateData(noteQry, values)
             self.listctrl.Set("")
             self.loadList() 
     except: 
         # catch *all* exceptions
         e0 = sys.exc_info()[0]
         e1 = sys.exc_info()[1]
         wx.MessageBox("Error: %s, %s" % (e0, e1))
开发者ID:barronmo,项目名称:gecko_emr,代码行数:28,代码来源:Notes.py

示例4: __init__

    def __init__(self, pt_ID, amount):
	self.amount = amount
	self.pt_ID = pt_ID
	from reportlab.lib.pagesizes import letter
	from reportlab.pdfgen import canvas
	
	canvas = canvas.Canvas("/home/mb/Desktop/GECKO/EMR_outputs/%s/Other/rcpt-%s.pdf" % \
						(self.pt_ID, EMR_utilities.dateToday()), pagesize=letter)
	canvas.setLineWidth(.3)
	canvas.setFont('Helvetica', 12)
 
	canvas.drawString(30,750,'PAYMENT FOR MEDICAL SERVICES FOR %s' % self.name_find())
	canvas.drawString(30,735,'RENDERED AT BARRON FAMILY MEDICINE')
	canvas.drawString(500,750,"%s" % EMR_utilities.dateToday())
	canvas.line(480,747,580,747)
 
	canvas.drawString(275,725,'AMOUNT PAID:')
	canvas.drawString(500,725,"$%s" % self.amount)
	canvas.line(378,723,580,723)
 
	canvas.drawString(30,703,'RECEIVED BY:')
	canvas.line(120,700,580,700)
	canvas.drawString(120,703,"MICHAEL BARRON MD")
 
	canvas.save()
开发者ID:barronmo,项目名称:gecko_emr,代码行数:25,代码来源:Printer1.py

示例5: __init__

    def __init__(self, pt_ID, amount):
	self.amount = amount
	self.pt_ID = pt_ID
	from reportlab.lib.pagesizes import letter
	from reportlab.pdfgen import canvas
	
	lt = "%s/EMR_outputs/%s/Other/rcpt-%s.pdf" % (settings.LINUXPATH, self.pt_ID, EMR_utilities.dateToday('file format'))
	at = "%s/EMR_outputs/%s/Other/rcpt-%s.pdf" % (settings.APPLEPATH, self.pt_ID, EMR_utilities.dateToday('file format'))
	wt = "%s\EMR_outputs\%s\Other\rcpt-%s.pdf" % (settings.WINPATH, self.pt_ID, EMR_utilities.dateToday('file format'))
	filename = EMR_utilities.platformText(lt, at, wt)
	canvas = canvas.Canvas(filename, pagesize=letter)
	canvas.setLineWidth(.3)
	canvas.setFont('Helvetica', 12)
 
	canvas.drawString(30,750,'PAYMENT FOR MEDICAL SERVICES FOR %s' % self.name_find())
	canvas.drawString(30,735,'RENDERED AT BARRON FAMILY MEDICINE')
	canvas.drawString(500,750,"%s" % EMR_utilities.dateToday())
	canvas.line(480,747,580,747)
 
	canvas.drawString(275,725,'AMOUNT PAID:')
	canvas.drawString(500,725,"$%s" % self.amount)
	canvas.line(378,723,580,723)
 
	canvas.drawString(30,703,'RECEIVED BY:')
	canvas.line(120,700,580,700)
	canvas.drawString(120,703, settings.NAME)
 
	canvas.save()
开发者ID:barronmo,项目名称:gecko_emr,代码行数:28,代码来源:Printer.py

示例6: OnpRintMed

    def OnpRintMed(self, event):
        obj = self.list.GetSelectedObjects()
        string = ''
        for items in obj:
            string = '%s %s\n   take %s %s %s   #%s refills: %s\n\n' % \
                     (items["med_name"],
                      items["dose"],
                      items["number_tablets"],
                      items["route"],
                      items["frequency"],
                      items["number_pills"],
                      items["refills"]) + string
        
	form_lt = "%s/EMR_outputs/Script.html" % settings.LINUXPATH
	form_at = "%s/EMR_outputs/Script.html" % settings.APPLEPATH
	form_wt = "%s\EMR_outputs\Script.html" % settings.WINPATH
        form = open(EMR_utilities.platformText(form_lt, form_at, form_wt), 'r')
	s = form.read()
	form.close()
	dem_data = EMR_utilities.getDictData('SELECT * FROM demographics WHERE patient_ID = %s;' % self.ptID)
	dem_data['string'] = string
	dem_data['date'] = EMR_utilities.dateToday()
	dem_data['name_address'] = EMR_formats.format_address(dem_data)
	script_text = s % (dem_data)
	printer = EMR_utilities.Printer()
	printer.PreviewText(script_text)
	path_lt = "%s/EMR_outputs/%s/Orders" % (settings.LINUXPATH, self.ptID)
	path_at = "%s/EMR_outputs/%s/Orders" % (settings.APPLEPATH, self.ptID)
	path_wt = "%s\EMR_outputs\%s\Orders" % (settings.WINPATH, self.ptID)
	path = EMR_utilities.platformText(path_lt, path_at, path_wt)
	filename = "%s/script%s.html" % (path, EMR_utilities.dateToday(t='file format'))
	f = open(filename, 'w')
	f.write(script_text)
	f.close()	
开发者ID:barronmo,项目名称:gecko_emr,代码行数:34,代码来源:Meds.py

示例7: OnArchMed

 def OnArchMed(self, event):		#need add/edit form pulled up on selected meds, update query, requery meds 
     #open AddEditMed form with selected/checked med filled in
     obj = self.list.GetSelectedObjects()
     for items in obj:
         qry = 'UPDATE meds SET archive = 1 WHERE med_number = %s;' % items['med_number']
         self.list.RemoveObject(items)
         EMR_utilities.updateData(qry)
开发者ID:barronmo,项目名称:gecko_emr,代码行数:7,代码来源:Meds.py

示例8: PrintLtr

    def PrintLtr(self):
	#need consultant first and lastname by parsing self.consultant 
	conName = self.consultant[0:self.consultant.find(',')]
	Printer.myConsultLtr(self, self.PtID, self.textctrl['reason'].GetValue(), self.textctrl['memo'].GetValue(), \
				conName, self.textctrl['Due Date'])
	EMR_utilities.updateList(todo_find(self.PtID, toggle=0), self.todoInstance.todo_list)
	self.Destroy()
开发者ID:barronmo,项目名称:gecko_emr,代码行数:7,代码来源:ToDo.py

示例9: listBilledICD

def listBilledICD(pt_ID):
    icdList = []
    billedProblems = []
    problems = []
    for i in range(1,11):
        #collect the icd10 codes billed with each note for every note in a given calendar year
        qry = "SELECT icd%d FROM notes INNER JOIN demographics USING (patient_ID) \
                WHERE date LIKE '2015%%' AND patient_ID = %s AND icd%d != '';" % (i,pt_ID,i)
        results = EMR_utilities.getAllData(qry)
	for r in results:
        #create a list from the tuple
	    icdList.append(r)
    #we make a set which eliminates any duplicates
    billedIcdList = set(icdList) #during 2015 some will be icd9 and some icd10
    for part in EMR_utilities.getAllData('SELECT short_des FROM problems10 WHERE patient_ID = %s;' % pt_ID):
        #collects problem names in a list
        problems.append(part[0])
    for item in billedIcdList:
        #gets list of billed problem's descriptions but pulls only icd10
        try:
            des = EMR_utilities.getData('SELECT short_des FROM icd10 WHERE icd10 = "%s";' % item[0])
            billedProblems.append(des[0])
        except: pass
            #print 'Icd %s not found!' % item[0]    #these should be all the icd9 codes billed
    for val in billedProblems:
        #subtracts billed problem's names from the pt's problem list
        if val in problems:
            problems.remove(val)
    EMR_utilities.MESSAGES = EMR_utilities.MESSAGES + 'ICD codes not billed this year:\n\n'
    for x in problems:
        EMR_utilities.MESSAGES = EMR_utilities.MESSAGES + '--' + x + '\n'	    
        EMR_utilities.MESSAGES = EMR_utilities.MESSAGES + '\n\n'
开发者ID:barronmo,项目名称:gecko_emr,代码行数:32,代码来源:Problems.py

示例10: OnOk

    def OnOk(self, event):
	qry = 'INSERT INTO todo SET date = "%s", description = "%s", priority = "%s", category = "%s", memo = "%s", due_date = "%s", complete = "0", patient_ID = %s;' % (self.textctrl['Date'].GetValue(), 
		     self.textctrl['Description'].GetValue(), self.textctrl['Priority'].GetValue(), 
		     self.textctrl['Category'].GetValue(), self.textctrl['Memo'].GetValue(), 
		     self.textctrl['Due Date'].GetValue(), self.PtID)
	EMR_utilities.updateData(qry)	
	EMR_utilities.updateList(todo_find(self.PtID), self.List)
开发者ID:barronmo,项目名称:gecko_emr,代码行数:7,代码来源:ToDo.py

示例11: EvtSelTmplist

    def EvtSelTmplist(self, event):
	lt = "/home/mb/Desktop/GECKO/wellchild/%s.txt"
	at = ""
	wt = "C:\Documents and Settings\mbarron\My Documents\GECKO\wellchild\%s.txt"
	if event.GetString() == 'generic':
	    gen_note = EMR_formats.note(self.PtID)
	    if wx.GetTopLevelParent(self).nb.GetPage(2).reviewed == 1:
		gen_note = gen_note.replace('Meds', 'Meds(reviewed today)')
		gen_note = gen_note.replace('Allergies', 'Allergies(reviewed today)')
	    self.newsoapNote.SetValue(gen_note)
	    self.not_billable = 0
	elif event.GetString() == 'prenatal':
	    self.newsoapNote.SetValue(EMR_formats.prenatal(self.PtID))
	elif event.GetString() == 'procedure':
	    self.newsoapNote.SetValue(EMR_formats.procedure(self.PtID))
	elif event.GetString() == 'phonecon':
	    self.newsoapNote.SetValue(EMR_formats.phonecon(self.PtID))
	    self.not_billable = 1
	elif event.GetString() == 'well child':
	    choice = wx.GetSingleChoice('What age child?', "", ['Wt Check', '2 month', '4 month', '6 month', '9 month',
		'12 month', '15 month', '18 month', '2 year', '3-4 year', '6-7_yr_old', '7-8 year', '10-11_yr_old', 
		'12-13_yr_old', '9-12 year', '13-15 year'])
	    string = open(EMR_utilities.platformText(lt, at, wt) % choice, 'r')
	    s = string.read()
	    string.close()
	    result = s % (EMR_utilities.getAge(self.PtID), EMR_utilities.getSex(self.PtID), 
		EMR_formats.getVitals(self.PtID, baby=1))
	    self.newsoapNote.SetValue(result)
	    self.not_billable = 0
	else: pass
开发者ID:barronmo,项目名称:gecko_emr,代码行数:30,代码来源:Notes.py

示例12: OnComplete

    def OnComplete(self, event):
	num = self.todo_list.GetItemCount()
	for i in range(num):
            if i == 0: pass
            if self.todo_list.IsChecked(i):
		qry = 'UPDATE todo SET complete = 1 WHERE todo_number = %s;' % (self.todo_list.GetItem(i, 7).GetText())
		EMR_utilities.updateData(qry)
		self.todo_list.DeleteItem(i)	
开发者ID:barronmo,项目名称:gecko_emr,代码行数:8,代码来源:ToDo.py

示例13: add_consultant

    def add_consultant(self, evt):
        qry = "INSERT INTO consultants SET firstname = '%s', lastname = '%s', address = '%s', city = '%s', state = '%s', zipcode = '%s', phone = '%s', fax = '%s', specialty = '%s';" % \
		(self.textctrl['firstname'].GetValue(), self.textctrl['lastname'].GetValue(), self.textctrl['address'].GetValue(), \
		self.textctrl['city'].GetValue(), self.textctrl['state'].GetValue(), self.textctrl['zipcode'].GetValue(), \
		self.textctrl['phonenumber'].GetValue(), self.textctrl['fax'].GetValue(), self.textctrl['specialty'].GetValue())
	EMR_utilities.updateData(qry)
	self.consultant = self.textctrl['firstname'].GetValue() + ' ' + self.textctrl['lastname'].GetValue() + ','
	self.addSpecialist = 1	#tells whether Add Consultant button has been pushed
开发者ID:barronmo,项目名称:gecko_emr,代码行数:8,代码来源:ToDo.py

示例14: OnRemove

    def OnRemove(self, event):
	
	num = self.todo_list.GetItemCount()
	for i in range(num):
            if i == 0: pass
            if self.todo_list.IsChecked(i):
		qry = 'DELETE FROM todo WHERE todo_number = %s;' % (self.todo_list.GetItem(i, 7).GetText())
		EMR_utilities.updateData(qry)
		self.todo_list.DeleteItem(i)		
开发者ID:barronmo,项目名称:gecko_emr,代码行数:9,代码来源:ToDo.py

示例15: OnNewAll

    def OnNewAll(self, event):
	allergy = wx.GetTextFromUser('What is the patient allergic to?', 'New Allergy')
	if allergy == "": pass
	else:
	    reaction = wx.GetTextFromUser('What happened?', 'Reaction')
	    query = 'INSERT INTO allergies SET allergy = "%s", reaction = "%s", patient_ID = %s;' % \
			(allergy, reaction, self.ptID)
	    EMR_utilities.updateData(query)
	    self.UpdateAllergy()
开发者ID:barronmo,项目名称:gecko_emr,代码行数:9,代码来源:Meds.py


注:本文中的EMR_utilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。