Produced by Araxis Merge on 8/29/2017 11:27:29 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.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | REFDOC-devel-20170714.zip\NVCC\NVCC.WebUI\Infrastructure | PatientProfileService.cs | Fri Jul 14 21:26:50 2017 UTC |
| 2 | REFDOC-devel-20170714.zip\NVCC\NVCC.WebUI\Infrastructure | PatientProfileService.cs | Mon Aug 28 17:38:49 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 2 | 256 |
| Changed | 1 | 2 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| 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 |
No regular expressions were active.
| 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 | ||
| 48 | patientP rofile.All ergies = _ patientRep ository.Ge tAllergies (patient.P atientSid) ; | |
| 49 | patientP rofile.App ointments = _patient Repository .GetAppoin tments(pat ient.Patie ntSid); | |
| 50 | patientP rofile.Lab s = _patie ntReposito ry.GetLabs (patient.P atientSid) ; | |
| 51 | patientP rofile.Med ications = _patientR epository. GetMedicat ions(patie nt.Patient Sid); | |
| 52 | patientP rofile.Pro blemDiagno ses = _pat ientReposi tory.GetPr oblemList( patient.Pa tientSid); | |
| 53 | patientP rofile.Non VaMedicati ons = _pat ientReposi tory.GetNo nVaMedicat ions(patie nt.Patient Sid); | |
| 54 | patientP rofile.Con sults = _p atientRepo sitory.Get Consults(p atient.Pat ientSid); | |
| 55 | patientP rofile.Nex tOfKin = _ patientRep ository.Ge tNextOfKin (patient.P atientSid) ; | |
| 56 | return p atientProf ile; | |
| 57 | } | |
| 58 | ||
| 59 | pr ivate Pati entProfile GetViaDat a(ViaQuery Bean myQue ryBean, st ring patie ntIen) | |
| 60 | { | |
| 61 | var pati entProfile = new Pat ientProfil e(); | |
| 62 | var date 1 = DateTi me.Now.Add (TimeSpan. FromDays(- 180)); | |
| 63 | var date 2 = DateTi me.Now; | |
| 64 | date2 = date2.AddD ays(1); | |
| 65 | ||
| 66 | var pati ent = _via Repository .GetPatien t(myQueryB ean, patie ntIen); | |
| 67 | if (pati ent.Fault) | |
| 68 | { | |
| 69 | pati entProfile .VistaUser .FaultMess age = pati ent.FaultM essage; | |
| 70 | pati entProfile .VistaUser .Fault = t rue; | |
| 71 | retu rn patient Profile; | |
| 72 | } | |
| 73 | ||
| 74 | myQueryB ean.ViaPat ient.Local Pid = pati ent.LocalP id; | |
| 75 | myQueryB ean.ViaPat ient.MpiPi d = patien t.MpiPid; | |
| 76 | myQueryB ean.ViaPat ient.Local SiteId = p atient.Loc alSiteId; | |
| 77 | IList<No te> notes = _viaRepo sitory.Get ProgressNo tes(date1, date2, 50 , myQueryB ean); | |
| 78 | IList<Au thorizatio n> authori zations = notes | |
| 79 | .Whe re(n => | |
| 80 | ((n.NoteTi tle != nul l) && | |
| 81 | (Autho rization.I dentifying NoteString s.Any(s => n.NoteTit le.Contain s(s)))) || | |
| 82 | ((n.NoteTe xt != null ) && | |
| 83 | (Autho rization.I dentifying NoteString s.Any(s => n.NoteTex t.Contains (s))))) | |
| 84 | .Sel ect(n => n ew Authori zation | |
| 85 | { | |
| 86 | Authorizat ionId = n. NoteID, | |
| 87 | Authorizat ionTitle = n.NoteTit le, | |
| 88 | Authorizat ionText = n.NoteText | |
| 89 | }) | |
| 90 | .ToL ist(); | |
| 91 | var repo rts = _via Repository .GetRadiol ogyReports (date1, da te2, 10, m yQueryBean ); | |
| 92 | patientP rofile.Aut horization s = author izations; | |
| 93 | patientP rofile.Not es = notes ; | |
| 94 | patientP rofile.Rad iologyRepo rts = repo rts; | |
| 95 | ||
| 96 | return p atientProf ile; | |
| 97 | } | |
| 98 | ||
| 99 | pu blic Patie nt GetPati ent(string patientSs n, short s ta3n) | |
| 100 | { | |
| 101 | if(patie ntSsn==nul l) | |
| 102 | thro w new Null ReferenceE xception(" patientSsn "); | |
| 103 | var pati ent = _pat ientReposi tory.GetPa tient(pati entSsn, st a3n); | |
| 104 | return p atient; | |
| 105 | } | |
| 106 | ||
| 107 | pu blic void LogItem(St opwatch st opwatch, P atient pat ient, stri ng current User, stri ng action) | |
| 108 | { | |
| 109 | if(patie nt==null) | |
| 110 | thro w new Null ReferenceE xception(" patient"); | |
| 111 | if (stop watch == n ull) | |
| 112 | thro w new Null ReferenceE xception(" stopwatch" ); | |
| 113 | ||
| 114 | var host Name = Htt pContextMa nager.Curr ent.Reques t.Url != n ull | |
| 115 | ? Ht tpContextM anager.Cur rent.Reque st.Url.Hos t : null; | |
| 116 | var logi tem = new LogItem | |
| 117 | { | |
| 118 | Host Name = hos tName, | |
| 119 | User ID = curre ntUser, | |
| 120 | Acce ssDateTime = DateTim e.Now, | |
| 121 | Acti on = actio n, | |
| 122 | Pati entSid = p atient.Pat ientSid, | |
| 123 | Elap sedTime = stopwatch. Elapsed.To talSeconds , | |
| 124 | DatabaseSe rverName = "
|
|
| 125 | }; | |
| 126 | _patient Repository .WriteLog( logitem); | |
| 127 | } | |
| 128 | } | |
| 129 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.