Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.11 - Černý kašel u praktiků #829

Merged
merged 33 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
20f91ab
secrets fix
jan-stanek Apr 19, 2024
11eb938
model, migration, ...
jan-stanek Apr 18, 2024
353b7fa
migration fix
jan-stanek Apr 19, 2024
9a34889
update web gp
jan-stanek Apr 19, 2024
b0d30d1
offers update
jan-stanek Apr 19, 2024
d1f8620
Merge pull request #821 from jan-stanek/secrets-fix
msusicky Apr 19, 2024
74b3db5
model, controller
jan-stanek Apr 19, 2024
1cce962
views, controllers
jan-stanek Apr 20, 2024
b78f845
migration
jan-stanek Apr 20, 2024
a8ea2d9
fetcher fixes
jan-stanek Apr 21, 2024
b4cac9d
controller, queries fix
jan-stanek Apr 21, 2024
28873db
update notice
jan-stanek Apr 21, 2024
72f4eb1
illness filter
jan-stanek Apr 21, 2024
8e58e4c
fix
jan-stanek Apr 21, 2024
aea3bad
filter fix
jan-stanek Apr 21, 2024
bd18cb4
fixes
jan-stanek Apr 21, 2024
a09df55
cleanup fix
jan-stanek Apr 21, 2024
e75c0b3
Merge pull request #812 from jan-stanek/illness-type
msusicky Apr 21, 2024
ea58180
db sync fix
jan-stanek Apr 22, 2024
aeaadb7
resize fix
jan-stanek Apr 22, 2024
1ba52b8
Merge pull request #822 from jan-stanek/sync-fix
msusicky Apr 22, 2024
46cf9eb
Merge pull request #823 from jan-stanek/resize
msusicky Apr 22, 2024
fb93949
test script improved
jan-stanek Apr 22, 2024
46eda2e
Merge pull request #824 from jan-stanek/test-path-impr
msusicky Apr 22, 2024
c6b6d5b
insert new vaccines
jan-stanek Apr 22, 2024
d891889
insert vaccines
jan-stanek Apr 22, 2024
25b66bc
Merge pull request #825 from jan-stanek/new-vaccines
msusicky Apr 22, 2024
dfcc35e
Pridani loga MZCR dle pozadavku a taky novinky
Apr 22, 2024
c8b7413
expiration, non registered
jan-stanek Apr 22, 2024
7ec6dad
Fixed typo a tab
Apr 22, 2024
21db866
Fixed typo a tab
Apr 22, 2024
2f619af
Merge pull request #828 from jan-stanek/active-nonregistered
msusicky Apr 22, 2024
62be08a
Merge pull request #827 from msusicky/feature-mzcr
msusicky Apr 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/deploy-acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
CFA_USER: ${{ secrets.CFA_USER }}
CFA_PASS: ${{ secrets.CFA_PASS }}
UZIS_TOKEN: ${{ secrets.UZIS_TOKEN }}
with:
filename: config.ci.py
- name: Build release package
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ jobs:
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
CFA_USER: ${{ secrets.CFA_USER }}
CFA_PASS: ${{ secrets.CFA_PASS }}
UZIS_TOKEN: ${{ secrets.UZIS_TOKEN }}
with:
filename: config.ci.py
- name: Build release package
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sync-prd-acc-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ jobs:
echo "${SSH_KEY}" | tr -d '\r' | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
- name: Execute db sync prd -> acc
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "pg_dump -c ockovani_prd | psql ockovani_acc"
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} -o ServerAliveInterval=120 "pg_dump -F c ockovani_prd | pg_restore -c -d ockovani_acc"
- name: Execute migrations
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${APP_DIR} && source venv/bin/activate && flask db upgrade"
2 changes: 1 addition & 1 deletion .github/workflows/update-data-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@ jobs:
with:
inlineScript: |
az vm deallocate --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME}
az vm resize --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} --size Standard_B1s
az vm resize --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME} --size Standard_B2s
az vm start --resource-group ${AZURE_RESOURCE_GROUP} --name ${AZURE_VM_NAME}
31 changes: 31 additions & 0 deletions .github/workflows/update-web-offers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: update-web-offers

on:
workflow_dispatch

concurrency: production_env

