Skip to content

Commit

Permalink
Fix study series QIDO bug (#3313)
Browse files Browse the repository at this point in the history
* Fix study series bug

* Add e2e tests

* Assert

* Fix int tests

* fix comment

* Revert file
  • Loading branch information
bcarthic authored Jan 19, 2024
1 parent 6e37dc7 commit e9bcf46
Show file tree
Hide file tree
Showing 10 changed files with 6,709 additions and 5 deletions.
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
Loading

0 comments on commit e9bcf46

Please sign in to comment.