Files
reporty/Comparemysqlandmedicus.py
2025-10-06 22:06:14 +02:00

40 lines
1.1 KiB
Python

fdbregistrovani="""
select rodcis
from
registr join kar on registr.idpac=kar.idpac
where kar.vyrazen!='A' and
kar.rodcis is not null and
idicp!=0 and
datum_zruseni is null"""
from Functions import get_medicus_connection,get_mysql_connection
medicus_registrovani=[]
fdbcon=get_medicus_connection()
if fdbcon:
cur=fdbcon.cursor()
cur.execute(fdbregistrovani)
for row in cur.fetchall():
medicus_registrovani.append(row[0])
print(medicus_registrovani)
print(len(medicus_registrovani))
mysqlcon=get_mysql_connection()
sql="""SELECT rc FROM `vzp_registrace` where icz=09305000"""
mysql_registrovani=[]
sqlcur=mysqlcon.cursor()
sqlcur.execute(sql)
for row in sqlcur.fetchall():
mysql_registrovani.append(row[0])
print(mysql_registrovani)
# extra_in_a = [x for x in a if x not in b]
# extra_in_b = [x for x in b if x not in a]
#Kdo je registrovany v Medicus, ale neni opravdu registrovany v ambulanci?
print("Toto jsou pacienti registrovaní v medicus ale nejsou registrovaní na webu")
print(len([x for x in medicus_registrovani if x not in mysql_registrovani]))