Skip to content

Commit

Permalink
obf "patient" stratifier, some logs info
Browse files Browse the repository at this point in the history
  • Loading branch information
enola-dkfz committed Apr 23, 2024
1 parent 408bfae commit 2b6331a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/beam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use beam_lib::{TaskResult, BeamClient, BlockingOptions, MsgId, TaskRequest, RawS
use http::StatusCode;
use once_cell::sync::Lazy;
use serde::Serialize;
use tracing::{debug, warn};
use tracing::{debug, warn, info};

use crate::{config::CONFIG, errors::FocusError};

Expand Down Expand Up @@ -87,7 +87,7 @@ pub async fn retrieve_tasks() -> Result<Vec<TaskRequest<String>>, FocusError> {
}

pub async fn answer_task<T: Serialize + 'static>(result: &TaskResult<T>) -> Result<(), FocusError> {
debug!("Answer task with id: {}", result.task);
info!("Answer task with id: {}", result.task);
BEAM_CLIENT.put_result(result, &result.task)
.await
.map(|_| ())
Expand Down
4 changes: 2 additions & 2 deletions src/blaze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use http::StatusCode;
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
use tracing::{debug, warn};
use tracing::{debug, warn, info};

use crate::BeamTask;
use crate::errors::FocusError;
Expand Down Expand Up @@ -93,7 +93,7 @@ pub async fn evaluate_measure(url: String) -> Result<String, FocusError> {
.map_err(FocusError::MeasureEvaluationErrorReqwest)?;

if resp.status() == StatusCode::OK {
debug!(
info!(
"Successfully evaluated the Measure with canonical URL: {}",
url
);
Expand Down
4 changes: 2 additions & 2 deletions src/task_processing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{sync::Arc, collections::HashMap, time::Duration};
use base64::{engine::general_purpose, Engine as _};
use laplace_rs::ObfCache;
use tokio::sync::{mpsc, Semaphore, Mutex};
use tracing::{error, warn, debug, Instrument, info_span};
use tracing::{error, warn, debug, info, Instrument, info_span};

use crate::{ReportCache, errors::FocusError, beam, BeamTask, BeamResult, run_exporter_query, config::{EndpointType, CONFIG}, run_cql_query, intermediate_rep, ast, run_intermediate_rep_query, Metadata, blaze::parse_blaze_query, util};

Expand Down Expand Up @@ -91,7 +91,7 @@ async fn process_task(
obf_cache: Arc<Mutex<ObfCache>>,
report_cache: Arc<Mutex<ReportCache>>,
) -> Result<BeamResult, FocusError> {
debug!("Processing task {}", task.id);
info!("Processing task {}", task.id);

let metadata: Metadata = serde_json::from_value(task.metadata.clone()).unwrap_or(Metadata {
project: "default_obfuscation".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ pub fn obfuscate_counts_mr(
.map_err(|e| FocusError::DeserializationError(format!(r#"{}. Is obfuscation turned on when it shouldn't be? Is the metadata in the task formatted correctly, like this {{"project": "name"}}? Are there any other projects stated in the projects_no_obfuscation parameter in the bridgehead?"#, e)))?;
for g in &mut measure_report.group {
match &g.code.text[..] {
"patients" => {
"patient" | "patients" => { // Prism used "patient" for catalogue, Lens uses "patients"
obfuscate_counts_recursive(
&mut g.population,
delta_patient,
Expand Down

0 comments on commit 2b6331a

Please sign in to comment.