Produced by Araxis Merge on 11/8/2016 5:24:59 PM Eastern Standard 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 | rxrefill-v2.0.0 P2.zip\vamf-commons-master.zip\eCrud\src\test\java\gov\va\mobile\vamf\common\ecrud\test\dao | PatientDaoImpl.java | Thu Jul 28 16:22:55 2016 UTC |
| 2 | rxrefill-v2.0.0 P2.zip\vamf-commons-master.zip\eCrud\src\test\java\gov\va\mobile\vamf\common\ecrud\test\dao | PatientDaoImpl.java | Fri Oct 28 18:54:26 2016 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 406 |
| 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 | package go v.va.mobil e.vamf.com mon.ecrud. test.dao; | |
| 5 | ||
| 6 | ||
| 7 | import gov .va.mobile .vamf.comm on.ecrud.d atalayer.E CrudMediaS ervice; | |
| 8 | import gov .va.mobile .vamf.comm on.ecrud.d atalayer.G enericDao; | |
| 9 | import gov .va.mobile .vamf.comm on.ecrud.d omain.Writ eResponse; | |
| 10 | import gov .va.mobile .vamf.comm on.ecrud.u til.DateUt ils; | |
| 11 | import gov .va.mobile .vamf.comm on.ecrud.u til.Domain Utils; | |
| 12 | import gov .va.mobile .vamf.jour nal.domain .Illness; | |
| 13 | import gov .va.mobile .vamf.jour nal.domain .Patient; | |
| 14 | ||
| 15 | import jav a.io.FileI nputStream ; | |
| 16 | import jav a.io.Outpu tStream; | |
| 17 | import jav a.util.Arr ayList; | |
| 18 | import jav a.util.Arr ays; | |
| 19 | import jav a.util.Dat e; | |
| 20 | import jav a.util.Lis t; | |
| 21 | import jav a.util.Map ; | |
| 22 | import jav a.util.reg ex.Matcher ; | |
| 23 | import jav a.util.reg ex.Pattern ; | |
| 24 | ||
| 25 | import org .apache.co mmons.lang 3.StringUt ils; | |
| 26 | import org .springfra mework.cor e.Paramete rizedTypeR eference; | |
| 27 | import org .springfra mework.web .client.Re stTemplate ; | |
| 28 | ||
| 29 | import com .google.gs on.Gson; | |
| 30 | ||
| 31 | /** | |
| 32 | * @author gormanch | |
| 33 | * | |
| 34 | * This is a sample DAO that e xtends the common Ge nericDao t o demonstr ate | |
| 35 | * how to make eCrud database calls. | |
| 36 | */ | |
| 37 | public cla ss Patient DaoImpl ex tends Gene ricDao<Pat ient> { | |
| 38 | ||
| 39 | // This need s to be in a common class | |
| 40 | pr ivate stat ic final S tring DATA BASE_URL = "http:// IP /eCRUD/v1/ journal-vi deo"; | |
| 41 | ||
| 42 | ||
| 43 | st atic final String DO MAIN_COLLE CTION = "p atient"; | |
| 44 | ||
| 45 | st atic final String ME DIA_COLLEC TION = "fs "; | |
| 46 | ||
| 47 | EC rudMediaSe rvice serv ice = new ECrudMedia Service(DA TABASE_URL , MEDIA_C OLLECTION) ; | |
| 48 | ||
| 49 | pu blic Patie ntDaoImpl( ) { | |
| 50 | supe r.setRestT emplate(ne w RestTemp late()); | |
| 51 | supe r.seteCrud ServiceUrl (DomainUti ls.createU RI(DATABAS E_URL)); | |
| 52 | supe r.setColle ctionName( DOMAIN_COL LECTION); | |
| 53 | } | |
| 54 | ||
| 55 | public List<Pati ent> getPa tients(Str ing queryS tring, Str ing sortSt ring, Stri ng docLimi t, String project, S tring sear chString) { | |
| 56 | ||
| 57 | ||
| 58 | Para meterizedT ypeReferen ce<List<Pa tient>> ty peRef = | |
| 59 | new Para meterizedT ypeReferen ce<List<Pa tient>>() {}; | |
| 60 | ||
| 61 | ||
| 62 | List <Patient> patients = super.get Data(typeR ef, queryS tring, sor tString, d ocLimit, p roject, se archString ); | |
| 63 | ||
| 64 | if ( patients = = null || patients.i sEmpty()) { | |
| 65 | Patien t errRespo nse = new Patient(); | |
| 66 | //errR esponse.se tError("No Data Foun d"); | |
| 67 | return Arrays.as List(errRe sponse); | |
| 68 | } | |
| 69 | ||
| 70 | retu rn patient s; | |
| 71 | } | |
| 72 | ||
| 73 | public List<Illn ess> getI llnessFrom Projection Search(Str ing text, String pro ject){ | |
| 74 | ||
| 75 | Pa rameterize dTypeRefer ence<List< Patient>> typeRef = | |
| 76 | new Para meterizedT ypeReferen ce<List<Pa tient>>() {}; | |
| 77 | ||
| 78 | St ring json = super.ge tData(DATA BASE_URL, text, proj ect, typeR ef); | |
| 79 | ||
| 80 | re turn getIl lnessListF romTextSea rch(json); | |
| 81 | } | |
| 82 | ||
| 83 | privat e List<Ill ness> getI llnessList FromTextSe arch(Strin g json){ | |
| 84 | ||
| 85 | ||
| 86 | Patt ern p = Pa ttern.comp ile("illne ss"); | |
| 87 | ||
| 88 | Matcher m = p.matc her(json); | |
| 89 | int coun t = 0; | |
| 90 | while (m .find()){ | |
| 91 | coun t +=1; | |
| 92 | } | |
| 93 | ||
| 94 | int index = js on.indexOf ("\"illnes s\":"); | |
| 95 | ||
| 96 | ||
| 97 | ||
| 98 | Stri ng illness Json = nul l; | |
| 99 | ||
| 100 | List <Illness> illnesses= new Array List<Illne ss>(); | |
| 101 | ||
| 102 | ||
| 103 | ||
| 104 | for (int i = 0 ; i< count ; i++) { | |
| 105 | ||
| 106 | illnes sJson = St ringUtils. substringB etween(jso n , "\"ill ness\":" , "}}")+"}" ; | |
| 107 | ||
| 108 | ||
| 109 | // System .out.print ln("Illnes s json = " +illnessJs on); | |
| 110 | ||
| 111 | ||
| 112 | ||
| 113 | ||
| 114 | Illnes s converte d = new Gs on().fromJ son(illnes sJson, Ill ness.class ); | |
| 115 | ||
| 116 | // System .out.print ln("Illnes s = "+conv erted.toSt ring()); | |
| 117 | ||
| 118 | illnes ses.add(co nverted); | |
| 119 | ||
| 120 | try { | |
| 121 | ||
| 122 | json = j son.substr ing(index + 50); | |
| 123 | } catc h (Excepti on e) { | |
| 124 | break; | |
| 125 | } | |
| 126 | ||
| 127 | index = json.ind exOf("\"il lness\":") ; | |
| 128 | ||
| 129 | } | |
| 130 | ||
| 131 | retu rn illness es; | |
| 132 | } | |
| 133 | ||
| 134 | public WriteResp onse SaveP atient(Pat ient patie nt) { | |
| 135 | // Gs on gson = new GsonBu ilder().cr eate(); | |
| 136 | ||
| 137 | // St ring jsonT oWrite = g son.toJson (patient); | |
| 138 | Wr iteRespons e response = super. writeData( patient); | |
| 139 | re turn respo nse; | |
| 140 | } | |
| 141 | ||
| 142 | pu blic Strin g saveMedi aByExchang e(String b aseUrl, St ring colle ctionName, | |
| 143 | FileIn putStream fis) { | |
| 144 | // T ODO Auto-g enerated m ethod stub | |
| 145 | retu rn service .saveMedia ByExchange (baseUrl, collection Name, fis) ; | |
| 146 | } | |
| 147 | ||
| 148 | pu blic Map<S tring, Str ing> getCo ntentMap() { | |
| 149 | // T ODO Auto-g enerated m ethod stub | |
| 150 | retu rn service .getConten tMap(); | |
| 151 | } | |
| 152 | ||
| 153 | pu blic Outpu tStream ge tImageById (String ba seUrl, Str ing collec tionName, | |
| 154 | String mediaId) { | |
| 155 | // T ODO Auto-g enerated m ethod stub | |
| 156 | retu rn service .getImageB yId(baseUr l, collect ionName, m ediaId); | |
| 157 | } | |
| 158 | ||
| 159 | pu blic Strin g deleteMe diaById(St ring media Id, String baseUrl, | |
| 160 | String collectio nName, Str ing queryS tring) { | |
| 161 | // T ODO Auto-g enerated m ethod stub | |
| 162 | retu rn service .deleteMed iaById(med iaId, base Url, colle ctionName, queryStri ng); | |
| 163 | } | |
| 164 | ||
| 165 | pu blic Strin g getIdFro mObjectID( String jso n){ | |
| 166 | retu rn service .getIdOnly FromBisonO bj(json); | |
| 167 | } | |
| 168 | ||
| 169 | pu blic Strin g getMedia ObjectUrl( ){ | |
| 170 | retu rn service .getMediaO bjUrl(); | |
| 171 | } | |
| 172 | ||
| 173 | pu blic Outpu tStream ge tVideoById (String me diaObjectU rl, | |
| 174 | String collectio nName, Str ing mediaI d) { | |
| 175 | // T ODO Auto-g enerated m ethod stub | |
| 176 | retu rn service .getVideoB yId(mediaO bjectUrl, collection Name, medi aId); | |
| 177 | } | |
| 178 | ||
| 179 | pu blic Strin g getSteam IdFromJson (String js on) { | |
| 180 | // T ODO Auto-g enerated m ethod stub | |
| 181 | retu rn service .getSteamI dFromJson( json); | |
| 182 | } | |
| 183 | ||
| 184 | pu blic Strin g getMedia Collection Name() { | |
| 185 | ||
| 186 | retu rn MEDIA_C OLLECTION; | |
| 187 | ||
| 188 | } | |
| 189 | ||
| 190 | pu blic List< Patient> g etData( | |
| 191 | Parame terizedTyp eReference <List<Pati ent>> type Ref, | |
| 192 | String queryStri ng, String sortStrin g, String docsLimit) { | |
| 193 | // T ODO Auto-g enerated m ethod stub | |
| 194 | retu rn this.ge tPatients( queryStrin g, sortStr ing, null, null, nul l); | |
| 195 | } | |
| 196 | ||
| 197 | pu blic Patie nt getData ById(Strin g id, Stri ng querySt ring, | |
| 198 | String sortStrin g, String docsLimit) { | |
| 199 | // T ODO Auto-g enerated m ethod stub | |
| 200 | retu rn this.ge tDataById( id, queryS tring, sor tString, d ocsLimit, null); | |
| 201 | } | |
| 202 | ||
| 203 | ||
| 204 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.