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

242.1 Files compared

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

242.2 Comparison summary

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

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

242.4 Active regular expressions

No regular expressions were active.

242.5 Comparison detail

  1   USE [NWIC_ PanelMgmt]
  2   GO
  3  
  4   SET ANSI_N ULLS ON
  5   GO
  6  
  7   SET QUOTED _IDENTIFIE R ON
  8   GO
  9  
  10   IF (SELECT  OBJECT_ID ('App.NVCC _usp_GetCo nsults'))  IS NOT NUL
  11   DROP PROCE DURE App.N VCC_usp_Ge tConsults
  12   GO
  13  
  14   CREATE PRO CEDURE [Ap p].[NVCC_u sp_GetCons ults]
  15           --  Add the p arameters  for the st ored proce dure here
  16           @p id bigint  -- this is  the patie ntsid
  17  
  18   -- NOTICE:
  19   -- Do not  edit the s tored proc edure live  on the se rver. Code  to genera te
  20   -- the pro cedures is  stored in  the proje ct reposit ory. Any c hanges mad e
  21   -- that ar e not reco rded in th e reposito ry will be  overwritt en.
  22  
  23   AS
  24   --======== ========== ========== ========== ========== ========== ========== ========== ===
  25   --Requesto r                                : Non Va C oordinated  Care Proj ect
  26   --Author                  : Jerr y Kohler ( Original s cript by D r. Charles  Demosthen es)
  27   --Object/S P Name                  : NVCC_u sp_GetCons ults
  28   --SERVER                                    
D NS . U R        
  29   --Data Bas e                                : NWIC_Pan elMgmt
  30   --Schema                                    : app
  31   --Report                                    : N/A
  32   --Folder                                    : N/A
  33   --Report L oc             : N/A
  34   --Job                     : None
  35   --Job Loc                 : None
  36   --Note                    : 
  37   --Date Cre ated           : 01-1 2-2016
  38   --Last Cha nged           : 12-0 1-2016
  39   --Last Cha nged By                 : Brian  Diggs - No rthwest In novation C enter (NWI C)
  40   --Reason F or Change               : Conver t from usi ng [App].[ vPCMMPatie ntProvider s] to
  41   --                                                  :  [App].[PCM MCurrentPa tientProvi derRelatio nship]
  42   --
  43   --Last Cha nged           : 06-2 2-2016
  44   --Last Cha nged By                 : Brian  Diggs - No rthwest In novation C enter (NWI C)
  45   --Reason F or Change               : Bringi ng in prim ary provid er and oth er fields  to
  46   --                                                     be able to  recreate  bottom blo ck of cons ult.
  47   --                          Chan ge likely  done by Jo nathan Duc kart but w as
  48   --                          neve r synced w ith the so urce repos itory.
  49   --
  50   --Last Cha nged           : 01-1 2-2016  
  51   --Last Cha nged By                 : Jerry  Kohler - N orthwest I nnovation  Center (NW IC)
  52   --Reason F or Change               : Remove d station  parameter  in order t o expand t he search
  53   --                          for  a patient' s consults  from a si ngle stati on to any
  54   --                          stat ion a pati ent is ass ociated wi th.
  55   --
  56   --Purpose                 : Retr ieve a pat ient's con sults from  within th e last 180
  57   --                          days  for inclu sion into  NVCC docum entation.
  58   --======== ========== ========== ========== ========== ========== ========== ========== ===
  59  
  60   BEGIN
  61      -- SET  NOCOUNT ON  added to  prevent ex tra result  sets from
  62      -- inte rfering wi th SELECT  statements .
  63      SET NOC OUNT ON;
  64  
  65           WI TH
  66                    PTSI D AS (
  67                             SELECT  PTSid 
  68                             FROM [ App].[udf_ AllPatient sSIDs](@pi d)
  69                    )
  70      SELECT
  71         c.St a3n
  72        ,App. udf_Statio nName (c.S ta3n) AS S tationName
  73        ,c.To RequestSer viceName
  74        ,cast (c.Request DateTime a s date) AS  RequestDa te
  75        ,c.CP RSStatus
  76        ,c.CP RSOrderSID
  77        ,c.Co nsultsid
  78            , c.ConsultI EN
  79        ,c.Pa tientSID
  80        ,c.To RequestSer viceSID
  81        ,c.Re questType
  82            , c.OrderSta tusSID
  83        ,c.Re centActivi tyTypeSID
  84        ,c.Re centActivi tyType
  85            , c.SendingS taffSID
  86        ,c.Ur gency
  87        ,c.In patOutpat
  88            , iif(c.Prov isionalDia gnosis is  null, ' ',  c.Provisi onalDiagno sis) AS Pr ovDx
  89            , iif(c.Prov isionalDia gnosisCode  is null,  ' ', c.Pro visionalDi agnosisCod e) AS Prov DxCode
  90            , c.TIUDocum entSID
  91        ,c.Ea rliestDate
  92        ,r.Co nsultReaso n
  93            , l.Location Name as Fr omService
  94            ,  st.StaffN ame as Req uestingPro vider
  95            ,  pcmm.Prim aryProvide r
  96            ,  pcmm.Team
  97            ,  sp.Eligib ility + '  ' + sp.Eli gibilitySt atus as Pr imaryEligi bility
  98      FROM CD WWork.Con. Consult c
  99      JOIN CD WWork.SPat ient.SCons ultReason  r
  100                    ON r .ConsultSI D = c.Cons ultSID
  101           JO IN CDWWork .dim.Locat ion l
  102                    ON l .LocationS ID=c.FromL ocationSID
  103           JO IN CDWWork .SStaff.SS taff st
  104                    ON s t.StaffSid =c.Sending StaffSID
  105           LE FT JOIN (
  106                    SELE CT TOP 1 *  
  107                    FROM  
  108                             App.PC MMCurrentP atientProv iderRelati onship pp
  109                             INNER  JOIN PTSid
  110                                      ON pp.Pa tientSID =  PTSid.PTS id
  111                    ORDE R BY Relat ionshipSta rtDate DES C) pcmm
  112                    ON p cmm.Patien tSID=c.Pat ientSID
  113           JO IN CDWWork .SPatient. SPatient s p
  114                    ON s p.patientS ID=c.Patie ntSID
  115           IN NER JOIN P TSid ptsid
  116                    ON p tsid.PTSid  = c.Patie ntSID
  117      WHERE c .ToRequest ServiceNam e not like  'NON-FORM %' 
  118            A ND c.CPRSS tatus not  in ('DISCO NTINUED',' CANCELLED' ,'COMPLETE ') 
  119        AND c .RequestDa teTime >=  CAST(datea dd(dd, -36 5, getdate ()) AS DAT E)
  120      ORDER B Y c.reques tdatetime;
  121   END
  122   GO
  123  
  124   EXEC sp_Si gnAppObjec t 'NVCC_us p_GetConsu lts';
  125