Produced by Araxis Merge on 1/31/2018 9:02:08 AM Central 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | NVCC_2.2_01162018.zip\NVCC\Database\App\Stored Procedures | NVCC_usp_CurrentUsage.sql | Thu Oct 19 16:36:38 2017 UTC |
| 2 | NVCC_2.2_01162018.zip\NVCC\Database\App\Stored Procedures | NVCC_usp_CurrentUsage.sql | Mon Jan 29 17:18:28 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 152 |
| Changed | 1 | 4 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 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 = ' SERVER . URL ' AND Acce ssDateTime > dateadd (minute, - (@timefram e), LastTi me.LastTim estamp)) | |
| 43 | OR (HostNa me = 'vaww .refdoc. DNS ' AND Acce ssDateTime > dateadd (hour, 3, dateadd(mi nute, -(@t imeframe), LastTime. LastTimest amp)))) | |
| 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 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.