Produced by Araxis Merge on 8/29/2017 11:27:39 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | REFDOC-devel-20170714.zip\NVCC\SQL | NVCC_usp_GetProbs.sql | Fri Jul 14 21:27:02 2017 UTC |
| 2 | REFDOC-devel-20170714.zip\NVCC\SQL | NVCC_usp_GetProbs.sql | Mon Aug 28 18:30:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 300 |
| Changed | 1 | 2 |
| 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 | 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_GetPr obs')) IS NOT NULL | |
| 11 | DROP PROCE DURE App.N VCC_usp_Ge tProbs | |
| 12 | GO | |
| 13 | ||
| 14 | CREATE PRO CEDURE [Ap p].[NVCC_u sp_GetProb s] | |
| 15 | -- Add the p arameters for the st ored proce dure here | |
| 16 | @p id bigint -- this is the patie ntsid | |
| 17 | AS | |
| 18 | --======== ========== ========== ========== ========== ========== ========== ========== === | |
| 19 | --Requesto r : Non Va C oordinated Care Proj ect | |
| 20 | --Author : Jerr y Kohler - Northwest Innovatio n Center ( NWIC) | |
| 21 | --Object/S P Name : NVCC_u sp_GetProb s | |
| 22 | --SERVER : DNS DN SURL | |
| 23 | --Data Bas e : NWIC_Pan elMgmt | |
| 24 | --Schema : app | |
| 25 | --Report : N/A | |
| 26 | --Folder : N/A | |
| 27 | --Report L oc : N/A | |
| 28 | --Job : None | |
| 29 | --Job Loc : None | |
| 30 | --Note : | |
| 31 | --Date Cre ated : 01-1 4-2016 | |
| 32 | -- | |
| 33 | --Last Cha nged : 03-1 6-2016 | |
| 34 | --Last Cha nged By : Jerry Kohler - N orthwest I nnovation Center (NW IC) | |
| 35 | --Reason F or Change : TFS Pr oject NVCC , item num ber 1368 - Eliminate | |
| 36 | -- dupl icate prob lem codes (Brian Dig gs). | |
| 37 | -- | |
| 38 | --Last Cha nged : 02-1 8-2016 | |
| 39 | --Last Cha nged By : Jerry Kohler - N orthwest I nnovation Center (NW IC) | |
| 40 | --Reason F or Change : Reques t to also provide th e station and statio n | |
| 41 | -- name . | |
| 42 | -- | |
| 43 | --Last Cha nged : 01-1 9-2016 | |
| 44 | --Last Cha nged By : Jerry Kohler - N orthwest I nnovation Center (NW IC) | |
| 45 | --Reason F or Change : Restru ctured the procedure into a CT E and sing le | |
| 46 | -- SELE CT stateme nt. Added DISTINCT to elimina te | |
| 47 | -- dupl icate retu rned rows, and tuned for perfo rmance. | |
| 48 | -- | |
| 49 | --Changed : 01-1 4-2016 | |
| 50 | --Changed By : Jerry Kohl er - North west Innov ation Cent er (NWIC) | |
| 51 | --Reason F or Change : Remove d station parameter in order t o expand t he search | |
| 52 | -- for a patient' s consults from a si ngle stati on to any | |
| 53 | -- stat ion a pati ent is ass ociated wi th. | |
| 54 | -- | |
| 55 | --Purpose : Retr ieve a pat ient's act ive proble m lists fo r provider | |
| 56 | -- revi ew while c ompiling N VCC docume ntation. | |
| 57 | --======== ========== ========== ========== ========== ========== ========== ========== === | |
| 58 | BEGIN | |
| 59 | --declare @station i nt; set @s tation=508 ; declare @pid bigin t; set @pi d=1717444; declare @ sflag int; set @sfla g=1; | |
| 60 | -- SET NOCOU NT ON adde d to preve nt extra r esult sets from | |
| 61 | -- interferi ng with SE LECT state ments. | |
| 62 | SET NOC OUNT ON; | |
| 63 | ||
| 64 | --DECLARE @PID INT = 24257470 --zzteleh ealth pati ent with t ons of dat a | |
| 65 | ||
| 66 | ; | |
| 67 | WITH PT Probs0 (St a3n, Stati onName, Pr oblemListS ID, Patien tSID, ICD9 SID, ICD10 SID, RN, L astModifie dDate) AS | |
| 68 | ( | |
| 69 | SELE CT p.Sta3n | |
| 70 | ,App.udf _StationNa me (p.Sta3 n) AS Stat ionName | |
| 71 | ,p.Probl emListSID | |
| 72 | ,p.Patie ntSID | |
| 73 | ,p.ICD9S ID | |
| 74 | ,p.ICD10 SID | |
| 75 | ,RN = CA SE | |
| 76 | When ICD9SID < > 0 | |
| 77 | T hen ROW_NU MBER() OVE R (PARTITI ON BY p.IC D9SID ORD ER BY p.La stModified Date DESC) | |
| 78 | When ICD10SID <> 0 | |
| 79 | T hen ROW_NU MBER() OVE R (PARTITI ON BY p.IC D10SID ORD ER BY p.La stModified Date DESC) | |
| 80 | Else -999 | |
| 81 | End | |
| 82 | ,p.LastM odifiedDat e | |
| 83 | FROM CDWWork.O utpat.Prob lemList p | |
| 84 | WHER E p.patien tsid IN (S elect PtSI D From App .udf_AllPa tientsSIDs (@pid)) | |
| 85 | AN D p.Active Flag = 'A' | |
| 86 | AN D probleml istconditi on <> 'H' | |
| 87 | ), | |
| 88 | ||
| 89 | PTPro bs1 (Sta3n , StationN ame, ICDCo de, ICDVer sion, Prob lemListSID , Problem, LastModif iedDate ,R N, Sensiti veDx, Abus eDx, Sickl eDx, HIVDx ) AS | |
| 90 | ( | |
| 91 | SELE CT p.Sta3n | |
| 92 | ,p.Stati onName | |
| 93 | ,i.ICD9C ode AS ICD Code | |
| 94 | ,'ICD9' AS ICDVers ion | |
| 95 | ,p.Probl emListSID | |
| 96 | ,left(i. ICD9Diagno sisText,50 ) AS Probl em | |
| 97 | ,p.LastM odifiedDat e | |
| 98 | ,ROW_NUM BER() OVER (PARTITIO N BY left( i.ICD9Diag nosisText, 50) ORDER BY p.LastM odifiedDat e DESC) AS RN | |
| 99 | , CASE WHEN dx.I CDSID is N OT NULL TH EN 1 ELSE 0 END AS S ensitiveDx | |
| 100 | , dx.A buseDx | |
| 101 | , dx.S ickleDx | |
| 102 | , dx.H IVDx | |
| 103 | FROM PTProbs0 p | |
| 104 | left outer joi n PanelMgm t.vICD9 i on p.ICD9S ID = i.ICD 9SID | |
| 105 | LEFT OUTER JOIN [NWI C_PanelMgm t].[App].[ NVCC_Sensi tiveDxCode s] dx | |
| 106 | on dx.ICDS ID = p.ICD 9SID | |
| 107 | WHER E p.ICD9SI D <> 0 | |
| 108 | AN D p.RN = 1 | |
| 109 | ||
| 110 | UNIO N ALL | |
| 111 | ||
| 112 | SELE CT p.Sta3n | |
| 113 | ,p.Stati onName | |
| 114 | ,k.ICD10 Code AS IC DCode | |
| 115 | ,'ICD10' AS IC DVersion | |
| 116 | ,p.Probl emListSID | |
| 117 | ,left(k. ICD10Diagn osisText,5 0) AS Prob lem | |
| 118 | ,p.LastM odifiedDat e | |
| 119 | ,ROW_NUM BER() OVER (PARTITIO N BY left( k.ICD10Dia gnosisText ,50) ORDER BY p.Last ModifiedDa te DESC) A S RN | |
| 120 | , CASE WHEN dx.I CDSID is N OT NULL TH EN 1 ELSE 0 END AS S ensitiveDx | |
| 121 | , dx.A buseDx | |
| 122 | , dx.S ickleDx | |
| 123 | , dx.H IVDx | |
| 124 | FROM PTProbs0 p | |
| 125 | left outer joi n PanelMgm t.vICD10 k on p.ICD1 0SID = k.I CD10SID | |
| 126 | LEFT OUT ER JOIN [N WIC_PanelM gmt].[App] .[NVCC_Sen sitiveDxCo des] dx | |
| 127 | on dx.ICDS ID = p.ICD 10SID | |
| 128 | WHER E p.ICD10S ID <> 0 | |
| 129 | AN D p.RN = 1 | |
| 130 | ) | |
| 131 | ||
| 132 | SELECT Sta3n | |
| 133 | , StationNam e | |
| 134 | , ICDCode | |
| 135 | , ICDVersion | |
| 136 | , ProblemLis tSID | |
| 137 | , Problem | |
| 138 | , LastModifi edDate | |
| 139 | ,Se nsitiveDx, AbuseDx, SickleDx, HIVDx | |
| 140 | FROM PT Probs1 | |
| 141 | WHERE R N = 1 | |
| 142 | ORDER B Y LastModi fiedDate D ESC; | |
| 143 | ||
| 144 | END; | |
| 145 | ||
| 146 | --exec nva .getProbs @station=5 08, @pid=1 717444; | |
| 147 | --exec nva .getSensDx Codes; | |
| 148 | ||
| 149 | GO | |
| 150 | ||
| 151 | EXEC sp_Si gnAppObjec t 'NVCC_us p_GetProbs '; |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.