1. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 8/29/2017 11:27:24 AM Eastern Daylight 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-devel-20170714.zip\NVCC\Database\App\Stored Procedures NVCC_usp_CurrentUsage.sql Fri Jul 14 21:26:46 2017 UTC
2 REFDOC-devel-20170714.zip\NVCC\Database\App\Stored Procedures NVCC_usp_CurrentUsage.sql Fri Aug 25 21:12:36 2017 UTC

1.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 142
Changed 1 2
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                             FROM A pp.NVCC_Ac cessLog
  36                             CROSS  JOIN LastT ime
  37                              WHERE ((Ho stName = ' DND . URL         ' AND Acce ssDateTime  > dateadd (minute, - (@timefram e), LastTi me.LastTim estamp))
  38                                      OR (Host Name = 'va ww.refdoc. va.gov' AN D AccessDa teTime > d ateadd(hou r, 3, date add(minute , -(@timef rame), Las tTime.Last Timestamp) )))
  39                    )
  40                    SELE CT
  41                             Users. HostName,
  42                             Users. UserID,
  43                             Users. LastLogged Event,
  44                             Time.M eanLookupT ime,
  45                             Users. NumberLook ups,
  46                             Users. NumberPack ages
  47                    FROM  (
  48                             -- For  each comb ination of  host/user , compute  some stati stics
  49                             SELECT
  50                                      HostName
  51                                      UserID,
  52                                      MAX(Acce ssDateTime ) AS LastL oggedEvent ,
  53                                      SUM(CASE  WHEN Acti on = 'Pati entProfile ' THEN 1 E LSE 0 END)  AS Number Lookups, 
  54                                      SUM(CASE  WHEN Acti on = 'PDF'  THEN 1 EL SE 0 END)  AS NumberP ackages
  55                             FROM R ecentLogs
  56                             GROUP  BY HostNam e, UserID
  57                    ) AS  Users
  58                    LEFT  JOIN (
  59                             -- Mea nLookupTim e is more  easily com puted sepa rately bec ause it
  60                             -- nee ds just a  subset of  the data
  61                             SELECT
  62                                      HostName , UserID,  AVG(Elapse dTime) AS  MeanLookup Time
  63                             FROM R ecentLogs
  64                             WHERE  Action = ' PatientPro file'
  65                             GROUP  BY HostNam e, UserID
  66                    ) AS  Time
  67                             ON Use rs.Hostnam e = Time.H ostName an d Users.Us erID = Tim e.UserID
  68                    ORDE R BY
  69                             HostNa me,
  70                             LastLo ggedEvent  DESC
  71   END
  72