jobs:
deploy:
name: Update static pages - offers
if: ${{ github.event.workflow_run.conclusion == 'success' }}
environment: production
runs-on: ubuntu-22.04
env:
APP_DIR: '${HOME}/prd/app'
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }}
steps:
- name: Setup SSH key
run: |
mkdir -p ~/.ssh/
ssh-keyscan -H ${SSH_HOST} >> ~/.ssh/known_hosts
eval `ssh-agent -s`
echo "${SSH_KEY}" | tr -d '\r' | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
- name: Check if webserver is running
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "systemctl status ockovani-prd.service"
- name: Create static pages
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "bash ${APP_DIR}/scripts/create_static_pages_offers.sh"
2 changes: 1 addition & 1 deletion .github/workflows/update-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ jobs:
- name: Check if webserver is running
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "systemctl status ockovani-prd.service"
- name: Create static pages
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${APP_DIR} && bash scripts/create_static_pages.sh"
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "bash ${APP_DIR}/scripts/create_static_pages.sh"
14 changes: 6 additions & 8 deletions app/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from datetime import date, timedelta

import click
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from sqlalchemy import text

from app import app, db
from app.etl import MetricsEtl
Expand Down Expand Up @@ -92,15 +92,13 @@ def clean_db_command():
"""Deletes older partition than 14 days. Executed weekly via cron"""
eng = db.engine

eng.execute(
"DELETE FROM ockovani_registrace WHERE import_id<(SELECT min(id) FROM importy WHERE start>now()-'14 days'::interval)")
with eng.connect() as conn:
conn.execute(text("DELETE FROM ockovani_registrace WHERE import_id<(SELECT min(id) FROM importy WHERE start>now()-'14 days'::interval)"))
app.logger.info("Old data deleted.")

connection = eng.raw_connection()
connection.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
cursor = connection.cursor()
cursor.execute("VACUUM(FULL, ANALYZE) ockovani_registrace")
with eng.connect() as conn:
with conn.execution_options(isolation_level='AUTOCOMMIT'):
conn.execute(text("VACUUM(FULL, ANALYZE) ockovani_registrace"))
app.logger.info("Vacuum finished.")
connection.autocommit = False

exit(0)
64 changes: 30 additions & 34 deletions app/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
from datetime import datetime

from flask import session, redirect, request, url_for
from flask.json import dump

from app import db, bp
from app.models import ZdravotnickeStredisko, PrakticiLogin, PrakticiKapacity, Vakcina
from app.models import ZdravotnickeStredisko, PrakticiLogin, PrakticiKapacity


@bp.route("/praktici_admin/register", methods=['POST'])
Expand All @@ -33,32 +32,13 @@ def praktici_admin_register():
elif user is not None:
session['error'] = 'Zdravotnické zařízení je už registrováno.'
else:
random.seed(datetime.now())
random.seed(datetime.now().timestamp())
characters = string.ascii_letters + string.digits
passwd = ''.join(random.choice(characters) for i in range(8))

user = PrakticiLogin(id, passwd)
db.session.add(user)

vaccines = db.session.query(Vakcina).all()

for vaccine in vaccines:
free_vaccine = PrakticiKapacity()
free_vaccine.datum_aktualizace = datetime.now()
free_vaccine.zdravotnicke_zarizeni_kod = id
free_vaccine.typ_vakciny = vaccine.vyrobce
free_vaccine.kraj = zarizeni.kraj
free_vaccine.mesto = zarizeni.obec
free_vaccine.nazev_ordinace = zarizeni.nazev_cely
free_vaccine.adresa = f'{zarizeni.ulice if zarizeni.ulice else zarizeni.obec} {zarizeni.cislo_domu}'
free_vaccine.pocet_davek = 0
free_vaccine.kontakt_email = zarizeni.email
free_vaccine.kontakt_tel = zarizeni.telefon
free_vaccine.poznamka = ''
free_vaccine.dospeli = zarizeni.druh_zarizeni_kod != 321
free_vaccine.deti = zarizeni.druh_zarizeni_kod == 321
db.session.add(free_vaccine)

db.session.commit()

session['user_id'] = id
Expand Down Expand Up @@ -122,31 +102,47 @@ def praktici_admin_edit():
if user is None:
session['error'] = 'Neplatné zdravotnické zařízení nebo heslo.'
else:
email = request.form.get('email')
user.email = email if email else None

telefon = request.form.get('telefon')
user.telefon = telefon if telefon else None

user.neregistrovani = request.form.get('neregistrovani') is not None

db.session.merge(user)

