Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/WorkflowManager/Contracts/Models/PatientDetails.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ namespace Monai.Deploy.WorkflowManager.Contracts.Models
public class PatientDetails
{
[JsonProperty(PropertyName = "patient_id")]
public string PatientId { get; set; } = string.Empty;
public string? PatientId { get; set; }

[JsonProperty(PropertyName = "patient_name")]
public string PatientName { get; set; } = string.Empty;
public string? PatientName { get; set; }

[JsonProperty(PropertyName = "patient_sex")]
public string PatientSex { get; set; } = string.Empty;
public string? PatientSex { get; set; }

[JsonProperty(PropertyName = "patient_dob")]
public DateTime? PatientDob { get; set; }

[JsonProperty(PropertyName = "patient_age")]
public string PatientAge { get; set; } = string.Empty;
public string? PatientAge { get; set; }

[JsonProperty(PropertyName = "patient_hospital_id")]
public string PatientHospitalId { get; set; } = string.Empty;
public string? PatientHospitalId { get; set; }
}
}
6 changes: 3 additions & 3 deletions src/WorkflowManager/Storage/Services/DicomService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<PatientDetails> GetPayloadPatientDetailsAsync(string payloadId
return patientDetails;
}

public async Task<string> GetFirstValueAsync(IList<VirtualFileInfo> items, string payloadId, string bucketId, string keyId)
public async Task<string?> GetFirstValueAsync(IList<VirtualFileInfo> items, string payloadId, string bucketId, string keyId)
{
Guard.Against.NullOrWhiteSpace(bucketId);
Guard.Against.NullOrWhiteSpace(payloadId);
Expand All @@ -73,7 +73,7 @@ public async Task<string> GetFirstValueAsync(IList<VirtualFileInfo> items, strin
{
if (items is null || items.Count == 0)
{
return string.Empty;
return null;
}

foreach (var item in items)
Expand Down Expand Up @@ -109,7 +109,7 @@ public async Task<string> GetFirstValueAsync(IList<VirtualFileInfo> items, strin
_logger.FailedToGetDicomTag(payloadId, keyId, bucketId, e);
}

return string.Empty;
return null;
}

public async Task<IEnumerable<string>> GetDicomPathsForTaskAsync(string outputDirectory, string bucketName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,24 @@ public static class PatientsTestData
Patient = new PatientDetails()
{
PatientId = "2",
PatientName = "",
PatientName = null,
PatientSex = "female",
PatientDob = null,
PatientAge = "",
PatientHospitalId = ""
PatientAge = null,
PatientHospitalId = null
}
},
new PatientTestData()
{
Name = "Null_Patient",
Patient = new PatientDetails()
{
PatientId = "",
PatientName = "",
PatientSex = "",
PatientId = null,
PatientName = null,
PatientSex = null,
PatientDob = null,
PatientAge = "",
PatientHospitalId = ""
PatientAge = null,
PatientHospitalId = null
}
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ public static class PayloadsTestData
PatientDetails = new PatientDetails()
{
PatientDob = null,
PatientId = String.Empty,
PatientName = String.Empty,
PatientSex = String.Empty
PatientId = null,
PatientName = null,
PatientSex = null
}
}
},
Expand Down