121. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 3/25/2019 8:58:08 AM 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.

121.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource VistaImagingStudyGraphDataSourceService.java Mon Mar 18 20:39:06 2019 UTC
2 C:\AraxisMergeCompare\Pri_re\IMAG_Source\VISA\Java\VistaImagingDataSourceProvider\main\src\java\gov\va\med\imaging\vistaimagingdatasource VistaImagingStudyGraphDataSourceService.java Tue Mar 19 12:04:26 2019 UTC

121.2 Comparison summary

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

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

121.4 Active regular expressions

No regular expressions were active.

121.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  7, 2008
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7     Develope r:  
  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.vis taimagingd atasource;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  29   import gov .va.med.Pa tientIdent ifier;
  30   import gov .va.med.Ro utingToken ;
  31   import gov .va.med.UR NFactory;
  32   import gov .va.med.im aging.Stud yURN;
  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.MethodE xception;
  36   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  37   import gov .va.med.im aging.exch ange.busin ess.Site;
  38   import gov .va.med.im aging.exch ange.busin ess.Study;
  39   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  40   import gov .va.med.im aging.exch ange.busin ess.StudyS etResult;
  41   import gov .va.med.im aging.exch ange.enums .StudyDele tedImageSt ate;
  42   import gov .va.med.im aging.exch ange.enums .StudyLoad Level;
  43   import gov .va.med.im aging.prot ocol.vista .VistaImag ingTransla tor;
  44   import gov .va.med.im aging.core .interface s.exceptio ns.Patient NotFoundEx ception;
  45   import gov .va.med.im aging.tran sactioncon text.Trans actionCont extFactory ;
  46   import gov .va.med.im aging.url. vista.Stri ngUtils;
  47   import gov .va.med.im aging.url. vista.Vist aQuery;
  48   import gov .va.med.im aging.url. vista.exce ptions.Inv alidVistaC redentials Exception;
  49   import gov .va.med.im aging.url. vista.exce ptions.Vis taMethodEx ception;
  50   import gov .va.med.im aging.vist adatasourc e.common.V istaCommon Utilities;
  51   import gov .va.med.im aging.vist adatasourc e.session. VistaSessi on;
  52   import gov .va.med.im aging.vist aimagingda tasource.c ommon.Vist aImagingCo mmonUtilit ies;
  53   import gov .va.med.im aging.vist aobjects.V istaGroup;
  54  
  55   import jav a.io.IOExc eption;
  56   import jav a.util.Has hMap;
  57   import jav a.util.Map ;
  58   import jav a.util.Sor tedSet;
  59   import jav a.util.Tre eSet;
  60  
  61   import org .apache.lo gging.log4 j.LogManag er;
  62   import org .apache.lo gging.log4 j.Logger;
  63  
  64   /**
  65    * An impl ementation  of a Stud yGraphData SourceSpi  that talks  to VistA.
  66    * 
  67    * NOTE:
  68    * 1.) pub lic method s that do  Vista acce ss (partic ularly any thing defi ned
  69    * in the  StudyGraph DataSource Spi interf ace) must  acquire a  VistaSessi on instanc e using
  70    * getVist aSession() .
  71    * 2.) pri vate metho ds which a re only ca lled from  public met hods that  do Vista a ccess
  72    * must in clude a Vi staSession  parameter , they sho uld not ac quire thei r own Vist aSession
  73    * 3.) Whe re a metho d is both  public and  called fr om within  this class , there sh ould be a
  74    * public  version fo llowing ru le 1, call ing a priv ate versio n followin g rule 2.
  75    * 
  76    * @author   DN S      BECKEC
  77    *
  78    */
  79   public cla ss VistaIm agingStudy GraphDataS ourceServi ce 
  80   extends Ab stractBase VistaImagi ngStudyGra phService
  81   {       
  82           pu blic final  static St ring SUPPO RTED_PROTO COL = "vis taimaging" ;
  83           
  84           /*  ========= ========== ========== ========== ========== ========== ==========
  85            *  Instance  fields and  methods
  86            *  ========= ========== ========== ========== ========== ========== ==========  */
  87           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass());
  88           // private in t maximumP atientSens itivityLev el = DEFAU LT_PATIENT _SENSITIVI TY_LEVEL;
  89           
  90           //  The requi red versio n of VistA  Imaging n eeded to e xecute the  RPC calls  for this  operation
  91           pu blic final  static St ring MAG_R EQUIRED_VE RSION = "3 .0P83";
  92           
  93       /**
  94            *  @param re solvedArti factSource
  95            *  @param pr otocol
  96            * /
  97           pu blic Vista ImagingStu dyGraphDat aSourceSer vice(Resol vedArtifac tSource re solvedArti factSource , String p rotocol)
  98           {
  99                    supe r(resolved ArtifactSo urce, prot ocol);
  100           }
  101  
  102           /*  (non-Java doc)
  103            *  @see gov. va.med.ima ging.vista datasource .AbstractB aseVistaSt udyGraphSe rvice#getR equiredVis taImagingV ersion()
  104            * /
  105           @O verride
  106           pr otected St ring getRe quiredVist aImagingVe rsion() 
  107           {
  108                    retu rn VistaIm agingCommo nUtilities .getVistaD ataSourceI magingVers ion(
  109                             VistaI magingData SourceProv ider.getVi staConfigu ration(), 
  110                             this.g etClass(),  
  111                             MAG_RE QUIRED_VER SION);
  112           }
  113  
  114           /* *
  115            *  Return th e maximum  permissibl e patient  sensitivit y level
  116            *  that will  be includ ed in resu lts.  Sens itivity le vels
  117            *  range fro m:
  118            *  0 - least  sensitive
  119            *      - to  -
  120            *  3 - most  sensitive
  121            *  
  122            *  @return
  123            * /
  124           pu blic int g etMaximumP atientSens itivityLev el(StudyFi lter filte r)
  125           {
  126                    retu rn filter. getMaximum AllowedLev el().getCo de();
  127           }
  128       
  129       /**
  130        * Get ting Studi es from Vi sta is a t wo step-pr ocess beca use:
  131        * a.)  the Vista  data stru cture is n ot organiz ed around  a study-se ries-insta nce hierar chy but
  132        * aro und a stud y-group-in stance, wh ere group  and study  are not sy nonymous.   A Study h as 
  133        * 1.. n Groups a nd a Group  can have  1..n Serie s.
  134        * b.)  the filte ring provi ded by Vis ta does no t implemen t all of t he filteri ng that ou r
  135        * Fil ter object  requires
  136        * 
  137        * @pa ram patien tIcn
  138        * @pa ram filter
  139        * @re turn
  140        * @th rows  
  141        * @se e gov.va.m ed.imaging .datasourc e.StudyGra phDataSour ceSpi#getS tudies(Str ing, Filte r)
  142        */
  143       @Overr ide
  144       public  StudySetR esult getP atientStud ies(Routin gToken glo balRouting Token, Pat ientIdenti fier patie ntIdentifi er, 
  145                    Stud yFilter fi lter, Stud yLoadLevel  studyLoad Level)
  146       throws  Unsupport edOperatio nException , MethodEx ception, C onnectionE xception
  147           {
  148           Vi staCommonU tilities.s etDataSour ceMethodAn dVersion(" getPatient Studies",  getDataSou rceVersion ());
  149           lo gger.info( "getPatien tStudies("  + patient Identifier  + 
  150                                      ", " + ( filter ==  null ? "<n ull>" : fi lter.toStr ing()) + 
  151                                      ", Study  load leve l " + stud yLoadLevel .toString( ) + 
  152                                      ") Trans actionCont ext (" + T ransaction ContextFac tory.get() .getDispla yIdentity( ) + ").");
  153                    
  154                    Vist aSession l ocalVistaS ession = n ull;
  155  
  156                    try
  157                    {
  158                             localV istaSessio n = getVis taSession( );
  159                             
  160                             String  patientDf n = null;
  161                             try
  162                             {
  163                                      patientD fn = getPa tientDfn(l ocalVistaS ession, pa tientIdent ifier);
  164                             }
  165                             catch( PatientNot FoundExcep tion pnfX)
  166                             {
  167                                      // JMW 3 /12/08 The  patient w as not fou nd in the  database,  return an  empty set  of studies  instead o f
  168                             logger .warn("Pat ient [" +  patientIde ntifier +  "] was not  found in  the VistA  database,  returning  empty stud y set", pn fX);
  169                             return  StudySetR esult.crea teFullResu lt(new Tre eSet<Study >());
  170                             }
  171                             
  172                             // if  we are get ting a sin gle study
  173                             if((fi lter != nu ll) && (fi lter.isStu dyIenSpeci fied()))
  174                             {
  175                                      // we ar e getting  a single s tudy                                   
  176                                      logger.i nfo("Getti ng study ' " + filter .getStudyI d().toStri ng() + "'  for patien t '" + pat ientIdenti fier + "'" );
  177                                      Study si ngleStudy  = null;
  178                                      if(filte r.isInclud eAllObject s()){
  179                                               logger.deb ug("Gettin g single s tudy metad ata from b oth old an d new data  structure s.");
  180                                               singleStud y = getSin gleStudyFr omBothData Structures MatchingFi lter(local VistaSessi on, patien tIdentifie r,
  181                                                                                  patientD fn, filter , studyLoa dLevel);
  182                                      }
  183                                      else{
  184                                               logger.deb ug("Gettin g single s tudy metad ata from o ld data st ructure on ly.");
  185                                               singleStud y = getSin gleStudyMa tchingFilt er(localVi staSession , patientI dentifier,  
  186                                                       pa tientDfn,  filter, st udyLoadLev el);
  187                                      }
  188                                      SortedSe t<Study> s tudies = n ew TreeSet <Study>();
  189                                      studies. add(single Study);
  190                                      return S tudySetRes ult.create FullResult (studies);
  191                             }
  192                             // we  are gettin g multiple  studies
  193                             else
  194                             {
  195                                      // we ar e getting  all the st udies for  a patient  (that matc h the filt er)                           
  196                                      logger.i nfo("Getti ng all stu dies that  match filt er for pat ient '" +  patientIde ntifier +  "'");
  197                                      
  198                             // che ck the pat ient sensi tivity fir st, if it  fails an e xception w ill be thr own
  199                             checkP atientSens itive(loca lVistaSess ion, patie ntDfn, pat ientIdenti fier, filt er);
  200                             if(fil ter.isIncl udeAllObje cts()){
  201                                               logger.deb ug("Gettin g all stud ies metada ta from bo th old and  new data  structures .");
  202                                      return S tudySetRes ult.create FullResult (getAllStu diesFromBo thDataStru cturesMatc hingFilter (localVist aSession,  patientIde ntifier, p atientDfn,  filter, s tudyLoadLe vel));                               
  203                             }
  204                             else{
  205                                               logger.deb ug("Gettin g all stud ies metada ta from ol d data str ucture onl y.");
  206                                      return S tudySetRes ult.create FullResult (getAllStu diesMatchi ngFilter(l ocalVistaS ession, pa tientIdent ifier, pat ientDfn, f ilter, stu dyLoadLeve l));
  207                             }
  208                             }                                                            
  209                    } 
  210                    catc h (IOExcep tion e)
  211           {
  212                             throw  new Connec tionExcept ion(e);
  213           }
  214                    fina lly
  215                    {
  216                             try{lo calVistaSe ssion.clos e();}
  217                             catch( Throwable  t){}
  218                    }
  219           }        
  220       
  221       /**
  222        * Thi s method i s implemen ted here f or complet eness.
  223        * As  of this da te it is n ot used in  productio n deployme nt. 
  224        */
  225       @Overr ide
  226           pu blic Study  getStudy( PatientIde ntifier pa tientIdent ifier, Glo balArtifac tIdentifie r studyId)  
  227       throws  MethodExc eption, Co nnectionEx ception
  228           {
  229           Vi staCommonU tilities.s etDataSour ceMethodAn dVersion(" getStudy",  getDataSo urceVersio n());
  230           if ( !(studyI d instance of StudyUR N) )
  231                    thro w new Conn ectionExce ption(this .getClass( ).getSimpl eName() +  " does not  recognize  GAI of ty pe " + stu dyId.getCl ass().getN ame() + ". ");
  232           
  233           St udyFilter  filter = n ew StudyFi lter(study Id); 
  234                    Stud yLoadLevel  studyLoad Level = St udyLoadLev el.FULL;
  235                    Stud ySetResult  result =  getPatient Studies(st udyId, pat ientIdenti fier, filt er, studyL oadLevel);
  236                    if(r esult == n ull)
  237                    {
  238                             logger .error("Go t null Stu dySetResul t - this s hould NEVE R happen!" );
  239                             return  null;
  240                    }
  241                    Sort edSet<Stud y> studies  = result. getArtifac ts();
  242                    if(s tudies !=  null && st udies.size () > 0)
  243                             return  studies.f irst();
  244                    
  245                    retu rn null;
  246           }
  247  
  248       /**
  249        * Thi s method i s implemen ted here f or complet eness.
  250        * As  of this da te it is n ot used in  productio n deployme nt. 
  251        */
  252           @O verride
  253           pu blic Strin g getStudy Report(Pat ientIdenti fier patie ntIdentifi er, Global ArtifactId entifier s tudyId) 
  254           th rows Metho dException , Connecti onExceptio n
  255           {
  256                    Vist aCommonUti lities.set DataSource MethodAndV ersion("ge tStudyRepo rt", getDa taSourceVe rsion());
  257                    Stud y study =  getStudy(p atientIden tifier, st udyId);
  258                    retu rn study.g etRadiolog yReport();
  259           }
  260  
  261           /* *
  262        * 
  263        * @pa ram localV istaSessio n
  264        * @pa ram patien tIcn
  265        * @pa ram patien tDfn
  266        * @pa ram filter
  267        * @pa ram studyL oadLevel
  268        * @re turn
  269        * @th rows Conne ctionExcep tion
  270        * @th rows Metho dException
  271        * @th rows IOExc eption
  272        */
  273       privat e SortedSe t<Study> g etAllStudi esMatching Filter(
  274           Vi staSession  localVist aSession, 
  275           Pa tientIdent ifier pati entIdentif ier, 
  276           St ring patie ntDfn, 
  277           St udyFilter  filter, 
  278           St udyLoadLev el studyLo adLevel)
  279           th rows Conne ctionExcep tion, Meth odExceptio n, IOExcep tion
  280       {
  281                    // N ote: a Stu dy has 1..  Groups an d a Group  can have 1 .. Series!
  282                    Sort edSet<Vist aGroup> gr oups = nul l;
  283                    logg er.info("G etting gro ups for pa tient '" +  patientId entifier +  "'.");
  284                    grou ps = getPa tientGroup s(localVis taSession,  getSite() , patientD fn, patien tIdentifie r, filter) ;          // 23Nov C TB = group s study ie n is null
  285                    logg er.info("F ound '" +  groups.siz e() + "' g roups for  patient '"  + patient Identifier  + "'");
  286                    // n o groups i s not an e xception s cenario bu t it does  mean we do n't need t o bother g etting mor
  287                    // i nformation  about eac h study
  288                    if(g roups.size () == 0)
  289                             return  new TreeS et<Study>( );             // ret urn a zero -length se t              
  290                    
  291                    // W arning: if  this filt er (and st udyIen) is  not null,  reducedGr oup might  truncate m ultiple gr oup studie s!!!
  292                    Map< String, St ring> stud yMap = new  HashMap<S tring, Str ing>();
  293                             
  294                    // J MW 12/17/2 008, call  the filter  to remove  studies f rom the gr oups, this  way
  295                    // t he datasou rce doesn' t need to  have knowl edge of th e filter d etails
  296                    if(f ilter != n ull)
  297                             filter .preFilter (groups);
  298                    
  299                    // i f we filte red everyt hing out r eturn now,  and don't  bother ma king the c all
  300                    // t o populate  the entir e Studies  tree
  301                    if(g roups.size () == 0)
  302                             return  new TreeS et<Study>( );             // ret urn a zero -length se t              
  303                    
  304                    logg er.info("L oading stu dy graph d ata for fi ltered gro ups");
  305  
  306                    // B uild a lis t of Study  IEN
  307                    // T he use of  a Map is a n artifact  of VistA,  which nee ds an inde x of the l ist elemen ts.
  308                    // T he Map end s up as so mething li ke {"0", " 662576753" },{"1", "7 61576512"}  ...
  309                    Stri ngBuilder  groupMessa ge = new S tringBuild er();
  310                    grou pMessage.a ppend('{') ;
  311                    for( VistaGroup  group : g roups)
  312                    {
  313                             // CTB  29Nov2009
  314                             //stud yMap.put(" " + studyM ap.size(),  Base32Con versionUti lity.base3 2Decode(gr oup.getIen ()));
  315                             studyM ap.put( In teger.toSt ring(study Map.size() ), group.g etIen() );
  316                             if(gro upMessage. length() >  1)
  317                                      groupMes sage.appen d(',');
  318                             groupM essage.app end(group. getIen());
  319                    }
  320                    grou pMessage.a ppend('}') ;
  321                    
  322                    //
  323                    bool ean includ esDeletedI mages = (f ilter == n ull ? fals e : filter .isInclude Deleted()) ;
  324                    bool ean canInc ludeDelete dImages =  canRetriev eDeletedIm ages(); //  if this d ata source  cannot su pport gett ing delete d images,  then it is  not an op tion
  325                    Stud yDeletedIm ageState s tudyDelete dImageStat e = StudyD eletedImag eState.can notInclude DeletedIma ges;
  326                    if(c anIncludeD eletedImag es) // if  the DS sup ports gett ing delete d images,  set approp riately ba sed on use r request
  327                             studyD eletedImag eState = ( includesDe letedImage s ? StudyD eletedImag eState.inc ludesDelet edImages :  StudyDele tedImageSt ate.doesNo tIncludeDe letedImage s);
  328                    Sort edSet<Stud y> studies  = getPati entStudyGr aph(localV istaSessio n, studyMa p, patient Dfn, 
  329                                      studyLoa dLevel, st udyDeleted ImageState );
  330                    logg er.info("g etPatientS tudyGraph  for studie s " + grou pMessage.t oString()  + " return ed " + stu dies.size( ) + " stud ies.");
  331                    Sort edSet<Stud y> result 
  332                             VistaI magingComm onUtilitie s.mergeStu dyLists(lo calVistaSe ssion, stu dies, grou ps, studyL oadLevel);
  333                    logg er.info("M erging stu dies and g roups resu lts in " +  result.si ze() + " s tudies.");
  334                    
  335                    // J MW 12/17/2 008, call  the filter  to remove  studies f rom the gr oups, this  way
  336                    // t he datasou rce doesn' t need to  have knowl edge of th e filter d etails
  337                    if(f ilter != n ull)
  338                    {
  339                             filter .postFilte r(result);
  340                    }
  341                    logg er.info("C ompleted g etPatientS tudies(),  returning  '" + resul t.size() +  "' studie s.");
  342                    retu rn result;
  343       }
  344  
  345           /* *
  346        * 
  347        * @pa ram localV istaSessio n
  348        * @pa ram patien tIcn
  349        * @pa ram patien tDfn
  350        * @pa ram filter
  351        * @pa ram studyL oadLevel
  352        * @re turn
  353        * @th rows Conne ctionExcep tion
  354        * @th rows Metho dException
  355        * @th rows IOExc eption
  356        */
  357       privat e SortedSe t<Study> g etAllStudi esFromBoth DataStruct uresMatchi ngFilter(
  358           Vi staSession  localVist aSession, 
  359           Pa tientIdent ifier pati entIdentif ier, 
  360           St ring patie ntDfn, 
  361           St udyFilter  filter, 
  362           St udyLoadLev el studyLo adLevel)
  363           th rows Conne ctionExcep tion, Meth odExceptio n, IOExcep tion
  364       {
  365                    // N ote: a Stu dy has 1..  Groups an d a Group  can have 1 .. Series!
  366                    //So rtedSet<Vi staGroup>  groups = n ull;
  367                    //lo gger.info( "Getting g roups for  patient '"  + patient Identifier  + "'.");
  368                    //gr oups = get PatientGro ups(localV istaSessio n, getSite (), patien tDfn, pati entIdentif ier, filte r);                //  23Nov CTB  = groups  study ien  is null
  369                    //lo gger.info( "Found '"  + groups.s ize() + "'  groups fo r patient  '" + patie ntIdentifi er + "'");
  370                    // n o groups i s not an e xception s cenario bu t it does  mean we do n't need t o bother g etting mor
  371                    // i nformation  about eac h study
  372                    //if (groups.si ze() == 0)
  373                    //re turn new T reeSet<Stu dy>();           // r eturn a ze ro-length  set              
  374                    
  375                    // W arning: if  this filt er (and st udyIen) is  not null,  reducedGr oup might  truncate m ultiple gr oup studie s!!!
  376                    Map< String, St ring> stud yMap = new  HashMap<S tring, Str ing>();
  377                             
  378                    // J MW 12/17/2 008, call  the filter  to remove  studies f rom the gr oups, this  way
  379                    // t he datasou rce doesn' t need to  have knowl edge of th e filter d etails
  380                    //if (filter !=  null)
  381                    //       filter .preFilter (groups);
  382                    
  383                    // i f we filte red everyt hing out r eturn now,  and don't  bother ma king the c all
  384                    // t o populate  the entir e Studies  tree
  385                    //if (groups.si ze() == 0)
  386                    //       return  new TreeS et<Study>( );             // ret urn a zero -length se t              
  387                    
  388                    //lo gger.info( "Loading s tudy graph  data for  filtered g roups");
  389  
  390                    // B uild a lis t of Study  IEN
  391                    // T he use of  a Map is a n artifact  of VistA,  which nee ds an inde x of the l ist elemen ts.
  392                    // T he Map end s up as so mething li ke {"0", " 662576753" },{"1", "7 61576512"}  ...
  393                    //St ringBuilde r groupMes sage = new  StringBui lder();
  394                    //gr oupMessage .append('{ ');
  395                    //fo r(VistaGro up group :  groups)
  396                    //{
  397                             // CTB  29Nov2009
  398                             //stud yMap.put(" " + studyM ap.size(),  Base32Con versionUti lity.base3 2Decode(gr oup.getIen ()));
  399                    //       studyM ap.put( In teger.toSt ring(study Map.size() ), group.g etIen() );
  400                    //       if(gro upMessage. length() >  1)
  401                    //                groupMes sage.appen d(',');
  402                    //       groupM essage.app end(group. getIen());
  403                    //}
  404                    //gr oupMessage .append('} ');
  405                    
  406                    //
  407                    bool ean includ esDeletedI mages = (f ilter == n ull ? fals e : filter .isInclude Deleted()) ;
  408                    bool ean canInc ludeDelete dImages =  canRetriev eDeletedIm ages(); //  if this d ata source  cannot su pport gett ing delete d images,  then it is  not an op tion
  409                    Stud yDeletedIm ageState s tudyDelete dImageStat e = StudyD eletedImag eState.can notInclude DeletedIma ges;
  410                    if(c anIncludeD eletedImag es) // if  the DS sup ports gett ing delete d images,  set approp riately ba sed on use r request
  411                             studyD eletedImag eState = ( includesDe letedImage s ? StudyD eletedImag eState.inc ludesDelet edImages :  StudyDele tedImageSt ate.doesNo tIncludeDe letedImage s);
  412                    Sort edSet<Stud y> studies  = getPati entStudyGr aphFromBot hDataStruc tures(loca lVistaSess ion, study Map, patie ntDfn, fil ter,
  413                                      studyLoa dLevel, st udyDeleted ImageState );
  414                    //lo gger.info( "getPatien tStudyGrap h for stud ies " + gr oupMessage .toString( ) + " retu rned " + s tudies.siz e() + " st udies.");
  415                    //So rtedSet<St udy> resul t = 
  416                    //       VistaI magingComm onUtilitie s.mergeStu dyLists(lo calVistaSe ssion, stu dies, grou ps, studyL oadLevel);
  417                    //lo gger.info( "Merging s tudies and  groups re sults in "  + result. size() + "  studies." );
  418                    
  419                    // J MW 12/17/2 008, call  the filter  to remove  studies f rom the gr oups, this  way
  420                    // t he datasou rce doesn' t need to  have knowl edge of th e filter d etails
  421                    //if (filter !=  null)
  422                    //{
  423                    //       filter .postFilte r(result);
  424                    //}
  425                    //lo gger.info( "Completed  getPatien tStudies() , returnin g '" + res ult.size()  + "' stud ies.");
  426                    //re turn resul t;
  427                    //re turn null;
  428                    logg er.debug(" Number of  studies: "  + studies .size());
  429                    logg er.debug(s tudies.toS tring());
  430                    retu rn studies ;
  431       }
  432  
  433           /* *
  434        * 
  435        * @pa ram localV istaSessio n
  436        * @pa ram patien tIcn
  437        * @pa ram patien tDfn
  438        * @pa ram filter
  439        * @pa ram studyL oadLevel
  440        * @re turn
  441        * @th rows Conne ctionExcep tion
  442        * @th rows Metho dException
  443        * @th rows IOExc eption
  444        */
  445       privat e Study ge tSingleStu dyMatching Filter(Vis taSession  localVista Session, 
  446                    Pati entIdentif ier patien tIdentifie r, String  patientDfn , StudyFil ter filter , StudyLoa dLevel stu dyLoadLeve l)
  447           th rows Conne ctionExcep tion, Meth odExceptio n, IOExcep tion
  448       {
  449           St udyURN stu dyUrn = nu ll;
  450           if (filter.ge tStudyId()  instanceo f StudyURN )
  451           {
  452                    try
  453                    {
  454                             studyU rn = URNFa ctory.crea te(filter. getStudyId ().toStrin g());
  455                    }
  456                    catc h(URNForma tException  urnfX)
  457                    {
  458                             throw  new Method Exception( "Error con verting fi lter study  Id to Stu dyURN", ur nfX);
  459                    }
  460           }
  461           el se
  462           {
  463                    thro w new Meth odExceptio n("Cannot  cast filte r study Id  '" + filt er.getStud yId() + "'  to StudyU RN, must b e study UR N to get s tudy type. ");
  464           }        
  465           
  466           St ring study Ien = stud yUrn.getSt udyId();
  467           Ma p<String,  String> st udyMap = n ew HashMap <String, S tring>();
  468                    // C TB 29Nov20 09
  469           // studyMap.p ut("" + st udyMap.siz e(), Base3 2Conversio nUtility.b ase32Decod e(studyIen ));
  470           st udyMap.put ("" + stud yMap.size( ), studyIe n);
  471           
  472           bo olean incl udesDelete dImages =  (filter ==  null ? fa lse : filt er.isInclu deDeleted( ));
  473           bo olean canI ncludeDele tedImages  = canRetri eveDeleted Images();  // if this  data sour ce cannot  support ge tting dele ted images , then it  is not an  option
  474                    Stud yDeletedIm ageState s tudyDelete dImageStat e = StudyD eletedImag eState.can notInclude DeletedIma ges;
  475                    if(c anIncludeD eletedImag es) // if  the DS sup ports gett ing delete d images,  set approp riately ba sed on use r request
  476                             studyD eletedImag eState = ( includesDe letedImage s ? StudyD eletedImag eState.inc ludesDelet edImages :  StudyDele tedImageSt ate.doesNo tIncludeDe letedImage s);
  477           
  478           So rtedSet<St udy> studi es = getPa tientStudy Graph(loca lVistaSess ion, study Map, patie ntDfn, 
  479                             studyL oadLevel,  studyDelet edImageSta te);
  480           if ((studies  == null) | | (studies .size() <=  0))
  481           {
  482                    thro w new Meth odExceptio n("Study [ " + studyI en + "] no t found");
  483           }                 
  484           if (studies.s ize() > 1)
  485           {
  486                    thro w new Meth odExceptio n("Found ' " + studie s.size() +  "' matchi ng studies , this sho uld never  happen!");
  487           }
  488           St udy study  = studies. first();
  489                    logg er.info("G etting gro ups for pa tient '" +  patientId entifier +  "'.");
  490                    Sort edSet<Vist aGroup> gr oups = get PatientGro ups(localV istaSessio n, getSite (), patien tDfn, pati entIdentif ier, filte r);
  491                    if(( groups ==  null) || ( groups.siz e() <= 0))
  492           {
  493                    thro w new Meth odExceptio n("Study [ " + studyI en + "] no t found");
  494           }    
  495                    logg er.info("F ound '" +  groups.siz e() + "' g roups for  patient '"  + patient Identifier  + "'");
  496                    Stud y result =  VistaImag ingCommonU tilities.m ergeStudyW ithMatchin gGroup(loc alVistaSes sion, stud y, groups,  studyLoad Level);
  497                    if(r esult == n ull)
  498                    {
  499                             throw  new Method Exception( "Cannot fi nd study ' " + studyI en + "', c ould not m atch group  to study. ");
  500                    }
  501                    retu rn result;
  502       }
  503  
  504           /* *
  505        * 
  506        * @pa ram localV istaSessio n
  507        * @pa ram patien tIcn
  508        * @pa ram patien tDfn
  509        * @pa ram filter
  510        * @pa ram studyL oadLevel
  511        * @re turn
  512        * @th rows Conne ctionExcep tion
  513        * @th rows Metho dException
  514        * @th rows IOExc eption
  515        */
  516       privat e Study ge tSingleStu dyFromBoth DataStruct uresMatchi ngFilter(V istaSessio n localVis taSession,  
  517                    Pati entIdentif ier patien tIdentifie r, String  patientDfn , StudyFil ter filter , StudyLoa dLevel stu dyLoadLeve l)
  518           th rows Conne ctionExcep tion, Meth odExceptio n, IOExcep tion
  519       {
  520           St udyURN stu dyUrn = nu ll;
  521           if (filter.ge tStudyId()  instanceo f StudyURN )
  522           {
  523                    try
  524                    {
  525                             studyU rn = URNFa ctory.crea te(filter. getStudyId ().toStrin g());
  526                    }
  527                    catc h(URNForma tException  urnfX)
  528                    {
  529                             throw  new Method Exception( "Error con verting fi lter study  Id to Stu dyURN", ur nfX);
  530                    }
  531           }
  532           el se
  533           {
  534                    thro w new Meth odExceptio n("Cannot  cast filte r study Id  '" + filt er.getStud yId() + "'  to StudyU RN, must b e study UR N to get s tudy type. ");
  535           }        
  536           
  537           St ring study Ien = stud yUrn.getSt udyId();
  538           Ma p<String,  String> st udyMap = n ew HashMap <String, S tring>();
  539           st udyMap.put ("" + stud yMap.size( ), studyIe n);
  540           
  541           bo olean incl udesDelete dImages =  (filter ==  null ? fa lse : filt er.isInclu deDeleted( ));
  542           bo olean canI ncludeDele tedImages  = canRetri eveDeleted Images();  // if this  data sour ce cannot  support ge tting dele ted images , then it  is not an  option
  543                    Stud yDeletedIm ageState s tudyDelete dImageStat e = StudyD eletedImag eState.can notInclude DeletedIma ges;
  544                    if(c anIncludeD eletedImag es) // if  the DS sup ports gett ing delete d images,  set approp riately ba sed on use r request
  545                             studyD eletedImag eState = ( includesDe letedImage s ? StudyD eletedImag eState.inc ludesDelet edImages :  StudyDele tedImageSt ate.doesNo tIncludeDe letedImage s);
  546           
  547           So rtedSet<St udy> studi es = getSi ngleStudyG raphFromBo thDataStru ctures(loc alVistaSes sion, stud yMap, pati entDfn, fi lter,
  548                             studyL oadLevel,  studyDelet edImageSta te);
  549           if ((studies  == null) | | (studies .size() <=  0))
  550           {
  551                    thro w new Meth odExceptio n("Study [ " + studyI en + "] no t found");
  552           }                 
  553           if (studies.s ize() > 1)
  554           {
  555                    thro w new Meth odExceptio n("Found ' " + studie s.size() +  "' matchi ng studies , this sho uld never  happen!");
  556           }
  557           St udy study  = studies. first();
  558                    //lo gger.info( "Getting g roups for  patient '"  + patient Identifier  + "'.");
  559                    //So rtedSet<Vi staGroup>  groups = g etPatientG roups(loca lVistaSess ion, getSi te(), pati entDfn, pa tientIdent ifier, fil ter);
  560                    //if ((groups = = null) ||  (groups.s ize() <= 0 ))
  561           // {
  562           //       thro w new Meth odExceptio n("Study [ " + studyI en + "] no t found");
  563           // }   
  564                    //lo gger.info( "Found '"  + groups.s ize() + "'  groups fo r patient  '" + patie ntIdentifi er + "'");
  565                    //St udy result  = VistaIm agingCommo nUtilities .mergeStud yWithMatch ingGroup(l ocalVistaS ession, st udy, group s, studyLo adLevel);
  566                    //if (result ==  null)
  567                    //{
  568                    //       throw  new Method Exception( "Cannot fi nd study ' " + studyI en + "', c ould not m atch group  to study. ");
  569                    //}
  570                    retu rn study;
  571           // return nul l;
  572       }
  573  
  574       /**
  575        * 
  576        * @pa ram localV istaSessio n
  577        * @pa ram studyM ap
  578        * @pa ram patien tDfn
  579        * @pa ram studyL oadLevel
  580        * @re turn
  581        * @th rows Metho dException
  582        * @th rows Conne ctionExcep tion
  583        */
  584       privat e SortedSe t<Study> g etPatientS tudyGraph(
  585           Vi staSession  localVist aSession, 
  586           Ma p<String,  String> st udyMap, 
  587           St ring patie ntDfn, 
  588           St udyLoadLev el studyLo adLevel,
  589           St udyDeleted ImageState  studyDele tedImageSt ate)
  590           th rows Metho dException , Connecti onExceptio n
  591       {            
  592           tr y
  593           {
  594                    Vist aQuery que ry = getPa tientStudy GraphVista Query(stud yMap, pati entDfn, st udyLoadLev el, 
  595                                      studyDel etedImageS tate);
  596                             logger .info("Ret rieving st udy graph  for patien t containi ng '" + st udyMap.siz e() + "' g roups");
  597                             String  vistaResp onse = loc alVistaSes sion.call( query);
  598                             String Builder sb  = new Str ingBuilder ();
  599                             sb.app end(query. getRpcName ()+" RPC R esults:"+S tringUtils .displayEn codedChars (vistaResp onse));
  600                             sb.app end("\nCom pleted stu dy graph R PC call, p arsing res ponse...") ;
  601                             
  602                             logger .info(sb.t oString()) ;                               
  603                             
  604                             Sorted Set<Study>  studies =  VistaImag ingTransla tor.create StudiesFro mGraph(get Site(), 
  605                                               vistaRespo nse, study LoadLevel,  studyDele tedImageSt ate);
  606                             logger .info("Con verted res ponse into  '" + ((st udies == n ull) ? 0 :  studies.s ize()) + " ' studies" );
  607                             return  studies;
  608           }
  609                    catc h (Excepti on ex)
  610                    {
  611                             logger .error(ex) ;
  612                             ex.pri ntStackTra ce();
  613                             throw  new Method Exception( ex);
  614                    }
  615       }
  616  
  617       /**
  618        * 
  619        * @pa ram localV istaSessio n
  620        * @pa ram studyM ap
  621        * @pa ram patien tDfn
  622        * @pa ram studyL oadLevel
  623        * @re turn
  624        * @th rows Metho dException
  625        * @th rows Conne ctionExcep tion
  626        */
  627       protec ted Sorted Set<Study>  getPatien tStudyGrap hFromBothD ataStructu res(
  628           Vi staSession  localVist aSession, 
  629           Ma p<String,  String> st udyMap, 
  630           St ring patie ntDfn, 
  631           St udyFilter  filter,
  632           St udyLoadLev el studyLo adLevel,
  633           St udyDeleted ImageState  studyDele tedImageSt ate)
  634           th rows Metho dException , Connecti onExceptio n
  635       {            
  636           tr y
  637           {
  638                    Vist aQuery que ry = getPa tientStudy GraphFromB othDataStr ucturesVis taQuery(st udyMap, pa tientDfn,  filter, st udyLoadLev el, 
  639                                       studyDe letedImage State);
  640                             logger .info("Ret rieving st udy graph  for patien t containi ng '" + st udyMap.siz e() + "' g roups");
  641                             String  vistaResp onse = loc alVistaSes sion.call( query);
  642                             logger .info(quer y.getRpcNa me()+" RPC  Results:" +StringUti ls.display EncodedCha rs(vistaRe sponse));                   
  643                             logger .info("Com pleted stu dy graph R PC call, p arsing res ponse...") ;                               
  644                             
  645                             Sorted Set<Study>  studies =  VistaImag ingTransla tor.create StudiesFro mGraph(get Site(), 
  646                                               vistaRespo nse, study LoadLevel,  studyDele tedImageSt ate);
  647                             logger .info("Con verted res ponse into  '" + ((st udies == n ull) ? 0 :  studies.s ize()) + " ' studies" );
  648                             
  649                             return  studies;
  650           }
  651                    catc h (Excepti on ex)
  652                    {
  653                             logger .error(ex) ;
  654                             ex.pri ntStackTra ce();
  655                             throw  new Method Exception( ex);
  656                    }
  657       }
  658  
  659  
  660       /**
  661        * 
  662        * @pa ram localV istaSessio n
  663        * @pa ram studyM ap
  664        * @pa ram patien tDfn
  665        * @pa ram studyL oadLevel
  666        * @re turn
  667        * @th rows Metho dException
  668        * @th rows Conne ctionExcep tion
  669        */
  670       privat e SortedSe t<Study> g etSingleSt udyGraphFr omBothData Structures (
  671           Vi staSession  localVist aSession, 
  672           Ma p<String,  String> st udyMap, 
  673           St ring patie ntDfn, 
  674           St udyFilter  filter,
  675           St udyLoadLev el studyLo adLevel,
  676           St udyDeleted ImageState  studyDele tedImageSt ate)
  677           th rows Metho dException , Connecti onExceptio n
  678       {            
  679           tr y
  680           {
  681                    Vist aQuery que ry = getSi ngleStudyG raphFromBo thDataStru cturesVist aQuery(stu dyMap, pat ientDfn, f ilter, stu dyLoadLeve l, 
  682                                      studyDel etedImageS tate);
  683                             String  vistaResp onse = loc alVistaSes sion.call( query);
  684                             String Builder sb  = new Str ingBuilder ();
  685                             sb.app end(query. getRpcName ()+" RPC R esults:"+S tringUtils .displayEn codedChars (vistaResp onse));
  686                             sb.app end("\nCom pleted stu dy graph R PC call, p arsing res ponse...") ;
  687                             
  688                             logger .info(sb.t oString()) ;                               
  689                             
  690                             Sorted Set<Study>  studies =  VistaImag ingTransla tor.create StudiesFro mGraph(get Site(), 
  691                                               vistaRespo nse, study LoadLevel,  studyDele tedImageSt ate);
  692                             logger .info("Con verted res ponse into  '" + ((st udies == n ull) ? 0 :  studies.s ize()) + " ' studies" );
  693                             return  studies;
  694                             //retu rn null;
  695           }
  696                    catc h (Excepti on ex)
  697                    {
  698                             logger .error(ex) ;
  699                             ex.pri ntStackTra ce();
  700                             throw  new Method Exception( ex);
  701                    }
  702       }
  703  
  704       
  705       protec ted VistaQ uery getPa tientGroup sVistaQuer y(VistaSes sion vista Session, S tring pati entDfn, St udyFilter  studyFilte r)
  706                    thro ws IOExcep tion, Inva lidVistaCr edentialsE xception,  VistaMetho dException
  707       {
  708           re turn Vista ImagingQue ryFactory. createGetG roupsVista Query(pati entDfn, st udyFilter) ;
  709       }
  710       
  711       /**
  712        * Met hod to get  the Vista Query to c all to get  the study  graph
  713        * @pa ram studyM ap
  714        * @pa ram patien tDfn
  715        * @pa ram studyL oadLevel
  716        * @pa ram studyD eletedImag eState
  717        * @re turn
  718        */
  719       protec ted VistaQ uery getPa tientStudy GraphVista Query(Map< String, St ring> stud yMap, 
  720                    Stri ng patient Dfn, 
  721                    Stud yLoadLevel  studyLoad Level,
  722                    Stud yDeletedIm ageState s tudyDelete dImageStat e)
  723       {
  724           //  this vers ion does n ot use the  studyDele tedImageSt ate
  725           re turn Vista ImagingQue ryFactory. createGetS tudiesByIe nVistaQuer y(studyMap
  726                             patien tDfn, stud yLoadLevel );
  727       }
  728  
  729       /**
  730        * Met hod to get  the Vista Query to c all to get  the study  graph
  731        * @pa ram studyM ap
  732        * @pa ram patien tDfn
  733        * @pa ram studyL oadLevel
  734        * @pa ram studyD eletedImag eState
  735        * @re turn
  736        */
  737       protec ted VistaQ uery getPa tientStudy GraphFromB othDataStr ucturesVis taQuery(Ma p<String,  String> st udyMap, 
  738                    Stri ng patient Dfn, 
  739                    Stud yFilter fi lter,
  740                    Stud yLoadLevel  studyLoad Level,
  741                    Stud yDeletedIm ageState s tudyDelete dImageStat e)
  742       {
  743           //  this vers ion does n ot use the  studyDele tedImageSt ate
  744           re turn Vista ImagingQue ryFactory. createGetS tudiesFrom BothDataSt ructuresBy PatientVis taQuery(st udyMap, 
  745                             patien tDfn, filt er, studyL oadLevel);
  746       }
  747  
  748       /**
  749        * Met hod to get  the Vista Query to c all to get  the study  graph
  750        * @pa ram studyM ap
  751        * @pa ram patien tDfn
  752        * @pa ram studyL oadLevel
  753        * @pa ram studyD eletedImag eState
  754        * @re turn
  755        */
  756       protec ted VistaQ uery getSi ngleStudyG raphFromBo thDataStru cturesVist aQuery(Map <String, S tring> stu dyMap, 
  757                    Stri ng patient Dfn, 
  758                    Stud yFilter fi lter,
  759                    Stud yLoadLevel  studyLoad Level,
  760                    Stud yDeletedIm ageState s tudyDelete dImageStat e)
  761       {
  762           //  this vers ion does n ot use the  studyDele tedImageSt ate
  763           re turn Vista ImagingQue ryFactory. createGetS ingleStudy FromBothDa taStructur esByCprsId entifierVi staQuery(s tudyMap, 
  764                             patien tDfn, filt er, studyL oadLevel);
  765       }
  766  
  767           /* *
  768            *  @throws I OException  
  769            *  @throws M ethodExcep tion 
  770            *  @throws C onnectionE xception 
  771            *  @throws I nvalidVist aCredentia lsExceptio
  772            *  
  773            * /
  774           pr ivate Sort edSet<Vist aGroup> ge tPatientGr oups(
  775                    Vist aSession s ession, 
  776                    Site  site, 
  777                    Stri ng patient Dfn, 
  778                    Pati entIdentif ier patien tIdentifie r, 
  779                    Stud yFilter fi lter)
  780           th rows Metho dException , IOExcept ion, Conne ctionExcep tion
  781           {                 
  782                    logg er.info("g etPatientG roups(" +  patientIde ntifier +  ") Transac tionContex t (" + Tra nsactionCo ntextFacto ry.get().g etDisplayI dentity()  + ").");
  783  
  784                    
  785                    try
  786                    {
  787                             // cre ates call  to RPC MAG 4_PAT_GET_ IMAGES
  788                             VistaQ uery vm =  getPatient GroupsVist aQuery(ses sion, pati entDfn, fi lter);
  789                             logger .info("get PatientGro ups with R PC '" + vm .getRpcNam e() + "'." );
  790                             
  791                             String  rtn = nul l;
  792                             logger .info("Mak ing call t o get grou ps for pat ient '" +  patientIde ntifier +  "'");
  793                             rtn =  session.ca ll(vm);
  794                             logger .info(vm.g etRpcName( )+" RPC Re sults:"+St ringUtils. displayEnc odedChars( rtn));                        
  795  
  796                             // che ck to be s ure first  character  is a 1 (me ans result  is ok)
  797                             
  798                             // if  no images  for patien t, respons e is [0^No  images fo r filter:  All Images ]
  799                             
  800                             if(rtn .charAt(0)  == '1') 
  801                             {                         
  802                                      boolean  includesDe letedImage s = (filte r == null  ? false :  filter.isI ncludeDele ted());
  803                                      boolean  canInclude DeletedIma ges = canR etrieveDel etedImages (); // if  this data  source can not suppor t getting  deleted im ages, then  it is not  an option
  804                                      StudyDel etedImageS tate study DeletedIma geState =  StudyDelet edImageSta te.cannotI ncludeDele tedImages;
  805                                      if(canIn cludeDelet edImages)  // if the  DS support s getting  deleted im ages, set  appropriat ely based  on user re quest
  806                                               studyDelet edImageSta te = (incl udesDelete dImages ?  StudyDelet edImageSta te.include sDeletedIm ages : Stu dyDeletedI mageState. doesNotInc ludeDelete dImages);
  807                                      return V istaImagin gTranslato r.createGr oupsFromGr oupLines(s ite, rtn,  patientIde ntifier, 
  808                                                       st udyDeleted ImageState );
  809                             }
  810                             else i f(rtn.star tsWith("0^ No images  for filter ")) 
  811                             {
  812                                      logger.i nfo("0 res ponse from  getPatien tGroupsVis taQuery()  rpc, no im ages found , [" + rtn  + "]");
  813                                      return n ew TreeSet <VistaGrou p>();
  814                             }
  815                             else i f(rtn.star tsWith("0^ No Such Pa tient:")) 
  816                             {
  817                                      logger.i nfo("0 res ponse from  getPatien tGroupsVis taQuery()  rpc, [" +  rtn + "]") ;
  818                                      throw ne w VistaMet hodExcepti on("No pat ient [ "+  patientIde ntifier +  "] found i n database ");
  819                             }
  820                             else 
  821                             {
  822                                      logger.i nfo("0 res ponse from  getPatien tGroupsVis taQuery()  rpc, [" +  rtn + "]") ;
  823                                      throw ne w VistaMet hodExcepti on(rtn);
  824                             }
  825                    }
  826                    catc h (Excepti on ex)
  827                    {
  828                             logger .error(ex) ;
  829                             throw  new Method Exception( ex);
  830                    }
  831           }        
  832           
  833           /* *
  834            *  
  835            *  @param pr ocedure
  836            *  @param fi lter
  837            *  @return
  838            * /
  839           /*
  840           pr ivate bool ean proced ureUsed(St ring proce dure, Stud yFilter fi lter) 
  841           {
  842                    if(p rocedure = = null)
  843                             return  false;
  844                    
  845                    if(  filter.get AllowableS tudyTypes( ) == null  || filter. getAllowab leStudyTyp es().size( ) == 0 )
  846                             return  true;
  847                    
  848                    for(  int i = 0 ; i < filt er.getAllo wableStudy Types().si ze(); i++  )
  849                             if( pr ocedure.eq ualsIgnore Case(filte r.getAllow ableStudyT ypes().get (i)) )
  850                                      return t rue;
  851                    
  852                    retu rn false;
  853           }
  854           */
  855       
  856       /**
  857        * 
  858        * @re turn
  859        * @th rows IOExc eption 
  860        * @th rows Vista Exception 
  861        */
  862           pu blic boole an disconn ect() 
  863           th rows IOExc eption 
  864           {
  865                    // d on;t do an ything, le t the conn ection tim eout
  866                    retu rn true;
  867           }
  868           
  869           /* *
  870            *  Determine s if this  data sourc e can hand le retriev ing delete d images i f the user  requests  them
  871            *  @return
  872            * /
  873           pr otected bo olean canR etrieveDel etedImages ()
  874           {
  875                    retu rn false;
  876           }
  877           
  878           @O verride
  879           pr otected St ring getDa taSourceVe rsion()
  880           {
  881                    retu rn "1";
  882           }
  883   }