Merge pull request #1 from pcvolkmer/issue_5

feat: ignore non oBDS 2.x messages
This commit is contained in:
Paul-Christian Volkmer 2024-08-30 17:42:59 +02:00 committed by GitHub
commit 0b6024e80b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 19 additions and 0 deletions

View File

@ -62,6 +62,8 @@ pub enum SubCommand {
year: String,
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
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")]
include_extern: bool,
#[arg(
@ -103,6 +105,8 @@ pub enum SubCommand {
year: String,
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
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")]
xls_csv: bool,
#[arg(long, help = "Meldungen mit externer Diagnose einschließen")]
@ -142,6 +146,8 @@ pub enum SubCommand {
year: String,
#[arg(long, value_parser = value_is_date, help = "Ignoriere LKR-Exporte seit Datum")]
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")]
include_extern: bool,
#[arg(

View File

@ -55,6 +55,7 @@ impl DatabaseSource {
&self,
year: &str,
ignore_exports_since: &str,
ignore_non_obds_2: bool,
include_extern: bool,
include_histo_zyto: bool,
schema_versions: bool,
@ -62,6 +63,7 @@ impl DatabaseSource {
let params = params! {
"year" => year,
"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_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
};
@ -97,6 +99,7 @@ impl DatabaseSource {
&self,
year: &str,
ignore_exports_since: &str,
ignore_non_obds_2: bool,
use_pat_id: bool,
include_extern: bool,
include_histo_zyto: bool,
@ -109,6 +112,7 @@ impl DatabaseSource {
params! {
"year" => year,
"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_histo_zyto" => if include_histo_zyto { 1 } else { 0 }
},

View File

@ -129,6 +129,7 @@ fn main() -> Result<(), Box<dyn Error>> {
user,
year,
ignore_exports_since,
ignore_non_obds_2,
include_extern,
include_histo_zyto,
schema_versions,
@ -148,6 +149,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.check(
&year,
&ignore_exports_since.unwrap_or("9999-12-31".into()),
ignore_non_obds_2,
include_extern,
include_histo_zyto,
schema_versions,
@ -169,6 +171,7 @@ fn main() -> Result<(), Box<dyn Error>> {
output,
year,
ignore_exports_since,
ignore_non_obds_2,
xls_csv,
include_extern,
include_histo_zyto,
@ -188,6 +191,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.export(
&year,
&ignore_exports_since.unwrap_or("9999-12-31".into()),
ignore_non_obds_2,
pat_id,
include_extern,
include_histo_zyto,
@ -232,6 +236,7 @@ fn main() -> Result<(), Box<dyn Error>> {
file,
year,
ignore_exports_since,
ignore_non_obds_2,
include_extern,
include_histo_zyto,
} => {
@ -250,6 +255,7 @@ fn main() -> Result<(), Box<dyn Error>> {
.export(
&year,
&ignore_exports_since.unwrap_or("9999-12-31".into()),
ignore_non_obds_2,
pat_id,
include_extern,
include_histo_zyto,

View File

@ -39,6 +39,7 @@ FROM (
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 (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
LEFT OUTER JOIN (

View File

@ -125,6 +125,7 @@ FROM (
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 (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
LEFT OUTER JOIN (
SELECT DISTINCT

View File

@ -125,6 +125,7 @@ FROM (
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 (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
LEFT OUTER JOIN (
SELECT DISTINCT