from django.shortcuts import render
import re
# Create your views here.
from collections import namedtuple
from django.db import connections, connection
from collections import namedtuple
from django.db import connection
from myapp import models
def show(request):
with connection.cursor() as cursor:
cursor.execute("SELECT DISTINCT(data) from section_year")
result1 = namedtuplefetchall(cursor)
data=[]
for i in result1:
data.append(i[0])
cursor.execute("SELECT treatment_section_name,count from section_year where data like '2017' and treatment_section_name not like '其他科室' LIMIT 15")
result2=namedtuplefetchall(cursor)
count1=[]
treatment_section_name1=[]
for i in result2:
count1.append(i[1])
treatment_section_name1.append(i[0])
cursor.execute(
"SELECT treatment_section_name,count from section_year where data like '2018' and treatment_section_name not like '其他科室' LIMIT 15")
result3 = namedtuplefetchall(cursor)
count2 = []
treatment_section_name2 = []
for i in result3:
count2.append(i[1])
treatment_section_name2.append(i[0])
cursor.execute(
"SELECT treatment_section_name,count from section_year where data like '2019' and treatment_section_name not like '其他科室' LIMIT 15")
result4 = namedtuplefetchall(cursor)
count3 = []
treatment_section_name3 = []
for i in result4:
count3.append(i[1])
treatment_section_name3.append(i[0])
cursor.execute(
"SELECT treatment_section_name,count from section_year where data like '2017' and org_name like '济南市儿童医院' LIMIT 15")
result5 = namedtuplefetchall(cursor)
count4 = []
treatment_section_name4 = []
for i in result5:
count4.append(i[1])
treatment_section_name4.append(i[0])
cursor.execute(
"SELECT treatment_section_name,count from section_year where data like '2018' and org_name like '济南市儿童医院' LIMIT 15")
result6 = namedtuplefetchall(cursor)
count5 = []
treatment_section_name5 = []
for i in result6:
count5.append(i[1])
treatment_section_name5.append(i[0])
cursor.execute(
"SELECT treatment_section_name,count from section_year where data like '2019' and org_name like '济南市儿童医院' LIMIT 15")
result7 = namedtuplefetchall(cursor)
count6 = []
treatment_section_name6 = []
for i in result7:
count6.append(i[1])
treatment_section_name6.append(i[0])
# count_year={e:count1[i] for i, e in enumerate(data)}
# print(count_year)
cursor.execute("SELECT cnt FROM org_name_2017 where org_name='济南市儿童医院'")
a1 = namedtuplefetchall(cursor)
cursor.execute("SELECT cnt FROM org_name_2018 where org_name='济南市儿童医院'")
a2 = namedtuplefetchall(cursor)
cursor.execute("SELECT cnt FROM org_name_2019 where org_name='济南市儿童医院'")
a3 = namedtuplefetchall(cursor)
cnt1=[]
cnt2=[]
cnt3=[]
for i in a1:
cnt1.append(i[0])
for i in a2:
cnt2.append(i[0])
for i in a3:
cnt3.append(i[0])
cnt_c=[]
cnt_c.append(cnt1[0])
cnt_c.append(cnt2[0])
cnt_c.append(cnt3[0])
# print(cnt_c)
cursor.execute("SELECT cnt FROM org_name_2017 where org_name='济南市第四人民医院'")
a4 = namedtuplefetchall(cursor)
cursor.execute("SELECT cnt FROM org_name_2018 where org_name='济南市第四人民医院'")
a5 = namedtuplefetchall(cursor)
cursor.execute("SELECT cnt FROM org_name_2019 where org_name='济南市第四人民医院'")
a6 = namedtuplefetchall(cursor)
cnt4=[]
cnt5=[]
cnt6=[]
for i in a4:
cnt4.append(i[0])
for i in a5:
cnt5.append(i[0])
for i in a6:
cnt6.append(i[0])
cnt_p=[]
cnt_p.append(cnt4[0])
cnt_p.append(cnt5[0])
cnt_p.append(cnt6[0])
cursor.execute("SELECT treatment_section_name,doc FROM doc_2018 where org_name='济南市儿童医院' GROUP BY doc desc limit 5")
b1 = namedtuplefetchall(cursor)
cursor.execute("SELECT treatment_section_name,doc FROM doc_2018 where org_name='济南市第四人民医院' GROUP BY doc desc limit 5 ")
b2 = namedtuplefetchall(cursor)
section_doc1 = []
section_doc2 = []
doc1=[]
doc2=[]
for i in b1 :
section_doc1.append(i[0])
doc1.append((i[1]))
for i in b2 :
section_doc2.append(i[0])
doc2.append((i[1]))
doc_c=[]
for i in range(len(section_doc1)):
doc={}
doc["name"]=section_doc1[i]
doc["value"]=doc1[i]
doc_c.append(doc)
# print(doc_c)
doc_p = []
for i in range(len(section_doc2)):
doc = {}
doc["name"] = section_doc2[i]
doc["value"] = doc2[i]
doc_p.append(doc)
# print(doc_p)
cursor.execute(
"SELECT treatment_section_name,cost from cost_2017 where org_name='济南市儿童医院' ")
c1 = namedtuplefetchall(cursor)
cursor.execute(
"SELECT treatment_section_name,cost from cost_2017 where org_name='济南市第四人民医院' ")
c2 = namedtuplefetchall(cursor)
section_doc3 = []
section_doc4 = []
cost1=[]
cost2=[]
for i in c1 :
section_doc3.append(i[0])
cost1.append((i[1]))
for i in c2 :
section_doc4.append(i[0])
cost2.append((i[1]))
cost_c=[]
for i in range(len(section_doc3)):
cost = {}
cost["name"] = section_doc3[i]
cost["value"] = cost1[i]
cost_c.append(cost)
cost_p = []
for i in range(len(section_doc4)):
cost = {}
cost["name"] = section_doc4[i]
cost["value"] = cost2[i]
cost_p.append(cost)
# count_year={e:count1[i] for i, e in enumerate(data)}
section_cost1={e:section_doc3[i] for i ,e in enumerate(section_doc3)}
section_cost2={e:section_doc4[i] for i ,e in enumerate(section_doc4)}
section_cost={}
section_cost.update(section_cost1)
section_cost.update(section_cost2)
return render(request,"medical/index.html",{"treatment_section_name1":treatment_section_name1,"data":data,"count1":count1,"treatment_section_name2":treatment_section_name2,"treatment_section_name3":treatment_section_name3,
"count2":count2,"count3":count3,"count4":count4,"count5":count5,"count6":count6,"treatment_section_name4":treatment_section_name4,"treatment_section_name5":treatment_section_name5,"treatment_section_name6":treatment_section_name6,
"cnt_c":cnt_c,"cnt_p":cnt_p,"doc_c":doc_c,"doc_p":doc_p,"cost_c":cost_c,"cost_p":cost_p,"section_cost":section_cost})
def gl(request):
with connection.cursor() as cursor:
cursor.execute("select admin_illness_name,SUM(count) as count from disease_year WHERE date like '%%01%%' or date like '%%02%%' or date like '%%03%%' GROUP BY admin_illness_name ORDER BY count DESC")
a1 = namedtuplefetchall(cursor)
cursor.execute("select admin_illness_name,SUM(count) as count from disease_year WHERE date like '%%04%%' or date like '%%05%%' or date like '%%06%%' GROUP BY admin_illness_name ORDER BY count DESC")
a2= namedtuplefetchall(cursor)
cursor.execute("select admin_illness_name
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
【资源说明】 基于Python+Django的门诊大数据分析推荐系统源码+全部资料齐全.zip基于Python+Django的门诊大数据分析推荐系统源码+全部资料齐全.zip 【备注】 1、该项目是个人高分项目源码,已获导师指导认可通过,答辩评审分达到95分 2、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 3、本项目适合计算机相关专业(人工智能、通信工程、自动化、电子信息、物联网等)的在校学生、老师或者企业员工下载使用,也可作为毕业设计、课程设计、作业、项目初期立项演示等,当然也适合小白学习进阶。 4、如果基础还行,可以在此代码基础上进行修改,以实现其他功能,也可直接用于毕设、课设、作业等。 欢迎下载,沟通交流,互相学习,共同进步!
资源推荐
资源详情
资源评论
收起资源包目录
基于大数据分析的门诊推荐系统源码+全部资料齐全.zip (77个子文件)
Outpatient-Department-master
myapp
__init__.py 0B
tests.py 60B
admin.py 63B
migrations
__init__.py 0B
0001_initial.py 514B
__pycache__
0001_initial.cpython-37.pyc 616B
__init__.cpython-37.pyc 142B
apps.py 85B
models.py 10KB
urls.py 396B
__pycache__
views.cpython-37.pyc 13KB
admin.cpython-37.pyc 172B
models.cpython-37.pyc 9KB
__init__.cpython-37.pyc 131B
apps.cpython-37.pyc 345B
urls.cpython-37.pyc 453B
views.py 27KB
templates
medical
index2.html 42KB
css
globle.css 2KB
index1.css 3KB
index.html 26KB
index3.html 11KB
images
top_title.png 93KB
cicleBg.png 21KB
bg.jpg 167KB
close.png 2KB
msgBg.png 70KB
dataBg.png 60KB
index5.html 15KB
index1.html 21KB
.idea
work.iml 552B
misc.xml 299B
inspectionProfiles
profiles_settings.xml 174B
modules.xml 260B
.gitignore 47B
manage.py 660B
work
__init__.py 106B
wsgi.py 385B
urls.py 796B
settings.py 3KB
__pycache__
settings.cpython-37.pyc 2KB
__init__.cpython-37.pyc 230B
wsgi.cpython-37.pyc 527B
urls.cpython-37.pyc 954B
asgi.py 385B
mml
test 2KB
static
js
nane_dingwei.js 947B
jquery-2.2.1.min.js 84KB
rem.js 773B
worldcloud.js 28KB
echarts-en.min.js 729KB
jquery-3.5.1.js 281KB
echarts.min.js 691KB
echarts-wordcloud.min.js 125KB
index.js 18KB
img
down.png 2KB
t_header.png 11KB
t_bg.png 110KB
cicleBg.png 21KB
bg.jpg 167KB
bg.png 1.64MB
close.png 2KB
msgBg.png 70KB
top.png 2KB
t_border.png 5KB
dataBg.png 60KB
css
globle.css 2KB
index1.css 3KB
index.css 2KB
index2.css 3KB
images
top_title.png 93KB
cicleBg.png 21KB
bg.jpg 167KB
close.png 2KB
msgBg.png 70KB
dataBg.png 60KB
171265889347208773632.zip 416B
共 77 条
- 1
资源评论
不走小道
- 粉丝: 3210
- 资源: 5120
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功