139. EPMO Open Source Coordination Office Redaction File Detail Report

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

139.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DicomCodecImpl\main\src\java\gov\va\med\imaging\dicom\io DataSetReader.java Mon Dec 4 21:34:56 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\DicomCodecImpl\main\src\java\gov\va\med\imaging\dicom\io DataSetReader.java Mon Dec 4 21:59:23 2017 UTC

139.2 Comparison summary

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

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

139.4 Active regular expressions

No regular expressions were active.

139.5 Comparison detail

  1   package go v.va.med.i maging.dic om.io;
  2  
  3   import gov .va.med.im aging.dico m.DataElem ent;
  4   import gov .va.med.im aging.dico m.DataElem entFactory ;
  5   import gov .va.med.im aging.dico m.DataElem entTag;
  6   import gov .va.med.im aging.dico m.DataSet;
  7   import gov .va.med.im aging.dico m.exceptio ns.DicomFo rmatExcept ion;
  8   import gov .va.med.im aging.dico m.exceptio ns.Incompa tibleValue LengthFiel d;
  9   import gov .va.med.im aging.dico m.exceptio ns.Invalid VRExceptio n;
  10   import gov .va.med.im aging.dico m.exceptio ns.Invalid VRModeExce ption;
  11  
  12   import jav a.io.IOExc eption;
  13  
  14   import org .apache.lo gging.log4 j.LogManag er;
  15   import org .apache.lo gging.log4 j.Logger;
  16  
  17   /**
  18    * This cl ass is giv en an Inpu tStream, p ositioned  at the sta rt of a Da taSet,
  19    * and rea ds until t he stream  is exhaust ed.
  20    * 
  21    * @author         
BECKEC
  22    *
  23    */
  24   public cla ss DataSet Reader
  25   {
  26           pr ivate fina l DataElem entReader  reader;
  27           pr ivate Logg er logger  = LogManag er.getLogg er(this.ge tClass().g etName());
  28           
  29           /* *
  30            *  
  31            *  @param in putStream
  32            *  @param da taElementF actory
  33            * /
  34           pu blic DataS etReader(D ataElement LimitedInp utStream i nputStream , DataElem entFactory  elementFa ctory)
  35           {
  36                    this .reader =  new DataEl ementReade r(inputStr eam, eleme ntFactory) ;
  37           }
  38  
  39           /* *
  40            *  Read a Da taSet, sta rting from  the curre nt positio n and stop ping at th e end of
  41            *  the file.
  42            *  
  43            *  @return
  44            *  @throws I OException  
  45            *  @throws U nsupported OperationE xception 
  46            *  @throws I nvalidVREx ception 
  47            *  @throws I nvalidVRMo deExceptio
  48            *  @throws D icomFormat Exception 
  49            * /
  50           pu blic DataS et readDat aSet() 
  51           th rows Unsup portedOper ationExcep tion, IOEx ception, I nvalidVRMo deExceptio n, Invalid VRExceptio n, DicomFo rmatExcept ion
  52           {
  53                    logg er.info("R eading roo t data set " );
  54                    Data Set dataSe t = new Da taSet(read er.getData ElementFac tory().get TransferSy ntaxUid()) ;
  55                    
  56                    for(  DataEleme nt<?> data Element =  reader.rea dNextDataE lement();
  57                             dataEl ement != n ull;
  58                             dataEl ement = re ader.readN extDataEle ment() )
  59                    {
  60                             dataSe t.add(data Element);
  61                    }
  62                    
  63                    retu rn dataSet ;
  64           }
  65           
  66           /* *
  67            *  Read a Da taSet, sta rting from  the curre nt positio n and stop ping at th e next
  68            *  SEQUENCE_ ITEM_DELIM ITER tag.   The delim iter tag i s NOT incl uded in ei ther
  69            *  the retur ned DataSe t or the p arent data  set.
  70            *  
  71            *  @return
  72            *  @throws U nsupported OperationE xception
  73            *  @throws I OException
  74            *  @throws I nvalidVRMo deExceptio n
  75            *  @throws I nvalidVREx ception
  76            *  @throws D icomFormat Exception 
  77            * /
  78           pu blic DataS et readSeq uenceEleme ntDataSet( long value Length) 
  79           th rows Unsup portedOper ationExcep tion, IOEx ception, I nvalidVRMo deExceptio n, Invalid VRExceptio n, DicomFo rmatExcept ion
  80           {
  81                    logg er.info("R eading seq uence elem ent data s et, length  is " + 
  82                                      (valueLe ngth == Da taElement. INDETERMIN ATE_LENGTH  ? "indete rminate" :  Long.toHe xString(va lueLength) ) );
  83                    
  84                    retu rn valueLe ngth == Da taElement. INDETERMIN ATE_LENGTH  ?
  85                                      readInde terminateL engthSeque nceElement DataSet()  :
  86                                      readDete rminateLen gthSequenc eElementDa taSet(valu eLength);
  87           }
  88           
  89           pr ivate Data Set readIn determinat eLengthSeq uenceEleme ntDataSet( )
  90           th rows Incom patibleVal ueLengthFi eld, IOExc eption, In validVRMod eException , InvalidV RException , DicomFor matExcepti on
  91           {
  92                    logg er.info("R eading ind eterminate  length se quence ele ment data  set." );
  93                    
  94                    // c reate an i nput strea m that wil l stop at  the SEQUEN CE_DELIMIT ATION_TAG
  95                    Data ElementLim itedInputS tream inSt ream = 
  96                             new Da taElementL imitedInpu tStream(
  97                                               reader.get InputStrea m(), 
  98                                               DataElemen tTag.SEQUE NCE_DELIMI TATION_TAG );
  99                    
  100                    // c reate a Da taSetReade r using th e same fac tory (and  same trans fer syntax ) as this  data set
  101                    Data SetReader  childDataS etReader =  new DataS etReader(i nStream, r eader.getD ataElement Factory()) ;
  102                    
  103                    // r ead the da ta set
  104                    Data Set dataSe t = childD ataSetRead er.readDat aSet();
  105                    
  106                    retu rn dataSet ;
  107           }
  108           
  109           pr ivate Data Set readDe terminateL engthSeque nceElement DataSet(lo ng length)  
  110           th rows Incom patibleVal ueLengthFi eld, IOExc eption, In validVRMod eException , InvalidV RException , DicomFor matExcepti on
  111           {
  112                    logg er.info("R eading det erminate l ength sequ ence eleme nt data se t, length  is '" + le ngth + "'. " );
  113                    if(l ength == 0 )
  114                             return  null;
  115                    
  116                    // c reate an i nput strea m that wil l stop aft er the spe cified num ber of byt es
  117                    Data ElementLim itedInputS tream inSt ream = 
  118                             new Da taElementL imitedInpu tStream(
  119                                               reader.get InputStrea m(), 
  120                                               length);
  121                    Data SetReader  childDataS etReader =  new DataS etReader(i nStream, r eader.getD ataElement Factory()) ;
  122                    Data Set dataSe t = childD ataSetRead er.readDat aSet();
  123                    
  124                    retu rn dataSet ;
  125                    
  126           }
  127   }