36. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 1/31/2018 9:02:17 AM 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.

36.1 Files compared

# Location File Last Modified
1 NVCC_2.2_01162018.zip\NVCC\NVCC.WebUI\Infrastructure PatientProfileService.cs Tue Dec 5 18:56:54 2017 UTC
2 NVCC_2.2_01162018.zip\NVCC\NVCC.WebUI\Infrastructure PatientProfileService.cs Mon Jan 29 19:18:20 2018 UTC

36.2 Comparison summary

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

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

36.4 Active regular expressions

No regular expressions were active.

36.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                patientP rofile.Aut horization s = viaPro file.Autho rizations;
  46                patientP rofile.Not es = viaPr ofile.Note s;
  47                foreach  (var note  in viaProf ile.Notes. ToList())
  48                {
  49  
  50                    if ( note.NoteT itle == "C ONSENT FOR  LONG-TERM  OPIOIDS F OR PAIN")
  51                    {
  52                         patientPro file.Opioi dNote.Note Title = no te.NoteTit le;
  53                         patientPro file.Opioi dExist = t rue;
  54                         patientPro file.Opiod NoteText =  note.Note Text;
  55                         patientPro file.Opioi dNote.Note Author = n ote.NoteAu thor;
  56                         patientPro file.Opioi dNote.Note Timestamp  = note.Not eTimestamp ;
  57                         patientPro file.Opioi dNote.Note ID = note. NoteID;
  58                        
  59                         //remove t he opiod n ote from p rogress No tes sectio n because  it's been  showed und er 
  60                         //medicati on list. 
  61                         patientPro file.Notes .Remove(no te);
  62                    }
  63  
  64                }
  65                patientP rofile.All ergies = _ patientRep ository.Ge tAllergies (patient.P atientSid) ;
  66                patientP rofile.App ointments  = _patient Repository .GetAppoin tments(pat ient.Patie ntSid);
  67                patientP rofile.Lab s = _patie ntReposito ry.GetLabs (patient.P atientSid) ;
  68                patientP rofile.Med ications =  _patientR epository. GetMedicat ions(patie nt.Patient Sid);
  69                patientP rofile.Pro blemDiagno ses = _pat ientReposi tory.GetPr oblemList( patient.Pa tientSid);
  70                patientP rofile.Non VaMedicati ons = _pat ientReposi tory.GetNo nVaMedicat ions(patie nt.Patient Sid);
  71                patientP rofile.Con sults = _p atientRepo sitory.Get Consults(p atient.Pat ientSid);
  72                patientP rofile.Nex tOfKin = _ patientRep ository.Ge tNextOfKin (patient.P atientSid) ;
  73                return p atientProf ile;
  74                }
  75  
  76           pr ivate Pati entProfile  GetViaDat a(ViaQuery Bean myQue ryBean, st ring patie ntIen)
  77           {
  78                var pati entProfile  = new Pat ientProfil e();
  79                var date 1 = DateTi me.Now.Add (TimeSpan. FromDays(- 180));
  80                var date 2 = DateTi me.Now;
  81                date2 =  date2.AddD ays(1);
  82  
  83                var pati ent = _via Repository .GetPatien t(myQueryB ean, patie ntIen);
  84                if (pati ent.Fault)
  85                {
  86                    pati entProfile .VistaUser .FaultMess age = pati ent.FaultM essage;
  87                    pati entProfile .VistaUser .Fault = t rue;
  88                    retu rn patient Profile;
  89                }
  90  
  91                myQueryB ean.ViaPat ient.Local Pid = pati ent.LocalP id;
  92                myQueryB ean.ViaPat ient.MpiPi d = patien t.MpiPid;
  93                myQueryB ean.ViaPat ient.Local SiteId = p atient.Loc alSiteId;
  94                IList<No te> notes  = _viaRepo sitory.Get ProgressNo tes(date1,  date2, 50 , myQueryB ean);
  95                IList<Au thorizatio n> authori zations =  notes
  96                    .Whe re(n =>
  97                         ((n.NoteTi tle != nul l) &&
  98                             (Autho rization.I dentifying NoteString s.Any(s =>  n.NoteTit le.Contain s(s)))) ||
  99                         ((n.NoteTe xt != null ) &&
  100                             (Autho rization.I dentifying NoteString s.Any(s =>  n.NoteTex t.Contains (s)))))
  101                    .Sel ect(n => n ew Authori zation
  102                    {
  103                         Authorizat ionId = n. NoteID,
  104                         Authorizat ionTitle =  n.NoteTit le,
  105                         Authorizat ionText =  n.NoteText
  106                    })
  107                    .ToL ist();
  108                var repo rts = _via Repository .GetRadiol ogyReports (date1, da te2, 10, m yQueryBean );
  109                patientP rofile.Aut horization s = author izations;
  110                patientP rofile.Not es = notes ;
  111                patientP rofile.Rad iologyRepo rts = repo rts;
  112  
  113                return p atientProf ile;
  114           }
  115  
  116           pu blic Patie nt GetPati ent(string  patientSs n, short s ta3n)
  117           {
  118                if(patie ntSsn==nul l)
  119                    thro w new Null ReferenceE xception(" patientSsn ");
  120                var pati ent = _pat ientReposi tory.GetPa tient(pati entSsn, st a3n);
  121                return p atient;
  122           }
  123  
  124           pu blic void  LogItem(St opwatch st opwatch, P atient pat ient, stri ng current User, stri ng action)
  125           {
  126                if(patie nt==null)
  127                    thro w new Null ReferenceE xception(" patient");
  128                if (stop watch == n ull)
  129                    thro w new Null ReferenceE xception(" stopwatch" );
  130  
  131                var host Name = Htt pContextMa nager.Curr ent.Reques t.Url != n ull
  132                    ? Ht tpContextM anager.Cur rent.Reque st.Url.Hos t : null;
  133                var logi tem = new  LogItem
  134                {
  135                    Host Name = hos tName,
  136                    User ID = curre ntUser,
  137                    Acce ssDateTime  = DateTim e.Now,
  138                    Acti on = actio n,
  139                    Pati entSid = p atient.Pat ientSid,
  140                    Elap sedTime =  stopwatch. Elapsed.To talSeconds ,
  141                      DatabaseSe rverName =  "
S ERVER "
  142                };
  143                _patient Repository .WriteLog( logitem);
  144           }
  145       }
  146   }