for i in range(len(request.form.getlist('typ_vakciny[]'))):
nemoc = request.form.getlist('nemoc[]')[i]
typ_vakciny = request.form.getlist('typ_vakciny[]')[i]

vaccine = db.session.query(PrakticiKapacity) \
.filter(PrakticiKapacity.zdravotnicke_zarizeni_kod == id) \
.filter(PrakticiKapacity.typ_vakciny == request.form.getlist('typ_vakciny[]')[i]) \
.filter(PrakticiKapacity.nemoc == nemoc) \
.filter(PrakticiKapacity.typ_vakciny == typ_vakciny) \
.one_or_none()

if vaccine is None:
continue
vaccine = PrakticiKapacity()
vaccine.zdravotnicke_zarizeni_kod = id
vaccine.nemoc = nemoc
vaccine.typ_vakciny = typ_vakciny

aktivni = [int(v) - 1 for v in request.form.getlist('aktivni[]')]
vaccine.aktivni = i in aktivni

pocet_davek = request.form.getlist('pocet_davek[]')[i]
expirace = request.form.getlist('expirace[]')[i]
dospeli = [int(v) - 1 for v in request.form.getlist('dospeli[]')]
vaccine.dospeli = i in dospeli

deti = [int(v) - 1 for v in request.form.getlist('deti[]')]
vaccine.deti = i in deti

vaccine.datum_aktualizace = datetime.now()
vaccine.pocet_davek = pocet_davek if pocet_davek.isnumeric() else 0
vaccine.dospeli = i in dospeli
vaccine.deti = i in deti
vaccine.adresa = request.form.getlist('adresa[]')[i]
vaccine.kontakt_tel = request.form.getlist('kontakt_tel[]')[i]
vaccine.kontakt_email = request.form.getlist('kontakt_email[]')[i]
vaccine.expirace = expirace if len(expirace) > 0 else None

vaccine.poznamka = request.form.getlist('poznamka[]')[i]

db.session.merge(vaccine)
db.session.commit()

db.session.commit()

return redirect(url_for('view.praktici_admin'))
4 changes: 2 additions & 2 deletions app/fetcher/fetcher_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ def _init_fetchers(self, dataset: str) -> None:
if dataset == 'all':
# self._fetchers.append(CentersFetcher()) # replaced by CentersApiFetcher
self._fetchers.append(CentersApiFetcher())
# self._fetchers.append(OpeningHoursFetcher())
# self._fetchers.append(HealthFacilitiesFetcher())
self._fetchers.append(OpeningHoursFetcher())
self._fetchers.append(HealthFacilitiesFetcher())
# self._fetchers.append(DistributedFetcher()) # not updated since 2022-11-29
# self._fetchers.append(UsedFetcher()) # not updated since 2022-02-16
self._fetchers.append(RegistrationsFetcher())
Expand Down
1 change: 1 addition & 0 deletions app/fetcher/health_facilities_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def fetch(self, import_id: int) -> None:

df = df.drop(['id', 'kraj_nuts_kod', 'kraj_nazev', 'okres_nazev'], axis=1)
df = df.rename(columns={'zarizeni_kod': 'id', 'okres_lau_kod': 'okres_id'})
df = df.groupby('id').first().reset_index()

self._truncate()

Expand Down
12 changes: 6 additions & 6 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ class Vakcina(db.Model):
vakcina_sklad = Column(Unicode, unique=True, nullable=False)
davky = Column(Integer, nullable=False)
aktivni = Column(Boolean, nullable=False)
nemoc = Column(Unicode, nullable=False)

def __repr__(self):
return f"<Vakcina(vyrobce='{self.vyrobce}')>"
Expand Down Expand Up @@ -1026,6 +1027,9 @@ class PrakticiLogin(db.Model):

zdravotnicke_zarizeni_kod = Column(Unicode, primary_key=True)
heslo = Column(Unicode, nullable=False)
email = Column(Unicode)
telefon = Column(Unicode)
neregistrovani = Column(Boolean, nullable=False)

