327. EPMO Open Source Coordination Office Redaction File Detail Report

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

327.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXWebApp\main\src\java\gov\va\med\imaging\mix\webservices\commands\v1 MixGetDASCachedDocId.java Mon Dec 4 21:35:34 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\MIXWebApp\main\src\java\gov\va\med\imaging\mix\webservices\commands\v1 MixGetDASCachedDocId.java Mon Dec 4 22:04:21 2017 UTC

327.2 Comparison summary

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

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

327.4 Active regular expressions

No regular expressions were active.

327.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: Dec  1, 2016
  6     Develope r:  vacoti ttoc
  7     Descript ion: 
  8  
  9           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  10           ;;  Property  of the US  Government .
  11           ;;  No permis sion to co py or redi stribute t his softwa re is give n.
  12           ;;  Use of un released v ersions of  this soft ware requi res the us er
  13           ;;   to execu te a writt en test ag reement wi th the Vis tA Imaging
  14           ;;   Developm ent Office  of the De partment o f Veterans  Affairs,
  15           ;;   telephon e (301) 73 4-0100.
  16           ;;
  17           ;;  The Food  and Drug A dministrat ion classi fies this  software a s
  18           ;;  a Class I I medical  device.  A s such, it  may not b e changed
  19           ;;  in any wa y.  Modifi cations to  this soft ware may r esult in a n
  20           ;;  adulterat ed medical  device un der 21CFR8 20, the us e of which
  21           ;;  is consid ered to be  a violati on of US F ederal Sta tutes.
  22           ;;  +-------- ---------- ---------- ---------- ---------- ---------- ---------- +
  23  
  24    */
  25   package go v.va.med.i maging.mix .webservic es.command s.v1;
  26  
  27   import jav a.io.Buffe redReader;
  28   import jav a.io.File;
  29   import jav a.io.FileR eader;
  30   import jav a.io.IOExc eption;
  31  
  32   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  33   import gov .va.med.im aging.mix. webservice s.rest.typ es.v1.DASC acheIdType ;
  34  
  35   /**
  36    * @author   DN S      TITTOC
  37    *
  38    */
  39   public cla ss MixGetD ASCachedDo cId
  40   {       
  41           pr ivate Stri ng repoId;
  42           pr ivate Stri ng docId;
  43           
  44           pu blic MixGe tDASCached DocId(Stri ng repoId,  String do cId)
  45           {
  46                    this .repoId =  repoId;
  47                    this .docId = d ocId;
  48           }
  49  
  50   //      pu blic DASCa cheIdType  getIDFromL ocalCache( )
  51           pu blic Strin g getIDFro mLocalCach e()
  52                    thro ws MethodE xception {
  53                    
  54                    // c heck input
  55                    if ( (repoId==n ull) || re poId.isEmp ty() || (d ocId==null ) || docId .isEmpty() )
  56                             throw  new Method Exception( "invalid r epoId and/ or docId p arameter(s )!");
  57  
  58   //               DASC acheIdType  dasCacheI dType = ne w DASCache IdType();
  59                    Stri ng longDoc Id="";
  60                    try  {
  61                             longDo cId = getE ncryptedDo cumentId(r epoId, doc Id);
  62   //                        dasCac heIdType.s etLongDocI d(longDocI d);
  63                    }
  64                    catc h (Excepti on e) {
  65                             throw  new Method Exception( "Local Cac he Read Er ror:" + e. getMessage ());
  66                    }
  67                                                       
  68   //               retu rn dasCach eIdType;
  69                    retu rn longDoc Id;
  70           }
  71           
  72       privat e static S tring getD asFolder(S tring repo Id) {
  73                    sync hronized(" CreateDasF older")
  74                    {
  75                    Stri ng path= S ystem.gete nv("vixcac he");
  76                    if ( path.lengt h() < 4){
  77                             return  null;
  78                    }
  79                    
  80                    if ( !(path.end sWith("/")  || path.e ndsWith("\ \"))){
  81                             path + = "/";
  82                    }
  83                    
  84                    path  += "dod-m etadata-re gion/das/"  + repoId;
  85           
  86                             File f older = ne w File(pat h);
  87                             if (!f older.exis ts())
  88                             {
  89                                      folder.m kdirs();
  90                             }        
  91           
  92                             return  path;
  93                    }
  94       }
  95  
  96           
  97           /* *
  98            *  Cache a l ist of doc ument inst ances into  the appro priate cac he.
  99            *  
  100            *  @param do cumentSetR esult
  101            *  @return R eturns tru e if all d ocuments i n the list  were cach ed, if one  or more d ocument wa s not cach ed, then f alse is re turned
  102            *  @throws I OException  
  103            * /
  104           pr ivate stat ic String  getEncrypt edDocument Id(String  repository Id, String  documentI d) 
  105           th rows IOExc eption
  106           {
  107                    Stri ng path =  getDasFold er(reposit oryId);
  108                    if ( path == nu ll)
  109                    {
  110                             throw  new IOExce ption("Una ble to fin d DAS Cach e folder") ;
  111                    }
  112  
  113                    Stri ng encDocI d = null;
  114  
  115                    sync hronized(" CacheDasDo cument")
  116                    {
  117                             File c acheFile =  new File( path, docu mentId);
  118                             if (!c acheFile.e xists())
  119                             {
  120                                      throw ne w IOExcept ion("Unabl e to find  DAS Cache  document:  " + docume ntId);
  121                             }
  122                             
  123                             String  cacheFile name = pat h + "/" +  documentId ;
  124                             Buffer edReader b r = new Bu fferedRead er(new Fil eReader(ca cheFilenam e));
  125                             try
  126                             {
  127                                      encDocId  = br.read Line();
  128                             }
  129                             finall y
  130                             {
  131                                      br.close ();
  132                             }
  133                    
  134                             return  encDocId;
  135                    }
  136           
  137           }
  138  
  139   }