Produced by Araxis Merge on 8/29/2017 11:27:38 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\OriginalSQLScripts | usp_PMUpdateMasterLabIndexFromWorkload.sql | Fri Jul 14 21:27:02 2017 UTC |
| 2 | REFDOC-devel-20170714.zip\NVCC\OriginalSQLScripts | usp_PMUpdateMasterLabIndexFromWorkload.sql | Mon Aug 28 17:45:22 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 222 |
| 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 | /****** Ob ject: Sto redProcedu re [PanelM gmt].[usp_ PMUpdateMa sterLabInd exFromWork load] S cript Date : 1/4/2016 12:52:52 PM ******/ | |
| 5 | SET ANSI_N ULLS ON | |
| 6 | GO | |
| 7 | ||
| 8 | SET QUOTED _IDENTIFIE R ON | |
| 9 | GO | |
| 10 | ||
| 11 | ||
| 12 | --======== ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== = | |
| 13 | --Requesto r : Jianji Y ang | |
| 14 | --Author : Stev e Schreine r | |
| 15 | --Object/S P Name : [Panel Mgmt].[usp _PMUpdateM asterLabIn dexFromWor kload] | |
| 16 | --SERVER : DNS DN S.URL | |
| 17 | --Data Bas e : NWIC_Pan elMgmt | |
| 18 | --Schema : | |
| 19 | --Report : None Yet | |
| 20 | --Folder : | |
| 21 | --Report L oc : | |
| 22 | --Job : None | |
| 23 | --Job Loc : None | |
| 24 | --Note : | |
| 25 | --Date Cre ated : 08-0 4-2014 | |
| 26 | --Last Cha nged : 05-1 5-2015 | |
| 27 | --Last Cha nged By : Jianji Yang | |
| 28 | --Reason F or Change : exclud e NON-HDL from 668 w hich is as signed to LDL worklo ad code | |
| 29 | --Purpose : Upda te Panel M anagement Master Lab Index tab le | |
| 30 | ----- with lab test with validate workload c odes. | |
| 31 | --======== ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== === | |
| 32 | ||
| 33 | CREATE PRO CEDURE [Pa nelMgmt].[ usp_PMUpda teMasterLa bIndexFrom Workload] | |
| 34 | AS | |
| 35 | ||
| 36 | select RO W_NUMBER() OVER( | |
| 37 | ORDE R BY a.Tes tGroup) as RecID, | |
| 38 | a.Te stGroup, | |
| 39 | a.Re sultForTes tNumeric, | |
| 40 | a.Te stSearchCr iteria | |
| 41 | into #T empTestGro ups | |
| 42 | from (s elect dist inct | |
| 43 | tg.TestG roup, | |
| 44 | tg.Resul tForTestNu meric, | |
| 45 | tg.TestS earchCrite ria | |
| 46 | fro m [Panel Mgmt].[PMM asterCohor tLabTestGr oups] as t g) as a | |
| 47 | ||
| 48 | ||
| 49 | declare @B egRec int, @EndRec i nt | |
| 50 | ||
| 51 | select @E ndRec = ma x(RecID) | |
| 52 | from #T empTestGro ups as tg | |
| 53 | ||
| 54 | declare @N extRec int | |
| 55 | set @Nex tRec = 1 | |
| 56 | ||
| 57 | while (@ NextRec <= @EndRec) | |
| 58 | begin | |
| 59 | ||
| 60 | declare @e xestr varc har(5000) | |
| 61 | ||
| 62 | declare @T estSearchN ame varcha r(20), | |
| 63 | @Res ultForTest Numeric va rchar(4), | |
| 64 | @Tes tGroup var char(30) | |
| 65 | ||
| 66 | select @T estSearchN ame = '''' +tg.TestSe archCriter ia+'''', | |
| 67 | @Res ultForTest Numeric = tg.ResultF orTestNume ric, | |
| 68 | @Tes tGroup = ' '''+tg.Tes tGroup+''' ' | |
| 69 | from #T empTestGro ups as tg | |
| 70 | where tg .RecID = @ NextRec | |
| 71 | ||
| 72 | set @exest r =' | |
| 73 | insert [Panel Mgmt].[PMM asterLabIn dex] | |
| 74 | select | |
| 75 | li.LabCh emTestSID, | |
| 76 | li.Sta3n , | |
| 77 | li.LabCh emTestName , | |
| 78 | '+@Resul tForTestNu meric+' as ResultFor TestNumeri c, | |
| 79 | getdate( ) as DateE xtracted, | |
| 80 | '+@TestG roup+' as TestGroup, | |
| 81 | null as LOINC, | |
| 82 | nc.Workl oadCode | |
| 83 | from [CDWWo rk].[dim]. [LabChemTe st] as li | |
| 84 | left outer join [CDW Work].[dim ].[Nationa lVALabCode ] as nc on | |
| 85 | li.Natio nalVALabCo deSID = nc .NationalV ALabCodeSI D | |
| 86 | inner join [Panel Mgmt].[PMM asterCohor tSite] as cs on | |
| 87 | li.Sta3n = cs.Sta3 n | |
| 88 | where nc.Wor kLoadCode like '+@Te stSearchNa me+' | |
| 89 | and not exists (se lect ni.La bChemTestS ID | |
| 90 | fr om [PanelM gmt].[PMMa sterLabInd ex] as ni | |
| 91 | where li.LabChem TestSID = ni.LabChem TestSID | |
| 92 | and li.Sta 3n = ni.St a3n) | |
| 93 | order by li.Sta 3n' | |
| 94 | exec (@exe str) | |
| 95 | ||
| 96 | set @NextRec = @NextRe c + 1 | |
| 97 | ||
| 98 | end | |
| 99 | ||
| 100 | -- remove non HDL la b with LDL workload code assig ned. worki ng with lo cal CAC to reassign appropiate code | |
| 101 | -- LabChem TestSID LabChe mTestIEN Sta3n La bChemTestN ame LabChe mPrintTest Name NL TNationalV ALabCodeSI D National VALabCodeS ID | |
| 102 | -- 8002231 62 7054 668 NON-HDL CHOLESTERO L NHDL 800522 569 800398429 | |
| 103 | ||
| 104 | delete FRO M [NWIC_Pa nelMgmt].[ PanelMgmt] .[PMMaster LabIndex] where labc hemtestnam e like '%N ON-HDL%' | |
| 105 | ||
| 106 | drop ta ble #TempT estGroups | |
| 107 | ||
| 108 | ||
| 109 | ||
| 110 | GO | |
| 111 | ||
| 112 |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.