Produced by Araxis Merge on 6/9/2017 3:50:58 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:50:58 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-server\src\main\java\gov\va\nvap\server\service\partner | PartnerOnboardingBean.java | Fri Apr 21 20:03:28 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 0 | 0 |
| Changed | 0 | 0 |
| Inserted | 1 | 272 |
| 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 | * To chan ge this te mplate, ch oose Tools | Templat es | |||||
| 3 | * and ope n the temp late in th e editor. | |||||
| 4 | */ | |||||
| 5 | package go v.va.nvap. server.ser vice.partn er; | |||||
| 6 | ||||||
| 7 | import gov .va.nvap.p artner.Par tner; | |||||
| 8 | import gov .va.nvap.s erver.auth .ServiceAu thenticati on; | |||||
| 9 | import gov .va.nvap.s ervice.aut h.ServiceA udit; | |||||
| 10 | import gov .va.nvap.s ervice.aut h.ServiceA uthenticat ionExcepti on; | |||||
| 11 | import gov .va.nvap.s ervice.par tner.Partn erOnboardi ngExceptio n; | |||||
| 12 | import gov .va.nvap.s vc.consent mgmt.PIPIn terface; | |||||
| 13 | import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.Announce rInterface ; | |||||
| 14 | import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.PatientC onsentBatc hAnnounce; | |||||
| 15 | import gov .va.nvap.s vc.consent mgmt.stub. data.Organ ization; | |||||
| 16 | import jav a.util.Col lection; | |||||
| 17 | import jav a.util.Lis t; | |||||
| 18 | import jav ax.annotat ion.Resour ce; | |||||
| 19 | import jav ax.ejb.Sta teless; | |||||
| 20 | import jav ax.interce ptor.Inter ceptors; | |||||
| 21 | import jav ax.jws.Web Service; | |||||
| 22 | import jav ax.xml.ws. WebService Context; | |||||
| 23 | import org .springfra mework.bea ns.factory .annotatio n.Autowire d; | |||||
| 24 | import org .springfra mework.con text.Appli cationCont ext; | |||||
| 25 | import org .springfra mework.ejb .intercept or.SpringB eanAutowir ingInterce ptor; | |||||
| 26 | ||||||
| 27 | /** | |||||
| 28 | * | |||||
| 29 | * @author vhaislegb erb | |||||
| 30 | */ | |||||
| 31 | @Stateless | |||||
| 32 | @WebServic e(endpoint Interface = "gov.va. nvap.servi ce.partner .PartnerOn boardingSe rvice") | |||||
| 33 | @Intercept ors(Spring BeanAutowi ringInterc eptor.clas s) | |||||
| 34 | public cla ss Partner Onboarding Bean imple ments Part nerOnboard ingBeanLoc al { | |||||
| 35 | ||||||
| 36 | @A utowired | |||||
| 37 | pr ivate Anno uncerInter face annou ncer; | |||||
| 38 | ||||||
| 39 | @A utowired | |||||
| 40 | pr ivate Pati entConsent BatchAnnou nce batchA nnouncer; | |||||
| 41 | ||||||
| 42 | @A utowired | |||||
| 43 | pr ivate PIPI nterface p olicyInfor mationPoin t; | |||||
| 44 | ||||||
| 45 | @A utowired | |||||
| 46 | pr ivate Appl icationCon text appli cationCont ext; | |||||
| 47 | @R esource | |||||
| 48 | pr ivate WebS erviceCont ext contex t; | |||||
| 49 | pr ivate Serv iceAuthent ication au th = new S erviceAuth entication (); | |||||
| 50 | @O verride | |||||
| 51 | pu blic void addPartner (final Par tner partn er, final Boolean an nounce) | |||||
| 52 | throws PartnerOn boardingEx ception { | |||||
| 53 | ||||||
| 54 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 55 | In teger succ ess = 1; | |||||
| 56 | ||||||
| 57 | tr y{ | |||||
| 58 | sa = aut h.checkAut h(context, applicatio nContext," addPartner "); | |||||
| 59 | }c atch (Serv iceAuthent icationExc eption ex) { | |||||
| 60 | return; | |||||
| 61 | } | |||||
| 62 | ||||||
| 63 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 64 | ||||||
| 65 | try { | |||||
| 66 | final Organizati on org = n ew Organiz ation(); | |||||
| 67 | org.se tOrgCommun ityIdPrefi x(partner. getCommuni tyIdPrefix ()); | |||||
| 68 | org.se tOrgContac t(partner. getContact ()); | |||||
| 69 | org.se tOrgDomain (partner.g etDomain() ); | |||||
| 70 | org.se tOrgName(p artner.get Name()); | |||||
| 71 | org.se tOrgNumber (partner.g etNumber() ); | |||||
| 72 | org.se tOrgOid(pa rtner.getO id()); | |||||
| 73 | org.se tOrgPhoneN umber(part ner.getPho neNumber() ); | |||||
| 74 | org.se tActive('Y '); | |||||
| 75 | org.se tIsTrusted ClinicalSo urce('N'); | |||||
| 76 | org.se tOrgConsum erOnly('N' ); | |||||
| 77 | ||||||
| 78 | // per sist the o rganizatio n. | |||||
| 79 | this.p olicyInfor mationPoin t.storeOrg anization( org); | |||||
| 80 | ||||||
| 81 | // pot entially y ou could d o more onb oarding st uff here. | |||||
| 82 | ||||||
| 83 | if (an nounce) { | |||||
| 84 | // do a targeted b atch annou nce to the new partn er | |||||
| 85 | // TODO: Validate SYSTEM use r as the a utomated o n-boarding batch | |||||
| 86 | // proce ssor | |||||
| 87 | final St ring batch Id = this. announcer. createAnno uncementsB atch( | |||||
| 88 | or g, "SYSTEM ", null, n ull, true) ; | |||||
| 89 | if (null != batchI d) { | |||||
| 90 | this.batch Announcer. batchAnnou nce(new St ring[] { b atchId }, | |||||
| 91 | "SYS TEM", "Par tnerOnboar dingBean") ; | |||||
| 92 | } | |||||
| 93 | } | |||||
| 94 | ||||||
| 95 | } ca tch (final Exception ex) { | |||||
| 96 | success = 0; | |||||
| 97 | throw new Partne rOnboardin gException ( | |||||
| 98 | "Error add ing the pa rtner orga nization." , ex); | |||||
| 99 | } fi nally { | |||||
| 100 | if (sa ! = null) { | |||||
| 101 | sa.s etSuccess( success); | |||||
| 102 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 103 | auth .persist(a pplication Context, s a); | |||||
| 104 | } | |||||
| 105 | } | |||||
| 106 | } | |||||
| 107 | ||||||
| 108 | pu blic void setAnnounc er(final A nnouncerIn terface an nouncer) { | |||||
| 109 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 110 | In teger succ ess = 1; | |||||
| 111 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 112 | ||||||
| 113 | tr y{ | |||||
| 114 | sa =auth .checkAuth (context,a pplication Context,"s etAnnounce r"); | |||||
| 115 | }c atch (Serv iceAuthent icationExc eption ex) { | |||||
| 116 | success = 0; | |||||
| 117 | return; | |||||
| 118 | } finally { | |||||
| 119 | if (sa ! = null) { | |||||
| 120 | sa.s etSuccess( success); | |||||
| 121 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 122 | auth .persist(a pplication Context, s a); | |||||
| 123 | } | |||||
| 124 | } | |||||
| 125 | ||||||
| 126 | th is.announc er = annou ncer; | |||||
| 127 | } | |||||
| 128 | ||||||
| 129 | /* * | |||||
| 130 | * | |||||
| 131 | * @param ba tchAnnounc er | |||||
| 132 | * / | |||||
| 133 | pu blic void setBatchAn nouncer(fi nal Patien tConsentBa tchAnnounc e batchAnn ouncer) { | |||||
| 134 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 135 | In teger succ ess = 1; | |||||
| 136 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 137 | ||||||
| 138 | tr y{ | |||||
| 139 | sa = aut h.checkAut h(context, applicatio nContext," setBatchAn nouncer"); | |||||
| 140 | }c atch (Serv iceAuthent icationExc eption ex) { | |||||
| 141 | success = 0; | |||||
| 142 | return; | |||||
| 143 | } finally { | |||||
| 144 | if (sa ! = null) { | |||||
| 145 | sa.s etSuccess( success); | |||||
| 146 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 147 | auth .persist(a pplication Context, s a); | |||||
| 148 | } | |||||
| 149 | } | |||||
| 150 | ||||||
| 151 | this .batchAnno uncer = ba tchAnnounc er; | |||||
| 152 | } | |||||
| 153 | ||||||
| 154 | @O verride | |||||
| 155 | pu blic void setPartner ActiveFlag (final Boo lean activ ate, final String oi d) throws PartnerOnb oardingExc eption { | |||||
| 156 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 157 | In teger succ ess = 1; | |||||
| 158 | ||||||
| 159 | tr y{ | |||||
| 160 | sa = aut h.checkAut h(context, applicatio nContext," setPartner ActiveFlag "); | |||||
| 161 | }c atch (Serv iceAuthent icationExc eption ex) { | |||||
| 162 | return; | |||||
| 163 | } | |||||
| 164 | ||||||
| 165 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 166 | ||||||
| 167 | tr y { | |||||
| 168 | final Or ganization org = thi s.policyIn formationP oint.getOr ganization ByOid(oid) ; | |||||
| 169 | if (org == null) { | |||||
| 170 | thro w new Part nerOnboard ingExcepti on( | |||||
| 171 | String .format( | |||||
| 172 | "The Org anization with OID: %s does no t exist in the syste m.", | |||||
| 173 | oid)); | |||||
| 174 | } | |||||
| 175 | org.se tActive((a ctivate) ? 'Y' : 'N' ); | |||||
| 176 | ||||||
| 177 | this.p olicyInfor mationPoin t.storeOrg anization( org); | |||||
| 178 | } ca tch (final PartnerOn boardingEx ception po e) { | |||||
| 179 | success = 0; | |||||
| 180 | throw poe; | |||||
| 181 | } ca tch (final Exception ex) { | |||||
| 182 | success = 0; | |||||
| 183 | throw new Partne rOnboardin gException ("Error se tting Part ner active flag.", e x); | |||||
| 184 | } fi nally { | |||||
| 185 | if (sa ! = null) { | |||||
| 186 | sa.s etSuccess( success); | |||||
| 187 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 188 | auth .persist(a pplication Context, s a); | |||||
| 189 | } | |||||
| 190 | } | |||||
| 191 | } | |||||
| 192 | ||||||
| 193 | /* * | |||||
| 194 | * | |||||
| 195 | * @param po licyInform ationPoint | |||||
| 196 | * / | |||||
| 197 | pu blic void setPolicyI nformation Point(fina l PIPInter face polic yInformati onPoint) { | |||||
| 198 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 199 | In teger succ ess = 1; | |||||
| 200 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 201 | ||||||
| 202 | tr y { | |||||
| 203 | sa = aut h.checkAut h(context, applicatio nContext," setPolicyI nformation Point"); | |||||
| 204 | } catch (Ser viceAuthen ticationEx ception ex ) { | |||||
| 205 | success = 0; | |||||
| 206 | return; | |||||
| 207 | } finally { | |||||
| 208 | if (sa ! = null) { | |||||
| 209 | sa.s etSuccess( success); | |||||
| 210 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 211 | auth .persist(a pplication Context, s a); | |||||
| 212 | } | |||||
| 213 | } | |||||
| 214 | ||||||
| 215 | th is.policyI nformation Point = po licyInform ationPoint ; | |||||
| 216 | } | |||||
| 217 | ||||||
| 218 | @Overr ide | |||||
| 219 | public void upda tePartnerL ist(List<P artner> pa rtners, Bo olean anno unce) thro ws Partner Onboarding Exception { | |||||
| 220 | Se rviceAudit sa = new ServiceAud it(); | |||||
| 221 | In teger succ ess = 1; | |||||
| 222 | ||||||
| 223 | tr y { | |||||
| 224 | sa = aut h.checkAut h(context, applicati onContext, "setPartn erActiveFl ag"); | |||||
| 225 | } catch (Ser viceAuthen ticationEx ception ex ) { | |||||
| 226 | return; | |||||
| 227 | } | |||||
| 228 | ||||||
| 229 | lo ng startTi me = Syste m.currentT imeMillis( ); | |||||
| 230 | ||||||
| 231 | tr y { | |||||
| 232 | final Co llection<O rganizatio n> orgs = this.polic yInformati onPoint.ge tAllowedOr ganization s(); | |||||
| 233 | for (Par tner p : p artners) { | |||||
| 234 | if ( p.getCommu nityIdPref ix() == nu ll || p.ge tDomain() == null || p.getNumb er() == nu ll || p.ge tName() == null || p .getOid() == null) { | |||||
| 235 | success = 0; | |||||
| 236 | throw new PartnerOnb oardingExc eption("Pa rtner " + p.getNumbe r() + "(" + p.getNum ber() + ") does not have all t he requred informati on."); | |||||
| 237 | } | |||||
| 238 | Bool ean found = false; | |||||
| 239 | for (Organizat ion org : orgs) { | |||||
| 240 | if (p.getN umber().eq uals(org.g etOrgNumbe r())) { | |||||
| 241 | found = true; | |||||
| 242 | org.se tOrgCommun ityIdPrefi x(p.getCom munityIdPr efix()); | |||||
| 243 | org.se tOrgDomain (p.getDoma in()); | |||||
| 244 | org.se tOrgName(p .getName() ); | |||||
| 245 | if (p. getContact () != null ) { | |||||
| 246 | or g.setOrgCo ntact(p.ge tContact() ); | |||||
| 247 | } | |||||
| 248 | if (p. getPhoneNu mber() != null) { | |||||
| 249 | or g.setOrgPh oneNumber( p.getPhone Number()); | |||||
| 250 | } | |||||
| 251 | org.se tOrgOid(p. getOid()); | |||||
| 252 | this.p olicyInfor mationPoin t.storeOrg anization( org); | |||||
| 253 | break; | |||||
| 254 | } | |||||
| 255 | } | |||||
| 256 | if ( !found) { | |||||
| 257 | this.addPa rtner(p, a nnounce); | |||||
| 258 | } | |||||
| 259 | } | |||||
| 260 | } catch (fin al Excepti on ex) { | |||||
| 261 | success = 0; | |||||
| 262 | throw ne w PartnerO nboardingE xception(" Error upda ting partn ers.", ex) ; | |||||
| 263 | } finally { | |||||
| 264 | if (sa ! = null) { | |||||
| 265 | sa.s etSuccess( success); | |||||
| 266 | sa.s etDuration ((int) (Sy stem.curre ntTimeMill is() - sta rtTime)); | |||||
| 267 | auth .persist(a pplication Context, s a); | |||||
| 268 | } | |||||
| 269 | } | |||||
| 270 | ||||||
| 271 | } | |||||
| 272 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.