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