1. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 11/9/2017 10:44:34 AM Eastern Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

1.1 Files compared

# Location File Last Modified
1 REFDOC-v2.1.0.zip\NVCC\Database\App\Stored Procedures NVCC_usp_CurrentUsage.sql Thu Oct 19 17:36:38 2017 UTC
2 REFDOC-v2.1.0.zip\NVCC\Database\App\Stored Procedures NVCC_usp_CurrentUsage.sql Tue Nov 7 22:58:45 2017 UTC

1.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 152
Changed 1 4
Inserted 0 0
Removed 0 0

1.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

1.4 Active regular expressions

No regular expressions were active.

1.5 Comparison detail

  1   CREATE PRO CEDURE [Ap p].[NVCC_u sp_Current Usage]
  2           --  @timefram e is the n umber of m inutes (po sitive) to  look back wards for  usage
  3           @t imeframe n umeric
  4   AS
  5   --======== ========== ========== ========== ========== ========== ========== ========== ====
  6   --Requesto r              : Non  Va Coordin ated Care  Project
  7   --Author                  : Bria n Diggs
  8   --Object/S P Name         : NVCC _usp_Curre ntUsage
  9   --Server                  : 
  10   --Data Bas e              : CC_R EFDOC
  11   --Schema                  : App
  12   --Report                  : N/A
  13   --Folder                  : N/A
  14   --Report L oc             : N/A
  15   --Job                     : None
  16   --Job Loc                 : None
  17   --Note                    : 
  18   --Date Cre ated           : 06-0 1-2016
  19   --
  20   --Last Cha nged           : 2017 -03-29
  21   --Last Cha nged By                 : Brian  Diggs (Nor thwest Inn ovation Ce nter)
  22   --Reason F or Change               : Tempor ary workar ound for d ifferent s ervers rec ording tim estamp
  23   --                          in l ocal time
  24   --
  25   --Purpose                 : To g et most re cent users /usage
  26   --======== ========== ========== ========== ========== ========== ========== ========== ====
  27   --Uses: Ap p.NVCC_Acc essLog
  28   BEGIN
  29           WI TH
  30                    -- 2  hour shif t due to d ifferences  in timezo nes of SQL  server an d applicat ion server
  31                    Last Time AS (S ELECT DATE ADD(hour,  -2, getdat e()) AS La stTimestam p),
  32                    -- P ull the lo g entries  for this t ime frame  to use as  a source f or the oth er queries
  33                    Rece ntLogs AS  (
  34                             SELECT  
  35                                      HostName ,
  36                                      UserID,
  37                                      AccessDa teTime,
  38                                      [Action] ,
  39                                      ElapsedT ime
  40                             FROM A pp.NVCC_Ac cessLog
  41                             CROSS  JOIN LastT ime
  42                              WHERE ((Ho stName = ' DNS . URL         ' AND Acce ssDateTime  > dateadd (minute, - (@timefram e), LastTi me.LastTim estamp))
  43                                       OR (HostNa me = ' DNS . URL  AND Acces sDateTime  > dateadd( hour, 3, d ateadd(min ute, -(@ti meframe),  LastTime.L astTimesta mp))))
  44                                      AND Host Name IS NO T NULL
  45                                      AND Acce ssDateTime  IS NOT NU LL
  46                    )
  47                    SELE CT
  48                             Users. HostName,
  49                             Users. UserID,
  50                             Users. LastLogged Event,
  51                             Time.M eanLookupT ime,
  52                             Users. NumberLook ups,
  53                             Users. NumberPack ages
  54                    FROM  (
  55                             -- For  each comb ination of  host/user , compute  some stati stics
  56                             SELECT
  57                                      HostName
  58                                      UserID,
  59                                      MAX(Acce ssDateTime ) AS LastL oggedEvent ,
  60                                      SUM(CASE  WHEN Acti on = 'Pati entProfile ' THEN 1 E LSE 0 END)  AS Number Lookups, 
  61                                      SUM(CASE  WHEN Acti on = 'PDF'  THEN 1 EL SE 0 END)  AS NumberP ackages
  62                             FROM R ecentLogs
  63                             GROUP  BY HostNam e, UserID
  64                    ) AS  Users
  65                    LEFT  JOIN (
  66                             -- Mea nLookupTim e is more  easily com puted sepa rately bec ause it
  67                             -- nee ds just a  subset of  the data
  68                             SELECT
  69                                      HostName , UserID,  AVG(Elapse dTime) AS  MeanLookup Time
  70                             FROM R ecentLogs
  71                             WHERE  Action IS  NOT NULL A ND Action  = 'Patient Profile' 
  72                             GROUP  BY HostNam e, UserID
  73                    ) AS  Time
  74                             ON Use rs.Hostnam e = Time.H ostName an d Users.Us erID = Tim e.UserID
  75                    ORDE R BY
  76                             HostNa me,
  77                             LastLo ggedEvent  DESC
  78   END