285. EPMO Open Source Coordination Office Redaction File Detail Report

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

285.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingDicomUtilities\src\java\gov\va\med\imaging\dicom\utilities\reconstitution Reconstitutor.java Mon Dec 4 21:35:10 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\ImagingDicomUtilities\src\java\gov\va\med\imaging\dicom\utilities\reconstitution Reconstitutor.java Mon Dec 4 22:03:10 2017 UTC

285.2 Comparison summary

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

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

285.4 Active regular expressions

No regular expressions were active.

285.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: Sept ember 26,  2005
  6     Site Nam e:  Washin gton OI Fi eld Office , Silver S pring, MD
  7       Developer:          
PETERB
  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   package go v.va.med.i maging.dic om.utiliti es.reconst itution;
  26  
  27   import gov .va.med.im aging.Size dInputStre am;
  28   import gov .va.med.im aging.dico m.common.i nterfaces. IDicomData Set;
  29   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.excepti ons.DicomF ileExcepti on;
  30   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.excepti ons.TGAFil eException ;
  31   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.excepti ons.TGAFil eNotFoundE xception;
  32   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.reconst itution.Di comFileExt ractor;
  33   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.reconst itution.Le gacyTGAFil eParser;
  34   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.reconst itution.Le gacyTextFi leParser;
  35   import gov .va.med.im aging.dico m.dcftoolk it.utiliti es.reconst itution.Or iginalPixe lDataInfo;
  36   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomRecon stitutionE xception;
  37   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomUtili tiesTGAFil eException ;
  38   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomUtili tiesTGAFil eNotFoundE xception;
  39   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomUtili tiesTextFi leExceptio n;
  40   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomUtili tiesTextFi leExtracti onExceptio n;
  41   import gov .va.med.im aging.dico m.utilitie s.exceptio ns.Generic DicomUtili tiesTextFi leNotFound Exception;
  42   import gov .va.med.im aging.exce ptions.Tex tFileExcep tion;
  43   import gov .va.med.im aging.exce ptions.Tex tFileExtra ctionExcep tion;
  44   import gov .va.med.im aging.exce ptions.Tex tFileNotFo undExcepti on;
  45   import gov .va.med.im aging.exch ange.busin ess.dicom. exceptions .DicomExce ption;
  46  
  47   import jav a.io.Buffe redReader;
  48   import jav a.io.Input StreamRead er;
  49   import jav a.util.Has hMap;
  50  
  51   import org .apache.lo gging.log4 j.LogManag er;
  52   import org .apache.lo gging.log4 j.Logger;
  53  
  54   /**
  55    *
  56    * @author  William P eterson
  57    * extende d by Csaba  Titton
  58    *                        for Vi X streamin g
  59    */
  60   @Deprecate d
  61   public cla ss Reconst itutor {
  62       
  63       privat e static f inal Logge r LOGGER =  LogManage r.getLogge r (Reconst itutor.cla ss);
  64  
  65       /**
  66        * Con structor
  67        *
  68        * 
  69        */
  70       @Depre cated
  71       public  Reconstit utor() {
  72           su per();
  73           //
  74       }
  75       
  76       /**
  77        * Ass emble a DI COM object  based on  the existi ng Text an d Targa fi les in Leg acy Vista 
  78        * Ima ging and a dditional  changes fr om Vista H IS.  This  Control cl ass perfor ms the 
  79        * act ual work.
  80        * 
  81        * @pa ram textFi lename rep resents th e name of  the Text f ile.
  82        * @pa ram tgaFil ename repr esents the  name of t he Targa f ile.
  83        * @pa ram hischa nges repre sents the  Vista HIS  changes.
  84        * @pa ram toVali date repre sents if t he DicomDa taSet obje ct is to b e validate  before re turning.
  85        * @re turn repre sents the  generic Di comDataSet  object.
  86        */
  87       @Depre cated
  88       public  IDicomDat aSet assem bleDicomOb ject(Strin g textFile name,
  89                String t gaFilename , HashMap< String, St ring> hisC hanges, bo olean toVa lidate)
  90                throws G enericDico mUtilities TextFileNo tFoundExce ption, Gen ericDicomU tilitiesTe xtFileExce ption, 
  91                GenericD icomUtilit iesTextFil eExtractio nException , GenericD icomUtilit iesTGAFile Exception,
  92                GenericD icomUtilit iesTGAFile NotFoundEx ception{
  93           
  94           ID icomDataSe t toolkitD DS = null;
  95           Or iginalPixe lDataInfo  originalPi xelData =  new Origin alPixelDat aInfo();
  96           tr y{
  97                LOGGER.i nfo(this.g etClass(). getName()  + ": Gener ic DICOM L ayer: " +
  98                         "parsing T ext file "  + textFil ename + "  ...");
  99                //Invoke  the extra ction of d ata from t he Text fi le.
  100                LegacyTe xtFilePars er textPar ser = new  LegacyText FileParser ();
  101                //A bett er design  would have  the Origi nalPixelDa taInfo obj ect
  102                //  enca psulated w ithin the  DicomDataS et since i ts being p ushed arou nd.
  103                toolkitD DS = textP arser.crea teDicomDat aSet(textF ilename, o riginalPix elData);
  104                
  105                LOGGER.i nfo(this.g etClass(). getName()  + ": Gener ic DICOM L ayer: " +
  106                         "parsing T GA/BIG fil e " + tgaF ilename +  " ...");
  107                String a cquisition Site = nul l;
  108                if(hisCh anges.cont ainsKey("0 032,1020") ){
  109                    acqu isitionSit e = (Strin g)hisChang es.get("00 32,1020");
  110                    tool kitDDS.set Acquisitio nSite(acqu isitionSit e);
  111                }
  112                //Invoke  the extra ction of p ixel data  from the T arga file.
  113                LegacyTG AFileParse r tgaParse r = new Le gacyTGAFil eParser();
  114                tgaParse r.updateDi comDataSet WithPixelD ata(toolki tDDS, tgaF ilename, o riginalPix elData);
  115                //Add th e Vista HI S changes  to the gen eric Dicom DataSet ob ject.  Thi s is done
  116                // by ca lling Csab a's code.
  117                toolkitD DS.updateH ISChangesT oDDS(hisCh anges);
  118                
  119                //Valida te the Dic omDataSet  if desired .
  120                if(toVal idate){
  121                    //Va lidate the  DicomData Set.
  122                }
  123                return t oolkitDDS;
  124           }
  125           ca tch(TextFi leNotFound Exception  noText){
  126                LOGGER.e rror(noTex t.getMessa ge());
  127                LOGGER.e rror(this. getClass() .getName()  + ": " +
  128                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  129                throw ne w GenericD icomUtilit iesTextFil eNotFoundE xception(
  130                         "Failure t o assemble  Dicom Obj ect.", noT ext);
  131           }
  132           ca tch(TextFi leExtracti onExceptio n extract) {
  133                LOGGER.e rror(extra ct.getMess age());
  134                LOGGER.e rror(this. getClass() .getName()  + ": " +
  135                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  136                throw ne w GenericD icomUtilit iesTextFil eExtractio nException (
  137                         "Failure t o assemble  Dicom Obj ect.", ext ract);
  138           }
  139           ca tch(TextFi leExceptio n e){
  140                LOGGER.e rror(e.get Message()) ;
  141                LOGGER.e rror(this. getClass() .getName()  + ": " +
  142                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  143                throw ne w GenericD icomUtilit iesTextFil eException (
  144                         "Failure t o assemble  Dicom Obj ect.", e);
  145           }
  146           ca tch(TGAFil eNotFoundE xception n otga){
  147                LOGGER.e rror(notga .getMessag e());
  148                LOGGER.e rror(this. getClass() .getName()  + ": " +
  149                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  150                throw ne w GenericD icomUtilit iesTGAFile Exception(
  151                         "Failure t o assemble  Dicom Obj ect.", not ga);
  152           }
  153           ca tch(TGAFil eException  badtga){
  154                LOGGER.e rror(badtg a.getMessa ge());
  155                LOGGER.e rror(this. getClass() .getName() +": " +
  156                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  157                throw ne w GenericD icomUtilit iesTGAFile Exception(
  158                         "Failure t o assemble  Dicom Obj ect.", bad tga);
  159           }
  160           ca tch(DicomE xception d e){
  161                LOGGER.e rror(de.ge tMessage() );
  162                LOGGER.e rror(this. getClass() .getName()  + ": " +
  163                         "\nExcepti on thrown  while asse mbling Dic om Object. ");
  164                throw ne w GenericD icomUtilit iesTGAFile Exception(
  165                         "Failure t o assemble  Dicom Obj ect.", de) ;
  166           }
  167       }
  168  
  169       /**
  170        * Ass emble a DI COM stream  based on  the existi ng Text an d Targa st reams from  Legacy Vi sta 
  171        * Ima ging and a dditional  changes fr om Vista H IS. Note:  the stream  format of  the TXT f ile
  172        * is  expected t o contain  the HIS ch anges that  represent s the late st local V ista datab ase
  173        * val ues to the  patient/s tudy.
  174        * 
  175        * @pa ram sizedT extStream  represents  the strea m of VistA  Imaging T XT data wi th byte si ze.
  176        * @pa ram sizedT gaStream r epresents  the stream  of the Vi stA Imagin g Targa fi le with by te size..
  177        * @pa ram toVali date repre sents if t he DicomDa taSet obje ct is to b e validate  before re turning.
  178        * @re turn repre sents the  generic Di comDataSet  object (p art 10 for mat) in a  byte array .
  179        */
  180       @Depre cated
  181       public  byte[] as sembleDico mStream(Si zedInputSt ream sized TextStream
  182                    Size dInputStre am sizedTg aStream, b oolean toV alidate)
  183                throws G enericDico mUtilities TextFileNo tFoundExce ption, Gen ericDicomU tilitiesTe xtFileExce ption, 
  184                GenericD icomUtilit iesTextFil eExtractio nException , GenericD icomUtilit iesTGAFile Exception,
  185                GenericD icomUtilit iesTGAFile NotFoundEx ception{
  186           
  187           Ha shMap<Stri ng, String > hisChang es=null;
  188           ID icomDataSe t toolkitD DS;
  189           Or iginalPixe lDataInfo  originalPi xelData =  new Origin alPixelDat aInfo();
  190           tr y{
  191                LOGGER.i nfo("Gener ic DICOM L ayer: Star t parsing  input stre ams ...");
  192                // Extra ct all DIC OM data fr om the Tex t file, bu ild datase t;
  193                // Make  sure ViX u pdates at  the end of  file are  processed  too
  194                LegacyTe xtFilePars er textPar ser = new  LegacyText FileParser ();
  195                Buffered Reader buf fer = new  BufferedRe ader(new I nputStream Reader(siz edTextStre am.getInSt ream()));
  196                toolkitD DS = textP arser.crea teDicomDat aSet(buffe r, origina lPixelData );
  197                hisChang es=textPar ser.getHis Updates(bu ffer);
  198  
  199                if (hisC hanges!=nu ll) { // m ake sure a cquisition Site is ex tracted fr om update  section if  available
  200                         String acq uisitionSi te = null;
  201                         if(hisChan ges.contai nsKey("003 2,1020")){
  202                             acquis itionSite  = (String) hisChanges .get("0032 ,1020");
  203                             toolki tDDS.setAc quisitionS ite(acquis itionSite) ;
  204                         }
  205                }
  206                //Invoke  the extra ction of p ixel data  from the T arga file.
  207                LegacyTG AFileParse r tgaParse r = new Le gacyTGAFil eParser();
  208                tgaParse r.updateDi comDataSet WithPixelD ata(toolki tDDS, size dTgaStream , original PixelData) ;
  209                LOGGER.i nfo("... G eneric DIC OM Layer:  Parsing in put stream s complete d.");
  210                // Extra ct the Vis ta HIS cha nges to th e generic  DicomDataS et object.   
  211                if (hisC hanges!=nu ll)
  212                    tool kitDDS.upd ateHISChan gesToDDS(h isChanges) ;
  213                
  214                //Valida te the Dic omDataSet  if desired .
  215                if(toVal idate){
  216                    //Va lidate the  DicomData Set.
  217                }
  218                return t oolkitDDS. part10Buff er(false);
  219           }
  220           ca tch(TextFi leExtracti onExceptio n extract) {
  221                LOGGER.e rror("Erro r: " + ext ract.getMe ssage());
  222                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  223                throw ne w GenericD icomUtilit iesTextFil eExtractio nException (
  224                         "Failure t o assemble  Dicom Obj ect.", ext ract);
  225           }
  226           ca tch(TextFi leExceptio n e){
  227                LOGGER.e rror("Erro r: " + e.g etMessage( ));
  228                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  229                throw ne w GenericD icomUtilit iesTextFil eException (
  230                         "Failure t o assemble  Dicom Obj ect.", e);
  231           }
  232           ca tch(TGAFil eNotFoundE xception n otga){
  233                LOGGER.e rror("Erro r: " + not ga.getMess age());
  234                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  235                throw ne w GenericD icomUtilit iesTGAFile Exception(
  236                         "Failure t o assemble  Dicom Obj ect.", not ga);
  237           }
  238           ca tch(TGAFil eException  badtga){
  239                LOGGER.e rror("Erro r: " + bad tga.getMes sage());
  240                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  241                throw ne w GenericD icomUtilit iesTGAFile Exception(
  242                         "Failure t o assemble  Dicom Obj ect.", bad tga);
  243           }
  244           ca tch(DicomE xception d e){
  245                LOGGER.e rror("Erro r: " + de. getMessage ());
  246                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  247                throw ne w GenericD icomUtilit iesTGAFile Exception( "Failure t o assemble  Dicom Obj ect.", de) ;
  248           }
  249       }
  250  
  251       /**
  252        * Upd ate a DICO M object b ased on th e existing  DICOM fil e in Legac y Vista Im aging and
  253        * add itional ch anges from  Vista HIS .
  254        * 
  255        * @pa ram dicomF ile repres ents the D ICOM file  path and n ame.
  256        * @pa ram hisCha nges repre sents the  Vista HIS  changes.
  257        * @pa ram toVali date repre sents if t he DicomDa taSet obje ct is to b e validate  before re turning.
  258        * @re turn repre sents the  generic Di comDataSet  object pr oduced.
  259        */
  260       @Depre cated
  261       public  IDicomDat aSet updat eDicomObje ct(String  dicomFile,  HashMap<S tring, Str ing> hisCh anges,
  262                boolean  toValidate )throws Ge nericDicom Reconstitu tionExcept ion {
  263           
  264           ID icomDataSe t toolkitD DS = null;
  265           Di comFileExt ractor fil eExtractor  = null;
  266           //  Add the V ista HIS c hanges to  the generi c DicomDat aSet objec t.  This i s done
  267           //  by callin g Csaba's  code.
  268           tr y{
  269                fileExtr actor = ne w DicomFil eExtractor ();
  270                toolkitD DS = fileE xtractor.g etDDSFromD icomFile(d icomFile);
  271                toolkitD DS.updateH ISChangesT oDDS(hisCh anges);
  272                
  273                //Valida te the Dic omDataSet  if desired .
  274                if(toVal idate){
  275                    //Va lidate the  DicomData Set.
  276                }
  277           }
  278           ca tch(DicomF ileExcepti on file){
  279                LOGGER.e rror(file. getMessage ());
  280                LOGGER.e rror(this. getClass() .getName()  + ": " +
  281                         "\nExcepti on thrown  while upda ting Dicom  Object.") ;
  282                throw ne w GenericD icomRecons titutionEx ception("F ailure to  update Dic om Object. ", file);
  283           }
  284           ca tch(DicomE xception d e){
  285                LOGGER.e rror(de.ge tMessage() );
  286                LOGGER.e rror(this. getClass() .getName()  + ": " +
  287                         "\nExcepti on thrown  while upda ting Dicom  Object.") ;
  288                throw ne w GenericD icomRecons titutionEx ception("F ailure to  update Dic om Object. ", de);
  289           }
  290           re turn toolk itDDS;
  291       }
  292  
  293       /**
  294        * Upd ate a DICO M stream b ased on th e existing  DICOM str eam from L egacy Vist a Imaging  and
  295        * add itional ch anges from  Vista HIS . Note: th e stream f ormat of t he TXT fil e is expec ted
  296        * to  contain th e HIS chan ges that r epresents  the latest  local Vis ta databas e values t o
  297        * the  patient/s tudy.
  298        * 
  299        * @pa ram sizedD icomStream  represent s the stre am of Vist A Imaging  DCM (DICOM ) data wit h byte siz e.
  300        * @pa ram sizedT extStream  represents  the strea m of VistA  Imaging T XT data wi th byte si ze.
  301        * @pa ram toVali date repre sents if t he DicomDa taSet obje ct is to b e validate  before re turning.
  302        * @re turn repre sents the  generic Di comDataSet  object (p art 10 for mat) in a  byte array .
  303        */
  304       @Depre cated
  305       public  byte[] up dateDicomS tream(Size dInputStre am sizedDi comStream,  SizedInpu tStream si zedTextStr eam,
  306                boolean  toValidate )throws Ge nericDicom Reconstitu tionExcept ion {
  307  
  308           Ha shMap<Stri ng,String>  hisChange s=null;
  309           ID icomDataSe t toolkitD DS;
  310           Di comFileExt ractor fil eExtractor ;
  311           // Add the Vi sta HIS ch anges to t he generic  DicomData Set object .  This is  done
  312           //  by callin g Csaba's  code.
  313           tr y{
  314                fileExtr actor = ne w DicomFil eExtractor ();
  315                toolkitD DS = fileE xtractor.g etDDSFromD icomStream (sizedDico mStream);
  316                // Extra ct all ViX  update da ta section  from the  Text file  and update
  317                // datas et with it ;
  318                LegacyTe xtFilePars er textPar ser = new  LegacyText FileParser ();
  319                hisChang es=textPar ser.extrac tHisUpdate sfromTextS tream(size dTextStrea m);
  320                if (hisC hanges!=nu ll)
  321                    tool kitDDS.upd ateHISChan gesToDDS(h isChanges) ;
  322                
  323                //Valida te the Dic omDataSet  if desired .
  324                if(toVal idate){
  325                    //Va lidate the  DicomData Set.
  326                }
  327                return t oolkitDDS. part10Buff er(true);
  328           }
  329           ca tch(DicomF ileExcepti on file){
  330                LOGGER.e rror("Erro r: " + fil e.getMessa ge());
  331                LOGGER.e rror("Exce ption thro wn while u pdating Di com Stream .");
  332                throw ne w GenericD icomRecons titutionEx ception("F ailure to  update Dic om Stream. ", file);
  333           }
  334           ca tch(DicomE xception d e){
  335                LOGGER.e rror("Erro r: " + de. getMessage ());
  336                LOGGER.e rror("Exce ption thro wn while u pdating Di com Object .");
  337                throw ne w GenericD icomRecons titutionEx ception("F ailure to  update Dic om Stream. ", de);
  338           }
  339           ca tch(TextFi leExtracti onExceptio n extract) {
  340                LOGGER.e rror("Erro r: " + ext ract.getMe ssage());
  341                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  342                throw ne w GenericD icomRecons titutionEx ception(
  343                         "Failure t o extract  HIS Update  data.", e xtract);
  344           }
  345           ca tch(TextFi leExceptio n e){
  346                LOGGER.e rror("Erro r: " + e.g etMessage( ));
  347                LOGGER.e rror("Exce ption thro wn while a ssembling  Dicom Obje ct.");
  348                throw ne w GenericD icomRecons titutionEx ception(
  349                         "Failure t o handle T ext file f or HIS Upd ates.", e) ;
  350           }
  351  
  352       }
  353   }