191. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 12/5/2017 12:06:41 PM Central 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.

191.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationDataSourceProvider\main\src\java\gov\va\med\imaging\federationdatasource\v8 FederationImageAnnotationDataSourceServiceV8.java Mon Dec 4 21:35:08 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\FederationDataSourceProvider\main\src\java\gov\va\med\imaging\federationdatasource\v8 FederationImageAnnotationDataSourceServiceV8.java Mon Dec 4 22:00:38 2017 UTC

191.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 3 524
Changed 2 4
Inserted 0 0
Removed 0 0

191.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

191.4 Active regular expressions

No regular expressions were active.

191.5 Comparison detail

  1   /**
  2    * 
  3     Package:  MAG - Vis tA Imaging
  4     WARNING:  Per VHA D irective 2 004-038, t his routin e should n ot be modi fied.
  5     Date Cre ated: Aug  23, 2011
  6       Developer:     DN S      TJAHJB
  7     Descript ion: 
  8  
  9           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  10           ;;  Property  of the US  Government .
  11           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  12           ;;  Use of un released v ersions of  this soft ware requi res the us er
  13           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  14           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  15           ;;   telephon e (301) 73 4-0100.
  16           ;;
  17           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  18           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  19           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  20           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  21           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  22           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  23  
  24    */
  25   package go v.va.med.i maging.fed erationdat asource.v8 ;
  26  
  27   import gov .va.med.im aging.Abst ractImagin gURN;
  28   import gov .va.med.im aging.Imag eAnnotatio nURN;
  29   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  30   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  31   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  32   import gov .va.med.im aging.core .interface s.exceptio ns.Securit yException ;
  33   import gov .va.med.im aging.data source.Ima geAnnotati onDataSour ceSpi;
  34   import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption;
  35   import gov .va.med.im aging.exch ange.busin ess.Resolv edSite;
  36   import gov .va.med.im aging.exch ange.busin ess.Site;
  37   import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio n;
  38   import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio nDetails;
  39   import gov .va.med.im aging.exch ange.busin ess.annota tions.Imag eAnnotatio nSource;
  40   import gov .va.med.im aging.fede ration.pro xy.Federat ionProxyUt ilities;
  41   import gov .va.med.im aging.fede ration.pro xy.v8.Fede rationRest ImageAnnot ationProxy V8;
  42   import gov .va.med.im aging.fede rationdata source.Abs tractFeder ationDataS ourceServi ce;
  43   import gov .va.med.im aging.fede rationdata source.Fed erationPat ientArtifa ctDataSour ceServiceV 4;
  44   import gov .va.med.im aging.prox y.services .ProxyServ iceType;
  45   import gov .va.med.im aging.prox y.services .ProxyServ ices;
  46   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  47   import gov .va.med.im aging.url. federation .exception s.Federati onConnecti onExceptio n;
  48   import gov .va.med.im aging.url. vftp.VftpC onnection;
  49   import gov .va.med.im aging.fede ration.pro xy.Federat ionProxyUt ilities;
  50  
  51   import jav a.io.IOExc eption;
  52   import jav a.util.Lis t;
  53  
  54   import org .apache.lo gging.log4 j.LogManag er;
  55   import org .apache.lo gging.log4 j.Logger;
  56  
  57   /**
  58    * @author   DN S      TJAHJB
  59    *
  60    */
  61   public cla ss Federat ionImageAn notationDa taSourceSe rviceV8
  62   extends Ab stractFede rationData SourceServ ice
  63   implements  ImageAnno tationData SourceSpi
  64   {
  65           
  66           pr ivate fina l VftpConn ection fed erationCon nection;
  67           pr ivate Prox yServices  federation ProxyServi ces = null ;
  68           
  69           pr ivate fina l static S tring DATA SOURCE_VER SION = "8" ;
  70           pr ivate Fede rationRest ImageAnnot ationProxy V8 proxy =  null;
  71           pu blic final  static St ring SUPPO RTED_PROTO COL = "vft p";
  72           pr ivate fina l static S tring FEDE RATION_PRO XY_SERVICE _NAME = "F ederation" ;
  73           
  74           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(Fede rationPati entArtifac tDataSourc eServiceV4 .class);
  75  
  76           pu blic Feder ationImage Annotation DataSource ServiceV8( ResolvedAr tifactSour ce resolve dArtifactS ource, Str ing protoc ol)
  77           th rows Unsup portedOper ationExcep tion
  78           {
  79                    supe r(resolved ArtifactSo urce, prot ocol);
  80                    fede rationConn ection = n ew VftpCon nection(ge tMetadataU rl());
  81  
  82                    if(!  (resolved ArtifactSo urce insta nceof Reso lvedSite)  )
  83                             throw  new Unsupp ortedOpera tionExcept ion("The a rtifact so urce must  be an inst ance of Re solvedSite  and it is  a '" + re solvedArti factSource .getClass( ).getSimpl eName() +  "'.");
  84           }
  85           
  86           pu blic stati c Federati onImageAnn otationDat aSourceSer viceV8 cre ate(Resolv edArtifact Source res olvedArtif actSource,  String pr otocol)
  87           th rows Conne ctionExcep tion, Unsu pportedPro tocolExcep tion
  88           {
  89                    retu rn new Fed erationIma geAnnotati onDataSour ceServiceV 8(resolved ArtifactSo urce, prot ocol);
  90           }
  91           
  92           pr otected Lo gger getLo gger()
  93           {
  94                    retu rn logger;
  95           }
  96  
  97           @O verride
  98           pu blic List< ImageAnnot ation> get ImageAnnot ations(Abs tractImagi ngURN imag ingUrn)
  99           th rows Metho dException , Connecti onExceptio n
  100           {
  101                    getL ogger().in fo("getIma geAnnotati ons for im age (" + i magingUrn. toString()  + 
  102                                      "), Tran sactionCon text (" +                                
  103                                      Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  104                    try 
  105                    {
  106                             federa tionConnec tion.conne ct();                   
  107                    }
  108                    catc h(IOExcept ion ioX) 
  109                    {
  110                             getLog ger().erro r("Error g etting ima ge annotat ions", ioX );
  111                             throw  new Federa tionConnec tionExcept ion(ioX);
  112                    }
  113                    List <ImageAnno tation> re sult = get Proxy().ge tImageAnno tations(im agingUrn);
  114                    getL ogger().in fo("getIma geAnnotati ons got ["  + (result  == null ?  "0" : res ult.size() ) + "] ima ge annotat ions from  site [" +  getSite(). getSiteNum ber() + "] ");                     
  115                    retu rn result;
  116           }
  117  
  118           @O verride
  119           pu blic Image Annotation Details ge tAnnotatio nDetails(
  120                             Abstra ctImagingU RN imaging Urn,
  121                             ImageA nnotationU RN imageAn notationUr n) 
  122           th rows Metho dException , Connecti onExceptio n
  123           {
  124                    getL ogger().in fo("getAnn otationDet ails for i mage (" +  imagingUrn .toString( ) + "), an notation ( " + imageA nnotationU rn.toStrin g() + 
  125                                      "), Tran sactionCon text (" +                                
  126                                      Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  127                    try 
  128                    {
  129                             federa tionConnec tion.conne ct();                   
  130                    }
  131                    catc h(IOExcept ion ioX) 
  132                    {
  133                             getLog ger().erro r("Error g etting ann otation de tails", io X);
  134                             throw  new Federa tionConnec tionExcept ion(ioX);
  135                    }
  136                    Imag eAnnotatio nDetails r esult = ge tProxy().g etAnnotati onDetails( imagingUrn ,
  137                                      imageAnn otationUrn );
  138                    getL ogger().in fo("getAnn otationDet ails got [ " + (resul t == null  ? "null" :  "not null ") + "] im age annota tion detai ls from si te [" + ge tSite().ge tSiteNumbe r() + "]") ;                    
  139                    retu rn result;
  140           }
  141  
  142           @O verride
  143           pu blic Image Annotation  storeImag eAnnotatio nDetails(A bstractIma gingURN im agingUrn,
  144                             String  annotatio nDetails,  String ann otationVer sion, Imag eAnnotatio nSource an notationSo urce)
  145           th rows Metho dException , Connecti onExceptio n
  146           {
  147                    getL ogger().in fo("storeI mageAnnota tionDetail s for imag e (" + ima gingUrn.to String() +  
  148                                      "), Tran sactionCon text (" +                                
  149                                      Transact ionContext Factory.ge t().getDis playIdenti ty() + "). ");
  150                    try 
  151                    {
  152                             federa tionConnec tion.conne ct();                   
  153                    }
  154                    catc h(IOExcept ion ioX) 
  155                    {
  156                             getLog ger().erro r("Error s toring ima ge annotat ion", ioX) ;
  157                             throw  new Federa tionConnec tionExcept ion(ioX);
  158                    }
  159                    Imag eAnnotatio n result =  getProxy( ).storeIma geAnnotati onDetails( imagingUrn
  160                                      annotati onDetails,  annotatio nVersion,  annotation Source);
  161                    getL ogger().in fo("storeI mageAnnota tionDetail s got [" +  (result = = null ? " null" : "n ot null")  + "] image  annotatio n from sit e [" + get Site().get SiteNumber () + "]");                      
  162                    retu rn result;
  163           }
  164  
  165           @O verride
  166           pu blic boole an isVersi onCompatib le() 
  167           th rows Secur ityExcepti on
  168           {
  169                    if(g etFederati onProxySer vices() ==  null)
  170                             return  false;            
  171                    try
  172                    {
  173                             getLog ger().debu g("Found F ederationP roxyServic es, lookin g for '" +  ProxyServ iceType.me tadata + " ' service  type at si te [" + ge tSite().ge tSiteNumbe r() + "]." );
  174                             getFed erationPro xyServices ().getProx yService(P roxyServic eType.meta data);
  175                             getLog ger().debu g("Found s ervice typ e '" + Pro xyServiceT ype.metada ta + "' at  site [" +  getSite() .getSiteNu mber() + " ], returni ng true fo r version  compatible .");
  176                             return  true;
  177                    }
  178                    catc h(gov.va.m ed.imaging .proxy.exc eptions.Pr oxyService NotFoundEx ception ps nfX)
  179                    {
  180                             getLog ger().warn ("Cannot f ind proxy  service ty pe '" + Pr oxyService Type.metad ata + "' a t site ["  + getSite( ).getSiteN umber() +  "]");
  181                             return  false;
  182                    }
  183           }
  184           
  185           pr otected Pr oxyService s getFeder ationProxy Services()
  186           {
  187                    if(f ederationP roxyServic es == null )
  188                    {
  189                             federa tionProxyS ervices = 
  190                                      Federati onProxyUti lities.get Federation ProxyServi ces(getSit e(), 
  191                                                       ge tFederatio nProxyName (), getDat aSourceVer sion());
  192                    }
  193                    retu rn federat ionProxySe rvices;
  194           }
  195           
  196           pr otected St ring getFe derationPr oxyName()
  197           {
  198                    retu rn FEDERAT ION_PROXY_ SERVICE_NA ME;
  199           }
  200           
  201           pu blic Strin g getDataS ourceVersi on() 
  202           {
  203                    retu rn DATASOU RCE_VERSIO N;
  204           }
  205           
  206           /* *
  207            *  The artif act source  must be c hecked in  the constr uctor to a ssure that  it is an  instance
  208            *  of Resolv edSite.
  209            *  
  210            *  @return
  211            * /
  212           pr otected Re solvedSite  getResolv edSite()
  213           {
  214                    retu rn (Resolv edSite)get ResolvedAr tifactSour ce();
  215           }
  216           
  217           pr otected Si te getSite ()
  218           {
  219                    retu rn getReso lvedSite() .getSite() ;
  220           }
  221           
  222           pr ivate Fede rationRest ImageAnnot ationProxy V8 getProx y()
  223           th rows Conne ctionExcep tion
  224           {
  225                    if(p roxy == nu ll)
  226                    {
  227                             ProxyS ervices pr oxyService s = getCur rentFedera tionProxyS ervices();
  228                             if(pro xyServices  == null)
  229                                      throw ne w Connecti onExceptio n("Did not  receive a ny applica ble servic es from ID S service  for site [ " + getSit e().getSit eNumber()  + "]");
  230                             proxy  = new Fede rationRest ImageAnnot ationProxy V8(proxySe rvices,
  231                                               getFederat ionConfigu ration());
  232                    }
  233                    retu rn proxy;
  234           }
  235  
  236           /* *
  237            *  Returns t he current  version o f proxy se rvices, if  none are  available  then null  is returne d
  238            * /
  239           pr ivate Prox yServices  getCurrent Federation ProxyServi ces()
  240           {
  241                    if(f ederationP roxyServic es == null )
  242                    {
  243                             federa tionProxyS ervices = 
  244                                      Federati onProxyUti lities.get CurrentFed erationPro xyServices (getSite()
  245                                                       ge tFederatio nProxyName ());
  246                    }
  247                    retu rn federat ionProxySe rvices;
  248           }
  249           
  250           @O verride
  251           pu blic Image Annotation Details ge tMostRecen tAnnotatio nDetails(
  252                             Abstra ctImagingU RN imaging Urn) 
  253           th rows Metho dException , Connecti onExceptio n
  254           {
  255                    // v 8 of this  interface  does not e xplicitly  define thi s method s o use exis ting metho ds to impl ement this
  256                    // f unctionali ty - add a  specific  method for  this in t he next Fe deration i nterface
  257                    List <ImageAnno tation> im ageAnnotat ions = get ImageAnnot ations(ima gingUrn);
  258                    // g et the las t item in  the list ( the newest  annotatio n layer)
  259                    Imag eAnnotatio n mostRece ntAnnotati onLayer =  imageAnnot ations.get (imageAnno tations.si ze() - 1);
  260  
  261                    retu rn getAnno tationDeta ils(imagin gUrn, most RecentAnno tationLaye r.getAnnot ationUrn() );
  262           }
  263  
  264   }