Produced by Araxis Merge on 8/16/2018 1:18:03 PM Central 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 | Caregivers_Tool_CareT_v1_Build 4.zip\core\portlets\caret-portlet\docroot\WEB-INF\src\gov\va\caret\util | CaretUtil.java | Thu Aug 9 14:04:46 2018 UTC |
| 2 | Caregivers_Tool_CareT_v1_Build 4.zip\core\portlets\caret-portlet\docroot\WEB-INF\src\gov\va\caret\util | CaretUtil.java | Thu Aug 16 01:35:22 2018 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 1074 |
| Changed | 1 | 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.caret .util; | |
| 2 | ||
| 3 | import jav a.io.Unsup portedEnco dingExcept ion; | |
| 4 | import jav a.net.URI; | |
| 5 | import jav a.net.URL; | |
| 6 | import jav a.util.Arr ayList; | |
| 7 | import jav a.util.Dat e; | |
| 8 | import jav a.util.Has hMap; | |
| 9 | import jav a.util.Has hSet; | |
| 10 | import jav a.util.Lin kedHashMap ; | |
| 11 | import jav a.util.Lis t; | |
| 12 | import jav a.util.Map ; | |
| 13 | import jav a.util.Set ; | |
| 14 | import jav a.util.Tre eMap; | |
| 15 | ||
| 16 | import jav ax.mail.in ternet.Add ressExcept ion; | |
| 17 | import jav ax.mail.in ternet.Int ernetAddre ss; | |
| 18 | import jav ax.portlet .PortletRe quest; | |
| 19 | import jav ax.portlet .PortletSe ssion; | |
| 20 | import jav ax.xml.par sers.Docum entBuilder ; | |
| 21 | import jav ax.xml.par sers.Docum entBuilder Factory; | |
| 22 | ||
| 23 | import org .w3c.dom.D ocument; | |
| 24 | import org .w3c.dom.N odeList; | |
| 25 | ||
| 26 | import com .liferay.m ail.servic e.MailServ iceUtil; | |
| 27 | import com .liferay.p ortal.kern el.excepti on.PortalE xception; | |
| 28 | import com .liferay.p ortal.kern el.excepti on.SystemE xception; | |
| 29 | import com .liferay.p ortal.kern el.log.Log ; | |
| 30 | import com .liferay.p ortal.kern el.log.Log FactoryUti l; | |
| 31 | import com .liferay.p ortal.kern el.mail.Ma ilMessage; | |
| 32 | import com .liferay.p ortal.kern el.mail.SM TPAccount; | |
| 33 | import com .liferay.p ortal.kern el.util.Li stUtil; | |
| 34 | import com .liferay.p ortal.kern el.util.Pr opsUtil; | |
| 35 | import com .liferay.p ortal.kern el.util.St ringPool; | |
| 36 | import com .liferay.p ortal.kern el.util.Va lidator; | |
| 37 | import com .liferay.p ortal.mode l.BaseMode l; | |
| 38 | import com .liferay.p ortal.mode l.Organiza tion; | |
| 39 | import com .liferay.p ortal.mode l.User; | |
| 40 | import com .liferay.p ortal.serv ice.Organi zationLoca lServiceUt il; | |
| 41 | import com .liferay.p ortal.serv ice.Servic eContext; | |
| 42 | import com .liferay.p ortal.serv ice.UserLo calService Util; | |
| 43 | import com .liferay.p ortal.util .PortalUti l; | |
| 44 | import com .liferay.p ortlet.exp ando.model .ExpandoBr idge; | |
| 45 | import com .liferay.p ortlet.exp ando.model .ExpandoCo lumn; | |
| 46 | import com .liferay.p ortlet.exp ando.model .ExpandoTa ble; | |
| 47 | import com .liferay.p ortlet.exp ando.model .ExpandoVa lue; | |
| 48 | import com .liferay.p ortlet.exp ando.servi ce.Expando ColumnLoca lServiceUt il; | |
| 49 | import com .liferay.p ortlet.exp ando.servi ce.Expando TableLocal ServiceUti l; | |
| 50 | import com .liferay.p ortlet.exp ando.servi ce.Expando ValueLocal ServiceUti l; | |
| 51 | import com .liferay.u til.portle t.PortletP rops; | |
| 52 | ||
| 53 | import gov .va.caret. Applicatio nWorkFlowE xception; | |
| 54 | import gov .va.caret. controller .dashboard .config.Fa cilityDash boardConfi g; | |
| 55 | import gov .va.caret. model.BoxG p; | |
| 56 | import gov .va.caret. model.Faci l; | |
| 57 | import gov .va.caret. model.Note ; | |
| 58 | import gov .va.caret. model.Pers n; | |
| 59 | import gov .va.caret. model.VcgA n; | |
| 60 | import gov .va.caret. model.WorI m; | |
| 61 | import gov .va.caret. model.impl .BoxGpImpl ; | |
| 62 | import gov .va.caret. model.impl .NoteImpl; | |
| 63 | import gov .va.caret. model.impl .WorImImpl ; | |
| 64 | import gov .va.caret. model.supp ort.NoteSu pport; | |
| 65 | import gov .va.caret. model.supp ort.Vendor ; | |
| 66 | import gov .va.caret. model.supp ort.WorkIt emSupport; | |
| 67 | import gov .va.caret. model.supp ort.WorkTy pe; | |
| 68 | import gov .va.caret. security.C Action; | |
| 69 | import gov .va.caret. security.C Action.Car etCan; | |
| 70 | import gov .va.caret. service.Bo xGpLocalSe rviceUtil; | |
| 71 | import gov .va.caret. service.Ca retLocalSe rviceUtil; | |
| 72 | import gov .va.caret. service.Fa cilLocalSe rviceUtil; | |
| 73 | import gov .va.caret. service.Pe rsnLocalSe rviceUtil; | |
| 74 | import gov .va.caret. view.Caret Param; | |
| 75 | import gov .va.caret. workflow.Q ueAction; | |
| 76 | ||
| 77 | public cla ss CaretUt il { | |
| 78 | ||
| 79 | pr ivate stat ic Log _lo g = LogFac toryUtil.g etLog( Car etUtil.cla ss ); | |
| 80 | ||
| 81 | st atic Map<S tring,Long > _visnMap = new Tre eMap<Strin g,Long>(); | |
| 82 | st atic Map<S tring,Map< String,Map <String,Lo ng>>> dist rictMap = null; | |
| 83 | pu blic stati c boolean isMviEnabl ed() { | |
| 84 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "search. mvi.attend ed.enabled " ) ); | |
| 85 | } | |
| 86 | ||
| 87 | pu blic stati c boolean isEmailEna bled() { | |
| 88 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "email.e nabled" ) ); | |
| 89 | } | |
| 90 | ||
| 91 | pu blic stati c boolean isTiuEnabl ed() { | |
| 92 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "tiu.wri te.service .enabled" ) ); | |
| 93 | } | |
| 94 | ||
| 95 | pu blic stati c String g etWsdlDire ctory(){ | |
| 96 | retu rn PropsUt il.get("ws dl.locatio n"); | |
| 97 | } | |
| 98 | ||
| 99 | pu blic stati c String g etEEWsdloc ation(){ | |
| 100 | retu rn PropsUt il.get("EE .wsdl.loca tion"); | |
| 101 | } | |
| 102 | ||
| 103 | pu blic stati c boolean isTrackerE nabled() { | |
| 104 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "form.su bmit.track er.enabled " ) ); | |
| 105 | } | |
| 106 | ||
| 107 | pu blic stati c void sen dPaymentNo tification Mail( Map< String,Obj ect> other Info ) { | |
| 108 | Inte rnetAddres s fromAddr ess = null ; | |
| 109 | Inte rnetAddres s toAddres s = null; | |
| 110 | try { | |
| 111 | fromAddres s = new In ternetAddr ess("
|
|
| 112 | toAddress = new Inte rnetAddres s(" PII "); | |
| 113 | MailMess age mailMe ssage = ne w MailMess age(); | |
| 114 | mailMess age.setTo( toAddress) ; | |
| 115 | mailMess age.setFro m(fromAddr ess); | |
| 116 | mailMess age.setSub ject("Test ing mail w ith Plain Text"); | |
| 117 | mailMess age.setBod y("This Ma il Comes F rom Lifera y Is Easy" ); | |
| 118 | MailServ iceUtil.se ndEmail(ma ilMessage) ; | |
| 119 | System.o ut.println ("Send mai l with Pla in Text"); | |
| 120 | } ca tch (Addre ssExceptio n e) { | |
| 121 | e.prin tStackTrac e(); | |
| 122 | } | |
| 123 | } | |
| 124 | ||
| 125 | ||
| 126 | pu blic stati c boolean isValidate UspsAddres s ( String userAddre ss, String userCity, String us erState, S tring user Zip, Strin g apt ){ | |
| 127 | if ( Toolbox.i sEmpty( ap t ) ) { | |
| 128 | apt = "<Address1 />"; | |
| 129 | } el se { | |
| 130 | apt = "<Address1 >" + apt + "</Addres s1>"; | |
| 131 | } | |
| 132 | String u rlQuery = "API=Verif y&XML=<Add ressValida teRequest USERID=\"4 02VA000055 0\"><Inclu deOptional Elements>t rue</Inclu deOptional Elements>< ReturnCarr ierRoute>t rue</Retur nCarrierRo ute><Addre ss ID=\"0\ "><FirmNam e />"+ apt +"<Addres s2>"+userA ddress+"</ Address2>< City>"+use rCity+"</C ity><State >"+userSta te+"</Stat e><Zip5>"+ userZip+"< /Zip5><Zip 4></Zip4>< /Address>< /AddressVa lidateRequ est>"; | |
| 133 | ||
| 134 | try{ | |
| 135 | URI uri = new URI( | |
| 136 | "http", | |
| 137 | "product ion.shippi ngapis.com ", | |
| 138 | "/Shippi ngAPI.dll" , | |
| 139 | urlQuery , | |
| 140 | null); | |
| 141 | URL url = uri. toURL(); | |
| 142 | Docu mentBuilde rFactory f actory = D ocumentBui lderFactor y.newInsta nce(); | |
| 143 | Docu mentBuilde r db = fac tory.newDo cumentBuil der(); | |
| 144 | Docu ment doc = db.parse( url.openSt ream()); | |
| 145 | doc. getDocumen tElement() .normalize (); | |
| 146 | Node List nodeL ist = doc. getElement sByTagName ("Error"); | |
| 147 | if ( nodeList ! = null && nodeList.g etLength() > 0) { | |
| 148 | return fal se; | |
| 149 | } | |
| 150 | retu rn true; | |
| 151 | } catch (Exception e) { | |
| 152 | Appl icationWor kFlowExcep tion.handl eException (e); | |
| 153 | } | |
| 154 | return f alse; | |
| 155 | } | |
| 156 | ||
| 157 | pu blic stati c Note cre ateNote(Da te now, lo ng chainId , long gro upId, long userId, | |
| 158 | String messageSt ring) { | |
| 159 | ||
| 160 | Note note; | |
| 161 | if ( messageSt ring == nu ll ){ | |
| 162 | note = null; | |
| 163 | Applic ationWorkF lowExcepti on.handleE xception(" CREATE NOT E on EMPTY "); | |
| 164 | } el se { | |
| 165 | note = new NoteS upport ( n ew NoteImp l() ); | |
| 166 | note.s etCreation Date(now); | |
| 167 | note.s etValue( m essageStri ng ); | |
| 168 | note.s etChainId( chainId); | |
| 169 | note.s etGroupId( groupId); | |
| 170 | note.s etUserId(u serId); | |
| 171 | } | |
| 172 | retu rn note; | |
| 173 | } | |
| 174 | ||
| 175 | pu blic stati c List<Wor Im> create WorkItems ( PortletR equest req uest, long groupId, BaseModel< ?> src, bo olean[] ch anges, lon g veteranP ersnId, lo ng caregiv erPersnId ){ | |
| 176 | List <WorIm> wo rkItems = new ArrayL ist<WorIm> (); | |
| 177 | Map< WorkType,W orIm> work ItemMap = (Map)reque st.getAttr ibute("wor kItemMap") ; | |
| 178 | if ( workItemM ap == null ){ | |
| 179 | workIt emMap = ne w HashMap< WorkType,W orIm>(); | |
| 180 | reques t.setAttri bute("work ItemMap", workItemMa p); | |
| 181 | } | |
| 182 | Serv iceContext sc = Care tParam.set CaretServi ceContext( request); | |
| 183 | WorI m workItem ; | |
| 184 | for ( int ndx = 0; ndx < changes.l ength; ndx ++ ){ | |
| 185 | if ( c hanges[ndx ] ){ | |
| 186 | switch ( ndx ){ | |
| 187 | case (0) : | |
| 188 | if ( workI temMap.con tainsKey( WorkType.P II_CHANGE) ) continu e; | |
| 189 | workItem = CaretUt il.createW orkItem(sc , groupId, src, Work Type.PII_C HANGE, vet eranPersnI d, caregiv erPersnId) ; | |
| 190 | workItem Map.put( W orkType.PI I_CHANGE, workItem); | |
| 191 | workItems. add ( work Item ); | |
| 192 | break; | |
| 193 | case (1) : | |
| 194 | if ( workI temMap.con tainsKey( WorkType.N AME_CHANGE ) ) contin ue; | |
| 195 | workItem = CaretUt il.createW orkItem(sc , groupId, src, Work Type.NAME_ CHANGE, ve teranPersn Id, caregi verPersnId ); | |
| 196 | workItem Map.put( W orkType.NA ME_CHANGE, workItem) ; | |
| 197 | workItems. add ( work Item ); | |
| 198 | break; | |
| 199 | case (2) : | |
| 200 | if ( workI temMap.con tainsKey( WorkType.I NSURANCE_C HANGE) ) c ontinue; | |
| 201 | workItem = CaretUt il.createW orkItem(sc , groupId, src, Work Type.INSUR ANCE_CHANG E, veteran PersnId, c aregiverPe rsnId); | |
| 202 | workItem Map.put( W orkType.IN SURANCE_CH ANGE, work Item); | |
| 203 | workItems. add ( work Item ); | |
| 204 | break; | |
| 205 | case (3) : | |
| 206 | if ( workI temMap.con tainsKey( WorkType.A DDRESS_CHA NGE) ) con tinue; | |
| 207 | workItem = CaretUt il.createW orkItem(sc , groupId, src, Work Type.ADDRE SS_CHANGE, veteranPe rsnId, car egiverPers nId); | |
| 208 | workItem Map.put( W orkType.AD DRESS_CHAN GE, workIt em); | |
| 209 | workItems. add ( work Item ); | |
| 210 | break; | |
| 211 | case (4) : | |
| 212 | if ( workI temMap.con tainsKey( WorkType.F ACILITY_CH ANGE) ) co ntinue; | |
| 213 | workItem = CaretUt il.createW orkItem(sc , groupId, src, Work Type.FACIL ITY_CHANGE , veteranP ersnId, ca regiverPer snId); | |
| 214 | workItem Map.put( W orkType.FA CILITY_CHA NGE, workI tem); | |
| 215 | workItems. add ( work Item ); | |
| 216 | break; | |
| 217 | default: | |
| 218 | } | |
| 219 | } | |
| 220 | } | |
| 221 | retu rn workIte ms; | |
| 222 | } | |
| 223 | ||
| 224 | pu blic stati c WorIm cr eateWorkIt em ( Servi ceContext sc, long g roupId, Ba seModel<?> src, Work Type type, long vete ranPersnId , long car egiverPers nId ){ | |
| 225 | retu rn CaretUt il.createW orkItem(sc , groupId, src, vete ranPersnId , type.na me(), care giverPersn Id, type.g etDueDate( sc.getCre ateDate() ) ); | |
| 226 | } | |
| 227 | ||
| 228 | pu blic stati c WorIm cr eateWorkIt em ( Servi ceContext sc, long g roupId, Ba seModel<?> src, long veteranPe rsnId, Str ing name, long careg iverPersnI d, Date du eDate ){ | |
| 229 | retu rn CaretUt il.createW orkItem(sc , groupId, PortalUti l.getClass NameId( sr c.getModel Class() ), (Long)src .getPrimar yKeyObj(), veteranPe rsnId, na me, caregi verPersnId , dueDate ); | |
| 230 | } | |
| 231 | ||
| 232 | pu blic stati c WorIm cr eateWorkIt em ( Servi ceContext sc, long g roupId, lo ng srcClas sId, long srcPrimary Key, long veteranPer snId, Stri ng name, l ong caregi verPersnId , Date due Date ){ | |
| 233 | WorI m workItem = new Wor ImImpl(); | |
| 234 | if ( groupId < 1200 ) { | |
| 235 | workIt em.setStat us( CaretS trPool.PEN DING ); | |
| 236 | } el se { | |
| 237 | workIt em.setStat us( CaretS trPool.NEW ); | |
| 238 | } | |
| 239 | work Item.setCr eationDate ( sc.getCr eateDate() ); | |
| 240 | work Item.setGr oupId( gro upId ); | |
| 241 | work Item.setCl assPk( src PrimaryKey ); | |
| 242 | work Item.setPe rsnId(vete ranPersnId ); | |
| 243 | work Item.setCa regiverId( caregiverP ersnId); | |
| 244 | work Item.setTy pe( name ) ; | |
| 245 | if ( _log.isIn foEnabled( ) ){ | |
| 246 | _log.i nfo("using DueDate=" + dueDate ); | |
| 247 | } | |
| 248 | work Item.setDu eDate( due Date ); | |
| 249 | if ( _log.isIn foEnabled( ) ){ | |
| 250 | _log.i nfo("using src.getMo delClass() =" + srcCl assId ); | |
| 251 | } | |
| 252 | work Item.setCl assId( src ClassId ); | |
| 253 | retu rn workIte m; | |
| 254 | } | |
| 255 | ||
| 256 | pu blic stati c WorIm cr eateHomeVi sitWorkIte m ( Servic eContext s c, long gr oupId, Bas eModel<?> src, WorkT ype type, long veter anPersnId, long care giverPersn Id, long v cgId, Date completio nDate){ | |
| 257 | WorI m workItem = new Wor ImImpl(); | |
| 258 | work Item.setSt atus( Care tStrPool.N EW ); | |
| 259 | work Item.setCr eationDate ( sc.getCr eateDate() ); | |
| 260 | work Item.setGr oupId( gro upId ); | |
| 261 | work Item.setTy pe( type.n ame() ); | |
| 262 | work Item.setCl assPk( (Lo ng)src.get PrimaryKey Obj() ); | |
| 263 | work Item.setPe rsnId(vete ranPersnId ); | |
| 264 | work Item.setCa regiverId( caregiverP ersnId); | |
| 265 | if ( _log.isIn foEnabled( ) ){ | |
| 266 | _log.i nfo("using DueDate=" + type.ge tBusinessD ueDate( co mpletionDa te ) ); | |
| 267 | } | |
| 268 | work Item.setDu eDate( typ e.getBusin essDueDate ( completi onDate ) ) ; | |
| 269 | if ( _log.isIn foEnabled( ) ){ | |
| 270 | _log.i nfo("using src.getMo delClass() =" + src.g etModelCla ss()); | |
| 271 | } | |
| 272 | work Item.setCl assId( Por talUtil.ge tClassName Id( src.ge tModelClas s() ) ); | |
| 273 | work Item.setVc gId(vcgId) ; | |
| 274 | retu rn workIte m; | |
| 275 | } | |
| 276 | ||
| 277 | pu blic stati c Map<Stri ng,Map<Str ing,Map<St ring,Long> >> getVhaO rgTree( lo ng company Id, boolea n includeN umber ) th rows Appli cationWork FlowExcept ion { | |
| 278 | ||
| 279 | if ( CaretUtil .districtM ap == null ){ | |
| 280 | try { | |
| 281 | Organiza tion head = Organiza tionLocalS erviceUtil .getOrgani zation( co mpanyId, P ortletProp s.get(Care tStrPool.H EAD_ORG_NA ME) ); | |
| 282 | CaretUti l.district Map = new HashMap<St ring,Map<S tring,Map< String,Lon g>>>(); | |
| 283 | for ( Or ganization district: Organizat ionLocalSe rviceUtil. getOrganiz ations( co mpanyId, h ead.getOrg anizationI d() ) ){ | |
| 284 | Map<String ,Map<Strin g,Long>> v isnMap = n ew TreeMap <String,Ma p<String,L ong>>(); | |
| 285 | CaretUtil. districtMa p.put(dist rict.getNa me(), visn Map ); | |
| 286 | for ( Orga nization v isn: Organ izationLoc alServiceU til.getOrg anizations ( companyI d, distric t.getOrgan izationId( ) ) ){ | |
| 287 | Ma p<String,L ong> facil ityMap = n ew TreeMap <String,Lo ng>(); | |
| 288 | vi snMap.put( visn.getNa me(), faci lityMap ); | |
| 289 | Ca retUtil._v isnMap.put ( visn.get Name(), vi sn.getOrga nizationId () ); | |
| 290 | fo r ( Organi zation fac ility : Or ganization LocalServi ceUtil.get Organizati ons( compa nyId, visn .getOrgani zationId() ) ){ | |
| 291 | Faci l facil = FacilLocal ServiceUti l.getByOrg Id( facili ty.getPrim aryKey() ) ; | |
| 292 | ||
| 293 | faci lityMap.pu t( include Number? fa cil.getFac ilityNumbe r() + Stri ngPool.COM MA_AND_SPA CE + facil ity.getNam e() + Stri ngPool.COM MA_AND_SPA CE + facil .getLocati on() : | |
| 294 | facili ty.getName (), | |
| 295 | facility .getOrgani zationId() ); | |
| 296 | } | |
| 297 | } | |
| 298 | } | |
| 299 | } catc h (PortalE xception e ) { | |
| 300 | throw ne w Applicat ionWorkFlo wException (e); | |
| 301 | } catc h (SystemE xception e ) { | |
| 302 | throw ne w Applicat ionWorkFlo wException (e); | |
| 303 | } | |
| 304 | ||
| 305 | } | |
| 306 | retu rn CaretUt il.distric tMap; | |
| 307 | } | |
| 308 | ||
| 309 | pu blic stati c Map<Long , String> getVhaOrgL ist(Portle tRequest a ctionReque st) throws Applicati onWorkFlow Exception { | |
| 310 | ||
| 311 | Port letSession psession = actionRe quest.getP ortletSess ion(); | |
| 312 | Map< Long, Stri ng> linked ; | |
| 313 | if ( psession. getAttribu te(CaretSt rPool.VHA_ MEMBER) == null ) { | |
| 314 | linked = new Lin kedHashMap <Long, Str ing>(); | |
| 315 | } el se { | |
| 316 | linked = (Map<Lo ng, String >)psession .getAttrib ute(CaretS trPool.VHA _MEMBER); | |
| 317 | } | |
| 318 | ||
| 319 | Faci lityDashbo ardConfig config = ( FacilityDa shboardCon fig)psessi on.getAttr ibute(Care tStrPool.D ASHBOARD_C ONFIG); | |
| 320 | try { | |
| 321 | Set<Lo ng> groupI ds = new H ashSet<Lon g>( config .getGroupI d() ); | |
| 322 | groupI ds.addAll( config.ge tVisnId() ); | |
| 323 | for ( Long group Id : group Ids ){ | |
| 324 | Organiza tion org = Organizat ionLocalSe rviceUtil. getOrganiz ation( gro upId ); | |
| 325 | Facil fa cil = null ; | |
| 326 | if ( !or g.getName( ).toLowerC ase().star tsWith("vi sn")) { | |
| 327 | facil = Fa cilLocalSe rviceUtil. getByOrgId ( org.getO rganizatio nId() ); | |
| 328 | } | |
| 329 | if ( fac il == null ){ | |
| 330 | // linked. put( 1l, o rg.getName () ); | |
| 331 | for ( Orga nization s ubOrg : or g.getSubor ganization s()){ | |
| 332 | fa cil = Faci lLocalServ iceUtil.ge tByOrgId( subOrg.get Organizati onId() ); | |
| 333 | li nked.put( subOrg.get Organizati onId(), fa cil.getFac ilityNumbe r() + Stri ngPool.COM MA_AND_SPA CE + subOr g.getName( ) ); | |
| 334 | } | |
| 335 | } else { | |
| 336 | // linked.put ( facil.ge tGroupId() , facil.ge tFacilityN umber() + StringPool .COMMA_AND _SPACE + o rg.getName () + Strin gPool.COMM A_AND_SPAC E + facil. getLocatio n() ); | |
| 337 | linked.put ( facil.ge tGroupId() , facil.ge tFacilityN umber() + StringPool .COMMA_AND _SPACE + o rg.getName () ); | |
| 338 | } | |
| 339 | } | |
| 340 | } ca tch (Porta lException e) { | |
| 341 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 342 | } ca tch (Syste mException e) { | |
| 343 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 344 | } | |
| 345 | pses sion.setAt tribute(Ca retStrPool .VHA_MEMBE R, linked) ; | |
| 346 | retu rn linked; | |
| 347 | } | |
| 348 | ||
| 349 | pu blic stati c Map<Stri ng,Long> g etVisnMap( ){ | |
| 350 | retu rn _visnMa p; | |
| 351 | } | |
| 352 | ||
| 353 | pu blic stati c String g etUserFull Name(long userId) { | |
| 354 | try { | |
| 355 | User u ser = User LocalServi ceUtil.get User( user Id ); | |
| 356 | return user.getL astName() + StringPo ol.COMMA_A ND_SPACE + user.getF irstName() ; | |
| 357 | } ca tch (Porta lException e) { | |
| 358 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 359 | } ca tch (Syste mException e) { | |
| 360 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 361 | } | |
| 362 | retu rn StringP ool.BLANK; | |
| 363 | } | |
| 364 | ||
| 365 | pu blic stati c String g etPersnFul lName(long persnId) { | |
| 366 | try { | |
| 367 | Persn persn = Pe rsnLocalSe rviceUtil. getPersn( persnId ); | |
| 368 | if ( C aretStrPoo l.UNKNOWN_ IDENTITY.e quals( per sn.getStat us() ) ){ | |
| 369 | return C aretStrPoo l.UNKNOWN_ IDENTITY; | |
| 370 | } else { | |
| 371 | return p ersn.getLa stName() + StringPoo l.COMMA_AN D_SPACE + persn.getF irstName() ; | |
| 372 | } | |
| 373 | } ca tch (Porta lException e) { | |
| 374 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 375 | } ca tch (Syste mException e) { | |
| 376 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 377 | } | |
| 378 | retu rn StringP ool.BLANK; | |
| 379 | } | |
| 380 | ||
| 381 | pu blic stati c String g etClinicSi te() { | |
| 382 | retu rn PropsUt il.get( "c aret.clini c.site" ); | |
| 383 | } | |
| 384 | ||
| 385 | pu blic stati c String g etOnlineSi te() { | |
| 386 | retu rn PropsUt il.get( "c aret.onlin e.site" ); | |
| 387 | } | |
| 388 | ||
| 389 | pu blic stati c void ini tYesNoBoxG p ( String subgroup, String ye sNoGroup, List<BoxGp > list, in t sequence ) throws Applicatio nWorkFlowE xception{ | |
| 390 | BoxG p yesAnswe r = new Bo xGpImpl(); | |
| 391 | yesA nswer.setB oxGroup(ye sNoGroup); | |
| 392 | yesA nswer.setB oxSubGroup (subgroup) ; | |
| 393 | yesA nswer.setL abel(Caret StrPool.YE S); | |
| 394 | yesA nswer.setV iewSequenc e(sequence ); | |
| 395 | ||
| 396 | BoxG p noAnswer = new Box GpImpl(); | |
| 397 | noAn swer.setBo xGroup(yes NoGroup); | |
| 398 | noAn swer.setBo xSubGroup( subgroup); | |
| 399 | noAn swer.setLa bel(CaretS trPool.NO) ; | |
| 400 | noAn swer.setVi ewSequence (sequence+ 1); | |
| 401 | try { | |
| 402 | list.a dd( BoxGpL ocalServic eUtil.addB oxGp(yesAn swer) ); | |
| 403 | list.a dd( BoxGpL ocalServic eUtil.addB oxGp(noAns wer) ); | |
| 404 | } ca tch (Syste mException e) { | |
| 405 | throw new Applic ationWorkF lowExcepti on(e); | |
| 406 | } | |
| 407 | } | |
| 408 | ||
| 409 | pu blic stati c Vendor v endorUpdat e ( Portle tRequest r equest, Ve ndor vendo r ){ //Wor kItemSuppo rt work | |
| 410 | try{ | |
| 411 | Servic eContext s c = CaretP aram.setCa retService Context(re quest); | |
| 412 | String data = re quest.getP arameter(" data"); | |
| 413 | Map<St ring,Strin g> map = T oolbox.get UrlQuery(d ata); | |
| 414 | vendor .setLastNa me(map.get ("_lastNam e")); | |
| 415 | vendor .setFirstN ame(map.ge t("_firstN ame")); | |
| 416 | vendor .setAddres s(map.get( "_address" )); | |
| 417 | vendor .setCity(m ap.get("_u _city")); | |
| 418 | vendor .setZip(ma p.get("_u_ zip")); | |
| 419 | vendor .setState( map.get("_ u_state")) ; | |
| 420 | vendor .setTaxId( map.get("_ TAXID")); | |
| 421 | vendor .setUserId (sc.getUse rId()); | |
| 422 | WorkTy pe workTyp e = vendor .getWorkTy pe(); | |
| 423 | CaretL ocalServic eUtil.save (vendor); | |
| 424 | if ( w orkType != null ){ | |
| 425 | WorIm wo rIm = ((Wo rkItemSupp ort)reques t.getAttri bute("work Item")); | |
| 426 | WorIm wi s = create WorkItem( sc, 0, ven dor, workT ype, worIm .getPersnI d(), worIm .getCaregi verId() ) ; | |
| 427 | wis.setV cgId(worIm .getVcgId( )); | |
| 428 | if ( wor Im.getUser Id() == sc .getUserId () && CAct ion.canDoC aret(reque st, CaretC an.CBOPC_V ENDOR_Q) ) { | |
| 429 | wis.setUse rId( sc.ge tUserId() ); | |
| 430 | } | |
| 431 | wis.setC lassId( Po rtalUtil.g etClassNam eId( VcgAn .class ) ) ; | |
| 432 | wis.setC lassPk( wo rIm.getCla ssPk() ); | |
| 433 | if ( Wor kType.VEND OR_CREATE == workTyp e ) { | |
| 434 | wis.setCom pletionBy( sc.getUse rId() ); | |
| 435 | wis.setCom pletionDat e( sc.getC reateDate( ) ); | |
| 436 | wis.setQue ueId( 1100 ); | |
| 437 | wis.setSta tus( QueAc tion.REVIE W_VENDOR_C OMPLETE.na me() ); | |
| 438 | } else { | |
| 439 | wis.setQue ueId(workT ype.workNa me.getQueu eId()); | |
| 440 | } | |
| 441 | CaretLoc alServiceU til.save( wis ); | |
| 442 | } | |
| 443 | return vendor; | |
| 444 | } ca tch (Porta lException e) { | |
| 445 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 446 | } ca tch (Unsup portedEnco dingExcept ion e) { | |
| 447 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 448 | } | |
| 449 | retu rn null; | |
| 450 | } | |
| 451 | ||
| 452 | st atic List< BoxGp> ini tBoxGroup( String na me, String subName ) throws Ap plicationW orkFlowExc eption { | |
| 453 | Stri ng boxGrou pValues = PortletPro ps.get(sub Name); | |
| 454 | List <BoxGp> gr oups = Box GpLocalSer viceUtil.g etBoxGroup s(name, su bName); | |
| 455 | Stri ng[] label s = boxGr oupValues. split( Str ingPool.SE MICOLON ); | |
| 456 | grou ps = new A rrayList<B oxGp>(); | |
| 457 | int i = 0; | |
| 458 | for ( String l abel: labe ls ){ | |
| 459 | BoxGp grp = new BoxGpImpl( ); | |
| 460 | grp.se tBoxGroup( name); | |
| 461 | grp.se tBoxSubGro up(subName ); | |
| 462 | grp.se tLabel(lab el); | |
| 463 | grp.se tViewSeque nce(i++); | |
| 464 | try { | |
| 465 | groups.a dd( BoxGpL ocalServic eUtil.addB oxGp(grp) ); | |
| 466 | } catc h (SystemE xception e ) { | |
| 467 | throw ne w Applicat ionWorkFlo wException (e); | |
| 468 | } | |
| 469 | } | |
| 470 | retu rn groups; | |
| 471 | } | |
| 472 | ||
| 473 | pu blic stati c List<Box Gp> loadBo xGroup ( S tring name , String s ubName ) t hrows Appl icationWor kFlowExcep tion { | |
| 474 | ||
| 475 | List<B oxGp> grou ps = BoxGp LocalServi ceUtil.get BoxGroups( name, subN ame); | |
| 476 | if ( g roups.isEm pty() ){ | |
| 477 | groups = initBoxGr oup(name, subName); | |
| 478 | } | |
| 479 | return groups; | |
| 480 | // Result Map.getFor m(request) .put( subN ame, group s ); | |
| 481 | } | |
| 482 | ||
| 483 | pu blic stati c boolean setExpando Value( Bas eModel<?> baseModel, String at tributeNam e, String value ) th rows Syste mException { | |
| 484 | try { | |
| 485 | if ( V alidator.i sNotNull( attributeN ame ) ){ | |
| 486 | if ( bas eModel.get ExpandoBri dge().hasA ttribute( attributeN ame ) ) { | |
| 487 | // baseModel. getExpando Bridge().s etAttribut e( attribu teName, va lue, false ); | |
| 488 | setUserCus tomFieldVa lue( (User )baseModel , attribut eName, val ue ); | |
| 489 | } else { | |
| 490 | throw new Applicatio nWorkFlowE xception(C aretStrPoo l.METADATA + " not i nitialized " ); | |
| 491 | } | |
| 492 | } | |
| 493 | return true; | |
| 494 | }cat ch (Portal Exception e) { | |
| 495 | Applic ationWorkF lowExcepti on.handleE xception(e ); | |
| 496 | } | |
| 497 | retu rn false; | |
| 498 | } | |
| 499 | ||
| 500 | pu blic stati c String g etExpandoV alue( Expa ndoBridge expandoBri dge, String att ributeName ) { | |
| 501 | retu rn CaretUt il.getExpa ndoValue(e xpandoBrid ge, attrib uteName, f alse); | |
| 502 | } | |
| 503 | ||
| 504 | pu blic stati c String g etExpandoV alue( Expa ndoBridge expandoBri dge, | |
| 505 | String attribute Name, | |
| 506 | Boolea n isSecure ) { | |
| 507 | if ( Validator .isNotNull ( attribut eName ) && expandoBr idge.hasAt tribute( a ttributeNa me ) ) { | |
| 508 | return (String) expandoBri dge.getAtt ribute( at tributeNam e, isSecur e ); | |
| 509 | } | |
| 510 | retu rn StringP ool.BLANK; | |
| 511 | } | |
| 512 | ||
| 513 | pr ivate stat ic void se tUserCusto mFieldValu e ( User u ser, Strin g field, S tring valu e ) throws PortalExc eption, Sy stemExcept ion{ | |
| 514 | Expa ndoTable t able = Exp andoTableL ocalServic eUtil.getD efaultTabl e( user.ge tCompanyId (), User.c lass.getNa me() ); | |
| 515 | Expa ndoColumn column = E xpandoColu mnLocalSer viceUtil.g etColumn( table.getT ableId(), field ); | |
| 516 | Expa ndoValue e xpandoValu e = Expand oValueLoca lServiceUt il.getValu e(table.ge tTableId() , column.g etColumnId (), user.g etPrimaryK ey()); | |
| 517 | if ( expandoVa lue == nul l ) { | |
| 518 | Expand oValueLoca lServiceUt il.addValu e(user.get CompanyId( ), table.g etTableId( ), column. getColumnI d(), user. getPrimary Key(), val ue); | |
| 519 | } el se { | |
| 520 | expand oValue.set Data(value ); | |
| 521 | Expand oValueLoca lServiceUt il.updateE xpandoValu e(expandoV alue); | |
| 522 | } | |
| 523 | } | |
| 524 | ||
| 525 | st atic List< String> re lationship Family = | |
| 526 | Li stUtil.toL ist( Portl etProps.ge t(CaretStr Pool.RELAT IONSHIP_FA MILY).spli t(StringPo ol.COMMA)) ; | |
| 527 | pu blic stati c boolean isFamily(S tring indi vidual) { | |
| 528 | retu rn relatio nshipFamil y.contains (individua l); | |
| 529 | } | |
| 530 | ||
| 531 | pu blic stati c boolean isMockFmsE nabled() { | |
| 532 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "mock.fm s.enabled" ) ); | |
| 533 | } | |
| 534 | ||
| 535 | pu blic stati c boolean isVistaGro upValidate () { | |
| 536 | retu rn StringP ool.TRUE.e quals( Pro psUtil.get ( "vista.v alidate.en abled" ) ) ; | |
| 537 | } | |
| 538 | ||
| 539 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.