mirror of
https://github.com/pcvolkmer/bzkf-rwdp-check.git
synced 2025-04-19 19:16:51 +00:00
Compare commits
No commits in common. "master" and "v0.4.0" have entirely different histories.
@ -11,11 +11,11 @@ clap = { version = "4.5", features = ["std", "help", "usage", "derive", "error-c
|
|||||||
console = "0.15"
|
console = "0.15"
|
||||||
csv = "1.3"
|
csv = "1.3"
|
||||||
dialoguer = "0.11"
|
dialoguer = "0.11"
|
||||||
itertools = "0.14"
|
itertools = "0.13"
|
||||||
mysql = "25.0"
|
mysql = "25.0"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
urlencoding = "2.1"
|
urlencoding = "2.1"
|
||||||
regex = "1.11"
|
regex = "1.10"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
|
@ -2,9 +2,6 @@
|
|||||||
|
|
||||||
Anwendung zur Durchführung einer Plausibilitätsprüfung anhand der Daten für die BZKF Real World Data Platform.
|
Anwendung zur Durchführung einer Plausibilitätsprüfung anhand der Daten für die BZKF Real World Data Platform.
|
||||||
|
|
||||||
**Hinweis:** Dies ist eine Weiterführung des ursprünglichen
|
|
||||||
Projekts [bzkf-rwdp-check](https://github.com/CCC-MF/bzkf-rwdp-check)
|
|
||||||
|
|
||||||
## Aufbau der ETL-Strecke an den Standorten
|
## Aufbau der ETL-Strecke an den Standorten
|
||||||
|
|
||||||
Die Daten werden aus der Onkostar-Datenbank ausgelesen und in Apache-Kafka eingespeist.
|
Die Daten werden aus der Onkostar-Datenbank ausgelesen und in Apache-Kafka eingespeist.
|
||||||
@ -113,8 +110,4 @@ Mithilfe dieser Anwendung kann auch der aktuelle Inhalt der Datenbank gegen die
|
|||||||
Export verglichen werden.
|
Export verglichen werden.
|
||||||
|
|
||||||
Der Befehl `check-export` kann zusammen mit der Angabe der Protokolldatei (`--file`) und der Angabe des
|
Der Befehl `check-export` kann zusammen mit der Angabe der Protokolldatei (`--file`) und der Angabe des
|
||||||
Exports (`--package=...` bzw. `--export-package=...`) und den Optionen für den Datenbankzugriff ausgeführt werden.
|
Exports (`--export-package=...`) und den Optionen für den Datenbankzugriff ausgeführt werden.
|
||||||
|
|
||||||
Zur Überprüfung werden irrelevante Leerzeichen und Zeilenumbrüche entfernt und _Self-Closed-Tags_ ersetzt
|
|
||||||
(`<Meldeanlass />` => `<Meldeanlass></Meldeanlass>`),
|
|
||||||
da in Onkostar in der Datenbank und der LKR-Export-Protokolldatei verschiedene Formatierungen verwendet werden (können).
|
|
17
src/cli.rs
17
src/cli.rs
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -62,8 +62,6 @@ pub enum SubCommand {
|
|||||||
year: String,
|
year: String,
|
||||||
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
||||||
ignore_exports_since: Option<String>,
|
ignore_exports_since: Option<String>,
|
||||||
#[arg(long, help = "Ignoriere Meldungen, die nicht im oBDS 2.x Format sind")]
|
|
||||||
ignore_non_obds_2: bool,
|
|
||||||
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
||||||
include_extern: bool,
|
include_extern: bool,
|
||||||
#[arg(
|
#[arg(
|
||||||
@ -105,8 +103,6 @@ pub enum SubCommand {
|
|||||||
year: String,
|
year: String,
|
||||||
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
||||||
ignore_exports_since: Option<String>,
|
ignore_exports_since: Option<String>,
|
||||||
#[arg(long, help = "Ignoriere Meldungen, die nicht im oBDS 2.x Format sind")]
|
|
||||||
ignore_non_obds_2: bool,
|
|
||||||
#[arg(long, help = "Export mit Trennzeichen ';' für Excel")]
|
#[arg(long, help = "Export mit Trennzeichen ';' für Excel")]
|
||||||
xls_csv: bool,
|
xls_csv: bool,
|
||||||
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
||||||
@ -146,8 +142,6 @@ pub enum SubCommand {
|
|||||||
year: String,
|
year: String,
|
||||||
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
|
||||||
ignore_exports_since: Option<String>,
|
ignore_exports_since: Option<String>,
|
||||||
#[arg(long, help = "Ignoriere Meldungen, die nicht im oBDS 2.x Format sind")]
|
|
||||||
ignore_non_obds_2: bool,
|
|
||||||
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
|
||||||
include_extern: bool,
|
include_extern: bool,
|
||||||
#[arg(
|
#[arg(
|
||||||
@ -179,13 +173,8 @@ pub enum SubCommand {
|
|||||||
user: String,
|
user: String,
|
||||||
#[arg(short, long, help = "LKR-Export-Protokoll-Datei")]
|
#[arg(short, long, help = "LKR-Export-Protokoll-Datei")]
|
||||||
file: PathBuf,
|
file: PathBuf,
|
||||||
#[arg(
|
#[arg(long, help = "Exportpaketnummer", default_value = "0")]
|
||||||
long,
|
export_package: u16,
|
||||||
alias = "export-package",
|
|
||||||
help = "Exportpaketnummer",
|
|
||||||
default_value = "0"
|
|
||||||
)]
|
|
||||||
package: u16,
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -55,7 +55,6 @@ impl DatabaseSource {
|
|||||||
&self,
|
&self,
|
||||||
year: &str,
|
year: &str,
|
||||||
ignore_exports_since: &str,
|
ignore_exports_since: &str,
|
||||||
ignore_non_obds_2: bool,
|
|
||||||
include_extern: bool,
|
include_extern: bool,
|
||||||
include_histo_zyto: bool,
|
include_histo_zyto: bool,
|
||||||
schema_versions: bool,
|
schema_versions: bool,
|
||||||
@ -63,7 +62,6 @@ impl DatabaseSource {
|
|||||||
let params = params! {
|
let params = params! {
|
||||||
"year" => year,
|
"year" => year,
|
||||||
"ignore_exports_since" => ignore_exports_since,
|
"ignore_exports_since" => ignore_exports_since,
|
||||||
"ignore_non_obds_2" => if ignore_non_obds_2 { 1 } else { 0 },
|
|
||||||
"include_extern" => if include_extern { 1 } else { 0 },
|
"include_extern" => if include_extern { 1 } else { 0 },
|
||||||
"include_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
|
"include_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
|
||||||
};
|
};
|
||||||
@ -99,7 +97,6 @@ impl DatabaseSource {
|
|||||||
&self,
|
&self,
|
||||||
year: &str,
|
year: &str,
|
||||||
ignore_exports_since: &str,
|
ignore_exports_since: &str,
|
||||||
ignore_non_obds_2: bool,
|
|
||||||
use_pat_id: bool,
|
use_pat_id: bool,
|
||||||
include_extern: bool,
|
include_extern: bool,
|
||||||
include_histo_zyto: bool,
|
include_histo_zyto: bool,
|
||||||
@ -112,7 +109,6 @@ impl DatabaseSource {
|
|||||||
params! {
|
params! {
|
||||||
"year" => year,
|
"year" => year,
|
||||||
"ignore_exports_since" => ignore_exports_since,
|
"ignore_exports_since" => ignore_exports_since,
|
||||||
"ignore_non_obds_2" => if ignore_non_obds_2 { 1 } else { 0 },
|
|
||||||
"include_extern" => if include_extern { 1 } else { 0 },
|
"include_extern" => if include_extern { 1 } else { 0 },
|
||||||
"include_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
|
"include_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
|
||||||
},
|
},
|
||||||
@ -138,14 +134,14 @@ impl DatabaseSource {
|
|||||||
Err(())
|
Err(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn exported(&self, package: u16) -> Result<Vec<(String, String)>, ()> {
|
pub fn exported(&self, export_id: u16) -> Result<Vec<(String, String)>, ()> {
|
||||||
match Pool::new(self.0.as_str()) {
|
match Pool::new(self.0.as_str()) {
|
||||||
Ok(pool) => {
|
Ok(pool) => {
|
||||||
if let Ok(mut connection) = pool.try_get_conn(Duration::from_secs(3)) {
|
if let Ok(mut connection) = pool.try_get_conn(Duration::from_secs(3)) {
|
||||||
return match connection.exec_map(
|
return match connection.exec_map(
|
||||||
EXPORTED_TO_LKR,
|
EXPORTED_TO_LKR,
|
||||||
params! {
|
params! {
|
||||||
"export_id" => package,
|
"export_id" => export_id,
|
||||||
},
|
},
|
||||||
|(id, xml_data)| (id, xml_data),
|
|(id, xml_data)| (id, xml_data),
|
||||||
) {
|
) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
60
src/main.rs
60
src/main.rs
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -51,9 +51,9 @@ fn request_password_if_none(password: Option<String>) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sanitize_year(year: &str) -> String {
|
fn sanitize_year(year: String) -> String {
|
||||||
if year.len() == 4 {
|
if year.len() == 4 {
|
||||||
year.to_string()
|
year
|
||||||
} else {
|
} else {
|
||||||
format!("2{:0>3}", year)
|
format!("2{:0>3}", year)
|
||||||
}
|
}
|
||||||
@ -129,13 +129,12 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
user,
|
user,
|
||||||
year,
|
year,
|
||||||
ignore_exports_since,
|
ignore_exports_since,
|
||||||
ignore_non_obds_2,
|
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
schema_versions,
|
schema_versions,
|
||||||
} => {
|
} => {
|
||||||
let password = request_password_if_none(password);
|
let password = request_password_if_none(password);
|
||||||
let year = sanitize_year(&year);
|
let year = sanitize_year(year);
|
||||||
|
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
||||||
@ -149,7 +148,6 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.check(
|
.check(
|
||||||
&year,
|
&year,
|
||||||
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
||||||
ignore_non_obds_2,
|
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
schema_versions,
|
schema_versions,
|
||||||
@ -171,13 +169,12 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
output,
|
output,
|
||||||
year,
|
year,
|
||||||
ignore_exports_since,
|
ignore_exports_since,
|
||||||
ignore_non_obds_2,
|
|
||||||
xls_csv,
|
xls_csv,
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
} => {
|
} => {
|
||||||
let password = request_password_if_none(password);
|
let password = request_password_if_none(password);
|
||||||
let year = sanitize_year(&year);
|
let year = sanitize_year(year);
|
||||||
|
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
||||||
@ -191,7 +188,6 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.export(
|
.export(
|
||||||
&year,
|
&year,
|
||||||
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
||||||
ignore_non_obds_2,
|
|
||||||
pat_id,
|
pat_id,
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
@ -236,12 +232,11 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
file,
|
file,
|
||||||
year,
|
year,
|
||||||
ignore_exports_since,
|
ignore_exports_since,
|
||||||
ignore_non_obds_2,
|
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
} => {
|
} => {
|
||||||
let password = request_password_if_none(password);
|
let password = request_password_if_none(password);
|
||||||
let year = sanitize_year(&year);
|
let year = sanitize_year(year);
|
||||||
|
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
&style(format!("Warte auf Daten für das Diagnosejahr {}...", year))
|
||||||
@ -255,7 +250,6 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.export(
|
.export(
|
||||||
&year,
|
&year,
|
||||||
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
&ignore_exports_since.unwrap_or("9999-12-31".into()),
|
||||||
ignore_non_obds_2,
|
|
||||||
pat_id,
|
pat_id,
|
||||||
include_extern,
|
include_extern,
|
||||||
include_histo_zyto,
|
include_histo_zyto,
|
||||||
@ -269,7 +263,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
let mut not_in_csv = db_items
|
let mut not_in_csv = db_items
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|&db_item| {
|
.filter(|db_item| {
|
||||||
!csv_items
|
!csv_items
|
||||||
.iter()
|
.iter()
|
||||||
.map(|csv_item| &csv_item.condition_id)
|
.map(|csv_item| &csv_item.condition_id)
|
||||||
@ -299,7 +293,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
not_in_csv
|
not_in_csv
|
||||||
.iter()
|
.iter()
|
||||||
.for_each(|&item| match Check::is_relevant(&item.icd_10_code) {
|
.for_each(|item| match Check::is_relevant(&item.icd_10_code) {
|
||||||
true => {
|
true => {
|
||||||
let _ = term.write_line(&format!(
|
let _ = term.write_line(&format!(
|
||||||
"{:<64} {:<10} {:<5} {:<5} {}",
|
"{:<64} {:<10} {:<5} {:<5} {}",
|
||||||
@ -330,7 +324,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
let mut not_in_db = csv_items
|
let mut not_in_db = csv_items
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|&csv_item| {
|
.filter(|csv_item| {
|
||||||
!db_items
|
!db_items
|
||||||
.iter()
|
.iter()
|
||||||
.map(|db_item| &db_item.condition_id)
|
.map(|db_item| &db_item.condition_id)
|
||||||
@ -450,14 +444,14 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
port,
|
port,
|
||||||
user,
|
user,
|
||||||
file,
|
file,
|
||||||
package,
|
export_package,
|
||||||
} => {
|
} => {
|
||||||
let password = request_password_if_none(password);
|
let password = request_password_if_none(password);
|
||||||
|
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style(format!(
|
&style(format!(
|
||||||
"Warte auf Daten für den LKR-Export '{}'...",
|
"Warte auf Daten für den LKR-Export '{}'...",
|
||||||
package
|
export_package
|
||||||
))
|
))
|
||||||
.blue()
|
.blue()
|
||||||
.bright()
|
.bright()
|
||||||
@ -467,7 +461,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
let db = DatabaseSource::new(&database, &host, &password, port, &user);
|
let db = DatabaseSource::new(&database, &host, &password, port, &user);
|
||||||
|
|
||||||
let db_entries = db
|
let db_entries = db
|
||||||
.exported(package)
|
.exported(export_package)
|
||||||
.map_err(|_e| "Fehler bei Zugriff auf die Datenbank")?;
|
.map_err(|_e| "Fehler bei Zugriff auf die Datenbank")?;
|
||||||
|
|
||||||
let db_meldungen = db_entries
|
let db_meldungen = db_entries
|
||||||
@ -504,16 +498,6 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
fn print_missing_ids(missing_ids: &[&String], term: &Term) {
|
|
||||||
missing_ids.iter().sorted().for_each(|&item| {
|
|
||||||
let _ = term.write_line(&format!(
|
|
||||||
"{} ({})",
|
|
||||||
item,
|
|
||||||
to_database_id(item).unwrap_or("?".into())
|
|
||||||
));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if db_meldungen.len() != xml_meldungen.len() {
|
if db_meldungen.len() != xml_meldungen.len() {
|
||||||
let _ = term.write_line(
|
let _ = term.write_line(
|
||||||
&style("\nNicht übereinstimmende Anzahl an Meldungen:")
|
&style("\nNicht übereinstimmende Anzahl an Meldungen:")
|
||||||
@ -538,7 +522,13 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
print_missing_ids(&missing_db_ids, &term);
|
missing_db_ids.iter().sorted().for_each(|&item| {
|
||||||
|
let _ = term.write_line(&format!(
|
||||||
|
"{} ({})",
|
||||||
|
item,
|
||||||
|
to_database_id(item).unwrap_or("?".into())
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if !missing_xml_ids.is_empty() {
|
if !missing_xml_ids.is_empty() {
|
||||||
@ -548,7 +538,13 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
print_missing_ids(&missing_xml_ids, &term);
|
missing_xml_ids.iter().sorted().for_each(|&item| {
|
||||||
|
let _ = term.write_line(&format!(
|
||||||
|
"{} ({})",
|
||||||
|
item,
|
||||||
|
to_database_id(item).unwrap_or("?".into())
|
||||||
|
));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -572,7 +568,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
.to_string(),
|
.to_string(),
|
||||||
);
|
);
|
||||||
|
|
||||||
multiple_meldung_entries.iter().for_each(|&item| {
|
multiple_meldung_entries.iter().for_each(|item| {
|
||||||
let _ = term.write_line(&item.to_string());
|
let _ = term.write_line(&item.to_string());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -608,7 +604,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
different_content
|
different_content
|
||||||
.iter()
|
.iter()
|
||||||
.sorted_by(|&id1, &id2| {
|
.sorted_by(|id1, id2| {
|
||||||
to_database_id(id1)
|
to_database_id(id1)
|
||||||
.unwrap_or_default()
|
.unwrap_or_default()
|
||||||
.cmp(&to_database_id(id2).unwrap_or_default())
|
.cmp(&to_database_id(id2).unwrap_or_default())
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -29,17 +29,15 @@ FROM (
|
|||||||
EXTRACTVALUE(lme.xml_daten, '//Patienten_Stammdaten/@Patient_ID') AS pid,
|
EXTRACTVALUE(lme.xml_daten, '//Patienten_Stammdaten/@Patient_ID') AS pid,
|
||||||
lme.versionsnummer,
|
lme.versionsnummer,
|
||||||
SHA2(CONCAT('https://fhir.diz.uk-erlangen.de/identifiers/onkostar-xml-condition-id|', EXTRACTVALUE(lme.xml_daten, '//Patienten_Stammdaten/@Patient_ID'), 'condition', EXTRACTVALUE(lme.xml_daten, '//Diagnose/@Tumor_ID')), 256) AS cond_id,
|
SHA2(CONCAT('https://fhir.diz.uk-erlangen.de/identifiers/onkostar-xml-condition-id|', EXTRACTVALUE(lme.xml_daten, '//Patienten_Stammdaten/@Patient_ID'), 'condition', EXTRACTVALUE(lme.xml_daten, '//Diagnose/@Tumor_ID')), 256) AS cond_id,
|
||||||
SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Primaertumor_ICD_Code'), ' ', 1) AS condcodingcode,
|
SUBSTRING_INDEX(EXTRACTVALUE(lm.xml_daten, '//Primaertumor_ICD_Code'), ' ', 1) AS condcodingcode,
|
||||||
SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1) AS diagnosedatum,
|
SUBSTRING_INDEX(EXTRACTVALUE(lm.xml_daten, '//Diagnosedatum'), ' ', 1) AS diagnosedatum,
|
||||||
SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) AS diagnosejahr
|
SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lm.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) AS diagnosejahr
|
||||||
FROM lkr_meldung_export lme
|
FROM lkr_meldung_export lme
|
||||||
WHERE lme.xml_daten LIKE '%ICD_Version%'
|
JOIN lkr_meldung lm ON (lm.id = lme.lkr_meldung AND lme.typ <> '-1' AND lm.extern <= :include_extern)
|
||||||
AND lme.typ <> -1
|
WHERE lm.xml_daten LIKE '%ICD_Version%'
|
||||||
AND lme.xml_daten NOT LIKE '%<Menge_Tumorkonferenz%'
|
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lm.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
||||||
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
AND (lm.xml_daten LIKE '%<cTNM%' OR lm.xml_daten LIKE '%<pTNM%' OR lm.xml_daten LIKE '%<Menge_Histologie>%' OR lm.xml_daten LIKE '%<Menge_Weitere_Klassifikation>%')
|
||||||
AND (lme.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
AND (lm.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//Meldende_Stelle') NOT LIKE '%9999%' OR 1 <= :include_extern)
|
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//ADT_GEKID/@Schema_Version') LIKE '2.%' OR 1 = :ignore_non_obds_2)
|
|
||||||
) o1
|
) o1
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -121,11 +121,10 @@ FROM (
|
|||||||
FROM lkr_meldung_export lme
|
FROM lkr_meldung_export lme
|
||||||
WHERE lme.xml_daten LIKE '%ICD_Version%'
|
WHERE lme.xml_daten LIKE '%ICD_Version%'
|
||||||
AND lme.typ <> -1
|
AND lme.typ <> -1
|
||||||
AND lme.xml_daten NOT LIKE '%<Menge_Tumorkonferenz%'
|
|
||||||
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
||||||
|
AND (lme.xml_daten LIKE '%<cTNM%' OR lme.xml_daten LIKE '%<pTNM%' OR lme.xml_daten LIKE '%<Menge_Histologie>%' OR lme.xml_daten LIKE '%<Menge_Weitere_Klassifikation>%')
|
||||||
AND (lme.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
AND (lme.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//Meldende_Stelle') NOT LIKE '%9999%' OR 1 <= :include_extern)
|
AND (EXTRACTVALUE(lme.xml_daten, '//Meldende_Stelle') NOT LIKE '%9999%' OR 1 <= :include_extern)
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//ADT_GEKID/@Schema_Version') LIKE '2.%' OR 1 = :ignore_non_obds_2)
|
|
||||||
) o1
|
) o1
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file is part of bzkf-rwdp-check
|
* This file is part of bzkf-rwdp-check
|
||||||
*
|
*
|
||||||
* Copyright (C) 2024 the original author or authors.
|
* Copyright (C) 2024 Comprehensive Cancer Center Mainfranken and contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -121,11 +121,10 @@ FROM (
|
|||||||
FROM lkr_meldung_export lme
|
FROM lkr_meldung_export lme
|
||||||
WHERE lme.xml_daten LIKE '%ICD_Version%'
|
WHERE lme.xml_daten LIKE '%ICD_Version%'
|
||||||
AND lme.typ <> -1
|
AND lme.typ <> -1
|
||||||
AND lme.xml_daten NOT LIKE '%<Menge_Tumorkonferenz%'
|
|
||||||
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
AND SUBSTRING_INDEX(SUBSTRING_INDEX(EXTRACTVALUE(lme.xml_daten, '//Diagnosedatum'), ' ', 1), '.', -1) = :year
|
||||||
|
AND (lme.xml_daten LIKE '%<cTNM%' OR lme.xml_daten LIKE '%<pTNM%' OR lme.xml_daten LIKE '%<Menge_Histologie>%' OR lme.xml_daten LIKE '%<Menge_Weitere_Klassifikation>%')
|
||||||
AND (lme.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
AND (lme.xml_daten NOT LIKE '%histologie_zytologie%' OR 1 = :include_histo_zyto)
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//Meldende_Stelle') NOT LIKE '%9999%' OR 1 <= :include_extern)
|
AND (EXTRACTVALUE(lme.xml_daten, '//Meldende_Stelle') NOT LIKE '%9999%' OR 1 <= :include_extern)
|
||||||
AND (EXTRACTVALUE(lme.xml_daten, '//ADT_GEKID/@Schema_Version') LIKE '2.%' OR 1 = :ignore_non_obds_2)
|
|
||||||
) o1
|
) o1
|
||||||
LEFT OUTER JOIN (
|
LEFT OUTER JOIN (
|
||||||
SELECT DISTINCT
|
SELECT DISTINCT
|
||||||
|
Loading…
x
Reference in New Issue
Block a user