Skip to content

Commit

Permalink
Integration tests for patient details (#229)
Browse files Browse the repository at this point in the history
* Added specflow steps and some test data

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Basic tests working but not clearing down workflow instances

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Fixed the deleting after test run task

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Fixed other tests that broke

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Added longer timeout for task status step

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Increased timeout on task check

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Added dev changes

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* .gitignore fix

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Changes to dicom metadata including dev changes to parse date correctly

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Removed uneeded variables in constructor

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Reset build.sh back to the same as develop

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Fixed int and unit tests that broke from dev work

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>

* Unit tests changes

Signed-off-by: Joss Sparkes <joss.sparkes@gmail.com>
  • Loading branch information
RemakingEden committed Jul 15, 2022
1 parent 030c171 commit 8c54e21
Show file tree
Hide file tree
Showing 33 changed files with 946 additions and 2,984 deletions.
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

0 comments on commit 8c54e21

Please sign in to comment.