-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix study series bug * Add e2e tests * Assert * Fix int tests * fix comment * Revert file
- Loading branch information
Showing
10 changed files
with
6,709 additions
and
5 deletions.
There are no files selected for viewing
62 changes: 62 additions & 0 deletions
62
src/Microsoft.Health.Dicom.SqlServer/Features/Schema/Migrations/56.diff.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
SET XACT_ABORT ON | ||
|
||
BEGIN TRANSACTION | ||
GO | ||
|
||
/***************************************************************************************/ | ||
-- STORED PROCEDURE | ||
-- Get Study level QIDO response | ||
-- | ||
/***************************************************************************************/ | ||
CREATE OR ALTER PROCEDURE dbo.GetStudyResult ( | ||
@partitionKey INT, | ||
@watermarkTableType dbo.WatermarkTableType READONLY | ||
) AS | ||
BEGIN | ||
SET NOCOUNT ON | ||
SET XACT_ABORT ON | ||
|
||
SELECT DISTINCT | ||
sv.StudyInstanceUid, | ||
sv.PatientId, | ||
sv.PatientName, | ||
sv.ReferringPhysicianName, | ||
sv.StudyDate, | ||
sv.StudyDescription, | ||
sv.AccessionNumber, | ||
sv.PatientBirthDate, | ||
sv.ModalitiesInStudy, | ||
sv.NumberofStudyRelatedInstances | ||
FROM dbo.Instance i | ||
JOIN @watermarkTableType input ON i.Watermark = input.Watermark AND i.PartitionKey = @partitionKey | ||
JOIN dbo.StudyResultView sv ON i.StudyKey = sv.StudyKey AND i.PartitionKey = sv.PartitionKey | ||
END | ||
GO | ||
|
||
/***************************************************************************************/ | ||
-- STORED PROCEDURE | ||
-- Get Series level QIDO response | ||
-- | ||
/***************************************************************************************/ | ||
CREATE OR ALTER PROCEDURE dbo.GetSeriesResult ( | ||
@partitionKey INT, | ||
@watermarkTableType dbo.WatermarkTableType READONLY | ||
) AS | ||
BEGIN | ||
SET NOCOUNT ON | ||
SET XACT_ABORT ON | ||
|
||
SELECT DISTINCT | ||
i.StudyInstanceUid, | ||
sv.SeriesInstanceUid, | ||
sv.Modality, | ||
sv.PerformedProcedureStepStartDate, | ||
sv.ManufacturerModelName, | ||
sv.NumberofSeriesRelatedInstances | ||
FROM dbo.Instance i | ||
JOIN @watermarkTableType input ON i.Watermark = input.Watermark AND i.PartitionKey = @partitionKey | ||
JOIN dbo.SeriesResultView sv ON i.StudyKey = sv.StudyKey AND i.SeriesKey = sv.SeriesKey AND i.PartitionKey = sv.PartitionKey | ||
END | ||
GO | ||
|
||
COMMIT TRANSACTION |
Oops, something went wrong.