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


Python EMR_utilities.name_fixer方法代码示例

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


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

示例1: __init__

# 需要导入模块: import EMR_utilities [as 别名]
# 或者: from EMR_utilities import name_fixer [as 别名]
    def __init__(self, parent, ptID, reason, background, consultant, dueDate):
	filename = "/home/mb/Desktop/GECKO/EMR_outputs/%s/Consults/%s.pdf" % (ptID, EMR_utilities.dateToday())
	doc = SimpleDocTemplate(filename, pagesize=letter, topMargin=60)
	# container for the 'Flowable' objects
	elements = []
	styleSheet = getSampleStyleSheet()
	styleSheet.add(ParagraphStyle(name='Address', fontSize=13, leading=15))
	styleSheet.add(ParagraphStyle(name='Body', fontSize=12, leading=14))

	dem_data = EMR_utilities.getDictData('SELECT * FROM demographics WHERE patient_ID = %s;' % ptID)
	consultDoc = EMR_utilities.name_fixer(consultant)
	if consultDoc.firstname == '':
            consult_data = EMR_utilities.getDictData('SELECT * FROM consultants WHERE lastname = "%s";' \
		% (consultDoc.lastname))
        else:
            consult_data = EMR_utilities.getDictData('SELECT * FROM consultants WHERE lastname = "%s" \
		AND firstname = "%s";' % (consultDoc.lastname, consultDoc.firstname))
	
	patient = 'RE: %(firstname)s %(lastname)s, DOB: %(dob)s' % dem_data
	salutation = 'Dear Dr. %(lastname)s:' % consult_data
	body = 'I am sending %s, a %s %s, to see you regarding %s. %s' % \
		(dem_data['firstname'], EMR_utilities.getAge(ptID), dem_data['sex'], reason, background)
	problems = EMR_formats.getProblems(ptID)
	meds = EMR_formats.getMeds(ptID, display='column')
	qry = "INSERT INTO todo SET patient_ID = %s, date = '%s', description = '%s- %s', priority = 3, \
		category = 'Consult', due_date = '%s', complete = 0;" % (ptID, EMR_utilities.dateToday(), \
		consult_data['lastname'], reason, dueDate)
	EMR_utilities.updateData(qry)
	
	styleSheet = getSampleStyleSheet()
	styleSheet.add(ParagraphStyle(name='Address', fontSize=13, leading=15))
	styleSheet.add(ParagraphStyle(name='Body', fontSize=12, leading=14))

	elements.append(Paragraph('Barron Family Medicine', styleSheet['Address']))
	elements.append(Paragraph('1423 S Big Bend Blvd', styleSheet['Address']))
	elements.append(Paragraph('Richmond Heights, MO 63117', styleSheet['Address']))
	elements.append(Spacer(1,24))
	elements.append(Paragraph('<para align=RIGHT>%s</para>' % EMR_utilities.dateToday(t='display'), styleSheet['Body']))
	elements.append(Spacer(1,24))

	elements.append(Paragraph('Dr. %(lastname)s' % consult_data, styleSheet['Body']))
	elements.append(Paragraph('%(address)s' % consult_data, styleSheet['Body']))
	elements.append(Paragraph('%(city)s, %(state)s  %(zipcode)s' % consult_data, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(patient, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(salutation, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(body, styleSheet['Body']))
	elements.append(Spacer(1,12))
	elements.append(Paragraph("I have attached current medications and problems.  \
		If you have any questions, don't hesitate to call me at (314) 667-5276.", styleSheet['Body']))
	elements.append(Spacer(1,12))
	elements.append(Paragraph('Sincerely,', styleSheet['Body']))
	#elements.append(Spacer(1, 48))
	#If you want the signature automatically then can un-comment these lines.  For now I will sign all.
	logo = "/home/mb/Dropbox/Office/Signature.png"
	im = Image(logo, 2*inch, 0.75*inch)
	im.hAlign = "LEFT"
	elements.append(im)

	elements.append(Paragraph('Michael Barron MD', styleSheet['Body']))
	elements.append(Spacer(1, 12))

	tableList = [[problems, meds,]]
	table = Table(tableList, colWidths=(3*inch, 3*inch), style=[('VALIGN', (0,0), (-1,-1), 'TOP'),
				     							('LEFTPADDING', (0,0), (-1,-1), 0),
			     	     							('RIGHTPADDING', (0,0), (-1,-1), 20)])
	table.hAlign = "LEFT"
	elements.append(table)
	
	# write the document to disk
	doc.build(elements)
	os.system("lp -d Updox %s" % filename)	#extremely slick: prints directly to Updox Printer
开发者ID:barronmo,项目名称:gecko_emr,代码行数:76,代码来源:Printer1.py

示例2: __init__

# 需要导入模块: import EMR_utilities [as 别名]
# 或者: from EMR_utilities import name_fixer [as 别名]
    def __init__(self, parent, ptID, reason, background, consultant, dueDate):
	lt = "%s/EMR_outputs/%s/Consults/%s.pdf" % (settings.LINUXPATH, ptID, EMR_utilities.dateToday('file format'))
	at = "%s/EMR_outputs/%s/Consults/%s.pdf" % (settings.APPLEPATH, ptID, EMR_utilities.dateToday('file format'))
	wt = "%s\EMR_outputs\%s\Consults\%s.pdf" % (settings.WINPATH, ptID, EMR_utilities.dateToday('file format'))
	filename = EMR_utilities.platformText(lt, at, wt)
	doc = SimpleDocTemplate(filename, pagesize=letter, topMargin=60)
	# container for the 'Flowable' objects
	elements = []
	styleSheet = getSampleStyleSheet()
	styleSheet.add(ParagraphStyle(name='Address', fontSize=13, leading=15))
	styleSheet.add(ParagraphStyle(name='Body', fontSize=12, leading=14))

	dem_data = EMR_utilities.getDictData('SELECT * FROM demographics WHERE patient_ID = %s;' % ptID)
	consultDoc = EMR_utilities.name_fixer(consultant)
	if consultDoc.firstname == '':
            consult_data = EMR_utilities.getDictData('SELECT * FROM consultants WHERE lastname = "%s";' \
		% (consultDoc.lastname))
        else:
            consult_data = EMR_utilities.getDictData('SELECT * FROM consultants WHERE lastname = "%s" \
		AND firstname = "%s";' % (consultDoc.lastname, consultDoc.firstname))
	
	dem_data['phonenumber'] = EMR_formats.phone_format(dem_data['phonenumber'])
	patient = 'RE: %(firstname)s %(lastname)s, DOB: %(dob)s, Phone: %(phonenumber)s' % dem_data
	salutation = 'Dear Dr. %(lastname)s:' % consult_data
	body = 'I am sending %s, a %s %s, to see you regarding %s. %s' % \
		(dem_data['firstname'], EMR_utilities.getAge(ptID), dem_data['sex'], reason, background)
	problems = EMR_formats.getProblems(ptID)
	meds = EMR_formats.getMeds(ptID, display='column')
	qry = "INSERT INTO todo SET patient_ID = %s, date = '%s', description = '%s- %s', priority = 3, \
		category = 'Consult', due_date = '%s', complete = 0;" % (ptID, EMR_utilities.dateToday(), \
		consult_data['lastname'], reason, dueDate)
	EMR_utilities.updateData(qry)
	
	styleSheet = getSampleStyleSheet()
	styleSheet.add(ParagraphStyle(name='Address', fontSize=13, leading=15))
	styleSheet.add(ParagraphStyle(name='Body', fontSize=12, leading=14))

	elements.append(Paragraph('Barron Family Medicine', styleSheet['Address']))
	elements.append(Paragraph('8515 Delmar Blvd #217', styleSheet['Address']))
	elements.append(Paragraph('University City, MO 63124', styleSheet['Address']))
	elements.append(Paragraph('(314)667-5276  fax:(314)677-3838', styleSheet['Address']))
	elements.append(Spacer(1,24))
	elements.append(Paragraph('<para align=RIGHT>%s</para>' % EMR_utilities.dateToday(t='display'), styleSheet['Body']))
	elements.append(Spacer(1,24))

	elements.append(Paragraph('Dr. %(lastname)s' % consult_data, styleSheet['Body']))
	elements.append(Paragraph('%(address)s' % consult_data, styleSheet['Body']))
	elements.append(Paragraph('%(city)s, %(state)s  %(zipcode)s' % consult_data, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(patient, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(salutation, styleSheet['Body']))
	elements.append(Spacer(1, 12))
	elements.append(Paragraph(body, styleSheet['Body']))
	elements.append(Spacer(1,12))
	elements.append(Paragraph("I have attached current medications and problems.  \
		If you have any questions, don't hesitate to call me at (314) 667-5276.", styleSheet['Body']))
	elements.append(Spacer(1,12))
	elements.append(Paragraph('Sincerely,', styleSheet['Body']))
	#If you want the signature automatically then can un-comment these lines.  For now I will sign all.
	#logo = "/home/%s/Dropbox/Office/%sSignature.png" % (settings.HOME_FOLDER, settings.HOME_FOLDER)
	#im = Image(logo, 2*inch, 0.75*inch)
	#im.hAlign = "LEFT"
	#elements.append(im)
	chooseSig(elements)

	elements.append(Paragraph(settings.NAME, styleSheet['Body']))
	elements.append(Spacer(1, 12))

	tableList = [[problems, meds,]]
	table = Table(tableList, colWidths=(3*inch, 3*inch), style=[('VALIGN', (0,0), (-1,-1), 'TOP'),
				     							('LEFTPADDING', (0,0), (-1,-1), 0),
			     	     							('RIGHTPADDING', (0,0), (-1,-1), 20)])
	table.hAlign = "LEFT"
	elements.append(table)
	
	# write the document to disk
	doc.build(elements)
	choosePrinter(filename)
开发者ID:barronmo,项目名称:gecko_emr,代码行数:81,代码来源:Printer.py


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