3. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 5/24/2018 2:23:10 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.

3.1 Files compared

# Location File Last Modified
1 CUI-v2.5.0-release-source.zip\app\controllers\vista veterans_controller.rb Fri Mar 23 17:02:06 2018 UTC
2 CUI-v2.5.0-release-source.zip\app\controllers\vista veterans_controller.rb Wed May 16 19:49:04 2018 UTC

3.2 Comparison summary

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

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

3.4 Active regular expressions

No regular expressions were active.

3.5 Comparison detail

  1   class Vist a::Veteran sControlle r < Applic ationContr oller
  2  
  3  
  4    
  5     # Method  triggered  by the a  Search sub mit from t he user
  6     def sear ch
  7       if par ams[:commi t].present ?
  8         if p arams[:com mit] == "S earch"
  9           if  params[:l ast_name]. blank? &&  params[:fi rst_name]. blank? &&  params[:ve teran_birt h_date].bl ank?
  10              flash.now[ :alert] =  "Please fi ll in at l east one f ield in or der to sea rch"
  11           el sif cookie  = authent ication_re quest
  12              results =  search_req uest(param s[:last_na me], param s[:first_n ame], para ms[:vetera n_birth_da te], cooki e)
  13              if results .code == 2 00
  14                @veteran s = eval(r esults.bod y)[:data][ :items]
  15                @veteran s.count <  1 ? flash. now[:alert ] = "No ma tching Vet erans were  found." :  flash.now [:notice]  = "The fol lowing res ults for V eterans we re found:"  
  16              else
  17                flash.no w[:alert]  = eval(res ults.body) [:message]              
  18              end
  19           el se
  20              flash.now[ :alert] =  "Unable to  obtain au thenticati on for req uest " 
  21           en d
  22         end
  23       end
  24     end
  25     
  26     
  27     def sele cted
  28       if par ams.try(:[ ], :commit ) == "Subm it"
  29         @vet erans = []
  30         para ms[:select ].each do  |s|
  31           ve t = {}
  32           fi elds = s[0 ].split(",  ")
  33           ve t[:fullNam e] = field s[0]
  34           ve t[:age] =  fields[1]
  35           ve t[:genderN ame] = fie lds[2]
  36           ve t[:birthDa te] = fiel ds[3]
  37           ve t[:ssn] =  fields[4]
  38           ve t[:city] =  fields[5]
  39           ve t[:state]  = fields[6 ]
  40           ve t[:zip] =  fields[7]
  41           @v eterans <<  vet
  42           fl ash.now[:n otice] = " You have s elected th e followin g Veteran( s) "
  43         end
  44       elsif  params.try (:[], :com mit) == "A dd"
  45         @vet erans = []
  46         vet  = {}
  47         vet[ :fullName]  = params[ :first_nam e] + " " +  params[:l ast_name]
  48         vet[ :birthDate ] = params [:veteran_ birth_date ]
  49         vet[ :city] = p arams[:cit y]
  50         vet[ :state] =  params[:st ate]
  51         vet[ :zip] = pa rams[:zip]        
  52         @vet erans << v et
  53         flas h.now[:not ice] = "Yo u have suc cessfully  added the  following  Veteran "
  54       end
  55     end
  56     
  57     
  58     def add
  59       if par ams[:commi t].present
  60         proc eed = true
  61         para ms[:first_ name].blan k? ? (@fna me_blank =  true; pro ceed=false ) : false
  62         para ms[:last_n ame].blank ? ? (@lnam e_blank =  true; proc eed=false)  : false
  63         para ms[:vetera n_birth_da te].blank?  ? (@veter an_birth_d ate_blank  = true; pr oceed=fals e) : false
  64         para ms[:email] .blank? ?  (@email_bl ank = true ; proceed= false) : f alse
  65         para ms[:phone_ number].bl ank? ? (@p hone_numbe r_blank =  true; proc eed=false)  : false
  66         para ms[:city]. blank? ? ( @city_blan k = true;  proceed=fa lse) : fal se
  67         para ms[:state] .blank? ?  (@state_bl ank = true ; proceed= false) : f alse
  68         para ms[:zip].b lank? ? (@ zip_blank  = true; pr oceed=fals e) : false
  69         
  70         if p roceed ==  false
  71           fl ash.now[:a lert] = "P lease fill  in the re quired fie lds below: "
  72         elsi f cookie =  authentic ation_requ est
  73           re sponse = a dd_veteran (params[:l ast_name],  params[:f irst_name] , params[: veteran_bi rth_date],  params[:e mail], par ams[:phone _number],  params[:ci ty], param s[:state],  params[:z ip], cooki e)
  74           if  response[ :code] ==  200
  75              redirect_t o :action  => :select ed, :param s => reque st.request _parameter s
  76           el se
  77              flash.now[ :alert] =  "Unable to  add Veter an. Please  check tha t all requ ired infor mation has  been subm itted."            
  78           en d
  79         else
  80           fl ash.now[:a lert] = "U nable to o btain auth entication  for reque st "  
  81         end
  82       end
  83     end
  84  
  85  
  86  
  87     private
  88     
  89       # Get  authorizat ion from V istA. Must  be obtain ed to esta blish a se ssion for  further co mmunicatio n with Vis tA.
  90       def au thenticati on_request
  91         url  = "DNS.DNS "
  92         requ est = Fara day.new(ur l)
  93         resp onse = req uest.post  do |req|
  94           re q.headers[ 'Content-T ype']   =  'applicati on/json'
  95           re q.headers[ "Cache-Con trol"]  =  "no-cache"
  96           re q.body                        =
  97           '{
  98              "accessCod e": "pu123 4",
  99              "verifyCod e": "pu123 4!!",
  100              "site": "9 E7A"
  101           }'
  102         end
  103         cook ie = respo nse.header s['set-coo kie']
  104         resp onse.code  == 200 ? c ookie : fa lse 
  105       end
  106     
  107     
  108       # Send  search re quest to V istA.
  109       def se arch_reque st(lname,  fname, bda te, cookie )
  110         url  = "https:/ /DNS.DNS
  111         requ est = Fara day.new(ur l)
  112  
  113         resp onse = req uest.post  do |req|
  114           re q.headers[ "Content-T ype"] = "a pplication /json"
  115           re q.headers[ "Cookie"]        = co okie
  116           bo dy_string  = '{'
  117           !l name.blank ? ? body_s tring += ' "name.last ": "'+lnam e+'", ' :  false
  118           !f name.blank ? ? body_s tring += ' "name.firs t": "'+fna me+'", ' :  false
  119           !b date.blank ? ? body_s tring += ' "date.birt h": "'+bda te+'", ' :  false
  120           bo dy_string. length > 5  ? body_st ring.chomp !(", ") :  false
  121           bo dy_string  += '}'
  122           re q.body = b ody_string
  123         end
  124         retu rn respons e
  125       end  
  126  
  127  
  128       def ad d_veteran( lname, fna me, bdate,  email, ph one_number , city, st ate, zip,  cookie)
  129         url  = "https:/ /DNS.DNS
  130         requ est = Fara day.new(ur l)
  131  
  132         resp onse = req uest.post  do |req|
  133           re q.headers[ "Content-T ype"] = "a pplication /json"
  134           re q.headers[ "Cookie"]        = co okie
  135           bo dy_string  = '{'
  136           !l name.blank ? ? body_s tring += ' "name.last ": "'+lnam e+'", ' :  false
  137           !f name.blank ? ? body_s tring += ' "name.firs t": "'+fna me+'", ' :  false
  138           !b date.blank ? ? body_s tring += ' "date.birt h": "'+bda te+'", ' :  false
  139           !e mail.blank ? ? body_s tring += ' "email": " '+email+'" , ' : fals e
  140           !p hone_numbe r.blank? ?  body_stri ng += '"ph one.number ": "'+phon e_number+' ", ' : fal se
  141           !c ity.blank?  ? body_st ring += '" city": "'+ city+'", '  : false
  142           !s tate.blank ? ? body_s tring += ' "state": " '+state+'" , ' : fals e
  143           !z ip.blank?  ? body_str ing += '"z ip": "'+zi p+'", ' :  false
  144           bo dy_string. length > 5  ? body_st ring.chomp !(", ") :  false
  145           bo dy_string  += '}'
  146           re q.body = b ody_string
  147         end
  148         resp onse = {}
  149         resp onse[:code ] = 200
  150         retu rn respons e
  151       end
  152                  
  153   end