public async Task FindEntityTest() { var testNumber = 2; // Create a test workspace var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber); // Upload test data var uploadPath = Path.Combine(TestSettings.TestDataRootDirectory, "Sro", "mr.dcm"); var overrides = new UploadFileOverrides { Patient = new PatientOverridesSchema { Mrn = $"{testNumber}-Mrn", Name = $"{testNumber}-Name" } }; var uploadResults = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath, overrides); var uploadProcessingResults = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults); var uploadBatch = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults.Results); // Get the summary views of the patient and an entity in the upload response var uploadPatientSummary = uploadBatch.FindPatient(uploadPath); var uploadEntitySummary = uploadBatch.FindEntity(uploadPath); // Verify the contents Assert.AreEqual(workspaceItem.Id, uploadEntitySummary.WorkspaceId); Assert.AreEqual(uploadPatientSummary.Id, uploadEntitySummary.PatientId); Assert.IsNotNull(uploadEntitySummary.Id); Assert.AreEqual("1.2.246.352.221.470938394496317011513892701464452657827", uploadEntitySummary.Uid); Assert.AreEqual("image_set", uploadEntitySummary.Type); Assert.AreEqual("MR", uploadEntitySummary.Modality); Assert.AreEqual("", uploadEntitySummary.Description); }
public async Task GetAsyncTest() { var testNumber = 1; // Create a test workspace var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber); // Upload test data var uploadPath = Path.Combine(TestSettings.TestDataRootDirectory, "Sro"); var overrides = new UploadFileOverrides { Patient = new PatientOverridesSchema { Mrn = $"{testNumber}-Mrn", Name = $"{testNumber}-Name" } }; var uploadResults = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath, overrides); var uploadProcessingResults = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults); var uploadBatch = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults.Results); // Get the summary views of the patient, entities, and SRO in the upload response var uploadPatientSummary = uploadBatch.FindPatient(Path.Combine(uploadPath, "reg.dcm")); var uploadCtEntitySummary = uploadBatch.FindEntity(Path.Combine(uploadPath, "ct.dcm")); var uploadMrEntitySummary = uploadBatch.FindEntity(Path.Combine(uploadPath, "mr.dcm")); var uploadSroSummary = uploadBatch.FindSro(Path.Combine(uploadPath, "reg.dcm")); // Get the full representation of the patient, entities, and SRO var ctImageSetItem = await uploadCtEntitySummary.GetAsync(); var mrImageSetItem = await uploadMrEntitySummary.GetAsync(); var sroItem = await uploadSroSummary.GetAsync(); // Verify the contents Assert.AreEqual(workspaceItem.Id, sroItem.WorkspaceId); Assert.AreEqual(uploadPatientSummary.Id, sroItem.PatientId); Assert.AreEqual(ctImageSetItem.StudyId, sroItem.StudyId); Assert.IsNotNull(sroItem.Id); Assert.AreEqual("1.2.246.352.221.52738008096457865345287404867971417272", sroItem.Uid); Assert.AreEqual("2018-02-19 09:06:05", sroItem.Name); Assert.AreEqual("rigid", sroItem.Type); Assert.AreEqual(mrImageSetItem.FrameOfReferenceUid, sroItem.Source.FrameOfReferenceUid); Assert.AreEqual(mrImageSetItem.Id, sroItem.Source.ImageSetId); Assert.AreEqual(ctImageSetItem.FrameOfReferenceUid, sroItem.Target.FrameOfReferenceUid); Assert.AreEqual(ctImageSetItem.Id, sroItem.Target.ImageSetId); }
public async Task GetAsyncTest() { var testNumber = 1; // Create a test workspace var workspaceItem = await TestHelper.CreateWorkspaceAsync(_testClassName, testNumber); // Upload test data var uploadPath = Path.Combine(TestSettings.TestDataRootDirectory, "Sro", "ct.dcm"); var overrides = new UploadFileOverrides { Patient = new PatientOverridesSchema { Mrn = $"{testNumber}-Mrn", Name = $"{testNumber}-Name" } }; var uploadResults = await _proKnow.Uploads.UploadAsync(workspaceItem, uploadPath, overrides); var uploadProcessingResults = await _proKnow.Uploads.GetUploadProcessingResultsAsync(workspaceItem, uploadResults); var uploadBatch = new UploadBatch(_proKnow, workspaceItem.Id, uploadProcessingResults.Results); // Get the summary views of the patient and entity in the upload response var uploadPatientSummary = uploadBatch.FindPatient(uploadPath); var uploadEntitySummary = uploadBatch.FindEntity(uploadPath); // Get the full representation of the entity var imageSetItem = await uploadEntitySummary.GetAsync() as ImageSetItem; // Verify the contents Assert.AreEqual(workspaceItem.Id, imageSetItem.WorkspaceId); Assert.AreEqual(uploadPatientSummary.Id, imageSetItem.PatientId); Assert.AreEqual("1.2.246.352.221.5093062159960566210763150553104377477", imageSetItem.FrameOfReferenceUid); Assert.IsNotNull(imageSetItem.Id); Assert.AreEqual("image_set", imageSetItem.Type); Assert.AreEqual("1.2.246.352.221.563569281719761951014104635106765053066", imageSetItem.Uid); Assert.AreEqual("CT", imageSetItem.Modality); Assert.AreEqual("", imageSetItem.Description); Assert.IsTrue(imageSetItem.Metadata.Count == 0); Assert.AreEqual("completed", imageSetItem.Status); }