From 37c0ab7d233d218413d7478fa3c1e5e133e1aa88 Mon Sep 17 00:00:00 2001 From: "michaela.buzalkova" Date: Thu, 2 Oct 2025 08:05:15 +0200 Subject: [PATCH] sestra --- 02 testík.py | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/02 testík.py b/02 testík.py index 810dfc0..700b29a 100644 --- a/02 testík.py +++ b/02 testík.py @@ -17,7 +17,7 @@ from pymysql.cursors import DictCursor from pprint import pprint from functions import get_medicus_connection from functions import get_mysql_connection -import time, random +import time, random,socket # ------------------- CONFIG ------------------- ENDPOINT = "https://prod.b2b.vzp.cz/B2BProxy/HttpProxy/RegistracePojistencePZSB2B" # case-sensitive @@ -32,15 +32,27 @@ K_DATU = date.today().isoformat() # YYYY-MM-DD ODBORNOSTI = ["001"] # VPL (adult GP) # MySQL -MYSQL_CFG = dict( - host="192.168.1.76", - port=3307, - user="root", - password="Vlado9674+", - database="medevio", - cursorclass=DictCursor, - autocommit=False, -) +if socket.gethostname().strip() == "NTBVBHP470G10": + MYSQL_CFG = dict( + host="192.168.1.76", + port=3307, + user="root", + password="Vlado9674+", + database="medevio", + cursorclass=DictCursor, + autocommit=True, # or False if you prefer manual commit + ) +elif socket.gethostname().strip() == "SESTRA": + MYSQL_CFG = dict( + host="127.0.0.1", + port=3307, + user="root", + password="Vlado9674+", + database="medevio", + cursorclass=DictCursor, + autocommit=True, # or False if you prefer manual commit + ) + # Namespaces (from your response/WSDL) NS = { @@ -204,7 +216,7 @@ def main(): con = get_medicus_connection() cur = con.cursor() - cur.execute("select rodcis, prijmeni, jmeno from kar where rodcis starting with '0'") + cur.execute("select rodcis, prijmeni, jmeno from kar where rodcis starting with '9'") # cur.execute("select first 2 rodcis, prijmeni, jmeno from kar where rodcis starting with '0'") # Vytvor seznam rodnych cisel, která už máme