Skip to content

Commit

Permalink
Merge pull request #481 from Enet4/bug/findscu/479-status
Browse files Browse the repository at this point in the history
[findscu] Fix nonconforming status matching in response objects
  • Loading branch information
Enet4 authored Mar 22, 2024
2 parents 4ed90ab + f6b30fc commit 6983bc4
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions findscu/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,20 +319,17 @@ fn run() -> Result<(), Error> {
.dump_object(&dcm)
.context(DumpOutputSnafu)?;

// check DICOM status,
// check DICOM status in response data,
// as some implementations might report status code 0
// upon sending the response data
let status = dcm
.get(tags::STATUS)
.whatever_context("status code from response is missing")?
.to_int::<u16>()
.whatever_context("failed to read status code")?;

if status == 0 {
if verbose {
debug!("Matching is complete");
if let Some(status) = dcm.get(tags::STATUS) {
let status = status.to_int::<u16>().ok();
if status == Some(0) {
if verbose {
debug!("Matching is complete");
}
break;
}
break;
}

i += 1;
Expand Down

0 comments on commit 6983bc4

Please sign in to comment.