SlideShare a Scribd company logo
1 of 42
Download to read offline
208.109.119.78
Documentation
CAPSTONE_HEDIS
Server 208.109.119.78
Author Stephen
Created Monday, April 17, 2017 5:33:39 PM
File Path C:UsersStephenDocumentsMy Database Documentation208.109.119.78_documentation-2017-04-
17T17-33-39.pdf
Table of Contents
Table of Contents ...................................................................................................................................................................2
208.109.119.78...........................................................................................................................................................3
User databases .....................................................................................................................................................5
CAPSTONE_HEDIS Database........................................................................................................................6
Tables.........................................................................................................................................................9
[dbo].[ADMIN_INFO]...........................................................................................................................10
[dbo].[CRITERIA_RESULT] ................................................................................................................12
[dbo].[DIAGNOSIS] .............................................................................................................................14
[dbo].[INSURANCE_PROVIDER] .......................................................................................................15
[dbo].[MEASURE_CRITERIA].............................................................................................................16
[dbo].[MEASURES] .............................................................................................................................18
[dbo].[PATIENT_DIAGNOSIS] ............................................................................................................20
[dbo].[PATIENTS]................................................................................................................................22
[dbo].[REPORT_PATIENTS_INCOMPLIANCE] .................................................................................25
[dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]..........................................................................27
Stored Procedures....................................................................................................................................29
[dbo].[CreatePatientDiagnosisAgeRows ]...........................................................................................30
[dbo].[ProcessPatientsInCompliance] .................................................................................................34
[dbo].[ProcessPatientsNotInCompliance]............................................................................................38
Project > 208.109.119.78
Author: Stephen Copyright 2017 - All Rights Reserved Page 3 of 42
208.109.119.78
Databases (1)
 CAPSTONE_HEDIS
