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

331.1 Files compared

# Location File Last Modified
1 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\P137RadiologyApiWebApp\main\src\java\gov\va\med\imaging\dicom\rdsr GetDoseDataServlet.java Mon Dec 4 21:35:08 2017 UTC
2 IV-eHMP_CIF.zip\IMAG_Source\VISA\Java\P137RadiologyApiWebApp\main\src\java\gov\va\med\imaging\dicom\rdsr GetDoseDataServlet.java Mon Dec 4 22:04:39 2017 UTC

331.2 Comparison summary

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

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

331.4 Active regular expressions

No regular expressions were active.

331.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: Apr  25, 2012
  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.dic om.rdsr;
  27  
  28   import gov .va.med.im aging.core .interface s.exceptio ns.Connect ionExcepti on;
  29   import gov .va.med.im aging.core .interface s.exceptio ns.MethodE xception;
  30   import gov .va.med.im aging.exch ange.busin ess.dicom. rdsr.CTDos e;
  31   import gov .va.med.im aging.exch ange.busin ess.dicom. rdsr.Dose;
  32   import gov .va.med.im aging.exch ange.busin ess.dicom. rdsr.Fluor oDose;
  33  
  34   import jav a.io.IOExc eption;
  35   import jav a.io.Print Writer;
  36   import jav a.util.Arr ayList;
  37   import jav a.util.Lis t;
  38  
  39   import jav ax.servlet .ServletEx ception;
  40   import jav ax.servlet .http.Http Servlet;
  41   import jav ax.servlet .http.Http ServletReq uest;
  42   import jav ax.servlet .http.Http ServletRes ponse;
  43  
  44   import org .apache.lo gging.log4 j.LogManag er;
  45   import org .apache.lo gging.log4 j.Logger;
  46  
  47   /**
  48    * @author         
WERFEJ
  49    *
  50    */
  51   public cla ss GetDose DataServle t
  52   extends Ht tpServlet
  53   {
  54           pr ivate stat ic final l ong serial VersionUID  = -185097 6585167762 873L;
  55           pr ivate fina l static L ogger logg er = LogMa nager.getL ogger(GetD oseDataSer vlet.class );
  56  
  57           @O verride
  58           pr otected vo id doGet(H ttpServlet Request re quest, Htt pServletRe sponse res ponse)
  59           {
  60                    try
  61                    {
  62                             String Buffer out put = new  StringBuff er();
  63                             
  64                             // Sta rt the pag e
  65                             output .append("< html>\n");
  66                             output .append("< head><link  rel='styl esheet' ty pe='text/c ss' href=' ../include s/styles.c ss' /></he ad>\n");
  67                             output .append("   <body>\n" );
  68                             output .append("          <h 1>P137 Rad iology API  Test Page </h1>\n");
  69                             output .append("          <f orm method ='POST' ac tion='GetD oseData'>\ n");
  70                             output .append("          <t able>\n");
  71                             output .append("                   <tr> \n");
  72                             output .append("                            <th>Pa tient ID ( DFN)</th>\ n");
  73                             output .append("                            <td><i nput type= 'text' nam e='patient Dfn'/></td >\n");
  74                             output .append("                   </tr >\n");
  75                             output .append("                   <tr> \n");
  76                             output .append("                            <th>Ac cession Nu mber</th>\ n");
  77                             output .append("                            <td><i nput type= 'text' nam e='accessi onNumber'/ ></td>\n") ;
  78                             output .append("                   </tr >\n");
  79                             output .append("          </ table>\n") ;
  80                             output .append("          <b r />\n");
  81                             output .append("          <i nput type= 'submit' n ame='searc h' value=' Get Dose D ata' />\n" );
  82                             output .append("  </form>\n" );
  83                             output .append("   </body>\n ");
  84                             PrintW riter out  = response .getWriter ();
  85                             out.wr ite(output .toString( ));
  86                    }
  87                    catc h (Excepti on e)
  88                    {
  89                             e.prin tStackTrac e();
  90                    }
  91           }
  92  
  93           @O verride
  94           pr otected vo id doPost( HttpServle tRequest r equest, Ht tpServletR esponse re sponse)
  95           th rows Servl etExceptio n, IOExcep tion
  96           {
  97                    Stri ng dfn = r equest.get Parameter( "patientDf n");
  98                    Stri ng accessi onNumber =  request.g etParamete r("accessi onNumber") ;
  99                    try
  100                    {
  101                             RDSRRo uter route r = RDSRCo ntext.getR outer();
  102                             List<D ose> doseL ist = rout er.getRadi ationDoseD etails(dfn , accessio nNumber);
  103                             
  104                             List<C TDose> ctD oseDetails  = new Arr ayList<CTD ose>();
  105                             List<F luoroDose>  fluoroDos eDetails =  new Array List<Fluor oDose>();
  106                             
  107                             for (D ose dose :  doseList)
  108                             {
  109                                      if (dose  instanceo f CTDose)
  110                                      {
  111                                               ctDoseDeta ils.add((C TDose)dose );
  112                                      }
  113                                      else if  (dose inst anceof Flu oroDose)
  114                                      {
  115                                               fluoroDose Details.ad d((FluoroD ose)dose);
  116                                      }
  117                             }
  118                             
  119                             String  html = ge tResultsHt ml(dfn, ac cessionNum ber, ctDos eDetails,  fluoroDose Details);
  120  
  121                             PrintW riter out  = response .getWriter ();
  122                             out.wr ite(html);
  123                    }
  124                    catc h (MethodE xception e )
  125                    {
  126                             // TOD O Auto-gen erated cat ch block
  127                             e.prin tStackTrac e();
  128                    }
  129                    catc h (Connect ionExcepti on e)
  130                    {
  131                             // TOD O Auto-gen erated cat ch block
  132                             e.prin tStackTrac e();
  133                    }
  134           }
  135  
  136           pr ivate Stri ng getResu ltsHtml(St ring dfn,  String acc essionNumb er, List<C TDose> ctD oseDetails , List<Flu oroDose> f luoroDoseD etails)
  137           {
  138                    Stri ngBuffer o utput = ne w StringBu ffer();
  139                    
  140                    // S tart the p age
  141                    outp ut.append( "<html>\n" );
  142                    outp ut.append( "<head><li nk rel='st ylesheet'  type='text /css' href ='../inclu des/styles .css' /></ head>\n");
  143                    outp ut.append( "<body>\n" );
  144                    
  145                    // A dd the tit le
  146                    outp ut.append( "<h1>P137  Radiology  API Test P age</h1>\n ");
  147                    
  148                    outp ut.append( "          <form meth od='POST'  action='Ge tDoseData' >\n");
  149                    outp ut.append( "          <table>\n" );
  150                    outp ut.append( "                  <t r>\n");
  151                    outp ut.append( "                           <th> Patient ID  (DFN)</th >\n");
  152                    outp ut.append( "                           <td> <input typ e='text' n ame='patie ntDfn' val ue='" + df n + "'/></ td>\n");
  153                    outp ut.append( "                  </ tr>\n");
  154                    outp ut.append( "                  <t r>\n");
  155                    outp ut.append( "                           <th> Accession  Number</th >\n");
  156                    outp ut.append( "                           <td> <input typ e='text' n ame='acces sionNumber ' value='"  + accessi onNumber +  "'/></td> \n");
  157                    outp ut.append( "                  </ tr>\n");
  158                    outp ut.append( "          </table>\n ");
  159  
  160                    // A dd the but ton to sea rch again
  161                    outp ut.append( "          <br />\n") ;
  162                    outp ut.append( "          <input typ e='submit'  name='sea rch' value ='Get Dose  Data' />\ n");
  163                    outp ut.append( " </form>\ n");
  164                    
  165                    // A dd the CT  Dose resul ts
  166                    outp ut.append( "<h3>CT Do se Informa tion</h3>\ n");
  167                    if ( ctDoseDeta ils.size()  == 0)
  168                    {
  169                             output .append("< font color ='red'>&nb sp;&nbsp;< i>No CT Do se informa tion found </i></font ></br>\n") ;
  170                    }
  171                    else
  172                    {
  173                             output .append("< table>\n") ;
  174                             output .append("< tr>\n");
  175                             output .append("< th>Mean CT DIvol</th> \n");
  176                             output .append("< th>DLP</th >\n");
  177                             output .append("< th>Target  Region</th >\n");
  178                             output .append("< th>Phantom  Type</th> \n");
  179                             output .append("< th>Irradia tion Event  UID</th>\ n");
  180                             output .append("< /tr>\n");
  181                             
  182                             for (C TDose dose  : ctDoseD etails)
  183                             {
  184                                      output.a ppend("<tr >\n");
  185                                      output.a ppend("<td >" + dose. getMeanCTD Ivol() + " </td>\n");
  186                                      output.a ppend("<td >" + dose. getDlp() +  "</td>\n" );
  187                                      output.a ppend("<td >" + dose. getAnatomi cTargetReg ion() + "< /td>\n");
  188                                      output.a ppend("<td >" + dose. getPhantom Type() + " </td>\n");
  189                                      output.a ppend("<td >" + dose. getIrradia tionEventU id() + "</ td>\n");
  190                                      output.a ppend("</t r>\n");
  191                             }
  192                             output .append("< /table>\n" );
  193                    }
  194                    
  195                    // A dd the Flu oro Dose r esults
  196                    outp ut.append( "<h3>Fluor o Dose Inf ormation</ h3>\n");
  197                    if ( fluoroDose Details.si ze() == 0)
  198                    {
  199                             output .append("< font color ='red'>&nb sp;&nbsp;< i>No Fluor o Dose inf ormation f ound</i></ font></br> \n");
  200                    }
  201                    else
  202                    {
  203                             output .append("< table>\n") ;
  204                             output .append("< tr>\n");
  205                             output .append("< th>Dose (R P) Total</ th>\n");
  206                             output .append("< th>Dose Ar ea Product  Total</th >\n");
  207                             output .append("< th>Fluoro  Time Total </th>\n");
  208                             output .append("< th>Fluoro  Dose (RP)  Total</th> \n");
  209                             output .append("< th>Fluoro  Dose Area  Product to tal</th>\n ");
  210                             output .append("< th>Cine Do se (RP) To tal</th>\n ");
  211                             output .append("< th>Cine Do se Area Pr oduct Tota l</th>\n") ;
  212                             output .append("< th>Cine Ti me</th>\n" );
  213                             output .append("< /tr>\n");
  214                             
  215                             for (F luoroDose  dose : flu oroDoseDet ails)
  216                             {
  217                                      output.a ppend("<tr >\n");
  218                                      output.a ppend("<td >" + dose. getDoseRpT otal() + " </td>\n");
  219                                      output.a ppend("<td >" + dose. getDoseAre aProductTo tal() + "< /td>\n");
  220                                      output.a ppend("<td >" + dose. getFluoroT imeTotal()  + "</td>\ n");
  221                                      output.a ppend("<td >" + dose. getFluoroD oseRpTotal () + "</td >\n");
  222                                      output.a ppend("<td >" + dose. getFluoroD oseAreaPro ductTotal( ) + "</td> \n");
  223                                      output.a ppend("<td >" + dose. getCineDos eRpTotal()  + "</td>\ n");
  224                                      output.a ppend("<td >" + dose. getCineDos eAreaProdu ctTotal()  + "</td>\n ");
  225                                      output.a ppend("<td >" + dose. getCineTim e() + "</t d>\n");
  226                                      output.a ppend("</t r>\n");
  227                             }
  228                             output .append("< /table>\n" );
  229                    }
  230  
  231                    // E nd the pag e
  232                    outp ut.append( "</body\n> ");
  233                    outp ut.append( "</html\n> ");
  234                    
  235                    retu rn output. toString() ;
  236           }
  237  
  238   }