-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #533 from woook/opms_postnatal
Update developmental disorders OPMS
- Loading branch information
Showing
15 changed files
with
44 additions
and
8 deletions.
There are no files selected for viewing
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,5 @@ | ||
SELECT Int(Now()-[DateReceived]) AS DaysOld, Referral.Referral, ArrayTest.InternalPatientID, ArrayTest.SpecimenNo, Patients.OverallResultCodeID AS RC, Status.Status AS ArrayStatus, [Patients].[BookinLastName] & " " & [Patients].[BookinFirstName] AS Name, ArrayTest.Check1ID AS A, ArrayTest.Check2ID AS C, dbo_specimenreportlinked.CreatedByUserInitials AS R, dbo_specimenreportlinked.Description, ArrayTest.RequestedDate, Patients.PatientID | ||
FROM (((ArrayTest INNER JOIN (dbo_specimenlinked LEFT JOIN dbo_specimenreportlinked ON dbo_specimenlinked.SpecimenID = dbo_specimenreportlinked.SpecimenID) ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID) INNER JOIN Status ON ArrayTest.StatusID = Status.StatusID) INNER JOIN Referral ON ArrayTest.ReferralID = Referral.ReferralID) INNER JOIN Patients ON ArrayTest.InternalPatientID = Patients.InternalPatientID | ||
WHERE (((dbo_specimenreportlinked.Description) Is Null Or (dbo_specimenreportlinked.Description)="10-aCGH General") AND ((ArrayTest.RequestedDate)>Now()-50) AND ((dbo_specimenreportlinked.DateAuthorized) Is Null) AND ((ArrayTest.ReferralID)=2 Or (ArrayTest.ReferralID)=1199901215 Or (ArrayTest.ReferralID)=1199901195 Or (ArrayTest.ReferralID)=1199901175 Or (ArrayTest.ReferralID)=1199901204 Or (ArrayTest.ReferralID)=1199901181 Or (ArrayTest.ReferralID)=1199901194) AND ((ArrayTest.Priority)=True) AND ((Status.StatusID)<>1202218787) AND ((ArrayTest.Service)=True)) | ||
ORDER BY Int(Now()-[DateReceived]) DESC; | ||
|
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 @@ | ||
SELECT DateDiff("d",[DateReceived],Now()) AS DaysOld, Referral.Referral, ArrayTest.InternalPatientID, ArrayTest.SpecimenNo, Patients.OverallResultCodeID AS RC, Status.Status AS ArrayStatus, [Patients].[BookinLastName] & " " & [Patients].[BookinFirstName] AS Name, ArrayTest.Check1ID AS A, ArrayTest.Check2ID AS C, dbo_specimenreportlinked.CreatedByUserInitials AS R, dbo_specimenlinked.DateReceived, dbo_specimenreportlinked.Description, ArrayTest.RequestedDate, Patients.PatientID FROM (((ArrayTest INNER JOIN (dbo_specimenlinked LEFT JOIN dbo_specimenreportlinked ON dbo_specimenlinked.SpecimenID = dbo_specimenreportlinked.SpecimenID) ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID) INNER JOIN Status ON ArrayTest.StatusID = Status.StatusID) INNER JOIN Referral ON ArrayTest.ReferralID = Referral.ReferralID) INNER JOIN Patients ON ArrayTest.InternalPatientID = Patients.InternalPatientID WHERE (((DateDiff("d",[DateReceived],Now()))>35) AND ((dbo_specimenlinked.DateReceived)>Now()-100) AND ((dbo_specimenreportlinked.Description)="10-aCGH General" Or (dbo_specimenreportlinked.Description) Is Null) AND ((dbo_specimenreportlinked.DateAuthorized) Is Null) AND ((ArrayTest.ReferralID)=2 Or (ArrayTest.ReferralID)=1199901215 Or (ArrayTest.ReferralID)=1199901195 Or (ArrayTest.ReferralID)=1199901175 Or (ArrayTest.ReferralID)=1199901204 Or (ArrayTest.ReferralID)=1199901181 Or (ArrayTest.ReferralID)=1199901194) AND ((ArrayTest.Priority)=False) AND ((Status.StatusID)<>1202218787) AND ((ArrayTest.Service)=True)) ORDER BY DateDiff("d",[DateReceived],Now()) DESC; |
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 @@ | ||
SELECT ArrayTest.ArrayTestID, ArrayTest.InternalPatientID, ArrayTest.RequestedDate, ArrayTest.SpecimenNo, Referral.Referral, Status.Status FROM (ArrayTest INNER JOIN Referral ON ArrayTest.ReferralID = Referral.ReferralID) INNER JOIN Status ON ArrayTest.StatusID = Status.StatusID WHERE (((ArrayTest.Priority)=True) AND ((ArrayTest.Service)=True)) ORDER BY ArrayTest.RequestedDate DESC; |
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 @@ | ||
SELECT ArrayTest.ArrayTestID, ArrayTest.InternalPatientID, ArrayTest.RequestedDate, ArrayTest.SpecimenNo, Referral.Referral, Status.Status FROM (ArrayTest INNER JOIN Referral ON ArrayTest.ReferralID = Referral.ReferralID) INNER JOIN Status ON ArrayTest.StatusID = Status.StatusID WHERE (((ArrayTest.Priority)=False) AND ((ArrayTest.Service)=True)) ORDER BY ArrayTest.RequestedDate DESC; |
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
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
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
SELECT TOP 24 Format([ArrayResultDate],"yyyy") & "-" & Format(Format([ArrayResultDate],"mm"),"00") AS [Month], Count(ArrayTest.ArrayTestID) AS CountOfArrayTestID, Sum(IIf(DateDiff("d",[dbo_Specimen_Table].[DateReceived],[ArrayTest].[ArrayResultDate])<26,1,0)) AS Count28days, Sum(IIf(DateDiff("d",[dbo_Specimen_Table].[DateReceived],[ArrayTest].[ArrayResultDate])<26,1,0))/Count([arraytestid]) AS 28days, (Avg(DateDiff("d",[dbo_Specimen_Table].[DateReceived],[ArrayTest].[ArrayResultDate])))+2 AS TATMeanAll, StDev(DateDiff("d",[dbo_Specimen_Table].[DateReceived],[ArrayTest].[ArrayResultDate]))/Avg(DateDiff("d",[dbo_Specimen_Table].[DateReceived],[ArrayTest].[ArrayResultDate])) AS CV | ||
FROM ArrayTest INNER JOIN dbo_Specimen_Table ON ArrayTest.SpecimenNo = dbo_Specimen_Table.SpecimenTrustID | ||
WHERE (((ArrayTest.ReferralID)=1185356886 Or (ArrayTest.ReferralID)=1199901176)) | ||
SELECT TOP 24 Format([ArrayResultDate],"yyyy") & "-" & Format(Format([ArrayResultDate],"mm"),"00") AS [Month], Count(ArrayTest.ArrayTestID) AS CountOfArrayTestID, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<42,1,0)) AS Count42days, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<28,1,0))/Count([arraytestid]) AS 28days, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<35,1,0))/Count([arraytestid]) AS 35days, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<42,1,0))/Count([arraytestid]) AS 42days, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<49,1,0))/Count([arraytestid]) AS 49days, Sum(IIf(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])<56,1,0))/Count([arraytestid]) AS 56days, (Avg(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])))+2 AS TATMeanAll, StDev(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate]))/Avg(DateDiff("d",[dbo_specimenlinked].[DateReceived],[ArrayTest].[ArrayResultDate])) AS CV | ||
FROM ArrayTest INNER JOIN dbo_specimenlinked ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID | ||
WHERE (((ArrayTest.ReferralID)=1185356886 Or (ArrayTest.ReferralID)=1199901176 Or (ArrayTest.ReferralID)=1199901175) AND ((ArrayTest.StatusID)=4) AND ((ArrayTest.Service)=True)) | ||
GROUP BY Format([ArrayResultDate],"yyyy") & "-" & Format(Format([ArrayResultDate],"mm"),"00") | ||
ORDER BY Format([ArrayResultDate],"yyyy") & "-" & Format(Format([ArrayResultDate],"mm"),"00") DESC; |
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,4 @@ | ||
SELECT ArrayTest.SpecimenNo, DateDiff("d",[dbo_specimenlinked].[DateReceived],Now()) AS TAT, DateDiff("d",[dbo_specimenreportlinked].[CreatedDate],Now()) AS DaysWaitingForAuth, dbo_SpecimenReportLinked.CreatedDate, dbo_SpecimenReportLinked.CreatedByUserInitials | ||
FROM ArrayTest INNER JOIN (dbo_SpecimenReportLinked INNER JOIN dbo_specimenlinked ON dbo_SpecimenReportLinked.SpecimenID = dbo_specimenlinked.SpecimenID) ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID | ||
WHERE (((ArrayTest.ReferralID)=2 Or (ArrayTest.ReferralID)=1199901192 Or (ArrayTest.ReferralID)=1199901183 Or (ArrayTest.ReferralID)=1199901169 Or (ArrayTest.ReferralID)=1199901181 Or (ArrayTest.ReferralID)=11999011942 Or (ArrayTest.ReferralID)=1199901192 Or (ArrayTest.ReferralID)=1199901183 Or (ArrayTest.ReferralID)=1199901169 Or (ArrayTest.ReferralID)=1199901181 Or (ArrayTest.ReferralID)=1199901194) AND ((dbo_SpecimenReportLinked.Description)="7a - aCGH general - Viapath" Or (dbo_SpecimenReportLinked.Description)="7i - aCGH general ISCAv2 - Viapath" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General New" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General") AND ((ArrayTest.StatusID)=4) AND ((ArrayTest.Service)=True) AND ((ArrayTest.RequestedDate)>#1/1/2018#) AND ((dbo_SpecimenReportLinked.DateAuthorized) Is Null) AND ((ArrayTest.Check2ID) Is Not Null)) | ||
ORDER BY DateDiff("d",[dbo_specimenlinked].[DateReceived],Now()) DESC; |
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,4 @@ | ||
SELECT ArrayTest.SpecimenNo, dbo_specimenlinked.DateReceived, ResultCode.ResultCode, DateDiff("d",[dbo_specimenlinked].[DateReceived],[dbo_SpecimenReportLinked].[DateAuthorized]) AS TAT, DateDiff("d",[dbo_specimenlinked].[DateReceived],[s_OPMS_98031_ArraysDNAs].[RequestedDate]) AS DaysToBookin, DateDiff("d",[s_OPMS_98031_ArraysDNAs].[RequestedDate],[s_OPMS_98031_ArraysDNAs].[ArrayRun]) AS DaysToArray, DateDiff("d",[s_OPMS_98031_ArraysDNAs].[ArrayRun],[s_OPMS_98031_ArraysDNAs].[Check1Date]) AS DaysToAnalysis, DateDiff("d",[s_OPMS_98031_ArraysDNAs].[Check1Date],[s_OPMS_98031_ArraysDNAs].[ArrayResultDate]) AS DaysToCheck, DateDiff("d",[dbo_specimenreportlinked].[CreatedDate],[dbo_specimenreportlinked].[DateAuthorized]) AS DaysToAuth, s_OPMS_98031_ArraysDNAs.RequestedDate AS BookedIntoMoka, s_OPMS_98031_ArraysDNAs.DNAPrep, s_OPMS_98031_ArraysDNAs.ArrayRun, s_OPMS_98031_ArraysDNAs.Check1Date AS Analysed, s_OPMS_98031_ArraysDNAs.ArrayResultDate AS Checked, dbo_SpecimenReportLinked.DateAuthorized | ||
FROM ((ArrayTest INNER JOIN (dbo_SpecimenReportLinked INNER JOIN dbo_specimenlinked ON dbo_SpecimenReportLinked.SpecimenID = dbo_specimenlinked.SpecimenID) ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID) INNER JOIN s_OPMS_98031_ArraysDNAs ON ArrayTest.ArrayTestID = s_OPMS_98031_ArraysDNAs.ArrayTestID) INNER JOIN ResultCode ON ArrayTest.ArrayResultCodeID = ResultCode.ResultCodeID | ||
WHERE (((dbo_SpecimenReportLinked.DateAuthorized) Between [Between? (start date)] And [And? (end date)]) AND ((dbo_SpecimenReportLinked.Description)="7a - aCGH general - Viapath" Or (dbo_SpecimenReportLinked.Description)="7i - aCGH general ISCAv2 - Viapath" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General New" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General")) | ||
ORDER BY DateDiff("d",[dbo_specimenlinked].[DateReceived],[dbo_SpecimenReportLinked].[DateAuthorized]) DESC; |
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,4 @@ | ||
SELECT ArrayTest.SpecimenNo, dbo_specimenlinked.DateReceived, ResultCode.ResultCode, DateDiff("d",[dbo_specimenlinked].[DateReceived],[dbo_SpecimenReportLinked].[DateAuthorized]) AS TAT, DateDiff("d",[dbo_specimenlinked].[DateReceived],[s_OPMS_98032_ArraysDNAsRushes].[RequestedDate]) AS DaysToBookin, DateDiff("d",[s_OPMS_98032_ArraysDNAsRushes].[RequestedDate],[s_OPMS_98032_ArraysDNAsRushes].[ArrayRun]) AS DaysToArray, DateDiff("d",[s_OPMS_98032_ArraysDNAsRushes].[ArrayRun],[s_OPMS_98032_ArraysDNAsRushes].[Check1Date]) AS DaysToAnalysis, DateDiff("d",[s_OPMS_98032_ArraysDNAsRushes].[Check1Date],[s_OPMS_98032_ArraysDNAsRushes].[ArrayResultDate]) AS DaysToCheck, DateDiff("d",[dbo_specimenreportlinked].[CreatedDate],[dbo_specimenreportlinked].[DateAuthorized]) AS DaysToAuth, s_OPMS_98032_ArraysDNAsRushes.RequestedDate AS BookedIntoMoka, s_OPMS_98032_ArraysDNAsRushes.DNAPrep, s_OPMS_98032_ArraysDNAsRushes.ArrayRun, s_OPMS_98032_ArraysDNAsRushes.Check1Date AS Analysed, s_OPMS_98032_ArraysDNAsRushes.ArrayResultDate AS Checked, dbo_SpecimenReportLinked.DateAuthorized | ||
FROM ((ArrayTest INNER JOIN (dbo_SpecimenReportLinked INNER JOIN dbo_specimenlinked ON dbo_SpecimenReportLinked.SpecimenID = dbo_specimenlinked.SpecimenID) ON ArrayTest.SpecimenNo = dbo_specimenlinked.SpecimenTrustID) INNER JOIN s_OPMS_98032_ArraysDNAsRushes ON ArrayTest.ArrayTestID = s_OPMS_98032_ArraysDNAsRushes.ArrayTestID) INNER JOIN ResultCode ON ArrayTest.ArrayResultCodeID = ResultCode.ResultCodeID | ||
WHERE (((dbo_SpecimenReportLinked.DateAuthorized) Between [Between? (start date)] And [And? (end date)]) AND ((dbo_SpecimenReportLinked.Description)="7a - aCGH general - Viapath" Or (dbo_SpecimenReportLinked.Description)="7i - aCGH general ISCAv2 - Viapath" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General New" Or (dbo_SpecimenReportLinked.Description)="10-aCGH General")) | ||
ORDER BY DateDiff("d",[dbo_specimenlinked].[DateReceived],[dbo_SpecimenReportLinked].[DateAuthorized]) DESC; |
Oops, something went wrong.