def __init__(self, id, passwd):
self.zdravotnicke_zarizeni_kod = id
Expand All @@ -1041,17 +1045,13 @@ class PrakticiKapacity(db.Model):
zdravotnicke_zarizeni_kod = Column(Unicode, primary_key=True)
datum_aktualizace = Column(DateTime, nullable=False, default="now()")
typ_vakciny = Column(Unicode, primary_key=True)
kraj = Column(Unicode, nullable=False)
mesto = Column(Unicode, nullable=False)
nazev_ordinace = Column(Unicode, nullable=False)
adresa = Column(Unicode)
pocet_davek = Column(Integer, nullable=False)
kontakt_email = Column(Unicode)
kontakt_tel = Column(Unicode)
poznamka = Column(Unicode)
deti = Column(Boolean, nullable=False)
dospeli = Column(Boolean, nullable=False)
expirace = Column(Date)
nemoc = Column(Unicode, nullable=False)
aktivni = Column(Boolean, nullable=False)

def __repr__(self):
return f"<PrakticiKapacity(zdravotnicke_zarizeni_kod='{self.zdravotnicke_zarizeni_kod}')>"
Expand Down
49 changes: 28 additions & 21 deletions app/queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from app import db
from app.context import get_import_date, get_import_id
from app.models import OckovaciMisto, Okres, Kraj, OckovaciMistoMetriky, CrMetriky, OckovaniRegistrace, Populace, \
PrakticiKapacity, OckovaniRezervace, Vakcina, ZdravotnickeStredisko
PrakticiKapacity, OckovaniRezervace, Vakcina, ZdravotnickeStredisko, PrakticiLogin


def unique_nrpzs_subquery():
Expand Down Expand Up @@ -86,15 +86,17 @@ def find_doctor_offices(nrpzs_kod):
df = pd.read_sql_query(
f"""
select coalesce(z.zarizeni_nazev, min(s.nazev_cely)) zarizeni_nazev, o.nazev okres, k.nazev kraj,
k.nazev_kratky kraj_kratky, s.druh_zarizeni, s.obec, s.psc, s.ulice, s.cislo_domu, s.telefon, s.email,
s.web, s.latitude, s.longitude
k.nazev_kratky kraj_kratky, s.druh_zarizeni, s.obec, s.psc, s.ulice, s.cislo_domu,
coalesce(p.telefon, s.telefon) telefon_c, coalesce(p.email, s.email) email_c, s.web, s.latitude, s.longitude,
p.neregistrovani
from ockovaci_zarizeni z
full join zdravotnicke_stredisko s on s.nrpzs_kod = z.id
left join praktici_login p on substring(p.zdravotnicke_zarizeni_kod from 1 for 11) = s.nrpzs_kod
left join okresy o on o.id = coalesce(z.okres_id, s.okres_kod)
join kraje k on k.id = o.kraj_id
where z.id = '{nrpzs_kod}' or s.nrpzs_kod = '{nrpzs_kod}'
group by z.zarizeni_nazev, o.nazev, k.nazev, k.nazev_kratky, s.druh_zarizeni, s.obec, s.psc, s.ulice,
s.cislo_domu, s.telefon, s.email, s.web, s.latitude, s.longitude
s.cislo_domu, telefon_c, email_c, s.web, s.latitude, s.longitude, p.neregistrovani
""",
db.engine)

Expand All @@ -120,9 +122,7 @@ def find_doctors(okres_id=None, kraj_id=None):
join kraje k on k.id = o.kraj_id
left join zarizeni_metriky m on m.zarizeni_id = z.id and m.datum = '{get_import_date()}'
left join (
select left(zdravotnicke_zarizeni_kod, 11) nrpzs_kod
from praktici_kapacity n
where n.pocet_davek > 0 and (n.expirace is null or n.expirace >= '{get_import_date()}')
select left(zdravotnicke_zarizeni_kod, 11) nrpzs_kod from praktici_kapacity n where n.aktivni
) n on n.nrpzs_kod = z.id
where prakticky_lekar = True
and (z.okres_id = {okres_id_sql} or {okres_id_sql} is null)
Expand Down Expand Up @@ -154,9 +154,7 @@ def find_doctors_map():
left join zdravotnicke_stredisko s on s.nrpzs_kod = z.id
left join zarizeni_metriky m on m.zarizeni_id = z.id and m.datum = '{get_import_date()}'
left join (
select left(zdravotnicke_zarizeni_kod, 11) nrpzs_kod
from praktici_kapacity n
where n.pocet_davek > 0 and (n.expirace is null or n.expirace >= '{get_import_date()}')
select left(zdravotnicke_zarizeni_kod, 11) nrpzs_kod from praktici_kapacity n where n.aktivni
) n on n.nrpzs_kod = z.id
where prakticky_lekar = True
group by z.id, z.zarizeni_nazev, z.provoz_ukoncen, s.latitude, s.longitude, m.ockovani_pocet_davek,
Expand All @@ -181,38 +179,47 @@ def find_doctors_map():
def find_doctors_vaccine_options():
return db.session.query(Vakcina.vyrobce) \
.filter(Vakcina.aktivni == True) \
.filter(Vakcina.nemoc == 'Covid-19') \
.order_by(Vakcina.vyrobce) \
.all()


