Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration tests for patient details #229

Merged
merged 13 commits into from
Jul 15, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
using Monai.Deploy.WorkflowManager.Storage.Constants;
using Newtonsoft.Json;
using Monai.Deploy.Storage.API;

using System.Globalization;

namespace Monai.Deploy.WorkflowManager.Storage.Services
{
public class DicomService : IDicomService
Expand Down Expand Up @@ -37,11 +38,11 @@ public async Task<PatientDetails> GetPayloadPatientDetailsAsync(string payloadId
PatientSex = await GetFirstValueAsync(items, payloadId, bucketName, DicomTagConstants.PatientSexTag),
PatientAge = await GetFirstValueAsync(items, payloadId, bucketName, DicomTagConstants.PatientAgeTag),
PatientHospitalId = await GetFirstValueAsync(items, payloadId, bucketName, DicomTagConstants.PatientHospitalIdTag)
};

};
var dob = await GetFirstValueAsync(items, payloadId, bucketName, DicomTagConstants.PatientDateOfBirthTag);

if (DateTime.TryParse(dob, out var dateOfBirth))
if (DateTime.TryParseExact(dob, "yyyyMMdd", CultureInfo.InvariantCulture, DateTimeStyles.None, out var dateOfBirth))
{
patientDetails.PatientDob = dateOfBirth;
}
Expand Down Expand Up @@ -116,7 +117,7 @@ public async Task<string> GetAnyValueAsync(string keyId, string payloadId, strin
Guard.Against.NullOrWhiteSpace(payloadId);
Guard.Against.NullOrWhiteSpace(bucketId);

var path = $"{payloadId}\\dcm";
var path = $"{payloadId}/dcm";
var listOfFiles = await _storageService.ListObjectsAsync(bucketId, path, true);
var listOfJsonFiles = listOfFiles.Where(file => file.Filename.EndsWith(".json")).ToList();
var fileCount = listOfJsonFiles.Count;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
{
"00080008": {
"vr": "CS",
"Value": [
"DERIVED",
"SECONDARY"
]
},
"00080016": {
"vr": "UI",
"Value": [
"1.2.840.10008.5.1.4.1.1.2"
]
},
"00080018": {
"vr": "UI",
"Value": [
"1.2.826.0.1.3680043.2.1125.1.74837570949868824183362694729753317"
]
},
"00080020": {
"vr": "DA",
"Value": [
"20190304"
]
},
"00080030": {
"vr": "TM",
"Value": [
"165227.888340"
]
},
"00080050": {
"vr": "SH"
},
"00080060": {
"vr": "CS",
"Value": [
"CT"
]
},
"00080064": {
"vr": "CS",
"Value": [
"DV"
]
},
"00080090": {
"vr": "PN"
},
"0008103E": {
"vr": "LO",
"Value": [
"Processed by Clara"
]
},
"00100010": {
"vr": "PN",
"Value": [
"Patient_Full_Patient"
]
},
"00100020": {
"vr": "LO",
"Value": [
"1"
]
},
"00100030": {
"vr": "DA",
"Value": [
"20000101"
]
},
"00100040": {
"vr": "CS",
"Value": [
"male"
]
},
"00101010": {
"vr": "AS",
"Value": [
"21"
]
},
"00100021": {
"vr": "LO",
"Value": [
"123"
]
},
"0020000D": {
"vr": "UI",
"Value": [
"1.2.826.0.1.3680043.2.1125.1.64854732231592794220757963127858480"
]
},
"0020000E": {
"vr": "UI",
"Value": [
"1.2.826.0.1.3680043.2.1125.1.88346615283577664091166302060792432"
]
},
"00200010": {
"vr": "SH"
},
"00200011": {
"vr": "IS"
},
"00200013": {
"vr": "IS"
},
"00200032": {
"vr": "DS",
"Value": [
0,
0,
288
]
},
"00200037": {
"vr": "DS",
"Value": [
1,
0,
0,
0,
1,
0
]
},
"00200052": {
"vr": "UI",
"Value": [
"1.2.826.0.1.3680043.2.1125.1.72833472134103137404323077718880857"
]
},
"00280002": {
"vr": "US",
"Value": [
1
]
},
"00280004": {
"vr": "CS",
"Value": [
"MONOCHROME2"
]
},
"00280010": {
"vr": "US",
"Value": [
512
]
},
"00280011": {
"vr": "US",
"Value": [
512
]
},
"00280030": {
"vr": "DS",
"Value": [
0.66796875,
0.66796875
]
},
"00280100": {
"vr": "US",
"Value": [
16
]
},
"00280101": {
"vr": "US",
"Value": [
16
]
},
"00280102": {
"vr": "US",
"Value": [
15
]
},
"00280103": {
"vr": "US",
"Value": [
0
]
},
"00281052": {
"vr": "DS",
"Value": [
0
]
},
"00281053": {
"vr": "DS",
"Value": [
1
]
},
"00281054": {
"vr": "LO",
"Value": [
"US"
]
}
}
Binary file not shown.
Loading