15. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 7/10/2017 1:01:42 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

15.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\IV-ehmp_cif\CoreValueObjects\main\src\java\gov\va\med\imaging\exchange\enums ImageFormat.java Thu Jun 29 17:22:20 2017 UTC
2 C:\AraxisMergeCompare\Pri_re\IV-ehmp_cif\CoreValueObjects\main\src\java\gov\va\med\imaging\exchange\enums ImageFormat.java Fri Jul 7 16:37:28 2017 UTC

15.2 Comparison summary

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

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

15.4 Active regular expressions

No regular expressions were active.

15.5 Comparison detail

  1   package go v.va.med.i maging.exc hange.enum s;
  2  
  3   /**
  4    * The lis t of mime  types that  the VIX u nderstands .
  5    * 
  6    * @author          R E DA C T E D
  7    */
  8   public enu m ImageFor mat 
  9   {
  10           //  The order  of the de clared enu m instance s is signi ficant.
  11           //  More spec ific types  should pr ecede less  specific  types.
  12           TG A("image/x -targa", " TGA format  image", n ull, false , "TGA"), 
  13           DO WNSAMPLEDT GA("image/ x-targa",  "Reduced r esolution  TGA format  image", n ull, false , "TGA"), 
  14           TI FF("image/ tiff", "TI FF format  image", nu ll, false,  "TIF"), 
  15           BM P("image/b mp", "A bi tmap image ", null, f alse, "BMP "), 
  16           JP EG("image/ jpeg", "JP EG formatt ed image",  null, tru e, "JPG"),  
  17           J2 K("image/j 2k", "JPEG  2000 form atted imag e", null,  true, "J2K "), 
  18           DI COM("appli cation/dic om", "A DI COM image,  the conte nt is unkn own", null , false, " DCM"), 
  19           DI COMJPEG("a pplication /dicom", " DICOM wrap ped JPEG i mages", "i mage/jpeg" , true, "D CM"), 
  20           DI COMJPEG200 0("applica tion/dicom ", "DICOM  wrapped JP EG 2000-im ages", "im age/j2k",  true, "DCM "),
  21           DI COMPDF("ap plication/ dicom","DI COM wrappe d PDF docu ments", "a pplication /pdf", fal se, "DCM") ,
  22           PD F("applica tion/pdf",  "A PDF do cument", n ull, false , "PDF"),
  23           TE XT_DICOM(" text/dicom ","Plain t ext file c ontaining  DICOM head er informa tion for a n image",  null, fals e, "TXT"),
  24           TE XT_PLAIN(" text/plain ","Plain t ext file c ontaining  patient te xt data (n ot DICOM h eader info rmation)",  null, fal se, "TXT") ,
  25           IM AGE("image /*","Any i mage type" , null, fa lse, "IMG" ),
  26           AP PLICATION( "applicati on/*","Any  applicati on type",  null, fals e, "APP"),
  27           AN YTHING("*/ *", "Any f iletype av ailable",  null, fals e, ""),
  28           DO C("applica tion/mswor d", "Micro soft Word  documents" , null, fa lse, "DOC" ),
  29           AV I("video/x -msvideo",  "AVI Vide o", null,  false, "AV I"),
  30           RT F("text/rt f", "Rich  text appli cation doc ument", nu ll, false,  "RTF"),
  31           WA V("audio/x -wav", "WA V audio",  null, fals e, "WAV"),
  32           HT ML("text/h tml","HTML  document" , null, fa lse, "HTM" ),
  33           MP 3("audio/m peg3", "Au dio MPEG L ayer 3", n ull, false , "MP3"),
  34           MP G("video/m peg", "Vid eo MPEG",  null, fals e, "MPG"),
  35           // UNKNOWN("? /?", "Unkn own file f ormat", nu ll),
  36           OR IGINAL("x/ x", "Repre sents the  original f ormat of t he image a s it is st ored by th e owner",  null, fals e, ""),
  37           GI F("image/g if", "GIF  formatted  image", nu ll, true,  "GIF"),
  38           PN G("image/p ng", "PNG  image", nu ll, true,  "PNG"),
  39           XL S("applica tion/vnd.m s-excel",  "Microsoft  Excel (pr e Office 2 007) forma t", null,  false, "XL S"),
  40           DO CX("applic ation/vnd. openxmlfor mats-offic edocument. wordproces singml.doc ument", "M icrosoft W ord 2007+  format", n ull, false , "DOCX"),
  41           XM L("text/xm l", "XML F iles", nul l, false,  "XML");
  42           // ANNOTATION S_BURNED(" image/anno tated", "I mage with  annotation s burned i n", null,  false);
  43                             
  44           
  45           pr ivate fina l String m ime;
  46           pr ivate fina l String t ype;
  47           pr ivate fina l String s ubType;
  48           pr ivate fina l String e nclosedMim e;
  49           pr ivate fina l String e nclosedTyp e;
  50           pr ivate fina l String e nclosedSub Type;
  51           pr ivate fina l String d escription ;
  52           pr ivate fina l boolean  compressed ;
  53           pr ivate fina l String e xtension;
  54           
  55           pr ivate fina l static S tring mime Delimiter  = "/";
  56           
  57           /* *
  58            *  
  59            *  @param mi meType
  60            *  @param de scription
  61            *  @param en closedMime Type
  62            * /
  63           Im ageFormat( String mim eType, Str ing descri ption, Str ing enclos edMimeType
  64                             boolea n compress ed, String  extension )
  65           {
  66                    this .mime = mi meType;
  67                    this .compresse d = compre ssed;
  68                    this .extension  = extensi on;
  69                    int  slashIndex  = mimeTyp e.indexOf( mimeDelimi ter); 
  70                    if(s lashIndex  >= 0)
  71                    {
  72                             this.t ype = mime Type.subst ring(0, sl ashIndex);
  73                             this.s ubType = s lashIndex  < mimeType .length()  ? mimeType .substring (slashInde x+1) : nul l;
  74                    }
  75                    else
  76                    {
  77                             this.t ype = mime Type;
  78                             this.s ubType = n ull;
  79                    }
  80                    
  81                    this .descripti on = descr iption;
  82                    this .enclosedM ime = encl osedMimeTy pe;
  83                    if(e nclosedMim e != null)
  84                    {
  85                             slashI ndex = enc losedMime. indexOf(mi meDelimite r); 
  86                             if(sla shIndex >=  0)
  87                             {
  88                                      this.enc losedType  = enclosed Mime.subst ring(0, sl ashIndex);
  89                                      this.enc losedSubTy pe = slash Index < en closedMime .length()  ? enclosed Mime.subst ring(slash Index+1) :  null;
  90                             }
  91                             else
  92                             {
  93                                      this.enc losedType  = enclosed Mime;
  94                                      this.enc losedSubTy pe = null;
  95                             }
  96                    }
  97                    else
  98                    {
  99                             this.e nclosedTyp e = null;
  100                             this.e nclosedSub Type = nul l;
  101                    }
  102           }
  103  
  104           pu blic Strin g getMime( )
  105           {
  106                    retu rn this.mi me;
  107           }
  108  
  109           pu blic Strin g getType( )
  110       {
  111           re turn type;
  112       }
  113  
  114           pu blic Strin g getSubTy pe()
  115       {
  116           re turn subTy pe;
  117       }
  118  
  119           pu blic Strin g getDescr iption()
  120           {
  121                    retu rn this.de scription;
  122           }
  123  
  124           pu blic Strin g getEnclo sedMime()
  125       {
  126           re turn enclo sedMime;
  127       }
  128  
  129           pu blic Strin g getEnclo sedType()
  130       {
  131           re turn enclo sedType;
  132       }
  133  
  134           pu blic Strin g getEnclo sedSubType ()
  135       {
  136           re turn enclo sedSubType ;
  137       }
  138           
  139           pu blic Strin g getMimeW ithEnclose dMime()
  140           {
  141                    if(e nclosedMim e != null)
  142                    {
  143                             return  mime + mi meDelimite r + enclos edMime;
  144                    }
  145                    else
  146                    {
  147                             return  mime;
  148                    }
  149           }
  150  
  151           /* *
  152            *  Determine s if the i mage forma t is a com pressed fo rmat
  153            *  
  154            *  @return t he compres sed
  155            * /
  156           pu blic boole an isCompr essed() {
  157                    retu rn compres sed;
  158           }
  159           
  160           /* *
  161            *  @return t he extensi on
  162            * /
  163           pu blic Strin g getExten sion()
  164           {
  165                    retu rn extensi on;
  166           }
  167  
  168           pu blic stati c ImageFor mat fromEx tension(St ring exten sion)
  169           {
  170                    for( ImageForma t imageFor mat : Imag eFormat.va lues())
  171                    {
  172                             if(ima geFormat.g etExtensio n().equals IgnoreCase (extension ))
  173                                      return i mageFormat ;
  174                    }
  175                    retu rn null;
  176                    
  177           }
  178  
  179  
  180           /* *
  181            *  
  182            *  @param im ageFormat
  183            *  @return
  184            * /
  185           pu blic stati c String g etContentT ype(ImageF ormat imag eFormat) 
  186           {
  187                    retu rn imageFo rmat.getMi me();
  188           }
  189           
  190           pu blic Strin g getDefau ltFileExte nsion()
  191           {
  192                    retu rn extensi on;
  193           }
  194  
  195           /* *
  196            *  Do a reve rse lookup , find the  ImageForm at enum fr om the mim e type.
  197            *  Note that  the mime  type is sp ecific to  type and s ubtype and  is 
  198            *  case sens itive.
  199            *  Note that  this will  return th e first Im ageFormat  enum mappe d to the
  200            *  mime type , there ma y be many.
  201            *  If the en closed typ e is speci fied then  it must ma tch
  202            *  that in t he ImageFo rmat enclo sedMimeTyp e.
  203            *  @param mi meType
  204            *  @return
  205            * /
  206           pu blic stati c ImageFor mat valueO fMimeType( String mim eType)
  207           {
  208                    Stri ng pieces[ ] = mimeTy pe.split(m imeDelimit er);
  209                    if(p ieces.leng th == 4)
  210                    {
  211                             String  mime = pi eces[0] +  mimeDelimi ter + piec es[1];
  212                             String  enclosedM ime = piec es[2] + mi meDelimite r + pieces [3];
  213                             return  valueOfMi meType(mim e, enclose dMime);
  214                             
  215                    }
  216                    else
  217                    {
  218                             return  valueOfMi meType(mim eType, nul l);
  219                    }
  220           }
  221           
  222           pu blic stati c ImageFor mat valueO fMimeType( String mim eType, Str ing enclos edMimeType )
  223           {
  224                    for( ImageForma t imageFor mat : Imag eFormat.va lues())
  225                             if(ima geFormat.g etMime().e quals(mime Type))
  226                                      if(enclo sedMimeTyp e == null)
  227                                               return ima geFormat;
  228                                      else if(  imageForm at.getEncl osedMime()  != null &
  229                                                       im ageFormat. getEnclose dMime().eq uals(enclo sedMimeTyp e) )
  230                                               return ima geFormat;
  231                    
  232                    retu rn null;
  233           }
  234           
  235           pu blic stati c boolean  isDICOMFor mat(ImageF ormat imag eFormat)
  236           {
  237                    if(( imageForma t == Image Format.DIC OM) ||
  238                             (image Format ==  ImageForma t.DICOMJPE G) ||
  239                             (image Format ==  ImageForma t.DICOMJPE G2000) ||
  240                             (image Format ==  ImageForma t.DICOMPDF ))
  241                             return  true;
  242                    retu rn false;
  243                             
  244           }
  245           
  246           pu blic stati c boolean  isDICOMFor mat(String  mimeType)
  247           {
  248                    Imag eFormat fo rmat = Ima geFormat.v alueOfMime Type(mimeT ype);
  249                    if(f ormat == n ull)
  250                             return  false;
  251                    retu rn isDICOM Format(for mat);
  252           }
  253           
  254           /* *
  255            *  
  256            *  @param or dinal
  257            *  @return
  258            * /
  259           pu blic stati c ImageFor mat valueO f(int ordi nal)
  260           {
  261                    for( ImageForma t imageFor mat : Imag eFormat.va lues())
  262                             if(ima geFormat.o rdinal() = = ordinal)
  263                                      return i mageFormat ;
  264                    
  265                    retu rn null;
  266           }
  267           
  268   }