4185. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/9/2017 3:51:19 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.

4185.1 Files compared

# Location File Last Modified
1 Fri Jun 9 19:51:19 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-svc-consent-mgmt\src\main\java\gov\va\nvap\svc\consentmgmt PolicyInformationPoint.java Fri Apr 21 20:15:58 2017 UTC

4185.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 0 0
Changed 0 0
Inserted 1 473
Removed 0 0

4185.3 Comparison options

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

4185.4 Active regular expressions

No regular expressions were active.

4185.5 Comparison detail

        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. svc.consen tmgmt;
        6  
        7   import gov .va.med.nh in.adapter .audit.Sor tFieldType ;
        8   import gov .va.nvap.p rivacy.Con sentDirect iveDetaile dExpiratio nRequest;
        9   import gov .va.nvap.s vc.consent mgmt.jpa.A uthorityJp aControlle r;
        10   import gov .va.nvap.s vc.consent mgmt.jpa.F acilityJpa Controller ;
        11   import gov .va.nvap.s vc.consent mgmt.jpa.F unctionalR oleJpaCont roller;
        12   import gov .va.nvap.s vc.consent mgmt.jpa.L ocationJpa Controller ;
        13   import gov .va.nvap.s vc.consent mgmt.jpa.O rganizatio nsJpaContr oller;
        14   import gov .va.nvap.s vc.consent mgmt.jpa.P urposeOfUs eJpaContro ller;
        15   import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.Announce ment;
        16   import gov .va.nvap.s vc.consent mgmt.stub. adapter.an nounce.dat a.Announce mentOrg;
        17   import gov .va.nvap.s vc.consent mgmt.stub. data.Autho rity;
        18   import gov .va.nvap.s vc.consent mgmt.stub. data.Conse ntDirectiv e;
        19   import gov .va.nvap.s vc.consent mgmt.stub. data.Conse ntType;
        20   import gov .va.nvap.s vc.consent mgmt.stub. data.Detai ledConsent Directive;
        21   import gov .va.nvap.s vc.consent mgmt.stub. data.Expir ingConsent Configurat ion;
        22   import gov .va.nvap.s vc.consent mgmt.stub. data.Facil ity;
        23   import gov .va.nvap.s vc.consent mgmt.stub. data.Facil ityOptInCo nsent;
        24   import gov .va.nvap.s vc.consent mgmt.stub. data.Funct ionalRole;
        25   import gov .va.nvap.s vc.consent mgmt.stub. data.Locat ion;
        26   import gov .va.nvap.s vc.consent mgmt.stub. data.Optou tReason;
        27   import gov .va.nvap.s vc.consent mgmt.stub. data.Organ ization;
        28   import gov .va.nvap.s vc.consent mgmt.stub. data.Patie ntDocument ;
        29   import gov .va.nvap.s vc.consent mgmt.stub. data.Patie ntDocument Type;
        30   import gov .va.nvap.s vc.consent mgmt.stub. data.Purpo seOfUse;
        31   import jav a.util.Col lection;
        32   import jav a.util.Dat e;
        33   import jav a.util.log ging.Level ;
        34   import jav a.util.log ging.Logge r;
        35  
        36   /**
        37    *
        38    * @author  vhaislegb erb
        39    * @author  Zack Pete rson
        40    */
        41   public cla ss PolicyI nformation Point impl ements PIP Interface  {
        42  
        43       privat e static f inal Logge r logger =  Logger
        44           .g etLogger(P olicyInfor mationPoin t.class.ge tName());
        45  
        46       privat e Authorit yControlle rInterface  authority Controller ;
        47       privat e ConsentD irectiveCo ntrollerIn terface co nsentDirec tiveContro ller;
        48       privat e Expiring ConsentCon trollerInt erface exp iringConse ntControll er;
        49       privat e Facility Controller Interface  facilityCo ntroller;
        50       privat e Function alRoleCont rollerInte rface func tionalRole Controller ;
        51       privat e Location Controller Interface  locationCo ntroller;
        52       privat e Organiza tionsContr ollerInter face organ izationsCo ntroller;
        53       privat e PatientD ocumentCon trollerInt erface pat ientDocume ntControll er;
        54       privat e PurposeO fUseContro llerInterf ace purpos eOfUseCont roller;
        55       privat e Announce mentOrgCon trollerInt erface ann ouncementO rgControll er;
        56  
        57       @Overr ide
        58       public  ConsentDi rective ge tActiveCon sentDirect ive(
        59           fi nal Collec tion<Strin g> patient Iens, fina l ConsentT ype consen tType) {
        60           re turn this. consentDir ectiveCont roller
        61                .findPat ientActive ConsentDir ective(pat ientIens,  consentTyp e);
        62       }
        63  
        64       @Overr ide
        65       public  Collectio n<ConsentD irective>  getActiveC onsentDire ctives(
        66           fi nal Collec tion<Strin g> patient Iens) {
        67           re turn this. consentDir ectiveCont roller
        68                .findPat ientActive ConsentDir ectives(pa tientIens) ;
        69       }
        70  
        71       @Overr ide
        72       public  Collectio n<Function alRole> ge tAllowedFu nctionalRo les() {
        73           re turn this. functional RoleContro ller.findF unctionalR oleEntitie s();
        74       }
        75  
        76       @Overr ide
        77       public  Collectio n<Organiza tion> getA llowedOrga nizations( ) {
        78           re turn this. organizati onsControl ler.getAct iveOrganiz ations();
        79       }
        80  
        81       @Overr ide
        82       public  Boolean g etIsOrgani zationTrus tedSource( String org anizationI d) {
        83  
        84           re turn this. organizati onsControl ler.getIsO rganizatio nTrustedSo urce(organ izationId) ;
        85       }
        86  
        87       @Overr ide
        88       public  Collectio n<PurposeO fUse> getA llowedPurp oseOfUse()  {
        89           re turn this. purposeOfU seControll er.findPur poseOfUseE ntities();
        90       }
        91  
        92       @Overr ide
        93       public  Collectio n<Facility > getAllow edVistAFac ilities()  {
        94           re turn this. facilityCo ntroller.f indAllowed Facilities ();
        95       }
        96  
        97       @Overr ide
        98       public  String ge tAuthority Name(final  String oi d) {
        99           fi nal Author ity author ity = this .authority Controller
        100                .findAut hortiyByOi d(oid);
        101           if  (authorit y != null)  {
        102                return a uthority.g etAuthorit yName();
        103           }
        104           re turn null;
        105       }
        106  
        107       @Overr ide
        108       public  PatientDo cument get ConsentDir ectiveDocu mentByType (
        109           fi nal Consen tDirective  consentDi rective,
        110           fi nal Patien tDocumentT ype patien tDocumentT ype) {
        111           re turn this. patientDoc umentContr oller.find ByConsentD irectiveAn dType(
        112                consentD irective,  patientDoc umentType) ;
        113       }
        114  
        115       @Overr ide
        116       public  Collectio n<PatientD ocument> g etConsentD irectiveDo cuments(
        117           fi nal Consen tDirective  consentDi rective) {
        118           re turn this. patientDoc umentContr oller
        119                .findByC onsentDire ctive(cons entDirecti ve);
        120       }
        121  
        122       @Overr ide
        123       public  Collectio n<ConsentD irective>  getConsent History(
        124           fi nal Collec tion<Strin g> patient Iens) {
        125           re turn this. consentDir ectiveCont roller
        126                .findPat ientConsen tDirective s(patientI ens);
        127       }
        128  
        129       @Overr ide
        130       public  ConsentTy pe getCons entTypeByN ame(final  String nam e) {
        131           re turn this. consentDir ectiveCont roller.fin dConsentTy peByName(n ame);
        132       }
        133  
        134       @Overr ide
        135       public  PurposeOf Use getPur poseOfUseB yValue(Str ing pouVal ue) {
        136           re turn this. consentDir ectiveCont roller.fin dPurposeOf UseByValue (pouValue) ;
        137       }
        138  
        139       @Overr ide
        140       public  Facility  getFacilit yByStation Id(final S tring id)  {
        141           re turn this. facilityCo ntroller.f indFacilit yByStation (id);
        142       }
        143  
        144       @Overr ide
        145       public  Location  getLocatio nByCode(fi nal String  locationC ode) {
        146           re turn this. locationCo ntroller.f indByLocat ionCode(lo cationCode );
        147       }
        148  
        149       @Overr ide
        150       public  Collectio n<OptoutRe ason> getO ptoutReaso ns() {
        151           re turn this. consentDir ectiveCont roller.fin dOptoutRea sons();
        152       }
        153  
        154       @Overr ide
        155       public  Organizat ion getOrg anizationB yId(final  Long id) {
        156           re turn this. organizati onsControl ler.findOr ganization (id);
        157       }
        158  
        159       @Overr ide
        160       public  Organizat ion getOrg anizationB yOid(final  String oi d) {
        161           re turn this. organizati onsControl ler.findOr ganization ByOid(oid) ;
        162       }
        163  
        164       @Overr ide
        165       public  Collectio n<PatientD ocumentTyp e> getPati entDocumen tTypes() {
        166           re turn this. patientDoc umentContr oller.find PatientDoc umentTypes ();
        167       }
        168  
        169       @Overr ide
        170       public  PolicyCon straints g etPolicyCo nstraints(
        171           fi nal Collec tion<Strin g> patient Iens, fina l ConsentT ype consen tType) {
        172  
        173           // ***
        174           //  Before th is check,  an NPE wou ld just be  thrown, a nd all cal lers
        175           //  would han dle that b y using nu ll in plac e of the r eturn from  this
        176           //  method. B ut that ca used distu rbing stac k traces i n the log,  especiall y
        177           //  from the  EJB Facade .
        178           // ***
        179           Co nsentDirec tive patie ntDirectiv e =
        180                getActiv eConsentDi rective(pa tientIens,  consentTy pe);
        181           if (patientDi rective ==  null)
        182           {
        183                return n ull;
        184           }
        185  
        186           fi nal Policy Constraint s policyCo nstraints  = new Poli cyConstrai nts();
        187           po licyConstr aints.setA llowedFunc tionalRole s(this
        188                .getAllo wedFunctio nalRoles() );
        189           po licyConstr aints.setA llowedOrga nizations( this
        190                .getAllo wedOrganiz ations());
        191           po licyConstr aints.setA llowedPurp oseOfUse(t his.getAll owedPurpos eOfUse());
        192           po licyConstr aints.setP atientExcl udedOrgani zations(
        193                    pati entDirecti ve.getExcl udedOrgani zations()) ;
        194           po licyConstr aints.setA llowedVist aFacilitie s(this
        195                .getAllo wedVistAFa cilities() );
        196  
        197           re turn polic yConstrain ts;
        198       }
        199  
        200       public  void setA uthorityCo ntroller(
        201           fi nal Author ityJpaCont roller aut horityCont roller) {
        202           th is.authori tyControll er = autho rityContro ller;
        203       }
        204  
        205       public  void setC onsentDire ctiveContr oller(
        206           fi nal Consen tDirective Controller Interface  consentDir ectiveCont roller) {
        207           th is.consent DirectiveC ontroller  = consentD irectiveCo ntroller;
        208       }
        209  
        210       public  void setE xpiringCon sentContro ller(
        211           fi nal Expiri ngConsentC ontrollerI nterface e xpiringCon sentContro ller) {
        212           th is.expirin gConsentCo ntroller =  expiringC onsentCont roller;
        213       }
        214  
        215       public  void setF acilityCon troller(
        216           fi nal Facili tyJpaContr oller faci lityContro ller) {
        217           th is.facilit yControlle r = facili tyControll er;
        218       }
        219  
        220       public  void setF unctionalR oleControl ler(
        221           fi nal Functi onalRoleJp aControlle r function alRoleCont roller) {
        222           th is.functio nalRoleCon troller =  functional RoleContro ller;
        223       }
        224  
        225       public  void setL ocationCon troller(
        226           fi nal Locati onJpaContr oller loca tionContro ller) {
        227           th is.locatio nControlle r = locati onControll er;
        228       }
        229  
        230       public  void setO rganizatio nsControll er(
        231           fi nal Organi zationsJpa Controller  organizat ionsContro ller) {
        232           th is.organiz ationsCont roller = o rganizatio nsControll er;
        233       }
        234  
        235       public  void setP atientDocu mentContro ller(
        236           fi nal Patien tDocumentC ontrollerI nterface p atientDocu mentContro ller) {
        237           th is.patient DocumentCo ntroller =  patientDo cumentCont roller;
        238       }
        239  
        240       public  void setP urposeOfUs eControlle r(
        241           fi nal Purpos eOfUseJpaC ontroller  purposeOfU seControll er) {
        242           th is.purpose OfUseContr oller = pu rposeOfUse Controller ;
        243       }
        244  
        245       public  Announcem entOrgCont rollerInte rface getA nnouncemen tOrgContro ller() {
        246           re turn annou ncementOrg Controller ;
        247       }
        248  
        249       public  void setA nnouncemen tOrgContro ller(Annou ncementOrg Controller Interface  announceme ntOrgContr oller) {
        250           th is.announc ementOrgCo ntroller =  announcem entOrgCont roller;
        251       }
        252  
        253       @Overr ide
        254       public  void stor eConsentDi rective(fi nal Consen tDirective  consentDi rective) {
        255           if  (consentD irective.g etConsentD irId() ==  null) {
        256                try {
        257                    this .consentDi rectiveCon troller.cr eate(conse ntDirectiv e);
        258                } catch  (final Exc eption ex)  {
        259                    thro w new Poli cyInformat ionPointEx ception(
        260                         "An error  occurred w hile creat ing the ne w patient  consent di rective in  the persi stent stor e.",
        261                         ex);
        262                }
        263           }  else {
        264                try {
        265                    this .consentDi rectiveCon troller.ed it(consent Directive) ;
        266                } catch  (final Exc eption ex)  {
        267                    thro w new Poli cyInformat ionPointEx ception(
        268                         "An error  occured wh ile updati ng the pat ient's con sent direc tive.",
        269                         ex);
        270                }
        271           }
        272       }
        273  
        274       @Overr ide
        275       public  void stor eOrganizat ion(final  Organizati on organiz ation) {
        276  
        277           if  (organiza tion == nu ll) {
        278                throw ne w IllegalA rgumentExc eption(
        279                    "Can not store  null organ ization.") ;
        280           }
        281  
        282           tr y {
        283                if (orga nization.g etOrgId()  == null) {
        284                    this .organizat ionsContro ller.creat e(organiza tion);
        285                } else {
        286                    this .organizat ionsContro ller.edit( organizati on);
        287                }
        288           }  catch (fin al Excepti on ex) {
        289                throw ne w PolicyIn formationP ointExcept ion(
        290                    "Err or storing  organizat ion.", ex) ;
        291           }
        292       }
        293  
        294       @Overr ide
        295       public  void stor ePatientDo cument(fin al Patient Document p atientDocu ment) {
        296           tr y {
        297                this.pat ientDocume ntControll er.create( patientDoc ument);
        298           }  catch (fin al Excepti on ex) {
        299                throw ne w PolicyIn formationP ointExcept ion(
        300                    "Err or creatin g patient  document." , ex);
        301           }
        302       }
        303  
        304       @Overr ide
        305       public  void upda tePatientD ocument(fi nal Patien tDocument  patientDoc ument) {
        306           if  (patientD ocument ==  null) {
        307                throw ne w IllegalA rgumentExc eption(
        308                    "Can not update  a null pa tient docu ment!");
        309           }
        310           tr y {
        311                this.pat ientDocume ntControll er.edit(pa tientDocum ent);
        312           }  catch (fin al Excepti on ex) {
        313                throw ne w PolicyIn formationP ointExcept ion(
        314                    "Cou ld not upd ate patien t document !");
        315           }
        316  
        317       }
        318  
        319       @Overr ide
        320       public  Collectio n<ConsentD irective>  getExpirin gPatientCo nsentDirec tives(
        321           Co llection<S tring> pat ientIens,  ConsentDir ectiveDeta iledExpira tionReques t consentD irectiveEx pirationRe quest) {
        322  
        323           in t daysTilE xpiration  = consentD irectiveEx pirationRe quest.getD ayRange();
        324           Da te startDa te = conse ntDirectiv eExpiratio nRequest.g etStartDat e();
        325           Da te endDate  = consent DirectiveE xpirationR equest.get EndDate();
        326  
        327           in t fromPage  = 0;
        328           in t toPage =  0;
        329  
        330           if  (consentD irectiveEx pirationRe quest.getP ageInfo()  != null) {
        331                int page Number = c onsentDire ctiveExpir ationReque st.getPage Info().get PageNumber ();
        332                int page Size = con sentDirect iveExpirat ionRequest .getPageIn fo().getPa geSize();
        333                fromPage  = pageNum ber * page Size + 1;
        334  
        335                if (page Number <=  0) {
        336                    toPa ge = pageS ize;
        337                } else {
        338                    toPa ge = (page Number + 1 ) * pageSi ze;
        339                }
        340           }  else {
        341                // Expir ed consent  email not ification  case
        342                toPage =  -1;
        343           }
        344  
        345           if  (patientI ens == nul l) {
        346                if (star tDate != n ull || end Date != nu ll) {
        347                    retu rn this.co nsentDirec tiveContro ller.findA llExpiring PatientCon sentDirect ives(start Date, endD ate, fromP age, toPag e);
        348                }
        349                if (days TilExpirat ion == -1)  {
        350                    retu rn this.co nsentDirec tiveContro ller.findA llFutureEx piringPati entConsent Directives (fromPage,  toPage);
        351                }
        352                return t his.consen tDirective Controller .findAllEx piringPati entConsent Directives (daysTilEx piration,  fromPage,  toPage);
        353           }
        354           re turn this. consentDir ectiveCont roller.fin dExpiringP atientCons entDirecti ves(daysTi lExpiratio n, fromPag e, toPage,  patientIe ns);
        355       }
        356  
        357       @Overr ide
        358       public  Collectio n<Detailed ConsentDir ective> ge tExpiringP atientDeta iledConsen tDirective s(
        359           Co nsentDirec tiveDetail edExpirati onRequest  consentDir ectiveExpi rationRequ est) {
        360  
        361           Da te startDa te = conse ntDirectiv eExpiratio nRequest.g etStartDat e();
        362           Da te endDate  = consent DirectiveE xpirationR equest.get EndDate();
        363           St ring facil ityStation  = consent DirectiveE xpirationR equest.get FacilitySt ation();
        364  
        365           St ring conse ntTypeName  = consent DirectiveE xpirationR equest.get ConsentTyp eName();
        366           St ring userI d = consen tDirective Expiration Request.ge tUserId();
        367           in t fromPage  = 0;
        368           in t toPage =  0;
        369  
        370           if  (consentD irectiveEx pirationRe quest.getP ageInfo()  != null) {
        371                int page Number = c onsentDire ctiveExpir ationReque st.getPage Info().get PageNumber ();
        372                int page Size = con sentDirect iveExpirat ionRequest .getPageIn fo().getPa geSize();
        373                fromPage  = pageNum ber * page Size + 1;
        374  
        375                if (page Number <=  0) {
        376                    toPa ge = pageS ize;
        377                } else {
        378                    toPa ge = (page Number + 1 ) * pageSi ze;
        379                }
        380           }
        381  
        382           //  Default s ort values
        383           St ring sortC olumn = "O PTIN_DATE" ;
        384           St ring sortD irection =  "DESC";
        385           if  (consentD irectiveEx pirationRe quest.getS ortFields( ) != null)  {
        386                SortFiel dType sort Field = co nsentDirec tiveExpira tionReques t.getSortF ields().ge tSortField ().get(0);
        387                sortColu mn = sortF ield.getFi eld().name ();
        388                sortDire ction = so rtField.ge tDirection ().value() ;
        389           }
        390  
        391           in t patientT ypes = con sentDirect iveExpirat ionRequest .getPatien tTypes();
        392  
        393           re turn this. consentDir ectiveCont roller.fin dAllExpiri ngDetailed ConsentDir ectives(
        394                startDat e, endDate , facility Station, c onsentType Name, user Id, fromPa ge, toPage , sortColu mn, sortDi rection, p atientType s);
        395       }
        396  
        397       @Overr ide
        398       public  Collectio n<Facility OptInConse nt> getAut horizedCon sentForSum mary() {
        399           re turn this. consentDir ectiveCont roller.fin dAuthorize dConsentFo rOptInSumm ary();
        400       }
        401  
        402       @Overr ide
        403       public  Collectio n<Organiza tion> getA llowedNonC onsumerOnl yOrganizat ions() {
        404           re turn this. organizati onsControl ler.getAct iveNonCons umerOnlyOr ganization s();
        405       }
        406  
        407       @Overr ide
        408       public  Collectio n<Organiza tion> getA llowedCons umerOnlyOr ganization s() {
        409           re turn this. organizati onsControl ler.getAct iveConsume rOnlyOrgan izations() ;
        410       }
        411  
        412       @Overr ide
        413       public  ExpiringC onsentConf iguration  getExpirin gConsentCo nfiguratio n() {
        414           Ex piringCons entConfigu ration con figuration
        415                = this.e xpiringCon sentContro ller.getCo nfiguratio n();
        416  
        417           re turn confi guration;
        418       }
        419  
        420       @Overr ide
        421       public  void upda teExpiring ConsentCon figuration (ExpiringC onsentConf iguration  config) {
        422           tr y {
        423                this.exp iringConse ntControll er.edit(co nfig);
        424           }  catch (Exc eption e)  {
        425                logger.l og(Level.I NFO, "Coul d not upda te Expirin g Consent  Configurat ion");
        426           }
        427       }
        428  
        429       @Overr ide
        430       public  Collectio n<Announce mentOrg> g etAllAnnou ncementOrg s() {
        431           re turn this. announceme ntOrgContr oller.find AllAnnounc ementOrgs( );
        432       }
        433  
        434       @Overr ide
        435       public  Collectio n<Announce mentOrg> g etAnnounce mentOrgsBy Announceme nt(Announc ement anno uncement)  {
        436           re turn this. announceme ntOrgContr oller.find Announceme ntOrgsByAn nouncement (announcem ent);
        437       }
        438  
        439       @Overr ide
        440       public  void stor eAnnouncem entOrg(Ann ouncementO rg announc eOrg) {
        441           tr y {
        442                this.ann ouncementO rgControll er.create( announceOr g);
        443           }  catch (fin al Excepti on ex) {
        444                throw ne w PolicyIn formationP ointExcept ion(
        445                    "Err or creatin g announce ment org." , ex);
        446           }
        447       }
        448  
        449       @Overr ide
        450       public  void upda teAnnounce mentOrg(An nouncement Org announ ceOrg) {
        451           tr y {
        452                this.ann ouncementO rgControll er.edit(an nounceOrg) ;
        453           }  catch (fin al Excepti on ex) {
        454                throw ne w PolicyIn formationP ointExcept ion(
        455                    "Err or updatin g announce ment org." , ex);
        456           }
        457       }
        458  
        459       @Overr ide
        460       public  Collectio n<ConsentD irective>  getRecentl yExpiredCo nsent() {
        461           re turn this. consentDir ectiveCont roller.fin dRecentlyE xpiredCons ent();
        462       }
        463  
        464       @Overr ide
        465       public  ConsentDi rective ge tConsentDi rective(Lo ng id) {
        466           re turn this. consentDir ectiveCont roller.fin dConsentDi rective(id );
        467       }
        468  
        469       @Overr ide
        470       public  Facility  getFacilit yByName(St ring facil ityName) {
        471           re turn this. facilityCo ntroller.f indFacilit yByName(fa cilityName );
        472       }
        473   }