Unterschiede die in der Production Version vorhanden sein müssen:
Constants.java: SERVICEURL muss Port 8080 nutzen (77)
Constants.java ADMINORGANIZATIONID auf 3 setzen (324)
web.xml: Production einkommentieren (11ff), Cookie Settings einkommentieren (140ff)
ActivationBean.java: Empfängeradresse muss die des Users sein (436/437)
ActivationBean.java Empfängeradresse muss die des verwalter sein (935/936)
UsersBean.java: Empfängeradresse muss die des Users sein (885)
LoginBean.java Email des Users (794)
nach neuer Version Datenübernahme + PDF Erstellung anklicken, damit es (vor-)kompiliert wird
Liste von Fehlern???
Hinweis in Online-Version auf ALTE QB-Version?
Archiv + Online-Version weiter online? -> Ärzte entfernen über Archiv möglich
Beta-Version als Test? Nein
Neues Layout besprechen
QB2023
1. Prüfung B-5/B-6 verbessern, harte Fehlermeldung vermeiden
2. Download XML-Datei optimieren oder beschreibenden Text für 'Speichern unter' ergänzen
3. Schema-Prüfung/Import bzgl. C-8 und alphabetischer Sortierung verbessern, mit DKTIG/DKG abstimmen, EWrläuterungstext
4. Liste von Zahlungen, die nicht zugeordnet werden konnten
5. Falscher Wert in C-2 wird übernommen ticket #002995
QB 2021:
datenübernahme: flag für bild, einleitungstext
einleitungsjson in formular_repair übertragen query im wiki
icd vorbereitet
ops vorbereitet
aop vorbereitet
Kritisch: Die Wörter Upload und Import gleichsetzen/mischen (Bei den QB Klausens, das verwirrt die)
zB: Per Klick auf Upload starten Sie den Import
Gilt für gesamtes QBM, Wörter, die Funktionen beschreiben: vereinheitlichen
Ebenso vereinheitlichen: Hinweis/Anleitungsfarbe (zb immer zartblau)
Warnung immer zartgelb
Fehler immer knallrot
--------
Anleitung zum Importieren
Sie benötigen die Jahresanmeldung zur Pups-Vereinbarung. Diese erhalten Sie wie in diesem Dokument beschrieben vom InEK.
Per Klick auf [] öffnen Sie das Upload-Fenster.
Ziehen Sie nun die Datei [ppipi] mit gedrückter, linker Maustaste in den grün hinterlegten Bereich im Upload-Fenster.
Per Klick auf den Button [Upload] starten Sie den Import.
Hinweis:
Bitte beachten Sie, dass die Zuordnung zur Fachabteilung nicht in die Abgabe-Datei übernommen wird.
Die Zuordnung können Sie bei Bedarf per Klick auf [] als Kommentar hinterlegen.
----
Anzahl Vollkräfte insgesamt = Anzahl der Vollkräfte aller Fachabteilungen (B-[X].11) + Anzahl der Vollkräfte ohne Fachabteilungszuordnung
Die Summierung übernimmt promato QBM für Sie automatisch, sobald Sie die Vorschau öffnen oder den PDF/DOCX/XML Export starten.
Sie müssen lediglich im Formular A-11 das Personal ohne Fachabteilungszuordnung eintragen.
Alternativ können Sie auch unsere Export-Import Funktion nutzen.
IKs, die von der DKTIG bestätigt werden müssen
Die Gesamtzahl der Vollkräfte des Krankenhauses muss der Anzahl der Vollkräfte aller Organisationseinheiten/Fachabteilungen (B-[X].11) addiert mit der Anzahl Vollkräfte, die keiner Fachabteilung zuzuordnen sind, entsprechen.
Die Werte im Formular A-11 sind dabei der Übersichtlichkeit halber in promato QBM als Anzahl der Vollkräfte aller Fachabteilungen zu hinterlegen, die endgültige Aufsummierung als Gesamtwert (inklusive der Anzahl Vollkräfte, die keiner Fachabteilung zuzuordnen sind)
wird automatisch bei einem PDF-, RTF- oder XML-Export durchgeführt. Eine automatische Berechnung der Anzahl Vollkräfte aller Fachabteilungen können Sie jederzeit mit einem Klick auf das "Taschenrechner-Symbol" durchführen.
-- dktig hospitals, percentage, state =4 // including date of latest edit and hospitals without formulars / departments
select h.hospitalid, h.ik, h.call_number,
(SELECT TIMESTAMP WITH TIME ZONE 'epoch' + max(stamp/1000) * INTERVAL '1 second' from formular where hospitalid = h.hospitalid) as max,
11 * count(d.departmentid) + 20 as d_count,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14) as f_count_1,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14 and state = 4) as f_count_2,
(select 100*count(formularid)/(11 * count(d.departmentid) + 20) from formular where hospitalid = h.hospitalid and qb_year_flag = 14 and state = 4) as perc
from hospital h, department d
--left join department d on h.hospitalid = d.hospitalid
where d.qb_year_flag = 14
and (h.hospitalid = d.hospitalid or not exists (select departmentid from department where hospitalid = h.hospitalid))
--and d.departmentid in (select departmentid from hospital_departments where hospitalid = h.hospitalid)
and h.hospitalid in (select hospitalid from organization_hospital where organizationid in (select organizationid from organization where isdktig = true) and organizationid != 3)
and h.hospitalid not in (select hospitalid from hospital where ik like '999%')
and h.hospitalid not in (select hospitalid from filelog where filename ilike '%xml%')
--and h.hospitalid in (select hospitalid from hospital where call_number != '99')
--and h.hospitalid not in (select distinct hospitalid from formular where stamp > 1512086400000)
group by h.hospitalid, h.ik, h.call_number
order by perc desc, max desc, ik asc
-- // SELECT TIMESTAMP WITH TIME ZONE 'epoch' + 982384720.12 * INTERVAL '1 second';
-- dktig hospitals, percentage
select h.hospitalid, h.ik, h.call_number,
(SELECT TIMESTAMP WITH TIME ZONE 'epoch' + max(stamp/1000) * INTERVAL '1 second' from formular where hospitalid = h.hospitalid) as max,
11 * count(d.departmentid) + 20 as d_count,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14) as f_count_1,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14 and state >2) as f_count_2,
(select 100*count(formularid)/(11 * count(d.departmentid) + 20) from formular where hospitalid = h.hospitalid and qb_year_flag = 14 and state>2) as perc
from hospital h, department d
--left join department d on h.hospitalid = d.hospitalid
where d.qb_year_flag = 14
and (h.hospitalid = d.hospitalid or not exists (select departmentid from department where hospitalid = h.hospitalid))
--and d.departmentid in (select departmentid from hospital_departments where hospitalid = h.hospitalid)
and h.hospitalid in (select hospitalid from organization_hospital where organizationid in (select organizationid from organization where isdktig = true) and organizationid != 3)
and h.hospitalid not in (select hospitalid from hospital where ik like '999%')
and h.hospitalid not in (select hospitalid from filelog where filename ilike '%xml%')
--and h.hospitalid in (select hospitalid from hospital where call_number != '99')
--and (h.hospitalid in (select distinct hospitalid from formular where stamp > 1512086400000) or h.hospitalid not in (select distinct hospitalid from formular))
--and (h.hospitalid in (select distinct hospitalid from formular where stamp > 1512086400000))
group by h.hospitalid, h.ik, h.call_number
order by perc desc, max desc, ik asc
-- xml abgaben dktig häuser
select distinct hospitalid from filelog
where hospitalid not in (select hospitalid from hospital where ik like '999%')
and filename ilike '%xml%'
and hospitalid in (select hospitalid from organization_hospital where organizationid in (select organizationid from organization where isdktig = true) and organizationid != 3)
-- alle organizations
select distinct organizationid from organization_hospital where organizationid in (
select organizationid from organization where rechnung_nummer is not null or isdktig is true)
and hospitalid not in (select hospitalid from hospital where ik like '999%')
-- alle häuser
select distinct hospitalid from organization_hospital where organizationid in (
select organizationid from organization where rechnung_nummer is not null or isdktig is true)
and hospitalid not in (select hospitalid from hospital where ik like '999%')
-- dktig iks
select distinct ik from organization_hospital where organizationid in (
select organizationid from organization where isdktig = true and organizationid != 3)
and ik not like '999%'
-- dktig hospitals -> without xml-export and not edited any formular since 1.12.2017
select * from hospital where hospitalid in (
select distinct hospitalid from organization_hospital where organizationid in (
select organizationid from organization where isdktig = true) and organizationid != 3
and hospitalid not in (select hospitalid from hospital where ik like '999%')
--and hospitalid in (select hospitalid from hospital where call_number = '99')
and hospitalid not in (select distinct hospitalid from filelog where filename ilike '%xml%')
--and hospitalid in (select hospitalid from hospital where ik >= '2609')
--and hospitalid not in (select hospitalid from formular where stamp > 1512086400000)
) order by ik, call_number
-- ausstehende neu-exporte nach b-8 fehler-email
select distinct hospitalid from formular
where guid in (select formular_guid from am_duplicate)
and hospitalid in (select hospitalid from filelog where filename like '%xml%')
and hospitalid not in (select hospitalid from filelog where date > 1512345600000 and filename like '%xml%')
select distinct ik from hospital where hospitalid in (
2962,
3385,
4002853,
4002917,
4003195,
4003211,
4003212,
4003405,
44565730,
89438639,
99110196,
99110401,
115124100,
115124841,
115126554,
173898616
) --order by ik, call_number
select distinct organizationid from organization_hospital where ik in (
'260100023',
'260100615',
'260100626',
'260100637',
'260311197',
'260330123',
'260330500',
'260550621',
'260710862',
'260970060',
'261200219'
)
FAQ Fragen
LMM Support wäre ein schöne Sache, um die Nutzung besser verfolgen zu können
TODO 24.11.
neue Version (App + Service)
bash scripts/update_postgresql.sh
Anleitung zum Upload bei Annahmestelle (sörched by Maaß, stolen by Dietrich)
https://www.g-qb.de/Dokumente/G-QB_Lieferweg-upload_KH_BZ2016.pdf
Formulare:
"Löschen" zu normalen PopUps hinzufügen (Nutzerwunsch)
Testimonials: alle Nutzer per Mail angefragt, wer baut es in die Webseite ein? Die Webseite sollte ins GIT? -> zugestimmte eingetragen in git
Zeller: 264529091 guenter.zeller@khdw.de
12:46:50 G: Vielen Dank für Ihre wieder mal superschnelle Antwort!
Habe Ihr Programm auch schon an die Kollegin vom Bezirkskrankenhaus Kaufbeuren weiterempfohlen :-)
12:49:06 Pascal Dietrich: Gern geschehen.
Vielen Dank für die Weiterempfehlung.
12:52:03 G: Gerne - nach den schlechten Erfahrungen mit dem von der BIK empfohlenen Programm (EasyQB) war es mir eine Freude!
Gast:
Vielen Dank für Ihre Hilfe. Als Neuling konnte ich Ihre Hilfe gut umsetzen. Ich wünsche ein schönes Wochenende.
Externe Seiten die erlaubt sein müssen
app.promato.de
stats.promato.de
mibew.promato.de
maxcdn.bootstrapcdn.com
fonts.googleapis.com
ajax.googleapis.com
cdnjs.cloudflare.com
cdn.datatables.net
fonts.gstatic.com
Gesamtbericht
Skalierungsmöglichkeiten des Systems/der Datenbank?
- Partitionierung bei Bedarf
- PDF-Erzeugung auslagern
- Queueing auch von PDF,XML,RTF-Export
- Gesamtbericht sollte mit JSON-Anpasung kein Problem darstellen
SELECT o.isdktig,u.*,p.* FROM rbacuser u
JOIN organization o ON o.organizationid = u.organization
JOIN person p USING (personid)
WHERE u.rbacroleid = 2 AND u.rbacuserid IN (
SELECT rbacuserid FROM hospital_user_relation
JOIN filelog f USING (hospitalid)
WHERE filetype = 6
AND hospitalid IN (
SELECT DISTINCT hospitalid FROM formular WHERE guid IN (
SELECT formular_guid FROM am_duplicate
)
)
)
B Fomulare zusammenzählen:
SELECT SUM (y.value) FROM
(SELECT formular_guid,key,replace(replace(value::text,'"',''),',','.')::float AS value FROM formular_json fj
LEFT JOIN LATERAL json_each(fj.jsondata::json) x ON true
WHERE fj.formular_guid IN (
SELECT guid FROM formular WHERE hospitalid = 2794 AND categoryid = 1931 AND departmentid IN (
SELECT departmentid FROM hospital_departments WHERE hospitalid = 2794)
)
and key like 'id_11110_%'
) y
AM Duplicate Check
select distinct on (hospitalid) * from filelog where filetype = 6 and hospitalid not in (
select hospitalid from filelog where filetype = 6 and date > 1512399600000 and hospitalid in (
select hospitalid from formular where guid in (
select formular_guid from am_duplicate
)
)
) and hospitalid in (
select hospitalid from formular where guid in (
select formular_guid from am_duplicate
)
)
DKTIG IKs
select distinct on (oh.ik) oh.ik,r.email_adress from organization_hospital oh
join rbacuser r on r.organization = oh.organizationid
where organizationid in (select organizationid from organization where isdktig = true and organizationid != 3)
and r.rbacroleid = 2
select * from (
select distinct on (oh.hospitalid) oh.ik,(select call_number from hospital h where h.hospitalid = oh.hospitalid),r.email_adress,(select count(*) from filelog f where f.hospitalid = oh.hospitalid and f.filetype = 6) from organization_hospital oh
join rbacuser r on r.organization = oh.organizationid
where organizationid in (select organizationid from organization where isdktig = true and organizationid != 3)
and r.rbacroleid = 2
) as foo order by ik,call_number
Bearbeitungsstatus aller aktiven Hospitals anzeigen:
SELECT DISTINCT ON (h.ik,h.call_number) h.ik,h.call_number,
CASE
WHEN h.assistant_last_step = 0 THEN 'Datenübernahme'
WHEN h.assistant_last_step = 1 THEN '§21-Import'
WHEN h.assistant_last_step = 2 THEN 'Formularbearbeitung'
WHEN h.assistant_last_step = 3 THEN 'Formular Freigabe'
WHEN h.assistant_last_step = 4 THEN 'Erstellung der Abgabedatei'
WHEN h.assistant_last_step = 5 THEN 'Plausibilitätsprüfung'
END
FROM hospital h
JOIN organization_hospital USING (hospitalid)
--WHERE h.call_number = '99'
ORDER BY h.ik,h.call_number
SELECT DISTINCT ON (h.ik,h.call_number) h.ik,h.call_number,
CASE
WHEN h.assistant_last_step = 0 THEN 'Datenübernahme'
WHEN h.assistant_last_step = 1 THEN '§21-Import'
WHEN h.assistant_last_step = 2 THEN 'Formularbearbeitung'
WHEN h.assistant_last_step = 3 THEN 'Formular Freigabe'
WHEN h.assistant_last_step = 4 THEN 'Erstellung der Abgabedatei'
WHEN h.assistant_last_step = 5 THEN 'Plausibilitätsprüfung'
END
FROM hospital h
JOIN organization_hospital USING (hospitalid)
JOIN organization o USING (organizationid)
WHERE o.isdktig = true
AND o.organizationid != 3
--WHERE h.call_number = '99'
ORDER BY h.ik,h.call_number
XML Exporte zählen:
SELECT
(SELECT COUNT(*) FROM organization_hospital WHERE organizationid IN (SELECT organizationid FROM organization WHERE organizationid != 3)) AS all,
(SELECT COUNT(*) FROM organization_hospital WHERE organizationid IN (SELECT organizationid FROM organization WHERE paid = true AND organizationid != 3)) AS paid,
(SELECT COUNT(*) FROM (SELECT COUNT(*) FROM filelog WHERE filetype = 6 AND hospitalid IN (SELECT hospitalid FROM organization_hospital WHERE organizationid IN (SELECT organizationid FROM organization WHERE paid = true AND organizationid != 3)) GROUP BY hospitalid) AS grouped) AS exported
Prüfen ob jedes Hospital nur zu einer Organisation gehört:
SELECT CASE WHEN (select count(hospitalid) from organization_hospital where organizationid != 3) = (select count(distinct hospitalid) from organization_hospital where organizationid != 3) THEN true ELSE false END
*select * from organization_hospital t1
*where (select count(*) from organization_hospital t2
*where t1.hospitalid = t2.hospitalid) > 2
*order by hospitalid
Name aus rbacuserid:
SELECT anrede, firstname, lastname FROM person WHERE personid = (SELECT personid FROM rbacuser WHERE rbacuserid = 294535447)
Stellt sicher, dass jedes Hospital auch in Organization 3 ist:
INSERT INTO organization_hospital (organizationid, hospitalid, ik) SELECT 3, hospitalid, ik FROM organization_hospital WHERE organizationid != 3 AND hospitalid NOT IN (SELECT hospitalid FROM organization_hospital WHERE organizationid = 3)
IK aus Userid:
select distinct(ik) from organization_hospital o join rbacuser u on u.organization = o.organizationid where u.rbacuserid =
Fehlerhaften Schlüssel löschen:
update formular_json set jsondata = regexp_replace(jsondata, '"id_11401_[0-9]+":"SP02"', '') where jsondata ilike '%"id\_11401\_%":"SP02"%'
ik zur organization hinzufügen:
INSERT INTO organization_hospital (organizationid, hospitalid, ik) (
SELECT ORGANIZATIONID, hospitalid, ik
FROM hospital
WHERE ik = 'NEWIK'
);
INSERT INTO organization_hospital (organizationid, hospitalid, ik) (
SELECT 3, hospitalid, ik
FROM hospital
WHERE ik = 'NEWIK'
);
INSERT INTO hospital_user_relation (hospitalid, rbacuserid, position) (
SELECT hospitalid, RBACUSERID, 0
FROM hospital
WHERE ik = 'NEWIK'
);
update formular_json set jsondata = regexp_replace(jsondata, ':(\d+)\.(\d+),', ':"\1,\2",', 'g') where jsondata ~ '.*:\d+\.\d+,.*' and formular_guid in (select guid from formular where categoryid = 1917)
Letzte Formularänderung anzeigen:
select h.hospitalid, h.ik, h.call_number, (select 11 * count(departmentid) + 20 from department where hospitalid = h.hospitalid and qb_year_flag = 14) as d_count,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14) as f_count,
(select count(formularid) from formular where hospitalid = h.hospitalid and qb_year_flag = 14 and state = 4) as f_stat,
TIMESTAMP WITH TIME ZONE 'epoch' + max(f.stamp/1000) * INTERVAL '1 second' as last_edit,
f.lasteditor
from hospital h
inner join formular f on h.hospitalid = f.hospitalid
inner join department d on h.hospitalid = d.hospitalid
where d.qb_year_flag = 14
and (h.ik like '5%' or h.ik like '26%')
and (h.ik not like '%1111' and h.ik not like '%2222' and h.ik not like '%9999')
and h.hospitalid not in (
select distinct hospitalid from filelog where filename ilike '%xml%' and qb_year_flag = 14
)
and (h.name not like '%test%' and h.name not like '%Test%')
group by h.hospitalid, h.ik, h.call_number,f.lasteditor
order by last_edit desc
Letzte Logins (in schön)
SELECT TIMESTAMP WITH TIME ZONE 'epoch' + MAX(last_login/1000) * INTERVAL '1 second' AS last_login,email_adress FROM rbacuser WHERE last_login IS NOT NULL GROUP BY email_adress ORDER BY last_login DESC
alter table organization add column terms_accepted bigint
Fehlerhafte OPS Schlüssel ohne Punkte und -
Regex für Sublime
(;\d{4};\d{4})(\d{1,3})
->
$1.$2
(;\d{4};\d{1})
->
$1-
Abschlussarbeiten:
Suche nach Schlüssel -> startsWidth
- Aggregation B-6 bei manueller Eingabe (HM)
-Absicherung der zugriffsbeschränkten Seiten
- Sortierung der CSV-Datei nach Fallzahlen in B-6/B-7/B-9 bei FA-Download (HM)
- Modal-Popup Überschriften ergänzen (PD) welches modal? Formulare bearbeiten ... Es wird generell erst mal nur die Überschrift des Formulars angezeigt und nicht des Elements, dass man bearbeitet, dafür gibt es bei den Popups nun ich glaube das Attribut "title"-> Freiwillige?
Formulare auch im Dashboard ausblenden falls keine Berechtigung vorhanden
Disclaimer bei Start nicht anzeigen für "Testsystem" -> Kein Disclaimer, Nutzungsbedigungen sollten im Rechnungs-PDF angehängt werden und/oder bei Aktivierung einsehbar?
Verbesserungen/Erweiterungen:
- Multi-Selekt/Multi-Delete, bisher keine Nachfrage, also geringe Priorität
- Import-Regeln bei §21-Import (SG) -> bisher keine Nachfrage, also geringe Priorität
- RTF-Export (FD) => Bitte testen! HM, PD
- XML Export inkl. Protokolldatei (neu) (SG) -> Neue Version
- Gesamtbericht (SG)
wenn keine tickets/chats/mitteilungen vorhanden sind, könnte man das noch hinschreiben?
11. Bearbeitungsstatus -> Lock der Formulare, in status 2 anderer User -> lock, Projektleiter darf immer
18. Registrierung: Mails versenden, Passwort/Nutzernamen Richtlinien festlegen
21 - Charts nach Veränderung fehler in der Hover Ansicht -> Keine Prio
28. Standort anlegen bei mehreren IKS -> ik auswählen -> Keine Prio!
38. Gleichzeitige Bearbeitung adminbeandaten() zwei Nutzer gleiche org zum Beispiel Nutzer -> Keine hohe Prio, da Reload der Formular-Metadaten aus db automatisch erfolgt, sobald z.B. Formular freigegeben o.ä.
39. Standortrechte organization testen
ICD/OPS/AOP
-> Codes sollen in andere Fachabteilungen verschoben werden können (per Regel, dazu müsste man sich ein Regelset (Standortunabhängig) definieren und speichern können,
also z.B. 8-892 soll in FA 0100, Hauptabteilung verschoben werden. Diese Regeln sollten dann auf den Standort anwendbar sein. So könnte man auch Regeln standortübergreifend
wiederverwenden. -> Wird nach Release ergänzt, mittlere Prio
Links
http://www.qbx-online.de/
http://www.saatmann.de/Saatmann_Flyer_Qualitaetsbericht.pdf
https://www.id-berlin.de/de/products/5-medizincontrolling/11-id-qualitaetsbericht/
https://www.id-berlin.de/static/files/products/ID_QB_komplett.pdf
http://solutions.3mdeutschland.de/wps/portal/3M/de_DE/3m-his/kh/loesungen-fuer-akut-kliniken/qualitaetsmanagement/qsreport-landingpage/
https://easyqb.de // https://webapp.easyqb.de
dateFormat: https://github.com/felixge/node-dateformat
Mailregex: https://regex101.com/r/NGFJnL/1
Rechte:
Level 5 externer Mitarbeiter nur berechtigte Formulare bearbeiten und Bearbeitung beenden -> Braucht man das überhaupt noch?
Level 4 normaler Mitarbeiter nur berechtigte Formulare bearbeiten und Bearbeitung beenden
Level 3 Projektleiter KH/Standort/ Leiter für Zukunft freihalten
Level 2 Verwaltung Organisation, nur ein Nutzer
Level 1 netfutura
FA Import: falls Nutzer Recht auf passendes Formular bessitzt, bei Level 4, sonst auch mit Level 1,2,3
Hier drunter sind nur DB Queries!!
Bitte hier ALLE Anpassungs-SQL-Statement seit Umstellung sammeln!!!!
CREATE TABLE public.custom_style_options
(
hospitalid bigint NOT NULL,
rbacuserid bigint NOT NULL,
options character varying NOT NULL,
CONSTRAINT pk_cso PRIMARY KEY (hospitalid, rbacuserid),
CONSTRAINT fk_cso_hosp FOREIGN KEY (hospitalid)
REFERENCES public.hospital (hospitalid) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT fk_cso_rbac FOREIGN KEY (rbacuserid)
REFERENCES public.rbacuser (rbacuserid) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE
)
alter table organization
add column isDktig boolean default false;
ALTER TABLE hospital ADD mergingid BIGINT;
UPDATE hospital h1 SET mergingid = (SELECT hospitalid FROM hospital h2 WHERE h2.ik = h1.ik and h2.call_number = '99');
UPDATE hospital h1 SET mergingid = (SELECT hospitalid FROM hospital h2 WHERE h2.ik = '260100023' and h2.call_number = '99') WHERE h1.ik in ('260101024','510106995','260102069');
CREATE TABLE public.organization
(
organizationid integer NOT NULL DEFAULT nextval('organization_organizationid_seq'::regclass),
paid boolean,
disclaimer boolean DEFAULT true,
paid_locations integer,
paid_departments integer,
CONSTRAINT organization_pkey PRIMARY KEY (organizationid)
);
CREATE TABLE public.organization_hospital
(
organizationid bigint NOT NULL,
hospitalid bigint NOT NULL,
CONSTRAINT organization_hospital_pkey PRIMARY KEY (organizationid, hospitalid),
CONSTRAINT organization_hospital_hospitalid_fkey FOREIGN KEY (hospitalid)
REFERENCES public.hospital (hospitalid) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT organization_hospital_organizationid_fkey FOREIGN KEY (organizationid)
REFERENCES public.organization (organizationid) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION
);
ALTER TABLE formular ADD COLUMN guid character varying;
select * from pg_available_extensions; // hier sollte dann "uuid-ossp" aufgelistet sein
CREATE EXTENSION "uuid-ossp";
update formular set guid = uuid_generate_v4()
CREATE TABLE formular_json
(
jsondata text,
formular_guid character varying NOT NULL,
CONSTRAINT idx_fj_p_fg PRIMARY KEY (formular_guid)
);
CREATE SEQUENCE public.organization_organizationid_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
alter table department add column changed bigint;
alter table organization add column rechnung_nummer int;
alter table formular add column release_comment char varying
CREATE TABLE pre_users
(
username character varying,
anrede character varying,
title character varying,
fname character varying,
lname character varying,
email character varying,
date bigint,
uniq_key character varying(10),
id serial NOT NULL,
CONSTRAINT pre_users_pkey PRIMARY KEY (id )
)
CREATE TABLE pre_mailing
(
uniq_key character varying,
ik character varying,
standort character varying,
kh_strasse character varying,
kh_ort character varying,
so_name character varying,
so_strasse character varying,
so_ort character varying,
ersteller_anrede character varying,
ersteller_titel character varying,
ersteller_titel_extra character varying,
ersteller_vname character varying,
ersteller_nname character varying,
ersteller_mail character varying,
ersteller_fax character varying,
leitung_anrede character varying,
leitung_titel character varying,
leitung_titel_extra character varying,
leitung_vname character varying,
leitung_nname character varying,
leitung_mail character varying,
leitung_fax character varying,
promato_qb boolean
)
alter table rbacuser alter column guid set default uuid_generate_v4();
alter table organization_hospital add column ik character varying;
zum nachtragen der iks:
update organization_hospital o
set ik = (
select h.ik
from hospital h
where h.hospitalid = o.hospitalid
)
update pre_users set username = trim(username)
alter table organization add column imported_departments int
alter table organization add column paid_stamp bigint
08.08.17
alter table rbacuser alter column training_manager set default false;
alter table organization alter disclaimer set default false
Grünauer:
update pre_mailing
set uniq_key = '118d002e'
where ik in ('260930129', '260930528', '260930517')
INSERT INTO ost_user_email (user_id, flags, address) VALUES ($userid, 0, $email);
INSERT INTO ost_user (id, org_id, default_email_id, status, name, created, updated) VALUES ($userid, 0, (SELECT id from ost_user_email WHERE user_id = $userid), 0 , $name, NOW(), NOW());
INSERT INTO ost_user_account (user_id, status, timezone, username, passwd, registered) VALUES ($userid, 9, 'Europe/Berlin', $username, $passwort, NOW());
INSERT INTO ost_user__cdata (user_id) VALUES ($userid);
CREATE TABLE captcha_cookies
(
uuid character varying NOT NULL,
valid_until bigint NOT NULL,
CONSTRAINT cc_pkey PRIMARY KEY (uuid)
)
WITH (
OIDS=FALSE
);
ALTER TABLE captcha_cookies
OWNER TO postgres;
alter table organization add column terms_accepted bigint