Produced by Araxis Merge on 10/26/2017 10:43:32 PM 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 | OSCIF_BMS_v2_iter 2_September_2017.zip\BMS_Cand\BMS_Source_C72993\C72993-Sources.zip\C72993\Source\Sources\Database\CreationScripts\BMS_DW\2.Functions | dbo.ufn_GetTransactionByBedIdAndWardId.UserDefinedFunction.sql | Fri Nov 22 17:02:52 2013 UTC |
| 2 | OSCIF_BMS_v2_iter 2_September_2017.zip\BMS_Cand\BMS_Source_C72993\C72993-Sources.zip\C72993\Source\Sources\Database\CreationScripts\BMS_DW\2.Functions | dbo.ufn_GetTransactionByBedIdAndWardId.UserDefinedFunction.sql | Thu Oct 26 18:33:58 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 100 |
| 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 | /****** Ob ject: Use rDefinedFu nction [db o].[ufn_Ge tTransacti onByBedIdA ndWardId] Script Date: 03/2 1/2012 16: 03:44 **** **/ | |
| 2 | IF EXISTS (SELECT * FROM sys. objects WH ERE object _id = OBJE CT_ID(N'[d bo].[ufn_G etTransact ionByBedId AndWardId] ') AND typ e in (N'FN ', N'IF', N'TF', N'F S', N'FT') ) | |
| 3 | DROP FUNCT ION [dbo]. [ufn_GetTr ansactionB yBedIdAndW ardId] | |
| 4 | GO | |
| 5 | ||
| 6 | SET ANSI_N ULLS ON | |
| 7 | GO | |
| 8 | SET QUOTED _IDENTIFIE R ON | |
| 9 | GO | |
| 10 | -- ======= ========== ========== ========== ======== | |
| 11 | -- Author:
|
|
| 12 | -- Create date: 10/2 6/2011 | |
| 13 | -- Descrip tion: Get transactio n type | |
| 14 | -- ======= ========== ========== ========== ======== | |
| 15 | CREATE FUN CTION [dbo ].[ufn_Get Transactio nByBedIdAn dWardId] | |
| 16 | ( | |
| 17 | @B ED_ID INT, | |
| 18 | @W ARD_ID INT | |
| 19 | ) | |
| 20 | RETURNS NV ARCHAR(50) | |
| 21 | AS | |
| 22 | BEGIN | |
| 23 | ||
| 24 | DE CLARE @TRA NSFER_DATE DATETIME, @DISCHARG E_DATE DAT ETIME, @TR ANSACTION_ NAME NVARC HAR(50), @ RESULT NVA RCHAR(50) | |
| 25 | ||
| 26 | SE LECT TOP(1 ) @TRANSFE R_DATE = M OVEMENT.EN TERED_DATE , | |
| 27 | @ TRANSACTIO N_NAME = ' TRANSFER' | |
| 28 | FR OM dbo.FAC T_MOVEMENT _EVN AS MO VEMENT | |
| 29 | WH ERE MOVEM ENT.DIM_WA RD_ID = @W ARD_ID | |
| 30 | AND MO VEMENT.DIM _BED_ID = @BED_ID | |
| 31 | OR DER BY MOV EMENT.ENTE RED_DATE D ESC | |
| 32 | ||
| 33 | SE LECT TOP(1 ) @DISCHAR GE_DATE = DISCHARGE. ENTERED_DA TE | |
| 34 | FR OM dbo.FAC T_DISCHARG E_EVN AS D ISCHARGE | |
| 35 | WH ERE DISCH ARGE.DIM_W ARD_ID = @ WARD_ID | |
| 36 | AND DI SCHARGE.DI M_BED_ID = @BED_ID | |
| 37 | OR DER BY DIS CHARGE.ENT ERED_DATE DESC | |
| 38 | ||
| 39 | IF @TRANSFER _DATE IS N ULL AND @D ISCHARGE_D ATE IS NOT NULL | |
| 40 | SET @RESULT = 'DISCHARGE ' | |
| 41 | EL SE IF @TRA NSFER_DATE IS NOT NU LL AND @DI SCHARGE_DA TE IS NULL | |
| 42 | SET @RESULT = @TRANSACTI ON_NAME | |
| 43 | EL SE | |
| 44 | IF @ TRANSFER_D ATE > @DIS CHARGE_DAT E | |
| 45 | SET @RESULT = @TRANSACTI ON_NAME | |
| 46 | ELSE | |
| 47 | SET @R ESULT = 'D ISCHARGE' | |
| 48 | ||
| 49 | RE TURN @RESU LT; | |
| 50 | END | |
| 51 | GO |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.