Produced by Araxis Merge on 9/15/2018 10:47:53 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 | MHV_2018.4.0.0.zip\2018.4.0.0\national portal\mhv_source\mhv_integration\mhv-integration-phr\mhv-integration-phrmgr-main\src\main\java\gov\va\med\mhv\integration\phr\service | AbstractBaseQueryService.java | Thu Aug 23 21:20:40 2018 UTC |
| 2 | MHV_2018.4.0.0.zip\2018.4.0.0\national portal\mhv_source\mhv_integration\mhv-integration-phr\mhv-integration-phrmgr-main\src\main\java\gov\va\med\mhv\integration\phr\service | AbstractBaseQueryService.java | Sat Sep 15 21:40:02 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 252 |
| Changed | 2 | 4 |
| 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 | package go v.va.med.m hv.integra tion.phr.s ervice; | |
| 2 | ||
| 3 | import gov .va.med.mh v.integrat ion.phr.da o.PhrBaseD AO; | |
| 4 | import gov .va.med.mh v.integrat ion.phr.se rvice.vist aweb.cache .CacheHand ler; | |
| 5 | import gov .va.med.mh v.integrat ion.phr.st age.enumer ation.Stag eMessageTy pe; | |
| 6 | import gov .va.med.mh v.integrat ion.phr.st age.transf er.StageMe ssageContr ol; | |
| 7 | import gov .va.med.mh v.integrat ion.phr.tr ansfer.Que ryRequest; | |
| 8 | ||
| 9 | import jav a.util.Dat e; | |
| 10 | ||
| 11 | /** | |
| 12 | * @author DNS | |
| 13 | * | |
| 14 | */ | |
| 15 | public abs tract clas s Abstract BaseQueryS ervice imp lements Qu eryService { | |
| 16 | ||
| 17 | pr otected St agingServi ce staging Service = null; | |
| 18 | ||
| 19 | pr otected Tr ackingServ ice tracki ngService = null; | |
| 20 | ||
| 21 | pu blic void setStaging Service(St agingServi ce staging Service) { | |
| 22 | this .stagingSe rvice = st agingServi ce; | |
| 23 | } | |
| 24 | ||
| 25 | pu blic Stagi ngService getStaging Service() { | |
| 26 | retu rn staging Service; | |
| 27 | } | |
| 28 | ||
| 29 | pu blic void setTrackin gService(T rackingSer vice track ingService ) { | |
| 30 | this .trackingS ervice = t rackingSer vice; | |
| 31 | } | |
| 32 | ||
| 33 | pu blic Track ingService getTracki ngService( ) { | |
| 34 | retu rn trackin gService; | |
| 35 | } | |
| 36 | ||
| 37 | pr otected ab stract Sta geMessageC ontrol doQ uery(Query Request re quest, | |
| 38 | QueryS erviceResp onse resul t); | |
| 39 | ||
| 40 | pr otected St ageMessage Control ge tResponseM essage(Que ryRequest request, | |
| 41 | QueryS erviceResp onse proce ssingResul t, String routingSta tus) { | |
| 42 | ||
| 43 | Stag eMessageCo ntrol resp onseMessag e = this.s tagingServ ice | |
| 44 | .findLat estStaging Request(re quest.getI cn(), | |
| 45 | re quest.getS tationNumb er(), | |
| 46 | Re freshDataS ervice.mes sageName, | |
| 47 | re quest.getE xtractType ()); | |
| 48 | ||
| 49 | if ( responseMe ssage == n ull) { | |
| 50 | respon seMessage = new Stag eMessageCo ntrol(Data Service.me ssageName, | |
| 51 | (long) pro cessingRes ult.getRec ordCount() , routingS tatus, | |
| 52 | StageMessa geType.RES PONSE, req uest.getIc n(), | |
| 53 | request.ge tStationNu mber(), re quest.getE xtractType (), | |
| 54 | request.ge tStartDate (), reques t.getEndDa te()); | |
| 55 | } | |
| 56 | ||
| 57 | // @ DN S
|
|
| 58 | // T he issue h ere is tha t the requ est / resp onse messa ge control IDs | |
| 59 | // a re initial ized durin g construc tion to a value of O L. If we r eset | |
| 60 | // t hem here t o the valu e of the i dentity of the objec t, if it's a | |
| 61 | // n ew object that hasn' t been per sisted yet , that val ue will be null | |
| 62 | // a nd may res ult in a n ull pointe r exceptio n. Better to leave t he value | |
| 63 | // a s 0L until the ID ha s an actua l value. T his value will be as signed | |
| 64 | // d uring the insert pro cess in th e DAO. | |
| 65 | ||
| 66 | // / / initiate the respo nse messag e control identifier from the request. | |
| 67 | // r esponseMes sage.setRe questMsgCt rlId(reque st.getRequ estMsgCtrl Id()); | |
| 68 | // | |
| 69 | // / / setup a request id if none w as provide d | |
| 70 | // i f (request .getReques tMsgCtrlId () == 0) | |
| 71 | // r esponseMes sage.setRe questMsgCt rlId(respo nseMessage .getId()); | |
| 72 | // | |
| 73 | // r esponseMes sage.setRe sponseMsgC trlId(resp onseMessag e.getId()) ; | |
| 74 | ||
| 75 | retu rn respons eMessage; | |
| 76 | } | |
| 77 | ||
| 78 | pu blic Query ServiceRes ponse proc ess(QueryR equest req uest) { | |
| 79 | ||
| 80 | Quer yServiceRe sponse res ult = new QueryServi ceResponse ( | |
| 81 | QuerySer viceRespon se.OK); | |
| 82 | Date queryStar tTime = ne w Date(); | |
| 83 | ||
| 84 | Stag eMessageCo ntrol stag eMessage = null; | |
| 85 | ||
| 86 | // u pdate the extract lo g with the progress | |
| 87 | try { | |
| 88 | stageM essage = d oQuery(req uest, resu lt); | |
| 89 | ||
| 90 | // upd ate the re sponse mes sage and t rack the p rogress | |
| 91 | stageM essage.set MessageSta tus(result .getStatus ()); | |
| 92 | stageM essage.set MessageNam e(DataServ ice.messag eName); | |
| 93 | stageM essage.set CreatedDat e(querySta rtTime); | |
| 94 | ||
| 95 | // inc lude the s tatus and any error message if the extra ct status is | |
| 96 | // 'ER ROR' infor mation | |
| 97 | stageM essage.set ExtractSta tus(result .getStatus ()); | |
| 98 | if ("E RROR".equa lsIgnoreCa se(stageMe ssage.getE xtractStat us())) { | |
| 99 | stageMes sage.setEr rorMessage (result.ge tDescripti on()); | |
| 100 | } | |
| 101 | ||
| 102 | stageM essage.set EndDate(ne w Date()); | |
| 103 | ||
| 104 | } ca tch (Excep tion ex) { | |
| 105 | result .setStatus (QueryServ iceRespons e.ERROR); | |
| 106 | result .setDescri ption(Stri ng.format( | |
| 107 | "Error sta ging messa ge status: %s", ex.g etMessage( ))); | |
| 108 | ||
| 109 | if (st ageMessage != null) { | |
| 110 | stageMes sage.setEx tractStatu s(result.g etStatus() ); | |
| 111 | stageMes sage.setEr rorMessage (result.ge tDescripti on()); | |
| 112 | } | |
| 113 | } fi nally { | |
| 114 | if (st ageMessage != null) { | |
| 115 | this.sta gingServic e.stageReq uest(stage Message); | |
| 116 | } | |
| 117 | } | |
| 118 | ||
| 119 | retu rn result; | |
| 120 | } | |
| 121 | ||
| 122 | pr otected vo id updateC acheHandle r(QueryReq uest reque st, PhrBas eDAO phrDa o) { | |
| 123 | Cach eHandler.g etInstance ().setIcn( request.ge tIcn()); | |
| 124 | Cach eHandler.g etInstance ().setFaci lityInfo(p hrDao.fetc hFacilityI nfoIds(req uest.getIc n())); | |
| 125 | Cach eHandler.g etInstance ().setPhrf acilitycon trol(phrDa o.fetchPhr FacilityCo ntrolIds(r equest.get Icn())); | |
| 126 | Cach eHandler.g etInstance ().setPati entId(phrD ao.fetchPa tientId(re quest.getI cn())); | |
| 127 | } | |
| 128 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.