129. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 6/22/2018 9:28:04 AM Eastern 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.

129.1 Files compared

# Location File Last Modified
1 REFDOC_2.3_06072018.zip\REFDOC 2.3_06072018\NVCC\NVCC.WebUI\Infrastructure PatientProfileService.cs Thu Jun 7 16:53:32 2018 UTC
2 REFDOC_2.3_06072018.zip\REFDOC 2.3_06072018\NVCC\NVCC.WebUI\Infrastructure PatientProfileService.cs Thu Jun 21 19:57:42 2018 UTC

129.2 Comparison summary

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

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

129.4 Active regular expressions

No regular expressions were active.

129.5 Comparison detail

  1   using NVCC .Models;
  2   using NVCC .WebUI.Uti lities;
  3   using Syst em;
  4   using Syst em.Collect ions.Gener ic;
  5   using Syst em.Diagnos tics;
  6   using Syst em.Linq;
  7  
  8   namespace  NVCC.WebUI .Infrastru cture
  9   {
  10       public  class Pat ientProfil eService :  IPatientP rofileServ ice
  11       {
  12           pr ivate read only IPati entReposit ory _patie ntReposito ry;
  13           pr ivate read only IViaR epository  _viaReposi tory;
  14           pr ivate read only IUser SessionMan ager _user SessionMan ager;
  15  
  16           pu blic Patie ntProfileS ervice(IPa tientRepos itory pati entReposit ory, 
  17                                           IVi aRepositor y viaRepos itory, 
  18                                           IUs erSessionM anager use rSessionMa nager)
  19           {
  20                _patient Repository  = patient Repository ;
  21                _viaRepo sitory = v iaReposito ry;
  22                _userSes sionManage r = userSe ssionManag er;
  23           }
  24  
  25           pu blic Patie ntProfile  GetPatient Profile(Pa tient pati ent, ViaUs er viaUser )
  26           {           
  27                if (pati ent == nul l)
  28                    thro w new Null ReferenceE xception(" patient");
  29                if (viaU ser == nul l)
  30                    thro w new Null ReferenceE xception(" queryBean" );
  31  
  32                var vaUs er = _user SessionMan ager.UserP rofile;
  33                var pati entProfile  = new Pat ientProfil e {VistaUs er = viaUs er};
  34                if (vaUs er == null )
  35                return p atientProf ile;
  36  
  37                var viaP rofile = G etViaData( viaUser.Qu eryBean, p atient.Pat ientIen);
  38                if (viaP rofile.Vis taUser.Fau lt)
  39                {
  40                    viaP rofile.Vis taUser.Que ryBean = v iaUser.Que ryBean;
  41                    retu rn viaProf ile;
  42                }
  43                    
  44                patientP rofile.Rad iologyRepo rts = viaP rofile.Rad iologyRepo rts;
  45                //patien tProfile.P athologyRe ports = vi aProfile.P athologyRe ports;
  46                patientP rofile.Aut horization s = viaPro file.Autho rizations;
  47                patientP rofile.Not es = viaPr ofile.Note s;
  48                foreach  (var note  in viaProf ile.Notes. ToList())
  49                {
  50  
  51                    if ( note.NoteT itle == "C ONSENT FOR  LONG-TERM  OPIOIDS F OR PAIN")
  52                    {
  53                         patientPro file.Opioi dNote.Note Title = no te.NoteTit le;
  54                         patientPro file.Opioi dExist = t rue;
  55                         patientPro file.Opiod NoteText =  note.Note Text;
  56                         patientPro file.Opioi dNote.Note Author = n ote.NoteAu thor;
  57                         patientPro file.Opioi dNote.Note Timestamp  = note.Not eTimestamp ;
  58                         patientPro file.Opioi dNote.Note ID = note. NoteID;
  59                        
  60                         //remove t he opiod n ote from p rogress No tes sectio n because  it's been  showed und er 
  61                         //medicati on list. 
  62                         patientPro file.Notes .Remove(no te);
  63                    }
  64  
  65                }
  66                patientP rofile.All ergies = _ patientRep ository.Ge tAllergies (patient.P atientSid) ;
  67                patientP rofile.App ointments  = _patient Repository .GetAppoin tments(pat ient.Patie ntSid);
  68                patientP rofile.Lab s = _patie ntReposito ry.GetLabs (patient.P atientSid) ;
  69                patientP rofile.Med ications =  _patientR epository. GetMedicat ions(patie nt.Patient Sid);
  70                patientP rofile.Pro blemDiagno ses = _pat ientReposi tory.GetPr oblemList( patient.Pa tientSid);
  71                patientP rofile.Non VaMedicati ons = _pat ientReposi tory.GetNo nVaMedicat ions(patie nt.Patient Sid);
  72                patientP rofile.Con sults = _p atientRepo sitory.Get Consults(p atient.Pat ientSid);
  73                patientP rofile.Nex tOfKin = _ patientRep ository.Ge tNextOfKin (patient.P atientSid) ;
  74                return p atientProf ile;
  75                }
  76  
  77           pr ivate Pati entProfile  GetViaDat a(ViaQuery Bean myQue ryBean, st ring patie ntIen)
  78           {
  79                var pati entProfile  = new Pat ientProfil e();
  80                var date 1 = DateTi me.Now.Add (TimeSpan. FromDays(- 180));
  81                var date 2 = DateTi me.Now;
  82                date2 =  date2.AddD ays(1);
  83  
  84                var pati ent = _via Repository .GetPatien t(myQueryB ean, patie ntIen);
  85                if (pati ent.Fault)
  86                {
  87                    pati entProfile .VistaUser .FaultMess age = pati ent.FaultM essage;
  88                    pati entProfile .VistaUser .Fault = t rue;
  89                    retu rn patient Profile;
  90                }
  91  
  92                myQueryB ean.ViaPat ient.Local Pid = pati ent.LocalP id;
  93                myQueryB ean.ViaPat ient.MpiPi d = patien t.MpiPid;
  94                myQueryB ean.ViaPat ient.Local SiteId = p atient.Loc alSiteId;
  95                IList<No te> notes  = _viaRepo sitory.Get ProgressNo tes(date1,  date2, 50 , myQueryB ean);
  96                IList<Au thorizatio n> authori zations =  notes
  97                    .Whe re(n =>
  98                         ((n.NoteTi tle != nul l) &&
  99                             (Autho rization.I dentifying NoteString s.Any(s =>  n.NoteTit le.Contain s(s)))) ||
  100                         ((n.NoteTe xt != null ) &&
  101                             (Autho rization.I dentifying NoteString s.Any(s =>  n.NoteTex t.Contains (s)))))
  102                    .Sel ect(n => n ew Authori zation
  103                    {
  104                         Authorizat ionId = n. NoteID,
  105                         Authorizat ionTitle =  n.NoteTit le,
  106                         Authorizat ionText =  n.NoteText
  107                    })
  108                    .ToL ist();
  109                var repo rts = _via Repository .GetRadiol ogyReports (date1, da te2, 10, m yQueryBean );
  110                //var pa thologyrep orts = _vi aRepositor y.GetPatho logyReport s(date1, d ate2, 50,  myQueryBea n);
  111                patientP rofile.Aut horization s = author izations;
  112                patientP rofile.Not es = notes ;
  113                patientP rofile.Rad iologyRepo rts = repo rts;
  114                //patien tProfile.P athologyRe ports = pa thologyrep orts;
  115                return p atientProf ile;
  116           }
  117  
  118           pu blic Patie nt GetPati ent(string  patientSs n, short s ta3n)
  119           {
  120                if(patie ntSsn==nul l)
  121                    thro w new Null ReferenceE xception(" patientSsn ");
  122                var pati ent = _pat ientReposi tory.GetPa tient(pati entSsn, st a3n);
  123                return p atient;
  124           }
  125  
  126           pu blic void  LogItem(St opwatch st opwatch, P atient pat ient, stri ng current User, stri ng action)
  127           {
  128                if(patie nt==null)
  129                    thro w new Null ReferenceE xception(" patient");
  130                if (stop watch == n ull)
  131                    thro w new Null ReferenceE xception(" stopwatch" );
  132  
  133                var host Name = Htt pContextMa nager.Curr ent.Reques t.Url != n ull
  134                    ? Ht tpContextM anager.Cur rent.Reque st.Url.Hos t : null;
  135                var logi tem = new  LogItem
  136                {
  137                    Host Name = hos tName,
  138                    User ID = curre ntUser,
  139                    Acce ssDateTime  = DateTim e.Now,
  140                    Acti on = actio n,
  141                    Pati entSid = p atient.Pat ientSid,
  142                    Elap sedTime =  stopwatch. Elapsed.To talSeconds ,
  143                      DatabaseSe rverName =  "
D N S      "
  144                };
  145                _patient Repository .WriteLog( logitem);
  146           }
  147       }
  148   }