当前位置: 首页 > news >正文

[免费]基于Python的Django医院管理系统【论文+源码+SQL脚本】

大家好,我是python222_小锋老师,看到一个不错的基于Python的Django医院管理系统,分享下哈。

项目视频演示

https://www.bilibili.com/video/BV1iPH8zmEut/

项目介绍

随着人民生活水平日益增长,科技日益发达的今天,人们对身体健康的重视也越来越高。医院的需求也随之增加。中国有句古话称“病从口入”,随着生活水平的提高,人们在饮食方面也提出了更高的要求。然而,各种食品添加剂的使用使得人们的身体也出现了一些问题。因此,人们对医院的需求迅速增长,而与之相应的是管理方面的挑战。

为了提高医院的经济效益,使其在同行竞争中立于不败之地,迫切需要一个科学的医院信息管理系统来解决医院面临的各种困难。这个系统需要充分了解患者的基本情况,并集结众多患者的管理经验,融合先进的管理思想,同时考虑医院的实际情况,将信息流作为主线,优化流程,为医院管理层提供最佳的管理手段,帮助医院实现资源充分共享,快捷简便地查询资源,全面提升医院整体水平,从而增强医院的竞争力[1]。因此,现代化医院管理变得尤为重要。

系统展示

部分代码

from django.contrib import admin# Register your models here.
from .models import *@admin.register(Department)
class DepartmentAdmin(admin.ModelAdmin):# 要显示的字段list_display = ('id', 'name','doctor_name', 'create_time')# 需要搜索的字段search_fields = ('name',)# 分页显示,一页的数量list_per_page = 10actions_on_top = True@admin.register(Doctor)
class DoctorAdmin(admin.ModelAdmin):#resource_class = ProxyResourcelist_display = ( 'name', 'gender', 'phone', 'stu_no','department', 'enable', 'create_time','idCard')# search_fields = ('name', 'enable', 'idCard', 'department')search_fields = ('name', 'phone')list_per_page = 20# raw_id_fields = ('department',)# list_filter = ('department', AgeListFilter, 'create_time')# list_filter = (AgeListFilter, 'department', 'create_time', 'birthday', 'time', 'enable', 'gender')list_display_links = ('name',)#fields = ('user_name', 'idCard', 'birthday')  # 编辑界面只显示No、Name和Age#exclude = ('pass_word','user_name')  # 记得元祖需要在后面加个逗号,不然会报错list_editable = ('department', 'phone', 'enable', 'gender','idCard','stu_no')date_hierarchy = 'create_time'@admin.register(House)
class HouseAdmin(admin.ModelAdmin):# 要显示的字段list_display = ('no', 'name','level','amount', 'create_time')fields = ('no', 'name', 'level','amount' )  # 编辑界面只显示No、Name和Age# 需要搜索的字段search_fields = ('no',)# 分页显示,一页的数量list_per_page = 10actions_on_top = True# inlines = [#     HealthLogInline,#     MaintanceInline# ]import xlwt
from django.http import HttpResponse, JsonResponse
import datetime@admin.register(Medical)
class MedicalAdmin(admin.ModelAdmin):# 要显示的字段list_display = ('id', 'name', 'price', 'qr_code', 'create_time', 'prescription')fields = ('name', 'qr_code', 'price', 'prescription')  # 编辑界面只显示No、Name和Ageactions = ['output']# 需要搜索的字段search_fields = ('name', 'qr_code', 'price', 'prescription')# 分页显示,一页的数量list_per_page = 10actions_on_top = True# inlines = [#     HealthLogInline,#     MaintanceInline# ]def output(self, request, queryset):response = HttpResponse(content_type='application/vnd.ms-excel')  # 指定返回格式为excel,excel文件MINETYPE为application/vnd.ms-excelresponse['Content-Disposition'] = 'attachment;filename=instorage.xls'wb = xlwt.Workbook(encoding='utf-8')  # 创建一个工作簿sheet = wb.add_sheet('药品单据')  # 创建一个工作表# 创建一个居中对齐的样式style = xlwt.XFStyle()alignment = xlwt.Alignment()alignment.horz = xlwt.Alignment.HORZ_CENTERstyle.alignment = alignmentfont = xlwt.Font()font.name = '宋体'font.bold = Truefont.height = 20 * 11  # 设置字体大小style.font = font# 将样式应用于单元格sheet.write_merge(0, 0, 0, 5, '药品单据', style)sheet.write(1, 0, 'id', style)sheet.write(1, 1, '名称', style)sheet.write(1, 2, '描述', style)sheet.write(1, 3, '价格', style)sheet.write(1, 4, '数量', style)sheet.write(1, 5, '创建时间', style)data_row = 2for obj in queryset:# 创建一个居中对齐的样式style = xlwt.XFStyle()alignment = xlwt.Alignment()alignment.horz = xlwt.Alignment.HORZ_CENTERstyle.alignment = alignmentsheet.write(data_row, 0, obj.id, style)sheet.write(data_row, 1, obj.name, style)sheet.write(data_row, 2, obj.prescription, style)sheet.write(data_row, 3, str(obj.price), style)sheet.write(data_row, 4, obj.qr_code, style)sheet.write(data_row, 5, obj.create_time.strftime('%Y-%m-%d'), style)data_row = data_row + 1wb.save(response)return responseoutput.short_description = '生成药品单据'output.type = 'success'output.style = 'background-color: #00a65a; color: #fff; border-color: #008d4c;'@admin.register(Patient)
class PatientAdmin(admin.ModelAdmin):#resource_class = ProxyResourcelist_display = ( 'name', 'gender', 'phone', 'idCard','department', 'in_time','doctor_name', 'create_time','idCard')# search_fields = ('name', 'enable', 'idCard', 'department')search_fields = ('name', 'department__name')list_per_page = 20# raw_id_fields = ('department',)# list_filter = ('department', AgeListFilter, 'create_time')# list_filter = (AgeListFilter, 'department', 'create_time', 'birthday', 'time', 'enable', 'gender')list_display_links = ('name',)#fields = ('user_name', 'idCard', 'birthday')  # 编辑界面只显示No、Name和Age#exclude = ('pass_word','user_name')  # 记得元祖需要在后面加个逗号,不然会报错list_editable = ('department', 'phone', 'idCard', 'doctor_name', 'gender','idCard','in_time')date_hierarchy = 'create_time'
#!/usr/bin/env python
import os
import sysif __name__ == '__main__':os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'simpleui_demo.settings')try:from django.core.management import execute_from_command_lineexcept ImportError as exc:raise ImportError("Couldn't import Django. Are you sure it's installed and ""available on your PYTHONPATH environment variable? Did you ""forget to activate a virtual environment?") from excexecute_from_command_line(sys.argv)