Server Properties
Server Settings
Advanced Server Settings
Property Value
Product Microsoft SQL Server
Version 10.50.1600.1
Language English (United States)
Platform NT INTEL X86
Edition Web Edition
Processors 2
OS Version 6.0 (6002)
Physical Memory 4060
Is Clustered False
Root Directory C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQL
Collation SQL_Latin1_General_CP1_CI_AS
Property Value
Default backup file path C:Program FilesMicrosoft SQL
ServerMSSQL10_50.MSSQLSERVERMSSQLBackup
Recovery Interval (minutes) 0
Default index fill factor 0
Default backup media retention 0
Property Value
Full text upgrade option 2
Locks 0
Nested triggers enabled True
Allow triggers to fire others True
Default language English
Network packet size 4096
Default fulltext language LCID 1033
Project > 208.109.119.78
Author: Stephen Copyright 2017 - All Rights Reserved Page 4 of 42
Two-digit year cutoff 2049
Remote login timeout 20
Cursor threshold -1
Max text replication size 65536
Parallelism cost threshold 5
Scan for startup procs False
Transform noise words False
Blocked process threshold 0
Filestream access level False
Optimize for ad hoc workloads False
Project > 208.109.119.78 > User databases
Author: Stephen Copyright 2017 - All Rights Reserved Page 5 of 42
User databases
Databases (1)
 CAPSTONE_HEDIS
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 6 of 42
CAPSTONE_HEDIS Database
Database Properties
Database Options
Property Value
SQL Server Version SQL Server 2008
Compatibility Level SQL Server 2005
Last backup time 03/30/2017
Last log backup time -
Creation date Mar 13 2017
Users 7
Database Encryption Enabled False
Database Encryption Algorithm None
Database size 48.00 MB
Unallocated space 11.38 MB
Property Value
Compatibility Level 90
Database collation SQL_Latin1_General_CP1_CI_AS
Restrict access MULTI_USER
Is read-only False
Auto close False
Auto shrink False
Database status ONLINE
In standby False
Cleanly shutdown False
Supplemental logging enabled False
Snapshot isolation state OFF
Read committed snapshot on False
Recovery model SIMPLE
Page verify option CHECKSUM
Auto create statistics True
Auto update statistics True
Auto update statistics asynchronously True
ANSI NULL default False
ANSI NULL enabled False
ANSI padding enabled False
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 7 of 42
Files
ANSI warnings enabled False
Arithmetic abort enabled False
Concatenating NULL yields NULL False
Numeric roundabort enabled False
Quoted Identifier On False
Recursive triggers enabled False
Close cursors on commit False
Local cursors by default False
Fulltext enabled True
Trustworthy False
Database chaining False
Forced parameterization False
Master key encrypted by server False
Published False
Subscribed False
Merge published False
Is distribution database False
Sync with backup False
Service broker GUID 09b5766c-f31e-4853-a2d2-1b39dd3f7a4d
Service broker enabled False
Log reuse wait NOTHING
Date correlation False
CDC enabled False
Encrypted False
Honor broker priority False
Database owner cindy_test
Name Type File Group Size Maxsize Autogrowth File Name
enotifyappuser Data 15.00 MB 200.00 MB 5.00 MB C:Program
FilesMicrosoft
SQL
ServerMSSQL1
0_50.MSSQLSE
RVERMSSQLD
ATACAPSTON
E_HEDIS.mdf
enotifyappuser_log Log 32.00 MB 100.00 MB 5.00 MB C:Program
FilesMicrosoft
SQL
ServerMSSQL1
0_50.MSSQLSE
RVERMSSQLD
ATACAPSTON
E_HEDIS_log.ldf
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 8 of 42
ftrow_enotifyappuser Data ftfg_enotifyap
puser
1.00 MB unlimited 10.00 percent C:Program
FilesMicrosoft
SQL
ServerMSSQL1
0_50.MSSQLSE
RVERMSSQLD
ATAHEDIS_-
QA_new.ndf
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables
Author: Stephen Copyright 2017 - All Rights Reserved Page 9 of 42
Tables
Objects
Name
dbo.ADMIN_INFO
dbo.CRITERIA_RESULT
dbo.DIAGNOSIS
dbo.INSURANCE_PROVIDER
dbo.MEASURE_CRITERIA
dbo.MEASURES
dbo.PATIENT_DIAGNOSIS
dbo.PATIENTS
dbo.REPORT_PATIENTS_INCOMPLIANCE
dbo.REPORT_PATIENTS_NOTINCOMPLIANCE
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.ADMIN_INFO
Author: Stephen Copyright 2017 - All Rights Reserved Page 10 of 42
[dbo].[ADMIN_INFO]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[ADMIN_INFO]
(
[AdminID] [int] NOT NULL IDENTITY(1, 1),
[AdminName] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AdminEmail] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[UserName] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Password] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Status] [int] NULL,
[SecurityQuestion] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[SecurityAnswer] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 4
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
AdminID int 4 False 1 - 1
AdminName varchar(40) 40 False
AdminEmail varchar(100) 100 True
UserName varchar(20) 20 False
Password varchar(20) 20 False
Status int 4 True
SecurityQuestion varchar(40) 40 True
SecurityAnswer varchar(40) 40 True
Key Name Key Columns Unique
PK_ADMIN_INFO_ID AdminID True
ADMIN_USERNAME UserName True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.ADMIN_INFO
Author: Stephen Copyright 2017 - All Rights Reserved Page 11 of 42
GO
ALTER TABLE [dbo].[ADMIN_INFO] ADD CONSTRAINT [PK_ADMIN_INFO_ID] PRIMARY KEY CLUSTERED
([AdminID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [ADMIN_USERNAME] ON [dbo].[ADMIN_INFO] ([UserName]) ON
[PRIMARY]
GO
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.CRITERIA_RESULT
Author: Stephen Copyright 2017 - All Rights Reserved Page 12 of 42
[dbo].[CRITERIA_RESULT]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[CRITERIA_RESULT]
(
[CriteriaResultID] [int] NOT NULL IDENTITY(1, 1),
[PatientID] [int] NOT NULL,
[CriteriaID] [int] NOT NULL,
[QualifierType] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[QualifierDate] [date] NOT NULL,
[Status] [int] NULL,
[CriteriaComment] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 27
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type
Max Length
(Bytes) Allow Nulls Identity
CriteriaResultID int 4 False 1 - 1
PatientID int 4 False
CriteriaID int 4 False
QualifierType varchar(30) 30 False
QualifierDate date 3 False
Status int 4 True
CriteriaComment varchar(1000) 1000 True
Key Name Key Columns Unique
PK_CRITERIA_RESULT_ID CriteriaResultID True
CRITERIA_RESULTID PatientID, CriteriaResultID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.CRITERIA_RESULT
Author: Stephen Copyright 2017 - All Rights Reserved Page 13 of 42
GO
ALTER TABLE [dbo].[CRITERIA_RESULT] ADD CONSTRAINT [PK_CRITERIA_RESULT_ID] PRIMARY KEY
CLUSTERED ([CriteriaResultID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [CRITERIA_RESULTID] ON [dbo].[CRITERIA_RESULT]
([PatientID], [CriteriaResultID]) ON [PRIMARY]
GO
Used By
[dbo].[ProcessPatientsInCompliance]
[dbo].[ProcessPatientsNotInCompliance]
[dbo].[ProcessMeasuresInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.DIAGNOSIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 14 of 42
[dbo].[DIAGNOSIS]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[DIAGNOSIS]
(
[DiagnosisID] [int] NOT NULL IDENTITY(1, 1),
[DiagnosisName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DiagnosisType] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[DIAGNOSIS] ADD CONSTRAINT [PK_DIAGNOSIS_ID] PRIMARY KEY CLUSTERED
([DiagnosisID]) ON [PRIMARY]
GO
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 17
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
DiagnosisID int 4 False 1 - 1
DiagnosisName varchar(50) 50 False
DiagnosisType varchar(20) 20 False
Key Name Key Columns Unique
PK_DIAGNOSIS_ID DiagnosisID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.INSURANCE_PROVIDER
Author: Stephen Copyright 2017 - All Rights Reserved Page 15 of 42
[dbo].[INSURANCE_PROVIDER]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[INSURANCE_PROVIDER]
(
[InsuranceID] [int] NOT NULL IDENTITY(1, 1),
[InsuranceProviderName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[INSURANCE_PROVIDER] ADD CONSTRAINT [PK_INSURANCE_PROVIDER_ID]
PRIMARY KEY CLUSTERED ([InsuranceID]) ON [PRIMARY]
GO
Used By
[dbo].[Import_ToPatientTable]
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 377
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:42:27 AM Thursday, October 3, 2013
Key Name Data Type
Max Length
(Bytes) Allow Nulls Identity
InsuranceID int 4 False 1 - 1
InsuranceProviderName varchar(50) 50 False
Key Name Key Columns Unique
PK_INSURANCE_PROVIDER_ID InsuranceID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURE_CRITERIA
Author: Stephen Copyright 2017 - All Rights Reserved Page 16 of 42
[dbo].[MEASURE_CRITERIA]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[MEASURE_CRITERIA]
(
[CriteriaID] [int] NOT NULL IDENTITY(1, 1),
[MeasureID] [int] NOT NULL,
[CriteriaName] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CriteriaDate] [date] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MEASURE_CRITERIA] ADD CONSTRAINT [PK_CRITERIA_ID] PRIMARY KEY
CLUSTERED ([CriteriaID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [MEASURE_CRITERIA] ON [dbo].[MEASURE_CRITERIA]
([MeasureID], [CriteriaID]) ON [PRIMARY]
GO
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 14
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
CriteriaID int 4 False 1 - 1
MeasureID int 4 False
CriteriaName varchar(60) 60 False
CriteriaDate date 3 True
Key Name Key Columns Unique
PK_CRITERIA_ID CriteriaID True
MEASURE_CRITERIA MeasureID, CriteriaID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURE_CRITERIA
Author: Stephen Copyright 2017 - All Rights Reserved Page 17 of 42
Used By
[dbo].[ProcessPatientsInCompliance]
[dbo].[ProcessPatientsNotInCompliance]
[dbo].[ProcessMeasuresInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURES
Author: Stephen Copyright 2017 - All Rights Reserved Page 18 of 42
[dbo].[MEASURES]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[MEASURES]
(
[MeasureID] [int] NOT NULL IDENTITY(1, 1),
[MeasureName] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MeasureCd] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DiagnosisID] [int] NOT NULL,
[MeasureType] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 14
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 8:25:00 AM Monday, July 1, 2013
Key Name Data Type
Max Length
(Bytes) Allow Nulls Identity
MeasureID int 4 False 1 - 1
MeasureName varchar(60) 60 False
MeasureCd varchar(20) 20 False
DiagnosisID int 4 False
MeasureType varchar(8) 8 True
MeasureGreaterThanAge int 4 True
MeasureLessThanAge int 4 True
SexCd char(1) 1 True
MeasureGreaterThanMonth int 4 True
MeasureLessThanMonth int 4 True
TargetCompliancePct decimal(5,2) 5 True
Key Name Key Columns Unique
PK_MEASURE_ID MeasureID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURES
Author: Stephen Copyright 2017 - All Rights Reserved Page 19 of 42
[MeasureGreaterThanAge] [int] NULL,
[MeasureLessThanAge] [int] NULL,
[SexCd] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[MeasureGreaterThanMonth] [int] NULL,
[MeasureLessThanMonth] [int] NULL,
[TargetCompliancePct] [decimal] (5, 2) NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[MEASURES] ADD CONSTRAINT [PK_MEASURE_ID] PRIMARY KEY CLUSTERED
([MeasureID]) ON [PRIMARY]
GO
Used By
[dbo].[CreatePatientDiagnosisAgeRows ]
[dbo].[ProcessPatientsInCompliance]
[dbo].[ProcessPatientsNotInCompliance]
[dbo].[ProcessMeasuresInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENT_DIAGNOSIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 20 of 42
[dbo].[PATIENT_DIAGNOSIS]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[PATIENT_DIAGNOSIS]
(
[PatientDiagnosisID] [int] NOT NULL IDENTITY(1, 1),
[PatientID] [int] NOT NULL,
[DiagnosisID] [int] NOT NULL,
[DiagnosisDate] [date] NOT NULL,
[ExpirationDate] [date] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[PATIENT_DIAGNOSIS] ADD CONSTRAINT [PK_PATIENT_DIAGNOSIS_ID] PRIMARY
KEY CLUSTERED ([PatientDiagnosisID]) ON [PRIMARY]
GO
Used By
[dbo].[CreatePatientDiagnosisAgeRows ]
Property Value
Row Count (~) 3129
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
PatientDiagnosisID int 4 False 1 - 1
PatientID int 4 False
DiagnosisID int 4 False
DiagnosisDate date 3 False
ExpirationDate date 3 True
Key Name Key Columns Unique
PK_PATIENT_DIAGNOSIS_ID PatientDiagnosisID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENT_DIAGNOSIS
Author: Stephen Copyright 2017 - All Rights Reserved Page 21 of 42
[dbo].[ProcessPatientsInCompliance]
[dbo].[ProcessPatientsNotInCompliance]
[dbo].[Import_ToDiagnosisTable]
[dbo].[ProcessMeasuresInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS
Author: Stephen Copyright 2017 - All Rights Reserved Page 22 of 42
[dbo].[PATIENTS]
Properties
Columns
Indexes
Triggers
Property Value
Collation SQL_Latin1_General_CP1_CI_AS
Row Count (~) 62
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:03:54 AM Monday, October 7, 2013
Key Name Data Type
Max Length
(Bytes) Allow Nulls Identity Default
PatientID int 4 False 1 - 1
ChartNum varchar(50) 50 False
FirstName varchar(50) 50 False
LastName varchar(50) 50 False
MiddleInitial char(1) 1 True
FullName varchar(100) 100 True
DOB date 3 False
SexCd char(1) 1 True
EmailAddress varchar(100) 100 True
Telephone varchar(40) 40 True
InsuranceNumber varchar(50) 50 False ('NO INSURANCE')
InsuranceID int 4 True
AgeYears int 4 True
AgeMonths int 4 True
ProviderFullName varchar(100) 100 True
Key Name Key Columns Unique
PK_PATIENTS_ID PatientID True
CHARTNUM_MRN ChartNum True
Name ANSI Nulls On Quoted Identifier On On
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS
Author: Stephen Copyright 2017 - All Rights Reserved Page 23 of 42
SQL Script
CREATE TABLE [dbo].[PATIENTS]
(
[PatientID] [int] NOT NULL IDENTITY(1, 1),
[ChartNum] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[FirstName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[LastName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[MiddleInitial] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[FullName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DOB] [date] NOT NULL,
[SexCd] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[EmailAddress] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Telephone] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[InsuranceNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL
CONSTRAINT [Insurance_def] DEFAULT ('NO INSURANCE'),
[InsuranceID] [int] NULL,
[AgeYears] [int] NULL,
[AgeMonths] [int] NULL,
[ProviderFullName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
CREATE TRIGGER [dbo].[PATIENT_INSERTUPDATE]
ON [dbo].[PATIENTS]
FOR INSERT, UPDATE
AS
DECLARE @FirstName varchar(50),
@LastName varchar(50),
@MiddleInitial varchar(50),
@DisplayName varchar(100),
@DOB date,
@CurrentYear char(4),
@DOBMonth char(2),
@DecemberDate date,
@AgeYears int,
@Count int,
@AgeMonths int
SELECT @Count = COUNT(*) FROM DELETED;
--This will be 0 for Insert
select @DOB = inserted.DOB
from inserted;
if UPDATE(DOB)
BEGIN
Select @CurrentYear = year(getdate()) ;
Select @DOBMonth = month(@DOB) ;
Select @DecemberDate = @CurrentYear + '-12-31'
select @AgeYears = datediff (year, convert (datetime, @DOB), @DecemberDate )
PATIENT_INSERTUPDATE True True After Insert Update
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS
Author: Stephen Copyright 2017 - All Rights Reserved Page 24 of 42
Select @AgeMonths = 12 - @DOBMonth
UPDATE PATIENTS
SET AgeYears = @AgeYears,
AgeMonths = @AgeMonths
FROM inserted
WHERE inserted.PatientID = PATIENTS.PatientID
END
/*Now update the FULLNAME */
select
@FirstName = inserted.FirstName,
@LastName = inserted.LastName,
@MiddleInitial = RTRIM(LTRIM(inserted.MiddleInitial))
from inserted;
if UPDATE(FirstName) OR UPDATE(LastName) or
UPDATE(MiddleInitial) OR
@Count <=0
BEGIN
If NOT @FirstName IS NULL
Select @DisplayName = @FirstName + ' '
If NOT @MiddleInitial IS NULL AND NOT @MiddleInitial = ' '
Select @DisplayName = @DisplayName + @MiddleInitial + ' '
If NOT @LastName IS NULL
Select @DisplayName = @DisplayName + @LastName + ' '
Select @DisplayName = RTRIM(LTRIM(@DisplayName))
UPDATE PATIENTS
SET FullName = @DisplayName
FROM inserted
WHERE inserted.PatientID = PATIENTS.PatientID
END
GO
ALTER TABLE [dbo].[PATIENTS] ADD CONSTRAINT [PK_PATIENTS_ID] PRIMARY KEY CLUSTERED
([PatientID]) ON [PRIMARY]
GO
CREATE UNIQUE NONCLUSTERED INDEX [CHARTNUM_MRN] ON [dbo].[PATIENTS] ([ChartNum]) ON
[PRIMARY]
GO
Used By
[dbo].[CreatePatientDiagnosisAgeRows ]
[dbo].[CalculatePatientAge]
[dbo].[Import_ToDiagnosisTable]
[dbo].[Import_ToPatientTable]
[dbo].[ProcessMeasuresInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_-
INCOMPLIANCE
Author: Stephen Copyright 2017 - All Rights Reserved Page 25 of 42
[dbo].[REPORT_PATIENTS_INCOMPLIANCE]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[REPORT_PATIENTS_INCOMPLIANCE]
(
[ReportPatientID] [int] NOT NULL IDENTITY(1, 1),
[MeasureID] [int] NOT NULL,
[ReportDate] [date] NOT NULL,
[CriteriaID] [int] NOT NULL,
[PatientID] [int] NOT NULL,
[Status] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[REPORT_PATIENTS_INCOMPLIANCE] ADD CONSTRAINT [PK_REPORT_-
PATIENTCOMPLIANT_ID] PRIMARY KEY CLUSTERED ([ReportPatientID]) ON [PRIMARY]
GO
Property Value
Row Count (~) 26
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
ReportPatientID int 4 False 1 - 1
MeasureID int 4 False
ReportDate date 3 False
CriteriaID int 4 False
PatientID int 4 False
Status int 4 False
Key Name Key Columns Unique
PK_REPORT_PATIENTCOMPLIANT_ID ReportPatientID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_-
INCOMPLIANCE
Author: Stephen Copyright 2017 - All Rights Reserved Page 26 of 42
Used By
[dbo].[ProcessPatientsInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_-
NOTINCOMPLIANCE
Author: Stephen Copyright 2017 - All Rights Reserved Page 27 of 42
[dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]
Properties
Columns
Indexes
SQL Script
CREATE TABLE [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]
(
[ReportPatientID] [int] NOT NULL IDENTITY(1, 1),
[MeasureID] [int] NOT NULL,
[ReportDate] [date] NOT NULL,
[CriteriaID] [int] NOT NULL,
[PatientID] [int] NOT NULL,
[Status] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE] ADD CONSTRAINT [PK_REPORT_-
MEASURECRIT_ID] PRIMARY KEY CLUSTERED ([ReportPatientID]) ON [PRIMARY]
GO
Property Value
Row Count (~) 3678
Created 10:07:11 AM Tuesday, June 25, 2013
Last Modified 10:07:11 AM Tuesday, June 25, 2013
Key Name Data Type Max Length (Bytes) Allow Nulls Identity
ReportPatientID int 4 False 1 - 1
MeasureID int 4 False
ReportDate date 3 False
CriteriaID int 4 False
PatientID int 4 False
Status int 4 False
Key Name Key Columns Unique
PK_REPORT_MEASURECRIT_ID ReportPatientID True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_-
NOTINCOMPLIANCE
Author: Stephen Copyright 2017 - All Rights Reserved Page 28 of 42
Used By
[dbo].[ProcessPatientsNotInCompliance]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures
Author: Stephen Copyright 2017 - All Rights Reserved Page 29 of 42
Stored Procedures
Objects
Name
dbo.CreatePatientDiagnosisAgeRows
dbo.ProcessPatientsInCompliance
dbo.ProcessPatientsNotInCompliance
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.CreatePatientDiagnosisAgeRows
Author: Stephen Copyright 2017 - All Rights Reserved Page 30 of 42
[dbo].[CreatePatientDiagnosisAgeRows ]
Properties
SQL Script
create PROCEDURE [dbo].[CreatePatientDiagnosisAgeRows ]
AS
declare @Message varchar(40),
@MeasureGreaterThanAge int = 0,
@MeasureGreaterThanMonth int = 0,
@MeasureLessThanAge int = 0,
@MeasureLessThanMonth int = 0,
@SexCd char(1),
@SexCdTest char(1) = 'N',
@MeasureID int = 0,
@DiagnosisID int = 0,
@PatientID int = 0,
@Quantity int = 0,
@ProcessRecord int = 0
--First delete all rows associated with an age Diagnosis
DELETE dbo.Patient_diagnosis
FROM dbo.Patient_diagnosis a,
dbo.Measures b
where a.diagnosisID = b.diagnosisID
and b.MeasureType = 'Age'
DECLARE Measure_cursor CURSOR FOR
Select MeasureID
,DiagnosisID
,MeasureGreaterThanAge
,MeasureLessThanAge
,MeasureGreaterThanMonth
,MeasureLessThanMonth
,SexCd
Property Value
ANSI Nulls On True
Quoted Identifier On True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.CreatePatientDiagnosisAgeRows
Author: Stephen Copyright 2017 - All Rights Reserved Page 31 of 42
from dbo.MEASURES
where MeasureType = 'AGE'
;
OPEN Measure_cursor ;
FETCH NEXT FROM Measure_cursor
INTO @MeasureID
,@DiagnosisID
,@MeasureGreaterThanAge
,@MeasureLessThanAge
,@MeasureGreaterThanMonth
,@MeasureLessThanMonth
,@SexCd
WHILE @@FETCH_STATUS = 0
BEGIN
Print ' '
Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID)
Set @ProcessRecord = 0
Select @SexCdTest = 'N'
if @SexCd = 'M' OR @SexCd = 'F'
Select @SexCdTest = 'Y'
If @MeasureGreaterThanAge = 0 AND @MeasureLessThanAge = 1
-- This is a Special Case for less than 12 months
BEGIN
INSERT INTO PATIENT_DIAGNOSIS
(PatientID,
DiagnosisID,
DiagnosisDate,
ExpirationDate)
(
Select PatientID
,@DiagnosisID
,GETDATE()
,'1900-01-01'
from dbo.Patients b
WHERE (AgeYears = 0 and AgeMonths <> 0)
AND (AgeMonths < @MeasureLessThanMonth )
AND (AgeMonths > @MeasureGreaterThanMonth )
)
INSERT INTO PATIENT_DIAGNOSIS
(PatientID,
DiagnosisID,
DiagnosisDate,
ExpirationDate)
(
Select PatientID
,@DiagnosisID
,GETDATE()
,'1900-01-01'
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.CreatePatientDiagnosisAgeRows
Author: Stephen Copyright 2017 - All Rights Reserved Page 32 of 42
from dbo.Patients b
WHERE (AgeYears = 0 and AgeMonths = 0)
AND (AgeMonths = @MeasureLessThanMonth )
AND (AgeMonths = @MeasureGreaterThanMonth )
)
Set @ProcessRecord = 1
Print ' Entering Age 0 logic'
END
if @SexCdTest = 'Y' and @ProcessRecord = 0
BEGIN
INSERT INTO PATIENT_DIAGNOSIS
(PatientID,
DiagnosisID,
DiagnosisDate,
ExpirationDate)
(
Select PatientID
,@DiagnosisID
,GETDATE()
,'1900-01-01'
from dbo.Patients b
WHERE AgeYears > @MeasureGreaterThanAge
AND AgeYears < @MeasureLessThanAge
AND (AgeMonths > @MeasureGreaterThanMonth OR (@MeasureGreaterThanMonth IS
NULL OR
@MeasureGreaterThanMonth = 0))
AND (AgeMonths < @MeasureLessThanMonth OR (@MeasureLessThanMonth IS NULL))
AND SexCd = @SexCd )
END
--Dont test sex code in this case --
if @SexCdTest = 'N' and @ProcessRecord = 0
BEGIN
INSERT INTO PATIENT_DIAGNOSIS
(PatientID,
DiagnosisID,
DiagnosisDate,
ExpirationDate)
(
Select PatientID
,@DiagnosisID
,GETDATE()
,'1900-01-01'
from dbo.Patients b
WHERE AgeYears > @MeasureGreaterThanAge
AND AgeYears < @MeasureLessThanAge
AND (AgeMonths > @MeasureGreaterThanMonth OR (@MeasureGreaterThanMonth IS
NULL OR
@MeasureGreaterThanMonth = 0))
AND (AgeMonths < @MeasureLessThanMonth OR (@MeasureLessThanMonth IS NULL))
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.CreatePatientDiagnosisAgeRows
Author: Stephen Copyright 2017 - All Rights Reserved Page 33 of 42
)
END
-- Get the next Measure Record.
FETCH NEXT FROM Measure_cursor
INTO
@MeasureID
,@DiagnosisID
,@MeasureGreaterThanAge
,@MeasureLessThanAge
,@MeasureGreaterThanMonth
,@MeasureLessThanMonth
,@SexCd
END
CLOSE Measure_cursor ;
DEALLOCATE Measure_cursor ;
GO
Uses
[dbo].[MEASURES]
[dbo].[PATIENT_DIAGNOSIS]
[dbo].[PATIENTS]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 34 of 42
[dbo].[ProcessPatientsInCompliance]
Properties
SQL Script
create PROCEDURE [dbo].[ProcessPatientsInCompliance]
AS
declare @CriteriaResultStatus int,
@Message varchar(100),
@TotalMeasureCount int = 0,
@MeasureInComplianceFlag int = 0,
@MeasureInComplianceCount int = 0,
@MeasureNotInComplianceCount int = 0,
@TotalPatientCount int = 0,
@MeasureCriteriaCount int = 0,
@CriteriaResultCount int = 0,
@CriteriaPassCount int = 0,
@CriteriaFailCount int = 0,
@MeasureID int = 0,
@DiagnosisID int = 0,
@PatientID int = 0,
@CritPatientID int = 0,
@CriteriaID int = 0,
@CriteriaResultID int = 0,
@Quantity int = 0
delete from dbo.REPORT_PATIENTS_INCOMPLIANCE
DECLARE Measure_cursor CURSOR FOR
Select MeasureID,
DiagnosisID
from dbo.MEASURES
--where MeasureID in (4)
;
OPEN Measure_cursor ;
FETCH NEXT FROM Measure_cursor
INTO @MeasureID
,@DiagnosisID
Property Value
ANSI Nulls On True
Quoted Identifier On True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 35 of 42
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID)
SET @MeasureInComplianceCount = 0;
SET @MeasureInComplianceCount = 0;
DECLARE PatientDiagnosis_cursor CURSOR FOR
Select PatientID
from dbo.PATIENT_DIAGNOSIS
WHERE DiagnosisID = @DiagnosisID
OPEN PatientDiagnosis_cursor;
FETCH NEXT FROM PatientDiagnosis_cursor
INTO @PatientID
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'PatientID = ' + + CONVERT(varchar(10),@PatientID)
SET @MeasureInComplianceFlag = 0
DECLARE MeasureCriteria_cursor CURSOR FOR
Select c.CriteriaID,
Status,
PatientID
from dbo.MEASURE_CRITERIA c
LEFT OUTER JOIN dbo.CRITERIA_RESULT r
ON c.CriteriaID = r.CriteriaID and PatientID = @PatientID
WHERE MeasureID = @MeasureID
OPEN MeasureCriteria_cursor;
FETCH NEXT FROM MeasureCriteria_cursor
INTO @CriteriaID,
@CriteriaResultStatus,
@CritPatientID
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'CriteriaID = ' + + CONVERT(varchar(10),@CriteriaID)
SET @TotalPatientCount = @TotalPatientCount + 1;
SELECT @Message = '';
SET @MeasureCriteriaCount = 0;
SET @CriteriaResultCount = 0;
SET @CriteriaPassCount = 0
SET @CriteriaFailCount = 0
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 36 of 42
if @CritPatientID IS NULL
Begin --this means no Patient row for this criteria so this Measure is Not
in compliance
Print 'CritPatient is Null'
SET @MeasureInComplianceFlag = 1;
End
/* Select CriteriaResultID = @CriteriaResultID,
Status = @CriteriaResultStatus
FROM dbo.CRITERIA_RESULT
Where CriteriaID = @CriteriaID
and PatientID = @PatientID */
SET @MeasureCriteriaCount = @MeasureCriteriaCount + 1;
If @CriteriaResultStatus = 1
BEGIN
SET @CriteriaPassCount = @CriteriaPassCount + 1;
END
If @CriteriaResultStatus != 1
BEGIN
SET @CriteriaFailCount = @CriteriaFailCount + 1;
END
--99 means criteria is missing --
if @MeasureInComplianceFlag = 1
Select @CriteriaResultStatus = 99
if @MeasureInComplianceFlag = 0 AND @CriteriaResultStatus = 1
BEGIN
INSERT INTO REPORT_PATIENTS_INCOMPLIANCE
(MeasureID,
ReportDate,
CriteriaID,
PatientID,
Status)
Values(
@MeasureID
,GETDATE()
,@CriteriaID
,@PatientID
,@CriteriaResultStatus
)
END
FETCH NEXT FROM MeasureCriteria_cursor
INTO
@CriteriaID,
@CriteriaResultStatus,
@CritPatientID
END
CLOSE MeasureCriteria_cursor;
DEALLOCATE MeasureCriteria_cursor;
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 37 of 42
if @MeasureInComplianceFlag = 1
BEGIN
SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1;
END
if @MeasureCriteriaCount = @CriteriaPassCount and @MeasureInComplianceFlag = 0
BEGIN
SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1;
END
if @MeasureCriteriaCount != @CriteriaPassCount and @MeasureInComplianceFlag = 0
BEGIN
SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1;
END
FETCH NEXT FROM PatientDiagnosis_cursor
INTO
@PatientID
END
CLOSE PatientDiagnosis_cursor ;
DEALLOCATE PatientDiagnosis_cursor ;
-- Get the next Measure Record.
FETCH NEXT FROM Measure_cursor
INTO
@MeasureID
,@DiagnosisID
END
CLOSE Measure_cursor ;
DEALLOCATE Measure_cursor ;
--End Measure_cursor
--Select 'Total Import = ' + CAST(@ImportCount AS char(5)) + ' Total Errors = ' +
CAST(@ErrorCount AS char(5))+
--'Total Records = ' + CAST(@TotalCount AS char(5));
GO
Uses
[dbo].[CRITERIA_RESULT]
[dbo].[MEASURE_CRITERIA]
[dbo].[MEASURES]
[dbo].[PATIENT_DIAGNOSIS]
[dbo].[REPORT_PATIENTS_INCOMPLIANCE]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsNotInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 38 of 42
[dbo].[ProcessPatientsNotInCompliance]
Properties
SQL Script
create PROCEDURE [dbo].[ProcessPatientsNotInCompliance]
AS
declare @CriteriaResultStatus int,
@Message varchar(100),
@TotalMeasureCount int = 0,
@MeasureInComplianceFlag int = 0,
@MeasureInComplianceCount int = 0,
@MeasureNotInComplianceCount int = 0,
@TotalPatientCount int = 0,
@MeasureCriteriaCount int = 0,
@CriteriaResultCount int = 0,
@CriteriaPassCount int = 0,
@CriteriaFailCount int = 0,
@MeasureID int = 0,
@DiagnosisID int = 0,
@PatientID int = 0,
@CritPatientID int = 0,
@CriteriaID int = 0,
@CriteriaResultID int = 0,
@Quantity int = 0
delete from dbo.REPORT_PATIENTS_NOTINCOMPLIANCE
DECLARE Measure_cursor CURSOR FOR
Select MeasureID,
DiagnosisID
from dbo.MEASURES
--where MeasureID in (4)
;
OPEN Measure_cursor ;
FETCH NEXT FROM Measure_cursor
INTO @MeasureID
,@DiagnosisID
Property Value
ANSI Nulls On True
Quoted Identifier On True
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsNotInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 39 of 42
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID)
SET @MeasureInComplianceCount = 0;
SET @MeasureNotInComplianceCount = 0;
DECLARE PatientDiagnosis_cursor CURSOR FOR
Select PatientID
from dbo.PATIENT_DIAGNOSIS
WHERE DiagnosisID = @DiagnosisID
OPEN PatientDiagnosis_cursor;
FETCH NEXT FROM PatientDiagnosis_cursor
INTO @PatientID
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'PatientID = ' + + CONVERT(varchar(10),@PatientID)
SET @MeasureInComplianceFlag = 0
DECLARE MeasureCriteria_cursor CURSOR FOR
Select c.CriteriaID,
Status,
PatientID
from dbo.MEASURE_CRITERIA c
LEFT OUTER JOIN dbo.CRITERIA_RESULT r
ON c.CriteriaID = r.CriteriaID and PatientID = @PatientID
WHERE MeasureID = @MeasureID
OPEN MeasureCriteria_cursor;
FETCH NEXT FROM MeasureCriteria_cursor
INTO @CriteriaID,
@CriteriaResultStatus,
@CritPatientID
WHILE @@FETCH_STATUS = 0
BEGIN
Print 'CriteriaID = ' + + CONVERT(varchar(10),@CriteriaID)
SET @TotalPatientCount = @TotalPatientCount + 1;
SELECT @Message = '';
SET @MeasureCriteriaCount = 0;
SET @CriteriaResultCount = 0;
SET @CriteriaPassCount = 0
SET @CriteriaFailCount = 0
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsNotInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 40 of 42
if @CritPatientID IS NULL
Begin --this means no Patient row for this criteria so this Measure is Not
in compliance
Print 'CritPatient is Null'
SET @MeasureInComplianceFlag = 1;
End
/* Select CriteriaResultID = @CriteriaResultID,
Status = @CriteriaResultStatus
FROM dbo.CRITERIA_RESULT
Where CriteriaID = @CriteriaID
and PatientID = @PatientID */
SET @MeasureCriteriaCount = @MeasureCriteriaCount + 1;
If @CriteriaResultStatus = 1
BEGIN
SET @CriteriaPassCount = @CriteriaPassCount + 1;
END
If @CriteriaResultStatus != 1
BEGIN
SET @CriteriaFailCount = @CriteriaFailCount + 1;
END
--99 means criteria is missing --
if @MeasureInComplianceFlag = 1
Select @CriteriaResultStatus = 99
if @MeasureInComplianceFlag = 1 or @CriteriaResultStatus != 1
BEGIN
INSERT INTO REPORT_PATIENTS_NOTINCOMPLIANCE
(MeasureID,
ReportDate,
CriteriaID,
PatientID,
Status)
Values(
@MeasureID
,GETDATE()
,@CriteriaID
,@PatientID
,@CriteriaResultStatus
)
END
FETCH NEXT FROM MeasureCriteria_cursor
INTO
@CriteriaID,
@CriteriaResultStatus,
@CritPatientID
END
CLOSE MeasureCriteria_cursor;
DEALLOCATE MeasureCriteria_cursor;
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsNotInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 41 of 42
if @MeasureInComplianceFlag = 1
BEGIN
SET @MeasureNotInComplianceCount = @MeasureNotInComplianceCount + 1;
END
if @MeasureCriteriaCount = @CriteriaPassCount and @MeasureInComplianceFlag = 0
BEGIN
SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1;
END
if @MeasureCriteriaCount != @CriteriaPassCount and @MeasureInComplianceFlag = 0
BEGIN
SET @MeasureNotInComplianceCount = @MeasureNotInComplianceCount + 1;
END
FETCH NEXT FROM PatientDiagnosis_cursor
INTO
@PatientID
END
CLOSE PatientDiagnosis_cursor ;
DEALLOCATE PatientDiagnosis_cursor ;
-- Get the next Measure Record.
FETCH NEXT FROM Measure_cursor
INTO
@MeasureID
,@DiagnosisID
END
CLOSE Measure_cursor ;
DEALLOCATE Measure_cursor ;
--End Measure_cursor
--Select 'Total Import = ' + CAST(@ImportCount AS char(5)) + ' Total Errors = ' +
CAST(@ErrorCount AS char(5))+
--'Total Records = ' + CAST(@TotalCount AS char(5));
GO
Uses
[dbo].[CRITERIA_RESULT]
[dbo].[MEASURE_CRITERIA]
[dbo].[MEASURES]
[dbo].[PATIENT_DIAGNOSIS]
[dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]
Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures >
dbo.ProcessPatientsNotInCompliance
Author: Stephen Copyright 2017 - All Rights Reserved Page 42 of 42

More Related Content

What's hot

Playing With (B)Sqli
Playing With (B)SqliPlaying With (B)Sqli
Playing With (B)SqliChema Alonso
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingLori MacVittie
 
Beyond xp_cmdshell: Owning the Empire through SQL Server
Beyond xp_cmdshell: Owning the Empire through SQL ServerBeyond xp_cmdshell: Owning the Empire through SQL Server
Beyond xp_cmdshell: Owning the Empire through SQL ServerScott Sutherland
 
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL ServerScott Sutherland
 
Inno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesInno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesMySQLConference
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclassDoug Chang
 
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShellScott Sutherland
 
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL ServerSecure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL ServerScott Sutherland
 
Metrics-Driven Engineering at Etsy
Metrics-Driven Engineering at EtsyMetrics-Driven Engineering at Etsy
Metrics-Driven Engineering at EtsyMike Brittain
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShellScott Sutherland
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Tom Diederich
 
Alfrescotomcat stderr.2013-03-05
Alfrescotomcat stderr.2013-03-05Alfrescotomcat stderr.2013-03-05
Alfrescotomcat stderr.2013-03-05NX21
 

What's hot (14)

Playing With (B)Sqli
Playing With (B)SqliPlaying With (B)Sqli
Playing With (B)Sqli
 
Nine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side ScriptingNine Ways to Use Network-Side Scripting
Nine Ways to Use Network-Side Scripting
 
Survey of Percona Toolkit
Survey of Percona ToolkitSurvey of Percona Toolkit
Survey of Percona Toolkit
 
Beyond xp_cmdshell: Owning the Empire through SQL Server
Beyond xp_cmdshell: Owning the Empire through SQL ServerBeyond xp_cmdshell: Owning the Empire through SQL Server
Beyond xp_cmdshell: Owning the Empire through SQL Server
 
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server
2018 Student360 - Beyond xp_cmdshell - Owning the Empire Through SQL Server
 
Inno Db Performance And Usability Patches
Inno Db Performance And Usability PatchesInno Db Performance And Usability Patches
Inno Db Performance And Usability Patches
 
Capital onehadoopclass
Capital onehadoopclassCapital onehadoopclass
Capital onehadoopclass
 
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
2017 Thotcon - Hacking SQL Servers on Scale with PowerShell
 
Ifr tool log
Ifr tool logIfr tool log
Ifr tool log
 
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL ServerSecure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
Secure360 - Beyond xp cmdshell - Owning the Empire through SQL Server
 
Metrics-Driven Engineering at Etsy
Metrics-Driven Engineering at EtsyMetrics-Driven Engineering at Etsy
Metrics-Driven Engineering at Etsy
 
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell2017 Secure360 - Hacking SQL Server on Scale with PowerShell
2017 Secure360 - Hacking SQL Server on Scale with PowerShell
 
Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)Ingesting streaming data for analysis in apache ignite (stream sets theme)
Ingesting streaming data for analysis in apache ignite (stream sets theme)
 
Alfrescotomcat stderr.2013-03-05
Alfrescotomcat stderr.2013-03-05Alfrescotomcat stderr.2013-03-05
Alfrescotomcat stderr.2013-03-05
 

Similar to Server 208 Documentation

Actor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active DirectoryActor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active Directoryprotect724rkeer
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Reportnyin27
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaMark Leith
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEOClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEOAltinity Ltd
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSChris Brown
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryOlivier DASINI
 
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...DataStax
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersoazabir
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesJose Manuel Jurado Diaz
 
SharePoint 2010 Virtualisation - SharePoint Saturday UK
SharePoint 2010 Virtualisation - SharePoint Saturday UKSharePoint 2010 Virtualisation - SharePoint Saturday UK
SharePoint 2010 Virtualisation - SharePoint Saturday UKMichael Noel
 
FleetDB: A Schema-Free Database in Clojure
FleetDB: A Schema-Free Database in ClojureFleetDB: A Schema-Free Database in Clojure
FleetDB: A Schema-Free Database in ClojureMark McGranaghan
 
The MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaThe MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaTed Wennmark
 
Coding for marketers
Coding for marketersCoding for marketers
Coding for marketersRobin Lord
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the CloudWesley Beary
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Bob Ward
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Stamatis Zampetakis
 
FleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in ClojureFleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in Clojureelliando dias
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 

Similar to Server 208 Documentation (20)

Actor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active DirectoryActor Model Import Connector for Microsoft Active Directory
Actor Model Import Connector for Microsoft Active Directory
 
Database Development Replication Security Maintenance Report
Database Development Replication Security Maintenance ReportDatabase Development Replication Security Maintenance Report
Database Development Replication Security Maintenance Report
 
Instrumenting plugins for Performance Schema
Instrumenting plugins for Performance SchemaInstrumenting plugins for Performance Schema
Instrumenting plugins for Performance Schema
 
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEOClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
ClickHouse tips and tricks. Webinar slides. By Robert Hodges, Altinity CEO
 
Automating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWSAutomating everything with PowerShell, Terraform, and AWS
Automating everything with PowerShell, Terraform, and AWS
 
MySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features SummaryMySQL 8.0.18 - New Features Summary
MySQL 8.0.18 - New Features Summary
 
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
Hey Relational Developer, Let's Go Crazy (Patrick McFadin, DataStax) | Cassan...
 
Stacki and Chef at Pardot
Stacki and Chef at PardotStacki and Chef at Pardot
Stacki and Chef at Pardot
 
Scaling asp.net websites to millions of users
Scaling asp.net websites to millions of usersScaling asp.net websites to millions of users
Scaling asp.net websites to millions of users
 
Azure from scratch part 4
Azure from scratch part 4Azure from scratch part 4
Azure from scratch part 4
 
Azure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best PracticesAzure SQL Database - Connectivity Best Practices
Azure SQL Database - Connectivity Best Practices
 
SharePoint 2010 Virtualisation - SharePoint Saturday UK
SharePoint 2010 Virtualisation - SharePoint Saturday UKSharePoint 2010 Virtualisation - SharePoint Saturday UK
SharePoint 2010 Virtualisation - SharePoint Saturday UK
 
FleetDB: A Schema-Free Database in Clojure
FleetDB: A Schema-Free Database in ClojureFleetDB: A Schema-Free Database in Clojure
FleetDB: A Schema-Free Database in Clojure
 
The MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS SchemaThe MySQL Performance Schema & New SYS Schema
The MySQL Performance Schema & New SYS Schema
 
Coding for marketers
Coding for marketersCoding for marketers
Coding for marketers
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017Enhancements that will make your sql database roar sp1 edition sql bits 2017
Enhancements that will make your sql database roar sp1 edition sql bits 2017
 
Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21Apache Calcite Tutorial - BOSS 21
Apache Calcite Tutorial - BOSS 21
 
FleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in ClojureFleetDB A Schema-Free Database in Clojure
FleetDB A Schema-Free Database in Clojure
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 

Recently uploaded

WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )Pooja Nehwal
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...NETWAYS
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝soniya singh
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxFamilyWorshipCenterD
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...henrik385807
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSebastiano Panichella
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfhenrik385807
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)Basil Achie
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...NETWAYS
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...NETWAYS
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Salam Al-Karadaghi
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSebastiano Panichella
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Krijn Poppe
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptxBasil Achie
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Pooja Nehwal
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptssuser319dad
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...NETWAYS
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@vikas rana
 

Recently uploaded (20)

WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
WhatsApp 📞 9892124323 ✅Call Girls In Juhu ( Mumbai )
 
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
OSCamp Kubernetes 2024 | Zero-Touch OS-Infrastruktur für Container und Kubern...
 
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
Call Girls in Sarojini Nagar Market Delhi 💯 Call Us 🔝8264348440🔝
 
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptxGenesis part 2 Isaiah Scudder 04-24-2024.pptx
Genesis part 2 Isaiah Scudder 04-24-2024.pptx
 
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
CTAC 2024 Valencia - Sven Zoelle - Most Crucial Invest to Digitalisation_slid...
 
SBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation TrackSBFT Tool Competition 2024 -- Python Test Case Generation Track
SBFT Tool Competition 2024 -- Python Test Case Generation Track
 
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdfOpen Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
Open Source Strategy in Logistics 2015_Henrik Hankedvz-d-nl-log-conference.pdf
 
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
NATIONAL ANTHEMS OF AFRICA (National Anthems of Africa)
 
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
OSCamp Kubernetes 2024 | SRE Challenges in Monolith to Microservices Shift at...
 
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
Open Source Camp Kubernetes 2024 | Running WebAssembly on Kubernetes by Alex ...
 
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
Exploring protein-protein interactions by Weak Affinity Chromatography (WAC) ...
 
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Vaishnavi 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Vaishnavi 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with AerialistSimulation-based Testing of Unmanned Aerial Vehicles with Aerialist
Simulation-based Testing of Unmanned Aerial Vehicles with Aerialist
 
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
Presentation for the Strategic Dialogue on the Future of Agriculture, Brussel...
 
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
LANDMARKS  AND MONUMENTS IN NIGERIA.pptxLANDMARKS  AND MONUMENTS IN NIGERIA.pptx
LANDMARKS AND MONUMENTS IN NIGERIA.pptx
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
Navi Mumbai Call Girls Service Pooja 9892124323 Real Russian Girls Looking Mo...
 
Philippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.pptPhilippine History cavite Mutiny Report.ppt
Philippine History cavite Mutiny Report.ppt
 
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
OSCamp Kubernetes 2024 | A Tester's Guide to CI_CD as an Automated Quality Co...
 
call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@call girls in delhi malviya nagar @9811711561@
call girls in delhi malviya nagar @9811711561@
 

Server 208 Documentation

  • 1. 208.109.119.78 Documentation CAPSTONE_HEDIS Server 208.109.119.78 Author Stephen Created Monday, April 17, 2017 5:33:39 PM File Path C:UsersStephenDocumentsMy Database Documentation208.109.119.78_documentation-2017-04- 17T17-33-39.pdf
  • 2. Table of Contents Table of Contents ...................................................................................................................................................................2 208.109.119.78...........................................................................................................................................................3 User databases .....................................................................................................................................................5 CAPSTONE_HEDIS Database........................................................................................................................6 Tables.........................................................................................................................................................9 [dbo].[ADMIN_INFO]...........................................................................................................................10 [dbo].[CRITERIA_RESULT] ................................................................................................................12 [dbo].[DIAGNOSIS] .............................................................................................................................14 [dbo].[INSURANCE_PROVIDER] .......................................................................................................15 [dbo].[MEASURE_CRITERIA].............................................................................................................16 [dbo].[MEASURES] .............................................................................................................................18 [dbo].[PATIENT_DIAGNOSIS] ............................................................................................................20 [dbo].[PATIENTS]................................................................................................................................22 [dbo].[REPORT_PATIENTS_INCOMPLIANCE] .................................................................................25 [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]..........................................................................27 Stored Procedures....................................................................................................................................29 [dbo].[CreatePatientDiagnosisAgeRows ]...........................................................................................30 [dbo].[ProcessPatientsInCompliance] .................................................................................................34 [dbo].[ProcessPatientsNotInCompliance]............................................................................................38
  • 3. Project > 208.109.119.78 Author: Stephen Copyright 2017 - All Rights Reserved Page 3 of 42 208.109.119.78 Databases (1)  CAPSTONE_HEDIS Server Properties Server Settings Advanced Server Settings Property Value Product Microsoft SQL Server Version 10.50.1600.1 Language English (United States) Platform NT INTEL X86 Edition Web Edition Processors 2 OS Version 6.0 (6002) Physical Memory 4060 Is Clustered False Root Directory C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQL Collation SQL_Latin1_General_CP1_CI_AS Property Value Default backup file path C:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLBackup Recovery Interval (minutes) 0 Default index fill factor 0 Default backup media retention 0 Property Value Full text upgrade option 2 Locks 0 Nested triggers enabled True Allow triggers to fire others True Default language English Network packet size 4096 Default fulltext language LCID 1033
  • 4. Project > 208.109.119.78 Author: Stephen Copyright 2017 - All Rights Reserved Page 4 of 42 Two-digit year cutoff 2049 Remote login timeout 20 Cursor threshold -1 Max text replication size 65536 Parallelism cost threshold 5 Scan for startup procs False Transform noise words False Blocked process threshold 0 Filestream access level False Optimize for ad hoc workloads False
  • 5. Project > 208.109.119.78 > User databases Author: Stephen Copyright 2017 - All Rights Reserved Page 5 of 42 User databases Databases (1)  CAPSTONE_HEDIS
  • 6. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS Author: Stephen Copyright 2017 - All Rights Reserved Page 6 of 42 CAPSTONE_HEDIS Database Database Properties Database Options Property Value SQL Server Version SQL Server 2008 Compatibility Level SQL Server 2005 Last backup time 03/30/2017 Last log backup time - Creation date Mar 13 2017 Users 7 Database Encryption Enabled False Database Encryption Algorithm None Database size 48.00 MB Unallocated space 11.38 MB Property Value Compatibility Level 90 Database collation SQL_Latin1_General_CP1_CI_AS Restrict access MULTI_USER Is read-only False Auto close False Auto shrink False Database status ONLINE In standby False Cleanly shutdown False Supplemental logging enabled False Snapshot isolation state OFF Read committed snapshot on False Recovery model SIMPLE Page verify option CHECKSUM Auto create statistics True Auto update statistics True Auto update statistics asynchronously True ANSI NULL default False ANSI NULL enabled False ANSI padding enabled False
  • 7. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS Author: Stephen Copyright 2017 - All Rights Reserved Page 7 of 42 Files ANSI warnings enabled False Arithmetic abort enabled False Concatenating NULL yields NULL False Numeric roundabort enabled False Quoted Identifier On False Recursive triggers enabled False Close cursors on commit False Local cursors by default False Fulltext enabled True Trustworthy False Database chaining False Forced parameterization False Master key encrypted by server False Published False Subscribed False Merge published False Is distribution database False Sync with backup False Service broker GUID 09b5766c-f31e-4853-a2d2-1b39dd3f7a4d Service broker enabled False Log reuse wait NOTHING Date correlation False CDC enabled False Encrypted False Honor broker priority False Database owner cindy_test Name Type File Group Size Maxsize Autogrowth File Name enotifyappuser Data 15.00 MB 200.00 MB 5.00 MB C:Program FilesMicrosoft SQL ServerMSSQL1 0_50.MSSQLSE RVERMSSQLD ATACAPSTON E_HEDIS.mdf enotifyappuser_log Log 32.00 MB 100.00 MB 5.00 MB C:Program FilesMicrosoft SQL ServerMSSQL1 0_50.MSSQLSE RVERMSSQLD ATACAPSTON E_HEDIS_log.ldf
  • 8. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS Author: Stephen Copyright 2017 - All Rights Reserved Page 8 of 42 ftrow_enotifyappuser Data ftfg_enotifyap puser 1.00 MB unlimited 10.00 percent C:Program FilesMicrosoft SQL ServerMSSQL1 0_50.MSSQLSE RVERMSSQLD ATAHEDIS_- QA_new.ndf
  • 9. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables Author: Stephen Copyright 2017 - All Rights Reserved Page 9 of 42 Tables Objects Name dbo.ADMIN_INFO dbo.CRITERIA_RESULT dbo.DIAGNOSIS dbo.INSURANCE_PROVIDER dbo.MEASURE_CRITERIA dbo.MEASURES dbo.PATIENT_DIAGNOSIS dbo.PATIENTS dbo.REPORT_PATIENTS_INCOMPLIANCE dbo.REPORT_PATIENTS_NOTINCOMPLIANCE
  • 10. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.ADMIN_INFO Author: Stephen Copyright 2017 - All Rights Reserved Page 10 of 42 [dbo].[ADMIN_INFO] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[ADMIN_INFO] ( [AdminID] [int] NOT NULL IDENTITY(1, 1), [AdminName] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [AdminEmail] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [UserName] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Password] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [Status] [int] NULL, [SecurityQuestion] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [SecurityAnswer] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 4 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity AdminID int 4 False 1 - 1 AdminName varchar(40) 40 False AdminEmail varchar(100) 100 True UserName varchar(20) 20 False Password varchar(20) 20 False Status int 4 True SecurityQuestion varchar(40) 40 True SecurityAnswer varchar(40) 40 True Key Name Key Columns Unique PK_ADMIN_INFO_ID AdminID True ADMIN_USERNAME UserName True
  • 11. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.ADMIN_INFO Author: Stephen Copyright 2017 - All Rights Reserved Page 11 of 42 GO ALTER TABLE [dbo].[ADMIN_INFO] ADD CONSTRAINT [PK_ADMIN_INFO_ID] PRIMARY KEY CLUSTERED ([AdminID]) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [ADMIN_USERNAME] ON [dbo].[ADMIN_INFO] ([UserName]) ON [PRIMARY] GO
  • 12. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.CRITERIA_RESULT Author: Stephen Copyright 2017 - All Rights Reserved Page 12 of 42 [dbo].[CRITERIA_RESULT] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[CRITERIA_RESULT] ( [CriteriaResultID] [int] NOT NULL IDENTITY(1, 1), [PatientID] [int] NOT NULL, [CriteriaID] [int] NOT NULL, [QualifierType] [varchar] (30) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [QualifierDate] [date] NOT NULL, [Status] [int] NULL, [CriteriaComment] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 27 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity CriteriaResultID int 4 False 1 - 1 PatientID int 4 False CriteriaID int 4 False QualifierType varchar(30) 30 False QualifierDate date 3 False Status int 4 True CriteriaComment varchar(1000) 1000 True Key Name Key Columns Unique PK_CRITERIA_RESULT_ID CriteriaResultID True CRITERIA_RESULTID PatientID, CriteriaResultID True
  • 13. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.CRITERIA_RESULT Author: Stephen Copyright 2017 - All Rights Reserved Page 13 of 42 GO ALTER TABLE [dbo].[CRITERIA_RESULT] ADD CONSTRAINT [PK_CRITERIA_RESULT_ID] PRIMARY KEY CLUSTERED ([CriteriaResultID]) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [CRITERIA_RESULTID] ON [dbo].[CRITERIA_RESULT] ([PatientID], [CriteriaResultID]) ON [PRIMARY] GO Used By [dbo].[ProcessPatientsInCompliance] [dbo].[ProcessPatientsNotInCompliance] [dbo].[ProcessMeasuresInCompliance]
  • 14. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.DIAGNOSIS Author: Stephen Copyright 2017 - All Rights Reserved Page 14 of 42 [dbo].[DIAGNOSIS] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[DIAGNOSIS] ( [DiagnosisID] [int] NOT NULL IDENTITY(1, 1), [DiagnosisName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [DiagnosisType] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[DIAGNOSIS] ADD CONSTRAINT [PK_DIAGNOSIS_ID] PRIMARY KEY CLUSTERED ([DiagnosisID]) ON [PRIMARY] GO Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 17 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity DiagnosisID int 4 False 1 - 1 DiagnosisName varchar(50) 50 False DiagnosisType varchar(20) 20 False Key Name Key Columns Unique PK_DIAGNOSIS_ID DiagnosisID True
  • 15. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.INSURANCE_PROVIDER Author: Stephen Copyright 2017 - All Rights Reserved Page 15 of 42 [dbo].[INSURANCE_PROVIDER] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[INSURANCE_PROVIDER] ( [InsuranceID] [int] NOT NULL IDENTITY(1, 1), [InsuranceProviderName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[INSURANCE_PROVIDER] ADD CONSTRAINT [PK_INSURANCE_PROVIDER_ID] PRIMARY KEY CLUSTERED ([InsuranceID]) ON [PRIMARY] GO Used By [dbo].[Import_ToPatientTable] Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 377 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:42:27 AM Thursday, October 3, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity InsuranceID int 4 False 1 - 1 InsuranceProviderName varchar(50) 50 False Key Name Key Columns Unique PK_INSURANCE_PROVIDER_ID InsuranceID True
  • 16. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURE_CRITERIA Author: Stephen Copyright 2017 - All Rights Reserved Page 16 of 42 [dbo].[MEASURE_CRITERIA] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[MEASURE_CRITERIA] ( [CriteriaID] [int] NOT NULL IDENTITY(1, 1), [MeasureID] [int] NOT NULL, [CriteriaName] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [CriteriaDate] [date] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[MEASURE_CRITERIA] ADD CONSTRAINT [PK_CRITERIA_ID] PRIMARY KEY CLUSTERED ([CriteriaID]) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [MEASURE_CRITERIA] ON [dbo].[MEASURE_CRITERIA] ([MeasureID], [CriteriaID]) ON [PRIMARY] GO Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 14 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity CriteriaID int 4 False 1 - 1 MeasureID int 4 False CriteriaName varchar(60) 60 False CriteriaDate date 3 True Key Name Key Columns Unique PK_CRITERIA_ID CriteriaID True MEASURE_CRITERIA MeasureID, CriteriaID True
  • 17. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURE_CRITERIA Author: Stephen Copyright 2017 - All Rights Reserved Page 17 of 42 Used By [dbo].[ProcessPatientsInCompliance] [dbo].[ProcessPatientsNotInCompliance] [dbo].[ProcessMeasuresInCompliance]
  • 18. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURES Author: Stephen Copyright 2017 - All Rights Reserved Page 18 of 42 [dbo].[MEASURES] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[MEASURES] ( [MeasureID] [int] NOT NULL IDENTITY(1, 1), [MeasureName] [varchar] (60) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [MeasureCd] [varchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [DiagnosisID] [int] NOT NULL, [MeasureType] [varchar] (8) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 14 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 8:25:00 AM Monday, July 1, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity MeasureID int 4 False 1 - 1 MeasureName varchar(60) 60 False MeasureCd varchar(20) 20 False DiagnosisID int 4 False MeasureType varchar(8) 8 True MeasureGreaterThanAge int 4 True MeasureLessThanAge int 4 True SexCd char(1) 1 True MeasureGreaterThanMonth int 4 True MeasureLessThanMonth int 4 True TargetCompliancePct decimal(5,2) 5 True Key Name Key Columns Unique PK_MEASURE_ID MeasureID True
  • 19. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.MEASURES Author: Stephen Copyright 2017 - All Rights Reserved Page 19 of 42 [MeasureGreaterThanAge] [int] NULL, [MeasureLessThanAge] [int] NULL, [SexCd] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [MeasureGreaterThanMonth] [int] NULL, [MeasureLessThanMonth] [int] NULL, [TargetCompliancePct] [decimal] (5, 2) NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[MEASURES] ADD CONSTRAINT [PK_MEASURE_ID] PRIMARY KEY CLUSTERED ([MeasureID]) ON [PRIMARY] GO Used By [dbo].[CreatePatientDiagnosisAgeRows ] [dbo].[ProcessPatientsInCompliance] [dbo].[ProcessPatientsNotInCompliance] [dbo].[ProcessMeasuresInCompliance]
  • 20. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENT_DIAGNOSIS Author: Stephen Copyright 2017 - All Rights Reserved Page 20 of 42 [dbo].[PATIENT_DIAGNOSIS] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[PATIENT_DIAGNOSIS] ( [PatientDiagnosisID] [int] NOT NULL IDENTITY(1, 1), [PatientID] [int] NOT NULL, [DiagnosisID] [int] NOT NULL, [DiagnosisDate] [date] NOT NULL, [ExpirationDate] [date] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[PATIENT_DIAGNOSIS] ADD CONSTRAINT [PK_PATIENT_DIAGNOSIS_ID] PRIMARY KEY CLUSTERED ([PatientDiagnosisID]) ON [PRIMARY] GO Used By [dbo].[CreatePatientDiagnosisAgeRows ] Property Value Row Count (~) 3129 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity PatientDiagnosisID int 4 False 1 - 1 PatientID int 4 False DiagnosisID int 4 False DiagnosisDate date 3 False ExpirationDate date 3 True Key Name Key Columns Unique PK_PATIENT_DIAGNOSIS_ID PatientDiagnosisID True
  • 21. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENT_DIAGNOSIS Author: Stephen Copyright 2017 - All Rights Reserved Page 21 of 42 [dbo].[ProcessPatientsInCompliance] [dbo].[ProcessPatientsNotInCompliance] [dbo].[Import_ToDiagnosisTable] [dbo].[ProcessMeasuresInCompliance]
  • 22. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS Author: Stephen Copyright 2017 - All Rights Reserved Page 22 of 42 [dbo].[PATIENTS] Properties Columns Indexes Triggers Property Value Collation SQL_Latin1_General_CP1_CI_AS Row Count (~) 62 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:03:54 AM Monday, October 7, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity Default PatientID int 4 False 1 - 1 ChartNum varchar(50) 50 False FirstName varchar(50) 50 False LastName varchar(50) 50 False MiddleInitial char(1) 1 True FullName varchar(100) 100 True DOB date 3 False SexCd char(1) 1 True EmailAddress varchar(100) 100 True Telephone varchar(40) 40 True InsuranceNumber varchar(50) 50 False ('NO INSURANCE') InsuranceID int 4 True AgeYears int 4 True AgeMonths int 4 True ProviderFullName varchar(100) 100 True Key Name Key Columns Unique PK_PATIENTS_ID PatientID True CHARTNUM_MRN ChartNum True Name ANSI Nulls On Quoted Identifier On On
  • 23. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS Author: Stephen Copyright 2017 - All Rights Reserved Page 23 of 42 SQL Script CREATE TABLE [dbo].[PATIENTS] ( [PatientID] [int] NOT NULL IDENTITY(1, 1), [ChartNum] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [FirstName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [LastName] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL, [MiddleInitial] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [FullName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [DOB] [date] NOT NULL, [SexCd] [char] (1) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [EmailAddress] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Telephone] [varchar] (40) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [InsuranceNumber] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL CONSTRAINT [Insurance_def] DEFAULT ('NO INSURANCE'), [InsuranceID] [int] NULL, [AgeYears] [int] NULL, [AgeMonths] [int] NULL, [ProviderFullName] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ) ON [PRIMARY] GO CREATE TRIGGER [dbo].[PATIENT_INSERTUPDATE] ON [dbo].[PATIENTS] FOR INSERT, UPDATE AS DECLARE @FirstName varchar(50), @LastName varchar(50), @MiddleInitial varchar(50), @DisplayName varchar(100), @DOB date, @CurrentYear char(4), @DOBMonth char(2), @DecemberDate date, @AgeYears int, @Count int, @AgeMonths int SELECT @Count = COUNT(*) FROM DELETED; --This will be 0 for Insert select @DOB = inserted.DOB from inserted; if UPDATE(DOB) BEGIN Select @CurrentYear = year(getdate()) ; Select @DOBMonth = month(@DOB) ; Select @DecemberDate = @CurrentYear + '-12-31' select @AgeYears = datediff (year, convert (datetime, @DOB), @DecemberDate ) PATIENT_INSERTUPDATE True True After Insert Update
  • 24. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.PATIENTS Author: Stephen Copyright 2017 - All Rights Reserved Page 24 of 42 Select @AgeMonths = 12 - @DOBMonth UPDATE PATIENTS SET AgeYears = @AgeYears, AgeMonths = @AgeMonths FROM inserted WHERE inserted.PatientID = PATIENTS.PatientID END /*Now update the FULLNAME */ select @FirstName = inserted.FirstName, @LastName = inserted.LastName, @MiddleInitial = RTRIM(LTRIM(inserted.MiddleInitial)) from inserted; if UPDATE(FirstName) OR UPDATE(LastName) or UPDATE(MiddleInitial) OR @Count <=0 BEGIN If NOT @FirstName IS NULL Select @DisplayName = @FirstName + ' ' If NOT @MiddleInitial IS NULL AND NOT @MiddleInitial = ' ' Select @DisplayName = @DisplayName + @MiddleInitial + ' ' If NOT @LastName IS NULL Select @DisplayName = @DisplayName + @LastName + ' ' Select @DisplayName = RTRIM(LTRIM(@DisplayName)) UPDATE PATIENTS SET FullName = @DisplayName FROM inserted WHERE inserted.PatientID = PATIENTS.PatientID END GO ALTER TABLE [dbo].[PATIENTS] ADD CONSTRAINT [PK_PATIENTS_ID] PRIMARY KEY CLUSTERED ([PatientID]) ON [PRIMARY] GO CREATE UNIQUE NONCLUSTERED INDEX [CHARTNUM_MRN] ON [dbo].[PATIENTS] ([ChartNum]) ON [PRIMARY] GO Used By [dbo].[CreatePatientDiagnosisAgeRows ] [dbo].[CalculatePatientAge] [dbo].[Import_ToDiagnosisTable] [dbo].[Import_ToPatientTable] [dbo].[ProcessMeasuresInCompliance]
  • 25. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_- INCOMPLIANCE Author: Stephen Copyright 2017 - All Rights Reserved Page 25 of 42 [dbo].[REPORT_PATIENTS_INCOMPLIANCE] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[REPORT_PATIENTS_INCOMPLIANCE] ( [ReportPatientID] [int] NOT NULL IDENTITY(1, 1), [MeasureID] [int] NOT NULL, [ReportDate] [date] NOT NULL, [CriteriaID] [int] NOT NULL, [PatientID] [int] NOT NULL, [Status] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[REPORT_PATIENTS_INCOMPLIANCE] ADD CONSTRAINT [PK_REPORT_- PATIENTCOMPLIANT_ID] PRIMARY KEY CLUSTERED ([ReportPatientID]) ON [PRIMARY] GO Property Value Row Count (~) 26 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity ReportPatientID int 4 False 1 - 1 MeasureID int 4 False ReportDate date 3 False CriteriaID int 4 False PatientID int 4 False Status int 4 False Key Name Key Columns Unique PK_REPORT_PATIENTCOMPLIANT_ID ReportPatientID True
  • 26. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_- INCOMPLIANCE Author: Stephen Copyright 2017 - All Rights Reserved Page 26 of 42 Used By [dbo].[ProcessPatientsInCompliance]
  • 27. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_- NOTINCOMPLIANCE Author: Stephen Copyright 2017 - All Rights Reserved Page 27 of 42 [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE] Properties Columns Indexes SQL Script CREATE TABLE [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE] ( [ReportPatientID] [int] NOT NULL IDENTITY(1, 1), [MeasureID] [int] NOT NULL, [ReportDate] [date] NOT NULL, [CriteriaID] [int] NOT NULL, [PatientID] [int] NOT NULL, [Status] [int] NOT NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE] ADD CONSTRAINT [PK_REPORT_- MEASURECRIT_ID] PRIMARY KEY CLUSTERED ([ReportPatientID]) ON [PRIMARY] GO Property Value Row Count (~) 3678 Created 10:07:11 AM Tuesday, June 25, 2013 Last Modified 10:07:11 AM Tuesday, June 25, 2013 Key Name Data Type Max Length (Bytes) Allow Nulls Identity ReportPatientID int 4 False 1 - 1 MeasureID int 4 False ReportDate date 3 False CriteriaID int 4 False PatientID int 4 False Status int 4 False Key Name Key Columns Unique PK_REPORT_MEASURECRIT_ID ReportPatientID True
  • 28. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Tables > dbo.REPORT_PATIENTS_- NOTINCOMPLIANCE Author: Stephen Copyright 2017 - All Rights Reserved Page 28 of 42 Used By [dbo].[ProcessPatientsNotInCompliance]
  • 29. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures Author: Stephen Copyright 2017 - All Rights Reserved Page 29 of 42 Stored Procedures Objects Name dbo.CreatePatientDiagnosisAgeRows dbo.ProcessPatientsInCompliance dbo.ProcessPatientsNotInCompliance
  • 30. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.CreatePatientDiagnosisAgeRows Author: Stephen Copyright 2017 - All Rights Reserved Page 30 of 42 [dbo].[CreatePatientDiagnosisAgeRows ] Properties SQL Script create PROCEDURE [dbo].[CreatePatientDiagnosisAgeRows ] AS declare @Message varchar(40), @MeasureGreaterThanAge int = 0, @MeasureGreaterThanMonth int = 0, @MeasureLessThanAge int = 0, @MeasureLessThanMonth int = 0, @SexCd char(1), @SexCdTest char(1) = 'N', @MeasureID int = 0, @DiagnosisID int = 0, @PatientID int = 0, @Quantity int = 0, @ProcessRecord int = 0 --First delete all rows associated with an age Diagnosis DELETE dbo.Patient_diagnosis FROM dbo.Patient_diagnosis a, dbo.Measures b where a.diagnosisID = b.diagnosisID and b.MeasureType = 'Age' DECLARE Measure_cursor CURSOR FOR Select MeasureID ,DiagnosisID ,MeasureGreaterThanAge ,MeasureLessThanAge ,MeasureGreaterThanMonth ,MeasureLessThanMonth ,SexCd Property Value ANSI Nulls On True Quoted Identifier On True
  • 31. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.CreatePatientDiagnosisAgeRows Author: Stephen Copyright 2017 - All Rights Reserved Page 31 of 42 from dbo.MEASURES where MeasureType = 'AGE' ; OPEN Measure_cursor ; FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID ,@MeasureGreaterThanAge ,@MeasureLessThanAge ,@MeasureGreaterThanMonth ,@MeasureLessThanMonth ,@SexCd WHILE @@FETCH_STATUS = 0 BEGIN Print ' ' Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID) Set @ProcessRecord = 0 Select @SexCdTest = 'N' if @SexCd = 'M' OR @SexCd = 'F' Select @SexCdTest = 'Y' If @MeasureGreaterThanAge = 0 AND @MeasureLessThanAge = 1 -- This is a Special Case for less than 12 months BEGIN INSERT INTO PATIENT_DIAGNOSIS (PatientID, DiagnosisID, DiagnosisDate, ExpirationDate) ( Select PatientID ,@DiagnosisID ,GETDATE() ,'1900-01-01' from dbo.Patients b WHERE (AgeYears = 0 and AgeMonths <> 0) AND (AgeMonths < @MeasureLessThanMonth ) AND (AgeMonths > @MeasureGreaterThanMonth ) ) INSERT INTO PATIENT_DIAGNOSIS (PatientID, DiagnosisID, DiagnosisDate, ExpirationDate) ( Select PatientID ,@DiagnosisID ,GETDATE() ,'1900-01-01'
  • 32. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.CreatePatientDiagnosisAgeRows Author: Stephen Copyright 2017 - All Rights Reserved Page 32 of 42 from dbo.Patients b WHERE (AgeYears = 0 and AgeMonths = 0) AND (AgeMonths = @MeasureLessThanMonth ) AND (AgeMonths = @MeasureGreaterThanMonth ) ) Set @ProcessRecord = 1 Print ' Entering Age 0 logic' END if @SexCdTest = 'Y' and @ProcessRecord = 0 BEGIN INSERT INTO PATIENT_DIAGNOSIS (PatientID, DiagnosisID, DiagnosisDate, ExpirationDate) ( Select PatientID ,@DiagnosisID ,GETDATE() ,'1900-01-01' from dbo.Patients b WHERE AgeYears > @MeasureGreaterThanAge AND AgeYears < @MeasureLessThanAge AND (AgeMonths > @MeasureGreaterThanMonth OR (@MeasureGreaterThanMonth IS NULL OR @MeasureGreaterThanMonth = 0)) AND (AgeMonths < @MeasureLessThanMonth OR (@MeasureLessThanMonth IS NULL)) AND SexCd = @SexCd ) END --Dont test sex code in this case -- if @SexCdTest = 'N' and @ProcessRecord = 0 BEGIN INSERT INTO PATIENT_DIAGNOSIS (PatientID, DiagnosisID, DiagnosisDate, ExpirationDate) ( Select PatientID ,@DiagnosisID ,GETDATE() ,'1900-01-01' from dbo.Patients b WHERE AgeYears > @MeasureGreaterThanAge AND AgeYears < @MeasureLessThanAge AND (AgeMonths > @MeasureGreaterThanMonth OR (@MeasureGreaterThanMonth IS NULL OR @MeasureGreaterThanMonth = 0)) AND (AgeMonths < @MeasureLessThanMonth OR (@MeasureLessThanMonth IS NULL))
  • 33. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.CreatePatientDiagnosisAgeRows Author: Stephen Copyright 2017 - All Rights Reserved Page 33 of 42 ) END -- Get the next Measure Record. FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID ,@MeasureGreaterThanAge ,@MeasureLessThanAge ,@MeasureGreaterThanMonth ,@MeasureLessThanMonth ,@SexCd END CLOSE Measure_cursor ; DEALLOCATE Measure_cursor ; GO Uses [dbo].[MEASURES] [dbo].[PATIENT_DIAGNOSIS] [dbo].[PATIENTS]
  • 34. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 34 of 42 [dbo].[ProcessPatientsInCompliance] Properties SQL Script create PROCEDURE [dbo].[ProcessPatientsInCompliance] AS declare @CriteriaResultStatus int, @Message varchar(100), @TotalMeasureCount int = 0, @MeasureInComplianceFlag int = 0, @MeasureInComplianceCount int = 0, @MeasureNotInComplianceCount int = 0, @TotalPatientCount int = 0, @MeasureCriteriaCount int = 0, @CriteriaResultCount int = 0, @CriteriaPassCount int = 0, @CriteriaFailCount int = 0, @MeasureID int = 0, @DiagnosisID int = 0, @PatientID int = 0, @CritPatientID int = 0, @CriteriaID int = 0, @CriteriaResultID int = 0, @Quantity int = 0 delete from dbo.REPORT_PATIENTS_INCOMPLIANCE DECLARE Measure_cursor CURSOR FOR Select MeasureID, DiagnosisID from dbo.MEASURES --where MeasureID in (4) ; OPEN Measure_cursor ; FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID Property Value ANSI Nulls On True Quoted Identifier On True
  • 35. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 35 of 42 WHILE @@FETCH_STATUS = 0 BEGIN Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID) SET @MeasureInComplianceCount = 0; SET @MeasureInComplianceCount = 0; DECLARE PatientDiagnosis_cursor CURSOR FOR Select PatientID from dbo.PATIENT_DIAGNOSIS WHERE DiagnosisID = @DiagnosisID OPEN PatientDiagnosis_cursor; FETCH NEXT FROM PatientDiagnosis_cursor INTO @PatientID WHILE @@FETCH_STATUS = 0 BEGIN Print 'PatientID = ' + + CONVERT(varchar(10),@PatientID) SET @MeasureInComplianceFlag = 0 DECLARE MeasureCriteria_cursor CURSOR FOR Select c.CriteriaID, Status, PatientID from dbo.MEASURE_CRITERIA c LEFT OUTER JOIN dbo.CRITERIA_RESULT r ON c.CriteriaID = r.CriteriaID and PatientID = @PatientID WHERE MeasureID = @MeasureID OPEN MeasureCriteria_cursor; FETCH NEXT FROM MeasureCriteria_cursor INTO @CriteriaID, @CriteriaResultStatus, @CritPatientID WHILE @@FETCH_STATUS = 0 BEGIN Print 'CriteriaID = ' + + CONVERT(varchar(10),@CriteriaID) SET @TotalPatientCount = @TotalPatientCount + 1; SELECT @Message = ''; SET @MeasureCriteriaCount = 0; SET @CriteriaResultCount = 0; SET @CriteriaPassCount = 0 SET @CriteriaFailCount = 0
  • 36. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 36 of 42 if @CritPatientID IS NULL Begin --this means no Patient row for this criteria so this Measure is Not in compliance Print 'CritPatient is Null' SET @MeasureInComplianceFlag = 1; End /* Select CriteriaResultID = @CriteriaResultID, Status = @CriteriaResultStatus FROM dbo.CRITERIA_RESULT Where CriteriaID = @CriteriaID and PatientID = @PatientID */ SET @MeasureCriteriaCount = @MeasureCriteriaCount + 1; If @CriteriaResultStatus = 1 BEGIN SET @CriteriaPassCount = @CriteriaPassCount + 1; END If @CriteriaResultStatus != 1 BEGIN SET @CriteriaFailCount = @CriteriaFailCount + 1; END --99 means criteria is missing -- if @MeasureInComplianceFlag = 1 Select @CriteriaResultStatus = 99 if @MeasureInComplianceFlag = 0 AND @CriteriaResultStatus = 1 BEGIN INSERT INTO REPORT_PATIENTS_INCOMPLIANCE (MeasureID, ReportDate, CriteriaID, PatientID, Status) Values( @MeasureID ,GETDATE() ,@CriteriaID ,@PatientID ,@CriteriaResultStatus ) END FETCH NEXT FROM MeasureCriteria_cursor INTO @CriteriaID, @CriteriaResultStatus, @CritPatientID END CLOSE MeasureCriteria_cursor; DEALLOCATE MeasureCriteria_cursor;
  • 37. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 37 of 42 if @MeasureInComplianceFlag = 1 BEGIN SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1; END if @MeasureCriteriaCount = @CriteriaPassCount and @MeasureInComplianceFlag = 0 BEGIN SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1; END if @MeasureCriteriaCount != @CriteriaPassCount and @MeasureInComplianceFlag = 0 BEGIN SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1; END FETCH NEXT FROM PatientDiagnosis_cursor INTO @PatientID END CLOSE PatientDiagnosis_cursor ; DEALLOCATE PatientDiagnosis_cursor ; -- Get the next Measure Record. FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID END CLOSE Measure_cursor ; DEALLOCATE Measure_cursor ; --End Measure_cursor --Select 'Total Import = ' + CAST(@ImportCount AS char(5)) + ' Total Errors = ' + CAST(@ErrorCount AS char(5))+ --'Total Records = ' + CAST(@TotalCount AS char(5)); GO Uses [dbo].[CRITERIA_RESULT] [dbo].[MEASURE_CRITERIA] [dbo].[MEASURES] [dbo].[PATIENT_DIAGNOSIS] [dbo].[REPORT_PATIENTS_INCOMPLIANCE]
  • 38. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsNotInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 38 of 42 [dbo].[ProcessPatientsNotInCompliance] Properties SQL Script create PROCEDURE [dbo].[ProcessPatientsNotInCompliance] AS declare @CriteriaResultStatus int, @Message varchar(100), @TotalMeasureCount int = 0, @MeasureInComplianceFlag int = 0, @MeasureInComplianceCount int = 0, @MeasureNotInComplianceCount int = 0, @TotalPatientCount int = 0, @MeasureCriteriaCount int = 0, @CriteriaResultCount int = 0, @CriteriaPassCount int = 0, @CriteriaFailCount int = 0, @MeasureID int = 0, @DiagnosisID int = 0, @PatientID int = 0, @CritPatientID int = 0, @CriteriaID int = 0, @CriteriaResultID int = 0, @Quantity int = 0 delete from dbo.REPORT_PATIENTS_NOTINCOMPLIANCE DECLARE Measure_cursor CURSOR FOR Select MeasureID, DiagnosisID from dbo.MEASURES --where MeasureID in (4) ; OPEN Measure_cursor ; FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID Property Value ANSI Nulls On True Quoted Identifier On True
  • 39. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsNotInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 39 of 42 WHILE @@FETCH_STATUS = 0 BEGIN Print 'MeasureID = ' + CONVERT(varchar(10),@MeasureID) SET @MeasureInComplianceCount = 0; SET @MeasureNotInComplianceCount = 0; DECLARE PatientDiagnosis_cursor CURSOR FOR Select PatientID from dbo.PATIENT_DIAGNOSIS WHERE DiagnosisID = @DiagnosisID OPEN PatientDiagnosis_cursor; FETCH NEXT FROM PatientDiagnosis_cursor INTO @PatientID WHILE @@FETCH_STATUS = 0 BEGIN Print 'PatientID = ' + + CONVERT(varchar(10),@PatientID) SET @MeasureInComplianceFlag = 0 DECLARE MeasureCriteria_cursor CURSOR FOR Select c.CriteriaID, Status, PatientID from dbo.MEASURE_CRITERIA c LEFT OUTER JOIN dbo.CRITERIA_RESULT r ON c.CriteriaID = r.CriteriaID and PatientID = @PatientID WHERE MeasureID = @MeasureID OPEN MeasureCriteria_cursor; FETCH NEXT FROM MeasureCriteria_cursor INTO @CriteriaID, @CriteriaResultStatus, @CritPatientID WHILE @@FETCH_STATUS = 0 BEGIN Print 'CriteriaID = ' + + CONVERT(varchar(10),@CriteriaID) SET @TotalPatientCount = @TotalPatientCount + 1; SELECT @Message = ''; SET @MeasureCriteriaCount = 0; SET @CriteriaResultCount = 0; SET @CriteriaPassCount = 0 SET @CriteriaFailCount = 0
  • 40. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsNotInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 40 of 42 if @CritPatientID IS NULL Begin --this means no Patient row for this criteria so this Measure is Not in compliance Print 'CritPatient is Null' SET @MeasureInComplianceFlag = 1; End /* Select CriteriaResultID = @CriteriaResultID, Status = @CriteriaResultStatus FROM dbo.CRITERIA_RESULT Where CriteriaID = @CriteriaID and PatientID = @PatientID */ SET @MeasureCriteriaCount = @MeasureCriteriaCount + 1; If @CriteriaResultStatus = 1 BEGIN SET @CriteriaPassCount = @CriteriaPassCount + 1; END If @CriteriaResultStatus != 1 BEGIN SET @CriteriaFailCount = @CriteriaFailCount + 1; END --99 means criteria is missing -- if @MeasureInComplianceFlag = 1 Select @CriteriaResultStatus = 99 if @MeasureInComplianceFlag = 1 or @CriteriaResultStatus != 1 BEGIN INSERT INTO REPORT_PATIENTS_NOTINCOMPLIANCE (MeasureID, ReportDate, CriteriaID, PatientID, Status) Values( @MeasureID ,GETDATE() ,@CriteriaID ,@PatientID ,@CriteriaResultStatus ) END FETCH NEXT FROM MeasureCriteria_cursor INTO @CriteriaID, @CriteriaResultStatus, @CritPatientID END CLOSE MeasureCriteria_cursor; DEALLOCATE MeasureCriteria_cursor;
  • 41. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsNotInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 41 of 42 if @MeasureInComplianceFlag = 1 BEGIN SET @MeasureNotInComplianceCount = @MeasureNotInComplianceCount + 1; END if @MeasureCriteriaCount = @CriteriaPassCount and @MeasureInComplianceFlag = 0 BEGIN SET @MeasureInComplianceCount = @MeasureInComplianceCount + 1; END if @MeasureCriteriaCount != @CriteriaPassCount and @MeasureInComplianceFlag = 0 BEGIN SET @MeasureNotInComplianceCount = @MeasureNotInComplianceCount + 1; END FETCH NEXT FROM PatientDiagnosis_cursor INTO @PatientID END CLOSE PatientDiagnosis_cursor ; DEALLOCATE PatientDiagnosis_cursor ; -- Get the next Measure Record. FETCH NEXT FROM Measure_cursor INTO @MeasureID ,@DiagnosisID END CLOSE Measure_cursor ; DEALLOCATE Measure_cursor ; --End Measure_cursor --Select 'Total Import = ' + CAST(@ImportCount AS char(5)) + ' Total Errors = ' + CAST(@ErrorCount AS char(5))+ --'Total Records = ' + CAST(@TotalCount AS char(5)); GO Uses [dbo].[CRITERIA_RESULT] [dbo].[MEASURE_CRITERIA] [dbo].[MEASURES] [dbo].[PATIENT_DIAGNOSIS] [dbo].[REPORT_PATIENTS_NOTINCOMPLIANCE]
  • 42. Project > 208.109.119.78 > User databases > CAPSTONE_HEDIS > Programmability > Stored Procedures > dbo.ProcessPatientsNotInCompliance Author: Stephen Copyright 2017 - All Rights Reserved Page 42 of 42