90. EPMO Open Source Coordination Office Redaction File Detail Report

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

90.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices\translator ClinicalDisplayTranslator3.java Mon Dec 4 21:35:20 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ClinicalDisplayWebApp\main\src\java\gov\va\med\imaging\clinicaldisplay\webservices\translator ClinicalDisplayTranslator3.java Mon Dec 4 21:58:18 2017 UTC

90.2 Comparison summary

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

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

90.4 Active regular expressions

No regular expressions were active.

90.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: Sep  8, 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.cli nicaldispl ay.webserv ices.trans lator;
  27  
  28   import gov .va.med.Gl obalArtifa ctIdentifi er;
  29   import gov .va.med.SE RIALIZATIO N_FORMAT;
  30   import gov .va.med.UR NFactory;
  31   import gov .va.med.im aging.*;
  32   import gov .va.med.im aging.clin icaldispla y.configur ation.Clin icalDispla yWebAppCon figuration ;
  33   import gov .va.med.im aging.exce ptions.URN FormatExce ption;
  34   import gov .va.med.im aging.exch ange.Image AccessLogE vent;
  35   import gov .va.med.im aging.exch ange.Image AccessLogE vent.Image AccessLogE ventType;
  36   import gov .va.med.im aging.exch ange.busin ess.Artifa ctResults;
  37   import gov .va.med.im aging.exch ange.busin ess.Image;
  38   import gov .va.med.im aging.exch ange.busin ess.Series ;
  39   import gov .va.med.im aging.exch ange.busin ess.Study;
  40   import gov .va.med.im aging.exch ange.busin ess.StudyF ilter;
  41   import gov .va.med.im aging.exch ange.busin ess.util.E xchangeUti l;
  42   import gov .va.med.im aging.exch ange.enums .ImageQual ity;
  43   import gov .va.med.im aging.exch ange.enums .SiteConne ctivitySta tus;
  44   import gov .va.med.im aging.exch ange.enums .VistaImag eType;
  45   import gov .va.med.im aging.webs ervices.cl inical.Cli nicalConte ntTypeConf ig;
  46  
  47   import jav a.math.Big Integer;
  48   import jav a.text.Dat eFormat;
  49   import jav a.text.Par seExceptio n;
  50   import jav a.text.Sim pleDateFor mat;
  51   import jav a.util.Col lection;
  52   import jav a.util.Dat e;
  53   import jav a.util.Ite rator;
  54   import org .apache.lo gging.log4 j.LogManag er;
  55   import org .apache.lo gging.log4 j.Logger;
  56  
  57   /**
  58    * @author         
WERFEJ
  59    *
  60    */
  61   public cla ss Clinica lDisplayTr anslator3 
  62   {
  63   private fi nal static  Logger lo gger = Log Manager.ge tLogger(Cl inicalDisp layTransla tor2.class );
  64           
  65           pr ivate fina l static S tring clin icalDispla yWebservic eShortDate Format = " MM/dd/yyyy ";
  66           pr ivate fina l static S tring clin icalDispla yWebservic eLongDateF ormat = "M M/dd/yyyy  HH:mm";
  67           
  68           pu blic Clini calDisplay Translator 3()
  69           {
  70                    supe r();
  71           }
  72           
  73           //  be carefu l about re -using Sim pleDateFor mat instan ces becaus e they are  not threa d-safe 
  74           pr ivate Date Format get ClinicalDi splayWebse rviceShort DateFormat ()
  75           {
  76                    retu rn new Sim pleDateFor mat(clinic alDisplayW ebserviceS hortDateFo rmat);
  77           }
  78           
  79           pr ivate Date Format get ClinicalDi splayWebse rviceLongD ateFormat( )
  80           {
  81                    retu rn new Sim pleDateFor mat(clinic alDisplayW ebserviceL ongDateFor mat);
  82           }
  83           
  84           /* *
  85            *  Transform  a clinica l display  webservice  FilterTyp e to an in ternal Fil ter instan ce.
  86            *  
  87            * /
  88           pu blic Study Filter tra nsformFilt er(gov.va. med.imagin g.clinical display.we bservices. soap.v3.Fi lterType f ilterType)  
  89           {
  90                    Stud yFilter fi lter = new  StudyFilt er();
  91                    
  92                    if(f ilterType  != null) 
  93                    {
  94                             DateFo rmat df =  getClinica lDisplayWe bserviceSh ortDateFor mat();
  95                             
  96                             Date f romDate =  null;
  97                             try
  98                             {
  99                                      fromDate  = filterT ype.getFro mDate() ==  null  ||  filterType .getFromDa te().lengt h() == 0 ?  null : df .parse(fil terType.ge tFromDate( ));
  100                             } 
  101                             catch  (ParseExce ption x)
  102                             {
  103                                      logger.e rror("Pars eException  convertin g webservi ce format  string fro m-date '"  +  filterT ype.getFro mDate() +  "' to inte rnal Date" , x);
  104                                      fromDate  = null;
  105                             }
  106                             
  107                             Date t oDate = nu ll;
  108                             try
  109                             {
  110                                      toDate =  filterTyp e.getToDat e() == nul l || filte rType.getT oDate().le ngth() ==  0 ? null :  df.parse( filterType .getToDate ());
  111                             } 
  112                             catch  (ParseExce ption x)
  113                             {
  114                                      logger.e rror("Pars eException  convertin g webservi ce format  string to- date '" +   filterTyp e.getToDat e() + "' t o internal  Date", x) ;
  115                                      fromDate  = null;
  116                             }
  117                             
  118                             // som e business  rules for  the filte r dates
  119                             if (fr omDate !=  null && to Date == nu ll)
  120                             {
  121                                      // defau lt toDate  to today
  122                                      toDate =  new Date( );
  123                             }
  124                             else i f (fromDat e == null  && toDate  != null)
  125                             {
  126                                      // defau lt to unfi ltered
  127                                      toDate =  null;
  128                             }
  129                             
  130                             filter .setFromDa te(fromDat e);
  131                             filter .setToDate (toDate);
  132                             
  133                             filter .setStudy_ class(filt erType.get _class() = = null ? " " : filter Type.get_c lass());
  134                             filter .setStudy_ event(filt erType.get Event() ==  null ? ""  : filterT ype.getEve nt());
  135                             filter .setStudy_ package(fi lterType.g et_package () == null  ? "" : fi lterType.g et_package ());
  136                             filter .setStudy_ specialty( filterType .getSpecia lty() == n ull ? "" :  filterTyp e.getSpeci alty());
  137                             filter .setStudy_ type(filte rType.getT ypes() ==  null ? ""  : filterTy pe.getType s());
  138                             
  139                             if(fil terType.ge tOrigin()  == null) {
  140                                      filter.s etOrigin(" ");
  141                             }
  142                             else {
  143                                      if("UNSP ECIFIED".e quals(filt erType.get Origin().g etValue()) ) {
  144                                               filter.set Origin("") ;
  145                                      }
  146                                      else {
  147                                               filter.set Origin(fil terType.ge tOrigin(). getValue() );
  148                                      }
  149                             }
  150                             // don 't have a  study id u sed here
  151                    }
  152                    retu rn filter;
  153           }
  154           
  155           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. ShallowStu dyType[] t ransformSt udiesToSha llowStudie s(
  156                             Artifa ctResults  artifactRe sults)
  157           th rows URNFo rmatExcept ion
  158           {
  159                    if(a rtifactRes ults == nu ll)
  160                             return  null;
  161                    if(a rtifactRes ults.getSt udySetResu lt() == nu ll)
  162                             return  null;
  163                    retu rn transfo rmStudiesT oShallowSt udies(arti factResult s.getStudy SetResult( ).getArtif acts());
  164                    
  165           }
  166           
  167           pr ivate gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ShallowSt udyType[]  transformS tudiesToSh allowStudi es(
  168                    Coll ection<Stu dy> studyL ist) 
  169           th rows URNFo rmatExcept ion 
  170           {
  171                    if(s tudyList = = null ||  studyList. size() ==  0)
  172                             return  null;
  173                    
  174                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ShallowSt udyType []  res = 
  175                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.Shallow StudyType[ studyList. size()];
  176                    
  177                    int  index=0;
  178                    for( Iterator<S tudy> stud iesIter =  studyList. iterator() ; studiesI ter.hasNex t(); ++ind ex)
  179                             res[in dex] = tra nsformStud yToShallow Study(stud iesIter.ne xt());
  180                    
  181                    retu rn res;
  182           }
  183           
  184           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. ShallowStu dyType tra nsformStud yToShallow Study(Stud y study) 
  185           th rows URNFo rmatExcept ion 
  186           {
  187                    if(s tudy == nu ll)
  188                             return  null;
  189                    
  190                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .ShallowSt udyType re sult = 
  191                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.Shallow StudyType( );
  192                    
  193                    resu lt.setDesc ription(ex tractIlleg alCharacte rs(study.g etDescript ion()));
  194                    //re sult.setDi comImageNu mber(study .get);
  195                    //re sult.setDi comSequenc eNumber(st udy.getst)
  196                    resu lt.setEven t(extractI llegalChar acters(stu dy.getEven t()));
  197                    resu lt.setImag eCount(Big Integer.va lueOf(stud y.getImage Count()));
  198                    resu lt.setImag ePackage(e xtractIlle galCharact ers(study. getImagePa ckage()));
  199                    resu lt.setImag eType(stud y.getImage Type());
  200                    resu lt.setNote Title(extr actIllegal Characters (study.get NoteTitle( )));
  201                    resu lt.setOrig in(extract IllegalCha racters(st udy.getOri gin()));
  202                    resu lt.setPati entIcn(stu dy.getPati entId());
  203                    resu lt.setPati entName(st udy.getPat ientName() );
  204                    resu lt.setProc edure(extr actIllegal Characters (study.get Procedure( )));
  205                    resu lt.setRadi ologyRepor t(study.ge tRadiology Report());
  206                    resu lt.setSite Number(stu dy.getSite Number());
  207                    resu lt.setSpec ialty(extr actIllegal Characters (study.get Specialty( )));
  208                    
  209                    // 2 /19/08 - n ow include  the site  name so th e Display  client sho ws what sp ecific DOD  facility  the study  is from
  210                    if(E xchangeUti l.isSiteDO D(study.ge tSiteNumbe r()))
  211                    {
  212                             result .setSiteAb breviation (study.get SiteAbbr() + (study.g etSiteName () != null  ? "-" + s tudy.getSi teName() :  ""));                          
  213                    }
  214                    else
  215                    {
  216                             result .setSiteAb breviation (study.get SiteAbbr() );
  217                    }                                  
  218                    resu lt.setStud yPackage(e xtractIlle galCharact ers(study. getImagePa ckage()));
  219                    resu lt.setStud yClass(ext ractIllega lCharacter s(study.ge tStudyClas s() == nul l ? "" : s tudy.getSt udyClass() )); // get  this from  study
  220                    resu lt.setStud yType(extr actIllegal Characters (study.get ImageType( )));
  221                    resu lt.setCapt ureDate(st udy.getCap tureDate() );
  222                    resu lt.setCapt uredBy(stu dy.getCapt ureBy());               
  223                    if(s tudy.getPr ocedureDat e() == nul l)
  224                    {
  225                             logger .warn("Set ting null  procedure  date for s tudy");
  226                             result .setProced ureDate("" );
  227                    }
  228                    else
  229                    {
  230                             if((st udy.getPro cedureDate String() = = null) ||  (study.ge tProcedure DateString ().length( ) <= 0))
  231                             {
  232                                      // if th e hour and  minute ar e not 0, t hen likely  they cont ain real v alues for  hour and m inute (not  00:00)
  233                                      // this  leaves ope n the poss ibility of  invalid d ata, if th e real dat e was at 0 0:00 then  this would  not show  that time.
  234                                      // we wo uld then o mit data,  not show i nvalid dat a
  235                                      if((stud y.getProce dureDate() .getHours( ) <= 0) &&  (study.ge tProcedure Date().get Minutes()  <= 0))
  236                                      {
  237                                               result.set ProcedureD ate(getCli nicalDispl ayWebservi ceShortDat eFormat(). format(stu dy.getProc edureDate( )));
  238                                      }
  239                                      else
  240                                      {
  241                                               result.set ProcedureD ate(getCli nicalDispl ayWebservi ceLongDate Format().f ormat(stud y.getProce dureDate() ));
  242                                      }
  243                                      
  244                             }
  245                             else i f(study.ge tProcedure DateString ().length( ) > 10)
  246                             {
  247                                      result.s etProcedur eDate(getC linicalDis playWebser viceLongDa teFormat() .format(st udy.getPro cedureDate ()));
  248                             }
  249                             else {
  250                                      result.s etProcedur eDate(getC linicalDis playWebser viceShortD ateFormat( ).format(s tudy.getPr ocedureDat e()));
  251                             }
  252                    }
  253                    resu lt.setRpcR esponseMsg (study.get RpcRespons eMsg());
  254                    // J MW - need  to find se ries for f irst image , ugly but  necessary
  255                    Seri es firstSe ries = nul l;
  256                    for( Series ser ies : stud y.getSerie s())
  257                    {
  258                             for(Im age image  : series)
  259                             {
  260                                      if(image .equals(st udy.getFir stImage()) )
  261                                      {
  262                                               firstSerie s = series ;
  263                                               break;
  264                                      }                                                   
  265                             }
  266                             if(fir stSeries ! = null)
  267                             {
  268                                      break;
  269                             }                          
  270                    }
  271                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .FatImageT ype firstI mage = 
  272                             transf ormImageTo FatImage(s tudy.getFi rstImage() , firstSer ies);
  273                    
  274                    resu lt.setFirs tImage(fir stImage);
  275                    
  276                    // n eed to add  site numb er field
  277                    
  278                    Glob alArtifact Identifier  imageIden tifier = s tudy.getGl obalArtifa ctIdentifi er();
  279                    if(i mageIdenti fier insta nceof Bhie StudyURN)
  280                             result .setStudyI d( ((BhieS tudyURN)im ageIdentif ier).toStr ingCDTP()  );
  281                    else
  282                             result .setStudyI d( imageId entifier.t oString()  );
  283                    
  284                    retu rn result;
  285           }
  286           
  287           /*
  288           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. FatImageTy pe[] trans formImages ToFatImage s(List<Ima ge> images
  289           th rows Imagi ngURNForma tException  
  290           {
  291                    if(i mages == n ull)
  292                             return  null;
  293                    
  294                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .FatImageT ype[] resu lt = 
  295                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.FatImag eType[imag es.size()] ;
  296                    
  297                    int  index=0;
  298                    for( Iterator<I mage> imag esIter = i mages.iter ator(); im agesIter.h asNext();  ++index)
  299                             result [index] =  transformI mageToFatI mage(image sIter.next ());
  300                    
  301                    retu rn result;
  302           }
  303           */
  304           
  305           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. FatImageTy pe[] trans formStudyT oFatImages (
  306                    Stud y study) 
  307           th rows URNFo rmatExcept ion 
  308           {
  309                    if(s tudy == nu ll)
  310                             return  null;
  311                    if(s tudy.getSe ries() ==  null)
  312                             return  null;
  313                    
  314                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .FatImageT ype[] resu lt = 
  315                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.FatImag eType[stud y.getImage Count()];
  316                    
  317                    int  index=0;
  318                    //fo r(Iterator <Image> im agesIter =  images.it erator();  imagesIter .hasNext() ; ++index)
  319                    //       result [index] =  transformI mageToFatI mage(image sIter.next ());
  320                    
  321                    for( Series ser ies : stud y.getSerie s())
  322                    {
  323                             if(ser ies != nul l)
  324                             {
  325                                      for(Imag e image :  series)
  326                                      {
  327                                               result[ind ex] = tran sformImage ToFatImage (image, se ries);
  328                                               index++;
  329                                      }
  330                             }
  331                                       
  332                    }
  333                    retu rn result;
  334           }
  335  
  336           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. FatImageTy pe transfo rmImageToF atImage(
  337                    Imag e image, S eries seri es) 
  338           th rows URNFo rmatExcept ion 
  339           {
  340                    if(i mage == nu ll)
  341                             return  null;
  342                    
  343                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .FatImageT ype result  = 
  344                             new go v.va.med.i maging.cli nicaldispl ay.webserv ices.soap. v3.FatImag eType();
  345                    
  346                    resu lt.setDesc ription(ex tractIlleg alCharacte rs(image.g etDescript ion()));
  347                    //re sult.setDi comImageNu mber(image .getDicomI mageNumber ForDisplay ());
  348                    resu lt.setDico mImageNumb er((image. getImageNu mber() !=  null) && ( image.getI mageNumber ().length( ) > 0) ? i mage.getIm ageNumber( ) : image. getDicomIm ageNumberF orDisplay( ));
  349                    //re sult.setDi comSequenc eNumber(im age.getDic omSequence NumberForD isplay());
  350                    resu lt.setDico mSequenceN umber((ser ies != nul l) && (ser ies.getSer iesNumber( ) != null)  && (serie s.getSerie sNumber(). length() >  0) ? seri es.getSeri esNumber()  : image.g etDicomSeq uenceNumbe rForDispla y());
  351                    //re sult.setDi comSequenc eNumber(im age.get)
  352                    resu lt.setPati entIcn(ima ge.getPati entId());
  353                    resu lt.setPati entName(im age.getPat ientName() );
  354                    resu lt.setProc edure(extr actIllegal Characters (image.get Procedure( )));
  355                    if(i mage.getPr ocedureDat e() == nul l)
  356                    {
  357                             logger .warn("Set ting null  procedure  date for i mage");
  358                             result .setProced ureDate("" );
  359                    }
  360                    else  
  361                    {
  362                             // if  the hour a nd minute  are not 0,  then like ly they co ntain real  values fo r hour and  minute (n ot 00:00)
  363                             // thi s leaves o pen the po ssibility  of invalid  data, if  the real d ate was at  00:00 the n this wou ld not sho w that tim e.
  364                             // we  would then  omit data , not show  invalid d ata
  365                             if((im age.getPro cedureDate ().getHour s() <= 0)  && (image. getProcedu reDate().g etMinutes( ) <= 0))
  366                             {
  367                                      result.s etProcedur eDate(getC linicalDis playWebser viceShortD ateFormat( ).format(i mage.getPr ocedureDat e()));
  368                             }
  369                             else
  370                             {
  371                                      result.s etProcedur eDate(getC linicalDis playWebser viceLongDa teFormat() .format(im age.getPro cedureDate ()));
  372                             }
  373                    }
  374                    resu lt.setSite Number(ima ge.getSite Number());
  375                    resu lt.setSite Abbr(image .getSiteAb br());
  376                    resu lt.setImag eClass(ext ractIllega lCharacter s(image.ge tImageClas s()));
  377                    resu lt.setAbsL ocation(im age.getAbs Location() );
  378                    resu lt.setFull Location(i mage.getFu llLocation ());
  379                    
  380                    resu lt.setQaMe ssage(imag e.getQaMes sage());
  381                    resu lt.setImag eType(BigI nteger.val ueOf(image .getImgTyp e()));
  382  
  383                    Glob alArtifact Identifier  imageIden tifier = i mage.getGl obalArtifa ctIdentifi er();
  384                    if(i mageIdenti fier insta nceof Bhie ImageURN)
  385                             result .setImageI d( ((BhieI mageURN)im ageIdentif ier).toStr ingCDTP()  );
  386                    else
  387                             result .setImageI d( imageId entifier.t oString()  );
  388                    
  389                    bool ean isRadI mage = isR adImage(im age);
  390                    if(( image.getF ullFilenam e() != nul l) && (ima ge.getFull Filename() .startsWit h("-1")))
  391                    {
  392                             result .setFullIm ageURI(ima ge.getFull Filename() ); // put  in error s tate
  393                    }
  394                    else
  395                    {
  396                             // if  the image  is not rad iology, th en this is  a ref ima ge request , if not r ad image
  397                             // the n ref loca tion is fo r the diag nostic ima ge.
  398                             int im ageQuality  = (isRadI mage ? Ima geQuality. REFERENCE. getCanonic al() : Ima geQuality. DIAGNOSTIC UNCOMPRESS ED.getCano nical());
  399                             result .setFullIm ageURI("im ageURN=" +  result.ge tImageId()  + "&image Quality="  + imageQua lity + "&c ontentType =" + getCo ntentType( image, Ima geQuality. REFERENCE) );
  400                    }
  401                    if(( image.getA bsFilename () != null ) && (imag e.getAbsFi lename().s tartsWith( "-1")))
  402                    {
  403                             result .setAbsIma geURI(imag e.getAbsFi lename());
  404                    }
  405                    else
  406                    {
  407                             //resu lt.setAbsI mageURI("i mageURN="  + imageUrn .toString( ) + "&imag eQuality=2 0&contentT ype=*/*");
  408                             result .setAbsIma geURI("ima geURN=" +  result.get ImageId()  + "&imageQ uality=20& contentTyp e=" + getC ontentType (image, Im ageQuality .THUMBNAIL ));
  409                    }
  410                    
  411                    if(i sRadImage)
  412                    {
  413                             if((im age.getBig Filename()  != null)  && (image. getBigFile name().sta rtsWith("- 1")))
  414                             {
  415                                      result.s etBigImage URI(image. getBigFile name());
  416                             }
  417                             else
  418                             {
  419                                      result.s etBigImage URI("image URN=" + re sult.getIm ageId() +  "&imageQua lity=90&co ntentType= " + getCon tentType(i mage, Imag eQuality.D IAGNOSTIC) );
  420                             }
  421                    }
  422                    else
  423                    {
  424                             result .setBigIma geURI("");
  425                    }
  426                    retu rn result;
  427           }
  428           
  429           pr ivate bool ean isRadI mage(Image  image)
  430           {
  431                    if(i mage == nu ll)
  432                             return  false;
  433                    int  imgType =  image.getI mgType();
  434                    if(( imgType ==  VistaImag eType.DICO M.getImage Type()) ||  
  435                                      (imgType  == VistaI mageType.X RAY.getIma geType()))
  436                    {
  437                             return  true;
  438                    }
  439                    retu rn false;
  440           }
  441           
  442           pr ivate Clin icalConten tTypeConfi g getConte ntTypeConf ig(int ima geType, Im ageQuality  imageQual ity)
  443           {
  444                    Vist aImageType  vistaImag eType = ge tVistaImag eType(imag eType);
  445                    if(v istaImageT ype == nul l)
  446                    {
  447                             return  null;                      
  448                    }
  449                    retu rn getClin icalDispla yConfigura tion().get ContentTyp eConfigura tion(vista ImageType,  
  450                                      imageQua lity);
  451           }
  452           
  453           
  454           pr ivate Clin icalDispla yWebAppCon figuration  getClinic alDisplayC onfigurati on()
  455           {
  456                    retu rn Clinica lDisplayWe bAppConfig uration.ge tConfigura tion();
  457           }
  458           
  459           pr ivate Vist aImageType  getVistaI mageType(i nt imageTy pe)
  460           {
  461                    retu rn VistaIm ageType.va lueOfImage Type(image Type);
  462           }
  463           
  464           pr ivate Stri ng getCont entType(Im age image,  ImageQual ity imageQ uality)
  465           {
  466                    Stri ng content Type = "";
  467                    
  468                    Clin icalConten tTypeConfi g config =  getConten tTypeConfi g(image.ge tImgType() , imageQua lity);
  469                    if(c onfig != n ull)
  470                             conten tType = co nfig.getCo ntentType( );
  471                    
  472                    if(c ontentType .length()  > 0)
  473                    {
  474                             conten tType += " ,*/*";
  475                    }
  476                    else
  477                    {
  478                             conten tType = "* /*";
  479                    }
  480                    retu rn content Type;
  481           }
  482           
  483           pu blic Image AccessLogE vent trans formLogEve nt(gov.va. med.imagin g.clinical display.we bservices. soap.v3.Im ageAccessL ogEventTyp e logEvent Type) 
  484           th rows URNFo rmatExcept ion 
  485           {
  486                    if(l ogEventTyp e == null)
  487                             return  null;
  488                    
  489                    Abst ractImagin gURN urn =  URNFactor y.create(l ogEventTyp e.getId(),  
  490                                      SERIALIZ ATION_FORM AT.CDTP, A bstractIma gingURN.cl ass);
  491                    
  492                    bool ean isDodI mage = Exc hangeUtil. isSiteDOD( urn.getOri ginatingSi teId());                  
  493                    
  494                    Imag eAccessLog EventType  imageAcces sLogEventT ype = tran sformLogEv entType(lo gEventType .getEventT ype());
  495                    Imag eAccessLog Event resu lt =                      
  496                             new Im ageAccessL ogEvent(ur n.getImagi ngIdentifi er(), "",  logEventTy pe.getPati entIcn(), 
  497                                               urn.getOri ginatingSi teId(), Sy stem.curre ntTimeMill is(), 
  498                                      logEvent Type.getRe ason(), "" , imageAcc essLogEven tType, isD odImage, 
  499                                      logEvent Type.getCr edentials( ).getSiteN umber());          
  500                    retu rn result;
  501           }        
  502  
  503           pu blic Image AccessLogE ventType t ransformLo gEventType (gov.va.me d.imaging. clinicaldi splay.webs ervices.so ap.v3.Imag eAccessLog EventTypeE ventType e ventType)  {
  504                    Imag eAccessLog EventType  result;//  = new gov. va.med.ima ging.excha nge.enums. ImageAcces sLogEventT ype();
  505                    if(e ventType = = gov.va.m ed.imaging .clinicald isplay.web services.s oap.v3.Ima geAccessLo gEventType EventType. IMAGE_COPY ) {
  506                             result  = ImageAc cessLogEve ntType.IMA GE_COPY;
  507                    }
  508                    else  if(eventT ype == gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.ImageAcc essLogEven tTypeEvent Type.PATIE NT_ID_MISM ATCH)
  509                    {
  510                             result  = ImageAc cessLogEve ntType.PAT IENT_ID_MI SMATCH;
  511                    }
  512                    else  if(eventT ype == gov .va.med.im aging.clin icaldispla y.webservi ces.soap.v 3.ImageAcc essLogEven tTypeEvent Type.IMAGE _ACCESS)
  513                    {
  514                             result  = ImageAc cessLogEve ntType.IMA GE_ACCESS;
  515                    }
  516                    else  {
  517                             result  = ImageAc cessLogEve ntType.IMA GE_PRINT;
  518                    }
  519                    retu rn result;
  520           }
  521           
  522           pu blic gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. PingServer TypePingRe sponse tra nsformServ erStatusTo PingServer Response(S iteConnect ivityStatu s siteStat us)
  523           {
  524                    gov. va.med.ima ging.clini caldisplay .webservic es.soap.v3 .PingServe rTypePingR esponse re sponse = n ull;
  525                    if(s iteStatus  == SiteCon nectivityS tatus.VIX_ READY)
  526                    {
  527                             respon se = gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. PingServer TypePingRe sponse.SER VER_READY;
  528                    }
  529                    else  if(siteSt atus == Si teConnecti vityStatus .DATASOURC E_UNAVAILA BLE)
  530                    {
  531                             respon se = gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. PingServer TypePingRe sponse.VIS TA_UNAVAIL ABLE;
  532                    }
  533                    else  
  534                    {
  535                             respon se = gov.v a.med.imag ing.clinic aldisplay. webservice s.soap.v3. PingServer TypePingRe sponse.SER VER_UNAVAI LABLE;
  536                    }
  537                    
  538                    retu rn respons e;
  539           }
  540           
  541           /* *
  542            *  Certain c haracters  cannot be  given to t he Clinica l Display  client bec ause they  will cause  exception s
  543            *  in the pa rsing, the y must be  removed to  ensure pr oper displ ay of meta data. This  function  removes th ose
  544            *  character s and repl aces them  with a spa ce
  545            *  @param in put Input  string to  check
  546            *  @return
  547            * /
  548           pr ivate Stri ng extract IllegalCha racters(St ring input )
  549           {
  550                    if(i nput == nu ll)
  551                             return  "";
  552                    retu rn input.r eplaceAll( "\\^", " " );    
  553           }
  554   }