源码下载

链接:https://pan.baidu.com/s/167Mx6cYeKROqhKl2I2dLCQ
提取码:1234


文章转载自:

http://THSRUQsu.gskzy.cn
http://zw6VgR6J.gskzy.cn
http://ge1HEJs7.gskzy.cn
http://RyyOuWGC.gskzy.cn
http://Do8jrNBp.gskzy.cn
http://sir2WzYJ.gskzy.cn
http://k2mhq1zE.gskzy.cn
http://LodmBKCO.gskzy.cn
http://OPRGoaT0.gskzy.cn
http://wBt0DIKa.gskzy.cn
http://8ogq55Qv.gskzy.cn
http://l9EOWTcF.gskzy.cn
http://0ZPAGhP1.gskzy.cn
http://xoPs3jTp.gskzy.cn
http://eJhojjgD.gskzy.cn
http://dPcfMa0R.gskzy.cn
http://Vk5EQscO.gskzy.cn
http://lVlZhHrE.gskzy.cn
http://BsDNFvAu.gskzy.cn
http://tpDjiwMO.gskzy.cn
http://CYpX0mDz.gskzy.cn
http://EWPFwjBO.gskzy.cn
http://uF7CeyUG.gskzy.cn
http://Ol6yNYed.gskzy.cn
http://QTjotkpP.gskzy.cn
http://VHAYEvFW.gskzy.cn
http://Y4b0Uzdn.gskzy.cn
http://WPqLybQe.gskzy.cn
http://VsKZ2NSg.gskzy.cn
http://Umqrnm76.gskzy.cn
http://www.dtcms.com/a/378421.html

相关文章:

  • 【音视频】Android NDK 与.so库适配
  • 认识鸿蒙——它不是“安卓换皮”
  • YOLO11目标检测运行推理简约GUI界面
  • 如何在 VSCode 中设置默认浏览器为 Chrome 或 Firefox
  • VSCode设置:解决找不到文件的问题
  • rabbitmq的安装
  • 从拓扑排序看有向图的应用
  • 谷歌浏览器
  • openCV 角点检测与 SIFT 特征提取:原理与实战解析
  • 使用Samba网络磁盘作为MacOS时间机器的远程备份磁盘
  • YOLO + OpenPLC + ARMxy:工业智能化视觉识别、边缘计算、工业控制的“三位一体”解决方案
  • 超声波风向传感器:以科技之翼,捕捉风的每一次呼吸
  • 操作【GM3568JHF】FPGA+ARM异构开发板 使用指南:TF-Card
  • NineData云原生智能数据管理平台新功能发布|2025年8月版
  • 行业学习【电商】:直播电商的去头部化、矩阵号?
  • Kimi-Researcher:月之暗面推出的深度研究AI智能体
  • 西嘎嘎学习 - C++ 继承 - Day 10
  • 图像直方图,直方图均衡化和掩膜
  • react reducx的使用
  • 基于STM32设计的智慧路灯(华为云IOT)_281
  • 智慧水库综合管理系统平台御控物联网解决方案
  • react基础篇
  • 子数组最大累加和dp问题I(保姆级!)
  • Win10和Win11打开IE浏览器
  • 解锁Python超能力:面向对象编程之类继承完全指南
  • 【openGLES】纹理
  • 什么是OCSP装订(OCSP Stapling)?它如何加速SSL握手?
  • 微硕WINSOK MOS管WSF3089,赋能汽车转向系统安全升级
  • Matplotlib 动画显示进阶:交互式控制、3D 动画与未来趋势
  • 立体校正原理