Produced by Araxis Merge on 6/9/2017 3:49:57 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 | Fri Jun 9 19:49:57 2017 UTC | ||
| 2 | eHealth_Exch (eHealth Exchange Enhancements) Build 3 docs & code_May_2017.zip\VAP_CIF_CODE0502.zip\VAP_CIF_CODE0502\VAP_CIF_CODE0502\nvap-common\src\main\java\gov\va\nvap\common\sql | SqlUtil.java | Fri Apr 21 20:03:26 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 61 |
| 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 | package go v.va.nvap. common.sql ; | |||||
| 2 | ||||||
| 3 | /** | |||||
| 4 | * Contain s common f unctions f or SQL man ipulation. | |||||
| 5 | * | |||||
| 6 | * @since 05/13/2015 | |||||
| 7 | * @author Irakli Ka kushadze | |||||
| 8 | */ | |||||
| 9 | public cla ss SqlUtil { | |||||
| 10 | /** | |||||
| 11 | * Gen erates par t of the W HERE claus e so that test patie nts are ex cluded fro m the quer y. | |||||
| 12 | * | |||||
| 13 | * @pa ram useHib ernate Whe ther to us e Hibernat e syntax | |||||
| 14 | * @pa ram tableN ame Table name or al ias to use | |||||
| 15 | * @pa ram ssnCol umnName SS N column n ame or ali as to use | |||||
| 16 | * @re turn SQL c lause to b e inserted into the WHERE clau se | |||||
| 17 | */ | |||||
| 18 | public static St ring gener ateExclude PatientsCl ause(boole an useHibe rnate, Str ing tableN ame, Strin g ssnColum nName, boo lean negat e) { | |||||
| 19 | St ring col = tableName + "." + s snColumnNa me; | |||||
| 20 | St ring subst r = useHib ernate ? " substring" : "substr "; | |||||
| 21 | St ring negat ion = nega te ? "" : "NOT "; | |||||
| 22 | re turn negat ion + "(" + | |||||
| 23 | col + " is nu ll or " + // Ig nore null entries | |||||
| 24 | "(" + | |||||
| 25 | su bstr + "(" + col + " , 1, 3) != '000' and " + // Ar ea number 000 denote s a test p atient | |||||
| 26 | su bstr + "(" + col + " , 1, 3) != '666' and " + // Ar ea number 666 denote s a test p atient | |||||
| 27 | su bstr + "(" + col + " , 1, 1) != '9' and " + // Ar ea number in 900-999 range den otes a tes t patient | |||||
| 28 | su bstr + "(" + col + " , 4, 2) != '00' and " + // Gr oup number 00 denote s a test p atient | |||||
| 29 | su bstr + "(" + col + " , 6, 4) != '0000'" + // Se rial numbe r 0000 den otes a tes t patient | |||||
| 30 | ")" + | |||||
| 31 | ")"; | |||||
| 32 | } | |||||
| 33 | ||||||
| 34 | public static St ring gener atePatient sClauseSQL (String ta bleName, S tring ssnC olumnName, int patie ntTypes, b oolean pre pendWithAn dClause) { | |||||
| 35 | ||||||
| 36 | if (patientT ypes == 1 || patient Types == 2 ) { | |||||
| 37 | // Real patients o nly or tes t patients only | |||||
| 38 | } else { | |||||
| 39 | // All p atients - no need to include i n the WHER E clause | |||||
| 40 | return " "; | |||||
| 41 | } | |||||
| 42 | ||||||
| 43 | St ring andIf Real = pat ientTypes == 1 ? "an d" : "or"; | |||||
| 44 | St ring notIf Real = pat ientTypes == 1 ? " n ot" : ""; | |||||
| 45 | ||||||
| 46 | fi nal String sql = | |||||
| 47 | (prepend WithAndCla use ? "and " : "") + | |||||
| 48 | "(" + | |||||
| 49 | (patient Types == 1 ? " " + tableName + "." + ss nColumnNam e + " is n ull or" : "") + | |||||
| 50 | " (" + | |||||
| 51 | " " + tableName + "." + s snColumnNa me + notIf Real + " l ike '666%' " + andIf Real + | |||||
| 52 | " " + tableName + "." + s snColumnNa me + notIf Real + " l ike '9%' " + andIfRe al + | |||||
| 53 | " " + tableName + "." + s snColumnNa me + notIf Real + " l ike '000%' " + andIf Real + | |||||
| 54 | " " + tableName + "." + s snColumnNa me + notIf Real + " l ike '___00 ____' " + andIfReal + | |||||
| 55 | " " + tableName + "." + s snColumnNa me + notIf Real + " l ike '%0000 '" + | |||||
| 56 | " )" + | |||||
| 57 | ")"; | |||||
| 58 | ||||||
| 59 | re turn sql; | |||||
| 60 | } | |||||
| 61 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.