def find_free_vaccines_available(nrpzs_kod=None, okres_id=None, kraj_id=None):
return db.session.query(PrakticiKapacity.datum_aktualizace, PrakticiKapacity.pocet_davek,
PrakticiKapacity.typ_vakciny, PrakticiKapacity.mesto, PrakticiKapacity.nazev_ordinace,
PrakticiKapacity.deti, PrakticiKapacity.dospeli, PrakticiKapacity.kontakt_tel,
PrakticiKapacity.kontakt_email, PrakticiKapacity.expirace, PrakticiKapacity.poznamka,
PrakticiKapacity.kraj, ZdravotnickeStredisko.nrpzs_kod, ZdravotnickeStredisko.latitude,
ZdravotnickeStredisko.longitude) \
return db.session.query(PrakticiKapacity.datum_aktualizace, PrakticiKapacity.aktivni, PrakticiKapacity.nemoc,
PrakticiKapacity.typ_vakciny, PrakticiKapacity.deti, PrakticiKapacity.dospeli,
PrakticiKapacity.poznamka, PrakticiLogin.email, PrakticiLogin.telefon,
PrakticiLogin.neregistrovani, ZdravotnickeStredisko.nazev_cely, ZdravotnickeStredisko.obec,
ZdravotnickeStredisko.kraj, ZdravotnickeStredisko.nrpzs_kod, ZdravotnickeStredisko.latitude,
ZdravotnickeStredisko.longitude, ZdravotnickeStredisko.email.label('email_nrpzs'),
ZdravotnickeStredisko.telefon.label('telefon_nrpzs')) \
.join(PrakticiLogin, PrakticiLogin.zdravotnicke_zarizeni_kod == PrakticiKapacity.zdravotnicke_zarizeni_kod) \
.outerjoin(ZdravotnickeStredisko,
ZdravotnickeStredisko.zdravotnicke_zarizeni_kod == PrakticiKapacity.zdravotnicke_zarizeni_kod) \
.filter(or_(func.left(PrakticiKapacity.zdravotnicke_zarizeni_kod, 11) == nrpzs_kod, nrpzs_kod is None)) \
.filter(or_(ZdravotnickeStredisko.okres_kod == okres_id, okres_id is None)) \
.filter(or_(ZdravotnickeStredisko.kraj_kod == kraj_id, kraj_id is None)) \
.filter(PrakticiKapacity.pocet_davek > 0) \
.filter(or_(PrakticiKapacity.expirace == None, PrakticiKapacity.expirace >= get_import_date())) \
.order_by(PrakticiKapacity.kraj, PrakticiKapacity.mesto, PrakticiKapacity.nazev_ordinace,
.filter(PrakticiKapacity.aktivni) \
.order_by(ZdravotnickeStredisko.kraj, ZdravotnickeStredisko.obec, ZdravotnickeStredisko.nazev_cely,
PrakticiKapacity.typ_vakciny) \
.all()


def find_free_vaccines_vaccine_options():
return db.session.query(PrakticiKapacity.typ_vakciny) \
.filter(PrakticiKapacity.pocet_davek > 0) \
.filter(or_(PrakticiKapacity.expirace == None, PrakticiKapacity.expirace >= get_import_date())) \
.filter(PrakticiKapacity.aktivni) \
.distinct(PrakticiKapacity.typ_vakciny) \
.order_by(PrakticiKapacity.typ_vakciny) \
.all()


def find_free_vaccines_illness_options():
return db.session.query(PrakticiKapacity.nemoc) \
.filter(PrakticiKapacity.aktivni) \
.distinct(PrakticiKapacity.nemoc) \
.order_by(PrakticiKapacity.nemoc) \
.all()


def count_vaccines_center(center_id):
mista = pd.read_sql_query(
"""
Expand Down
Binary file added app/static/img/Logo MZCR_pod sebou.jfif
Binary file not shown.
Loading
Loading