diff --git a/src/api/qido/service.rs b/src/api/qido/service.rs index ccfebf7..c02b21b 100644 --- a/src/api/qido/service.rs +++ b/src/api/qido/service.rs @@ -180,10 +180,15 @@ impl<'a> Visitor<'a> for IncludeFieldVisitor { if v.to_lowercase() == "all" { Ok(IncludeField::All) } else { - let entry = StandardDataDictionary - .by_expr(v) - .ok_or_else(|| E::custom(format!("unknown tag {v}")))?; - Ok(IncludeField::List(vec![entry.tag()])) + v.split(',') + .map(|v| { + let entry = StandardDataDictionary + .by_expr(v) + .ok_or_else(|| E::custom(format!("unknown tag {v}")))?; + Ok(entry.tag()) + }) + .collect::, _>>() + .map(IncludeField::List) } } @@ -298,6 +303,24 @@ mod tests { ); } + #[test] + fn parse_query_params_multiple_includefield() { + let uri = + Uri::from_static("http://test?offset=1&limit=42&includefield=PatientWeight,00100010"); + let Query(params) = Query::::try_from_uri(&uri).unwrap(); + + assert_eq!( + params, + QueryParameters { + offset: 1, + limit: 42, + include_field: IncludeField::List(vec![tags::PATIENT_WEIGHT, tags::PATIENT_NAME]), + match_criteria: MatchCriteria(vec![]), + fuzzy_matching: false, + } + ); + } + #[test] fn parse_query_params_default() { let uri = Uri::from_static("http://test");