133. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:46 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.

133.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource MixImageDataSourceService.java Thu Jun 29 17:23:07 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\MIXDataSource\main\src\java\gov\va\med\imaging\mixdatasource MixImageDataSourceService.java Thu Jul 6 15:04:34 2017 UTC

133.2 Comparison summary

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

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

133.4 Active regular expressions

No regular expressions were active.

133.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: Jan  10, 2008
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
WERFEJ
  8     Descript ion: 
  9  
  10           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  11           ;;  Property  of the US  Government .
  12           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  13           ;;  Use of un released v ersions of  this soft ware requi res the us er
  14           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  15           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  16           ;;   telephon e (301) 73 4-0100.
  17           ;;
  18           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  19           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  20           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  21           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  22           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  23           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  24  
  25    */
  26   package go v.va.med.i maging.mix datasource ;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  29   import gov .va.med.SE RIALIZATIO N_FORMAT;
  30   import gov .va.med.im aging.Abst ractImagin gURN;
  31   import gov .va.med.im aging.Imag eURN;
  32   import gov .va.med.im aging.arti factsource .ArtifactS ource;
  33   import gov .va.med.im aging.arti factsource .ResolvedA rtifactSou rce;
  34   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  35   import gov .va.med.im aging.core .interface s.exceptio ns.ImageNe arLineExce ption;
  36   import gov .va.med.im aging.core .interface s.exceptio ns.ImageNo tFoundExce ption;
  37   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  38   import gov .va.med.im aging.core .interface s.exceptio ns.MethodR emoteExcep tion;
  39   import gov .va.med.im aging.data source.Abs tractVersi onableData Source;
  40   import gov .va.med.im aging.data source.Ima geDataSour ceSpi;
  41   import gov .va.med.im aging.data source.exc eptions.Un supportedP rotocolExc eption;
  42   import gov .va.med.im aging.exch ange.busin ess.Image;
  43   import gov .va.med.im aging.exch ange.busin ess.ImageF ormatQuali ty;
  44   import gov .va.med.im aging.exch ange.busin ess.ImageF ormatQuali tyList;
  45   import gov .va.med.im aging.exch ange.busin ess.ImageS treamRespo nse;
  46   import gov .va.med.im aging.exch ange.enums .ImageForm at;
  47   import gov .va.med.im aging.exch ange.enums .ImageQual ity;
  48   import gov .va.med.im aging.exch ange.stora ge.DataSou rceImageIn putStream;
  49   import gov .va.med.im aging.exch ange.stora ge.DataSou rceInputSt ream;
  50   import gov .va.med.im aging.mix. DODImageUR N;
  51   import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xy;
  52   import gov .va.med.im aging.mix. proxy.v1.I mageMixPro xyFactory;
  53   import gov .va.med.im aging.mix. rest.proxy .AbstractM ixRestImag eProxy;
  54   import gov .va.med.im aging.mix. rest.proxy .MixRestGe tClient;
  55   import gov .va.med.im aging.mix. webservice s.rest.end points.Mix ImageWADOR estUri;
  56   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  57   import gov .va.med.im aging.url. mix.MIXCon nection;
  58   import gov .va.med.im aging.url. mix.config uration.MI XConfigura tion;
  59   import gov .va.med.im aging.url. mix.config uration.MI XSiteConfi guration;
  60   import gov .va.med.im aging.url. mix.except ions.MIXCo nfiguratio nException ;
  61   import gov .va.med.im aging.url. mix.except ions.MIXCo nnectionEx ception;
  62  
  63   import jav a.io.IOExc eption;
  64   import jav a.util.Arr ayList;
  65   import jav a.util.Has hMap;
  66   import jav a.util.Lis t;
  67   import jav a.util.Map ;
  68  
  69   import jav ax.ws.rs.c ore.MediaT ype;
  70  
  71   import org .apache.lo g4j.Logger ;
  72  
  73   import com .sun.jerse y.api.clie nt.ClientR esponse;
  74  
  75   //import c om.sun.jer sey.api.cl ient.Clien tResponse;
  76  
  77   //import c om.sun.jer sey.api.cl ient.Clien tResponse;
  78  
  79   /**
  80    * @author         
WERFEJ
  81    *
  82    */
  83   public cla ss MixImag eDataSourc eService 
  84   extends Ab stractVers ionableDat aSource
  85   implements  ImageData SourceSpi
  86   {
  87           
  88           pu blic stati c final Li st<ImageFo rmat> acce ptableThum bnailRespo nseTypes;
  89           pu blic stati c final Li st<ImageFo rmat> acce ptableRefe renceRespo nseTypes;
  90           pu blic stati c final Li st<ImageFo rmat> acce ptableDiag nosticResp onseTypes;
  91           
  92           st atic
  93           {
  94                    acce ptableThum bnailRespo nseTypes =  new Array List<Image Format>();
  95                    acce ptableThum bnailRespo nseTypes.a dd(ImageFo rmat.JPEG) ;
  96                    
  97                    acce ptableRefe renceRespo nseTypes =  new Array List<Image Format>();
  98                    acce ptableRefe renceRespo nseTypes.a dd(ImageFo rmat.DICOM JPEG2000);
  99                    
  100                    acce ptableDiag nosticResp onseTypes  = new Arra yList<Imag eFormat>() ;
  101                    acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DICO MJPEG2000) ;
  102   //               acce ptableDiag nosticResp onseTypes. add(ImageF ormat.DICO M); // DIC OM must be  here beca use the re quest type  will be a pplication /dicom whi ch literal ly convert s to this  one
  103           }        
  104           
  105           pr ivate fina l MIXConne ction mixC onnection;
  106           pr ivate MIXC onfigurati on mixConf iguration  = null;
  107           pr ivate MIXS iteConfigu ration mix SiteConfig uration =  null;
  108           pr ivate Abst ractMixRes tImageProx y amrip;
  109  
  110           
  111           //  Hashmap t o hold pro xies based  on the al ien site n umber (if  empty stri ng, will r eturn prox y to BIA),  otherwise  will use  wormhole.
  112           pr ivate Hash Map<String , ImageMix Proxy> xch angeProxie s = new Ha shMap<Stri ng, ImageM ixProxy>() ;
  113           
  114           pr ivate fina l static L ogger logg er = Logge r.getLogge r(MixImage DataSource Service.cl ass);
  115           //  private f inal stati c String M IX_PROXY_S ERVICE_NAM E = "MIX";
  116           pr ivate fina l static S tring DATA SOURCE_VER SION = "1" ;
  117           pu blic final  static St ring SUPPO RTED_PROTO COL = "mix ";
  118           
  119           /* *
  120        * The  Provider  will use t he create( ) factory  method pre ferentiall y
  121        * ove r a constr uctor.  Th is allows  for cachin g of Vista StudyGraph DataSource Service
  122        * ins tances acc ording to  the criter ia set her e.
  123        * 
  124        * @pa ram url
  125        * @pa ram protoc ol
  126        * @re turn
  127        * @th rows Conne ctionExcep tion
  128        * @th rows Unsup portedProt ocolExcept ion 
  129        */
  130       public  static Mi xImageData SourceServ ice create (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col)
  131       throws  Connectio nException , Unsuppor tedProtoco lException
  132       {
  133           re turn new M ixImageDat aSourceSer vice(resol vedArtifac tSource, p rotocol);
  134       }
  135           
  136       /**
  137        * 
  138        * @pa ram resolv edArtifact Source
  139        * @pa ram protoc ol
  140        * @th rows Unsup portedProt ocolExcept ion if the  ResolvedA rtifactSou rce is not  an instan ce of Reso lvedSite
  141        */
  142           pu blic MixIm ageDataSou rceService (ResolvedA rtifactSou rce resolv edArtifact Source, St ring proto col) 
  143           th rows Unsup portedProt ocolExcept ion
  144           {
  145                    supe r(resolved ArtifactSo urce, prot ocol);                  
  146                    mixC onnection  = new MIXC onnection( getArtifac tUrl());
  147                    mixC onfigurati on = MixDa taSourcePr ovider.get MixConfigu ration();
  148           }        
  149  
  150           @O verride
  151           pu blic boole an isVersi onCompatib le() 
  152           {
  153                    // n othing rea lly to che ck
  154                    retu rn true;
  155           }
  156  
  157   //      /*  (non-Java doc)
  158   //       *  @see gov. va.med.ima ging.datas ource.Imag eDataSourc eSpi#getUr l()
  159   //       * /
  160   //      pu blic URL g etUrl() 
  161   //      {
  162   //               retu rn mixConn ection.get URL();
  163   //      }
  164           
  165           @O verride
  166           pu blic DataS ourceInput Stream get ImageTXTFi le(Image i mage)
  167           th rows Metho dException , Connecti onExceptio n
  168           {
  169                    retu rn null;
  170           }
  171  
  172           /* *
  173            *  
  174            *  @see gov. va.med.ima ging.datas ource.Imag eDataSourc e#getImage (gov.va.me d.imaging. exchange.b usiness.Im age, int,  java.lang. String)
  175            * /
  176           @O verride
  177           pu blic Image StreamResp onse getIm age(Image  image, Ima geFormatQu alityList  requestFor matQuality List) 
  178           th rows Metho dException , Connecti onExceptio n
  179           {
  180                    logg er.info("g etImage("  + image.ge tIen() + " ) from Ima ge object  Transactio nContext ( " + Transa ctionConte xtFactory. get().getD isplayIden tity() + " ).");
  181                    try 
  182                    {                         
  183                             ImageM ixProxy pr oxy = getP roxy(image );
  184                             ImageU RN imageUr n = image. getImageUr n();
  185                             //Imag eURN image Urn = Imag eURN.creat e(image.ge tSiteNumbe r(), image .getIen(),  image.get StudyIen() , image.ge tPatientIC N());
  186                             return  getImage( imageUrn,  requestFor matQuality List, prox y);
  187                    }
  188                    catc h(IOExcept ion ioX)
  189                    {
  190                             logger .error("Er ror gettin g image",  ioX);
  191                             throw  new Method RemoteExce ption(ioX) ;
  192                    }
  193           }
  194  
  195           /*  (non-Java doc)
  196            *  @see gov. va.med.ima ging.datas ource.Imag eDataSourc eSpi#getIm age(gov.va .med.imagi ng.ImageUR N, int, ja va.lang.St ring)
  197            *  This is t he main ge tImage cal l in MIX ! !!
  198            * /
  199           @O verride
  200           pu blic Image StreamResp onse getIm age(Global ArtifactId entifier g ai, ImageF ormatQuali tyList req uestFormat QualityLis t) 
  201           th rows Metho dException , MIXConne ctionExcep tion, Conn ectionExce ption
  202           {                 
  203                    // s ubstitute  if(!(gai i nstanceof  ImageURN))  check
  204                    DODI mageURN dI U = new DO DImageURN( );
  205                    if ( !gai.toStr ing().star tsWith(dIU .getDODPre fix()))
  206                    {
  207                             throw  new Method Exception( "GlobalArt ifactIdent ifier '" +  gai.toStr ing() + "'  is not in stanceof D ODImageURN , cannot r etrieve im age from D AS.");
  208                    }
  209                    Imag eURN image Urn = (Ima geURN)gai;
  210                    logg er.info("g etImage("  + imageUrn .toString( ) + ") fro m Image UR N Transact ionContext  (" + Tran sactionCon textFactor y.get().ge tDisplayId entity() +  ").");
  211                    try
  212                    {
  213                             ImageM ixProxy pr oxy = getP roxy(null) ;
  214                             return  getImage( imageUrn,  requestFor matQuality List, prox y);
  215                    }
  216                    catc h(IOExcept ion ioX)
  217                    {
  218                             logger .error("Er ror gettin g image",  ioX);
  219                             throw  new Method RemoteExce ption(ioX) ;
  220                    }                 
  221           }
  222           
  223           //  this is t he common  MIX getIma ge client  call
  224           pr ivate Imag eStreamRes ponse getI mage(
  225                    Imag eURN image Urn, 
  226                    Imag eFormatQua lityList r equestForm atQualityL ist, 
  227                    Imag eMixProxy  proxy) 
  228           th rows Metho dException , MIXConne ctionExcep tion, Conn ectionExce ption
  229           {
  230                    MixD ataSourceC ommon.setD ataSourceM ethodAndVe rsion("get Image", DA TASOURCE_V ERSION);
  231                    Stri ng imageUR N = imageU rn.toStrin g(SERIALIZ ATION_FORM AT.NATIVE) ;
  232                    if(p roxy.getAl ienSiteNum ber() != n ull)
  233                             Transa ctionConte xtFactory. get().addD ebugInform ation("Ret rieving im age from a lien site  number ["  + proxy.ge tAlienSite Number() +  "]");
  234                    logg er.info("M IX getImag e: Retriev ing image  [" + image URN + "] f rom site [ " + getRes olvedArtif actSourceS tring() +  "]");
  235                    // g et desired  imageQual ity
  236                    Imag eFormatQua lityList p runedList  = pruneReq uestList(r equestForm atQualityL ist);
  237                    if ( prunedList .size()==0 )
  238                    {
  239                             String  msg = "MI X getImage  Error: No /Bad Forma tQuality l ist receiv ed for  ["  + imageUR N + "] fro m site ["  + getResol vedArtifac tSourceStr ing() + "] ";
  240                             logger .info(msg) ;
  241                             throw  new Method Exception( msg);
  242                    }
  243                    Imag eQuality i Q = pruned List.getFi rstImageQu ality();
  244                    
  245                    // c ompose URL  to client
  246                    Map< String, St ring> urlP arameterKe yValues =  new HashMa p<String,  String>();
  247                    // u rlParamete rKeyValues .put("{rou tingToken} ", routing Token.toRo utingToken String());
  248                    DODI mageURN do dUrn = new  DODImageU RN(imageUr n);
  249                    urlP arameterKe yValues.pu t("{studyU id}", dodU rn.getStud yUID());
  250                    urlP arameterKe yValues.pu t("{series Uid}", dod Urn.getSer iesUID());
  251                    urlP arameterKe yValues.pu t("{instan ceUid}", d odUrn.getI nstanceUID ());
  252  
  253                    Medi aType mT =  MediaType .APPLICATI ON_OCTET_S TREAM_TYPE ; // ?????
  254                    
  255                    Stri ng urlPath  = MixImag eWADORestU ri.thumbna ilPath;
  256                    if ( iQ == Imag eQuality.R EFERENCE) 
  257                    {
  258                             urlPat h = MixIma geWADORest Uri.dicomJ 2KReferenc ePath;
  259                    }
  260                    else  if (iQ ==  ImageQual ity.DIAGNO STIC)
  261                    {
  262                             urlPat h = MixIma geWADORest Uri.dicomJ 2KDiagnost icPath;
  263                    }
  264                    Stri ng url="";
  265                    try  {
  266                             url =  amrip.getW ebResource Url(urlPat h, urlPara meterKeyVa lues); 
  267                    }
  268                    catc h (Connect ionExcepti on ce) {
  269                             throw  new MIXCon nectionExc eption("MI X getImage : Failed t o connect  to/compose  URL sourc e!" + ce.g etMessage( ));
  270                    }
  271                    // s end reques t to Clien t and chec k response
  272                    MixR estGetClie nt getClie nt = new M ixRestGetC lient(url,  mT, mixCo nfiguratio n);
  273                    Imag eStreamRes ponse imag eStreamRes ponse= nul l;
  274                    Clie ntResponse  clientRes ponse=null ;
  275                    try{  // *** un sure how t o get the  stream!!!!
  276                             client Response =  getClient .executeRe quest(Clie ntResponse .class); / / Connecti onExceptio n & Method Exception
  277                             if (cl ientRespon se.getClie ntResponse Status() = = ClientRe sponse.Sta tus.OK) {
  278                                      imageStr eamRespons e = new Im ageStreamR esponse((D ataSourceI mageInputS tream)clie ntResponse .getEntity InputStrea m(), iQ);
  279                                      imageStr eamRespons e.setMedia Type(mT.to String());
  280                             }
  281                    }
  282                    catc h (Connect ionExcepti on ce) {
  283                             throw  new MIXCon nectionExc eption("MI X getImage : Failed t o connect  to Client! ");
  284                    }
  285                    catc h (MethodE xception m e) {
  286                             throw  new MIXCon nectionExc eption("MI X getImage : Error ge tting Clie nt respons e!" + me.g etMessage( ));
  287                    }
  288           re turn image StreamResp onse;
  289           }
  290  
  291           pr ivate MIXS iteConfigu ration get MixSiteCon figuration (String al ienSiteNum ber)
  292           th rows IOExc eption
  293           {
  294   //               MIXS iteConfigu ration mix SiteConfig uration =  null;
  295                    Stri ng reposit oryId = ge tResolvedA rtifactSou rce().getA rtifactSou rce().getR epositoryI d();
  296                    Stri ng primary SiteNumber  = reposit oryId;
  297                    Stri ng seconda rySiteNumb er = null;
  298                    if(( alienSiteN umber != n ull) && (a lienSiteNu mber.lengt h() > 0))
  299                    {
  300                             second arySiteNum ber = repo sitoryId;
  301                             primar ySiteNumbe r = alienS iteNumber;
  302                    }
  303                    try 
  304                    {
  305                             mixSit eConfigura tion = 
  306                                      MixDataS ourceProvi der.getMix Configurat ion().getS iteConfigu ration(pri marySiteNu mber, seco ndarySiteN umber);
  307                    }
  308                    catc h(MIXConfi gurationEx ception ec X)
  309                    {
  310                             throw  new IOExce ption(ecX) ;
  311                    }                 
  312                    retu rn mixSite Configurat ion;
  313           }
  314           
  315           /*
  316           pr ivate Imag eXChangePr oxy getPro xy()
  317           th rows IOExc eption
  318           {
  319                    retu rn getProx y(null);
  320           }
  321           */
  322           
  323           pr ivate Imag eMixProxy  getProxy(I mage image )
  324           th rows IOExc eption
  325           {
  326                    Stri ng alienSi teNumber =  null;
  327                    bool ean isAlie nSiteNumbe r = false;
  328                    if(( image != n ull) && (i mage.getAl ienSiteNum ber() != n ull))
  329                    {
  330                             alienS iteNumber  = image.ge tAlienSite Number();
  331                             if(xch angeProxie s.contains Key(alienS iteNumber) )
  332                             {
  333                                      return x changeProx ies.get(al ienSiteNum ber);
  334                             }                         
  335                    }                 
  336                    MIXS iteConfigu ration mix SiteConfig uration =  getMixSite Configurat ion(alienS iteNumber) ;
  337                    Stri ng host =  mixConnect ion.getURL ().getHost ();
  338                    int  port = mix Connection .getURL(). getPort();
  339                    if(m ixSiteConf iguration. containsHo stAndPort( ))
  340                    {
  341                             host =  mixSiteCo nfiguratio n.getHost( );
  342                             port =  mixSiteCo nfiguratio n.getPort( );
  343                             isAlie nSiteNumbe r = true;
  344                    }
  345                    Imag eMixProxy  proxy = Im ageMixProx yFactory.g etSingleto n().get(
  346                                      host, 
  347                                      port, 
  348                                      mixSiteC onfigurati on,
  349                                      isAlienS iteNumber  ? alienSit eNumber :  null,
  350                                      MixDataS ourceProvi der.getMix Configurat ion());   
  351                    
  352                    xcha ngeProxies .put(alien SiteNumber , proxy);      
  353                    
  354                    retu rn proxy;            
  355                    
  356           }
  357  
  358           @O verride
  359           pu blic DataS ourceInput Stream get ImageTXTFi le(ImageUR N imageURN )
  360           th rows Unsup portedOper ationExcep tion, Meth odExceptio n,
  361                    Conn ectionExce ption, Ima geNotFound Exception,  ImageNear LineExcept ion 
  362           {
  363                    retu rn null;
  364           }
  365  
  366           @O verride
  367           pu blic Strin g getImage Informatio n(Abstract ImagingURN  imagingUr n, boolean  includeDe letedImage s)
  368           th rows Unsup portedOper ationExcep tion, Meth odExceptio n,
  369                    Conn ectionExce ption, Ima geNotFound Exception 
  370           {
  371                    thro w new Unsu pportedOpe rationExce ption("The  MIX Image DataSource  does not  support th e getImage Informatio n method." );
  372           }
  373  
  374           @O verride
  375           pu blic Strin g getImage SystemGlob alNode(Abs tractImagi ngURN imag ingUrn)
  376                             throws  Unsupport edOperatio nException , MethodEx ception,
  377                             Connec tionExcept ion, Image NotFoundEx ception {
  378                    thro w new Unsu pportedOpe rationExce ption("The  MIX Image DataSource  does not  support th e getImage Informatio n method." );
  379           }
  380           
  381           @O verride
  382           pu blic Strin g getImage DevFields( AbstractIm agingURN i magingUrn,  String fl ags)
  383           th rows Unsup portedOper ationExcep tion, Meth odExceptio n,
  384                    Conn ectionExce ption, Ima geNotFound Exception 
  385           {
  386                    thro w new Unsu pportedOpe rationExce ption("The  MIX Image DataSource  does not  support th e getImage Informatio n method." );
  387           }
  388  
  389           /* *
  390            *  This func tion reduc es the req uested for mat list t o a list a cceptable  by the DOD .
  391            *  If the re quest incl udes forma ts that th e DOD does  not expec t, they wi ll not wor k properly
  392            *  so if the  request c ame from t he Clinica l Display  client, it  must be r educed to  eliminate
  393            *  types lik e TGA, J2K , PDF, DOC , etc.
  394            * /
  395           pr ivate Imag eFormatQua lityList p runeReques tList(Imag eFormatQua lityList r equestList )
  396           {
  397                    Imag eFormatQua lityList p runedList  = new Imag eFormatQua lityList() ;
  398                    for( ImageForma tQuality q uality : r equestList )
  399                    {
  400                             List<I mageFormat > allowabl eFormats =  getAccept ableImageF ormatsForQ uality(qua lity.getIm ageQuality ());
  401                             if(isQ ualityForm atAllowed( quality.ge tImageForm at(), allo wableForma ts))
  402                             {
  403                                      prunedLi st.addUniq ueMime(qua lity);
  404                             }
  405                    }
  406                    retu rn prunedL ist;
  407           }
  408           
  409           pr ivate List <ImageForm at> getAcc eptableIma geFormatsF orQuality( ImageQuali ty quality )
  410           {                 
  411                    if(q uality ==  ImageQuali ty.REFEREN CE) 
  412                             return  acceptabl eReference ResponseTy pes;
  413                    else  if(qualit y == Image Quality.DI AGNOSTIC)
  414                             return  acceptabl eDiagnosti cResponseT ypes;
  415   //               else  if(qualit y == Image Quality.DI AGNOSTICUN COMPRESSED ) -- retir ed for MIX !
  416   //                        return  acceptabl eDiagnosti cResponseT ypes;
  417                    else  // thumbn ail or oth er
  418                             return  acceptabl eThumbnail ResponseTy pes;
  419           }
  420           
  421           pr ivate bool ean isQual ityFormatA llowed(Ima geFormat f ormat, Lis t<ImageFor mat> accep tableForma ts)
  422           {
  423                    for( ImageForma t acceptab leFormat :  acceptabl eFormats)
  424                    {
  425                             if((ac ceptableFo rmat == Im ageFormat. ANYTHING)  ||
  426                                      (accepta bleFormat. getMime(). equalsIgno reCase(for mat.getMim e())))
  427                             {
  428                                      return t rue;
  429                             }
  430                    }                 
  431                    retu rn false;
  432           }
  433           
  434           pr otected St ring getRe solvedArti factSource String()
  435           {
  436                    Arti factSource  artifactS ource = ge tResolvedA rtifactSou rce().getA rtifactSou rce();
  437                    retu rn artifac tSource.ge tHomeCommu nityId() +  ", " + ar tifactSour ce.getRepo sitoryId() ;   
  438           }
  439   }