238. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/22/2018 9:28:20 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.

238.1 Files compared

# Location File Last Modified
1 REFDOC_2.3_06072018.zip\REFDOC 2.3_06072018\NVCC\SQL NVCC_usp_CurrentUsage.sql Thu Jun 7 16:53:36 2018 UTC
2 REFDOC_2.3_06072018.zip\REFDOC 2.3_06072018\NVCC\SQL NVCC_usp_CurrentUsage.sql Fri Jun 22 12:28:51 2018 UTC

238.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 146
Changed 2 6
Inserted 0 0
Removed 0 0

238.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

238.4 Active regular expressions

No regular expressions were active.

238.5 Comparison detail

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