Ejemplo n.º 1
0
 public bool deletePatient(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         ReadOnlyCollection <Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 Movement.Database.Patient.RemovePatient(patientList[0].PatientID);
                 return(true);
             }
             catch (Exception e)
             {
                 Log(e);
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 2
0
    public bool updatePatient(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            Movement.Database.Patient tempPatient = new Movement.Database.Patient(patient.ID);
            try
            {
                tempPatient.Name        = patient.name;
                tempPatient.Address     = patient.address;
                tempPatient.ContactInfo = patient.ContactInfo;
                /* The following patient properties are READ-ONLY in the database */

                /*
                 * sex
                 * dob
                 * handedness
                 * ssn
                 */
                return(true);
            }
            catch (Exception e)
            {
                Log(e);
                return(false);
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 3
0
 public bool addPatientNote(PatientObject patient, UserObject user, String data)
 {
     if (Authenticated_AorC())
     {
         ReadOnlyCollection <Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 //Movement.Database.User filler = Movement.Database.User.Login(user.userName, user.password);
                 patientList[0].RecordNote(UserInfo, data);
                 return(true);
             }
             catch (Exception e)
             {
                 Log(e);
                 return(false);
             }
         }
         else
         {
             return(false);
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
        public PatientObject GetPatient(string PID)
        {
            IDbConnection connection    = null;
            PatientObject patientObject = new PatientObject();
            var           dataReader    = DBManager.SetUpDataBase("FinanceSytem").GetDataReader("SSP_GetPatient", System.Data.CommandType.StoredProcedure, new List <IDbDataParameter> {
                DBManager.CreateParameter("@PID", PID, DbType.String)
            }.ToArray(), out connection);

            try
            {
                while (dataReader.Read())
                {
                    patientObject.ID         = (Int64)dataReader["id"];
                    patientObject.PID        = dataReader["pid"].ToString();
                    patientObject.FirstName  = dataReader["first_name"].ToString();
                    patientObject.LastName   = dataReader["last_name"].ToString();
                    patientObject.MiddleName = dataReader["middle_name"].ToString();
                    patientObject.DOB        = (DateTime)dataReader["dob"];
                    patientObject.Age        = (int)dataReader["age"];
                }
            }
            catch (Exception ex)
            {
            }
            finally
            {
                dataReader.Close();
                connection.Close();
            }
            //return patientObject;
            return(DBManager.SetUpDataBase("FinanceSytem").GetDataTable("SSP_GetPatient", System.Data.CommandType.StoredProcedure, new List <IDbDataParameter> {
                DBManager.CreateParameter("@PID", PID, DbType.String)
            }.ToArray()).ToList <Patient>().FirstOrDefault().BussinessPatientObject());
        }
Ejemplo n.º 5
0
 public List <Notes> getPatientNotes(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         ReadOnlyCollection <Movement.Database.Patient> patientList = FindAPatient(patient);
         Movement.Database.PatientNote newNote;
         List <Notes> allNotes = new List <Notes>();
         Notes        filler   = new Notes();
         if (patientList.Count == 1)
         {
             try
             {
                 for (int i = 0; i < patientList[0].Notes.Count; i++)
                 {
                     newNote       = patientList[0].Notes[i];
                     filler.author = newNote.Author.Name;
                     filler.note   = newNote.Data;
                     filler.time   = newNote.Timestamp;
                     allNotes.Add(filler);
                 }
                 return(allNotes);
             }
             catch (Exception e)
             {
                 Log(e);
                 return(null);
             }
         }
         return(null);
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 6
0
 public PatientObject retrievePatientData(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         PatientObject newPatient = new PatientObject();
         ReadOnlyCollection <Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 newPatient.name        = patientList[0].Name;
                 newPatient.address     = patientList[0].Address;
                 newPatient.ContactInfo = patientList[0].ContactInfo;
                 newPatient.sex         = patientList[0].Sex;
                 newPatient.dob         = patientList[0].DOB;
                 newPatient.handedness  = patientList[0].Handedness;
                 newPatient.ssn         = patientList[0].SSN4;
                 return(newPatient);
             }
             catch (Exception e)
             {
                 Log(e);
                 return(newPatient);
             }
         }
         else
         {
             return(newPatient);
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 7
0
    private int EWSCalc(PatientObject MyPatient)
    {
        int calc = 0;

        //calculation here
        return(calc);
    }
Ejemplo n.º 8
0
 public PatientNotes(UserObject user, PatientObject patient, Label patient_notes)
 {
     InitializeComponent();
     this.patient             = new Patient();
     this.patient.ThisPatient = patient;
     this.user  = user;
     this.notes = patient_notes;
 }
Ejemplo n.º 9
0
        public List<PatientObject> RetrievePatient(String name, String ssn, DateTime dob)
        {
            PatientObject patient = new PatientObject();
            patient.dob = dob;
            patient.ssn = ssn;
            patient.name = name;

            return new List<PatientObject>(Connection.Servicer.findPatient(patient));
        }
Ejemplo n.º 10
0
        public List <PatientObject> RetrievePatient(String name, String ssn, DateTime dob)
        {
            PatientObject patient = new PatientObject();

            patient.dob  = dob;
            patient.ssn  = ssn;
            patient.name = name;

            return(new List <PatientObject>(Connection.Servicer.findPatient(patient)));
        }
Ejemplo n.º 11
0
        /// <summary>
        /// Sends a completed test taken by a patient to the sever
        /// </summary>
        /// <param name="patient">Patient taking the test</param>
        /// <param name="user">Current user logged into Movement</param>
        /// <param name="samples">Data captured during the test</param>
        /// <param name="id">Script ID</param>
        /// <returns></returns>
        public Boolean SendTestData(PatientObject patient, UserObject user, List <global::Movement.TestEngine.Capture.CalibratedInkSample> samples, int id)
        {
            movement_web_service.Test completed_test = new global::Movement.UserInterface.movement_web_service.Test();
            ScriptInfo tempScript = new ScriptInfo();

            tempScript.scriptID = id;
            Scripting.ScriptEngine script_engine = new global::Movement.Scripting.ScriptEngine(Connection.Servicer.getScript(tempScript).scriptData);
            Data[] test_data = new Data[samples.Count];
            short  average_x = 0, average_y = 0;
            Data   temp;

            //get the data in a form to send to the server
            for (int x = 0; x < samples.Count; x++)
            {
                temp          = new Data();
                temp.pressure = (short)samples[x].Pressure;
                temp.time     = samples[x].Time;
                temp.x        = (short)samples[x].X;
                temp.y        = (short)samples[x].Y;

                //we also need to compute the average x and y coordinates
                average_x += temp.x;
                average_y += temp.y;

                test_data[x] = temp;
            }

            //get the rest of the information about the test together to send to the sever
            completed_test.hand    = patient.handedness;
            completed_test.patient = patient;
            completed_test.user    = user;
            if (script_engine.Cognitive)
            {
                completed_test.mode = 'C';
            }
            else
            {
                completed_test.mode = 'D';
            }

            completed_test.rotation        = 0;
            completed_test.avg_X           = average_x / samples.Count;
            completed_test.avg_Y           = average_y / samples.Count;
            completed_test.script          = new Script();
            completed_test.script.scriptID = id;
            completed_test.data            = test_data;

            //try to store the completed test
            if (Connection.Servicer.storeTest(completed_test))
            {
                return(true);
            }

            return(false);
        }
Ejemplo n.º 12
0
 protected void btnConfirmSave_Click(object sender, EventArgs e)
 {
     PatientObject patient = new PatientObject();
     patient.ExternalPatientId.Value = tbPatId.Text;
     patient.Load(Constants.Database.NullUserId);
     patient.Name.Value = RISUtility.GetFullName(tbPatFName.Text, tbPatLName.Text);
     patient.DateOfBirth.Value = dcDOB.Date;
     patient.Gender.Value = rblGender.SelectedItem.Text;
     patient.Save(loggedInUserId);
     WorkListObject worklist = new WorkListObject();
     worklist.PatientId.Value = patient.PatientId.Value;
     worklist.RequestingPhysicianId.Value = int.Parse(ddlRefPhysician.SelectedValue);
     worklist.ModalityId.Value = int.Parse(ddlModality.SelectedValue);
     worklist.ProcedureId.Value = int.Parse(ddlProcedure.SelectedValue);
     worklist.StationId.Value = int.Parse(ddlStationName.SelectedValue);
     worklist.Save(loggedInUserId);
     //try
     {
         StringBuilder workListFile = GetFile();
         workListFile.Replace("${AccessionNumber}", SecurityElement.Escape(worklist.WorkListId.Value.ToString()));
         workListFile.Replace("${ReferringPhysician}", SecurityElement.Escape(ddlRefPhysician.SelectedItem.Text));
         workListFile.Replace("${PatientName}", SecurityElement.Escape(RISUtility.GetFullName(tbPatFName.Text, tbPatLName.Text)));
         workListFile.Replace("${PatientId}", SecurityElement.Escape(tbPatId.Text));
         workListFile.Replace("${PatientDOB}", SecurityElement.Escape(RISUtility.GetDICOMDate(dcDOB.Date)));
         workListFile.Replace("${PatientSex}", SecurityElement.Escape(rblGender.SelectedItem.Text));
         int age = DateTime.Now.Subtract(dcDOB.Date).Days/365;
         workListFile.Replace("${PatientAge}", SecurityElement.Escape(age.ToString()));
         workListFile.Replace("${Procedure}", SecurityElement.Escape(ddlProcedure.SelectedItem.Text));
         workListFile.Replace("${Modality}", SecurityElement.Escape(ddlModality.SelectedItem.Text));
         workListFile.Replace("${StationName}", SecurityElement.Escape(ddlStationName.SelectedItem.Text));
         WriteFile(workListFile, worklist.WorkListId.Value.ToString());
         Session[ParameterNames.Session.InformationMessage] = Messages.Information.DataSaved;
         string url = PagesFactory.GetUrl(PagesFactory.Pages.DataSavedPage);
         url += "?" + ParameterNames.Request.ExternalPatientId + "=" + patient.ExternalPatientId.Value;
         url += "&" + ParameterNames.Request.PatientName + "=" + patient.Name.Value;
         Response.Redirect(url);
     }
     //catch (OleDbException ex)
     {
         //((Main)this.Master).ErrorMessage = Messages.Error.ErrorSavingDataToDICOM;
     }
 }
Ejemplo n.º 13
0
    private int QSepsisCalc(PatientObject MyPatient)
    {
        int calc = 0;

        if (MyPatient.RR >= 22)
        {
            calc++;
        }

        if (MyPatient.BPS <= 100)
        {
            calc++;
        }

        if (MyPatient.InfectionCurrent <= 50)
        {
            calc++;
        }

        return(calc);
    }
Ejemplo n.º 14
0
        public TestPatient(List<Script> tests, String batch_name, UserObject user, PatientObject patient, char sender)
        {
            InitializeComponent();
            this.patient = patient;
            this.user = user;
            this.t = new Test();
            this.sender = sender;

            TestEngine.Testing.TestScript s;
            test_scripts = new List<global::Movement.TestEngine.Testing.TestScript>();

            //Display the name of the batch as the form's title
            this.Text = "Running " + batch_name;

            //put the tests in a list in the form used by the test batch capture controle
            for (int x = 0; x < tests.Count; x++)
                test_scripts.Add(s = new global::Movement.TestEngine.Testing.TestScript(tests[x].scriptID, tests[x].scriptData));

            //callback functions for test completion and batch completion
            tbcc_test_patient.TestBatchComplete += new global::Movement.TestEngine.Testing.TestBatchCompleteHandler(testBatchCaptureControl1_TestBatchComplete);
            tbcc_test_patient.TestComplete += new global::Movement.TestEngine.Testing.TestCompleteHandler(testBatchCaptureControl1_TestComplete);
        }
Ejemplo n.º 15
0
    public int addPatient(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            Movement.Database.Patient filler;
            ReadOnlyCollection <Movement.Database.Patient> p1;
            try
            {
                p1 = FindAPatient(patient);

                if (!p1.Count.Equals(0))
                {
                    return(-1);
                }
                else
                {
                    filler = Movement.Database.Patient.CreatePatient(patient.name,
                                                                     patient.address,
                                                                     patient.ContactInfo,
                                                                     patient.sex,
                                                                     patient.dob,
                                                                     patient.handedness,
                                                                     patient.ssn);

                    return(filler.PatientID);
                }
            }
            catch (Exception e)
            {
                Log(e);
                return(-5);
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 16
0
        public TestPatient(List <Script> tests, String batch_name, UserObject user, PatientObject patient, char sender)
        {
            InitializeComponent();
            this.patient = patient;
            this.user    = user;
            this.t       = new Test();
            this.sender  = sender;

            TestEngine.Testing.TestScript s;
            test_scripts = new List <global::Movement.TestEngine.Testing.TestScript>();

            //Display the name of the batch as the form's title
            this.Text = "Running " + batch_name;

            //put the tests in a list in the form used by the test batch capture controle
            for (int x = 0; x < tests.Count; x++)
            {
                test_scripts.Add(s = new global::Movement.TestEngine.Testing.TestScript(tests[x].scriptID, tests[x].scriptData));
            }

            //callback functions for test completion and batch completion
            tbcc_test_patient.TestBatchComplete += new global::Movement.TestEngine.Testing.TestBatchCompleteHandler(testBatchCaptureControl1_TestBatchComplete);
            tbcc_test_patient.TestComplete      += new global::Movement.TestEngine.Testing.TestCompleteHandler(testBatchCaptureControl1_TestComplete);
        }
Ejemplo n.º 17
0
 public bool updatePatient(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         Movement.Database.Patient tempPatient = new Movement.Database.Patient(patient.ID);
         try
         {
             tempPatient.Name = patient.name;
             tempPatient.Address = patient.address;
             tempPatient.ContactInfo = patient.ContactInfo;
             /* The following patient properties are READ-ONLY in the database */
             /*
              * sex
              * dob
              * handedness
              * ssn
              */
             return true;
         }
         catch (Exception e)
         {
             Log(e);
             return false;
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 18
0
    public bool Load()
    {
        StudyObject study = new StudyObject();
        study.StudyId.Value = studyId;
        study.Load();
        if (study.IsLoaded)
        {
            if (study.ClientId.Value != null)
            {
                ClientObject client = new ClientObject();
                client.ClientId.Value = study.ClientId.Value;
                client.Load();
                if (client.IsLoaded)
                {
                    _clientName = client.Name.Value.ToString();
                    if (client.Address.Value != null)
                        _clientAddress = client.Address.Value.ToString() + ", ";
                    if (client.City.Value != null)
                        _clientAddress += client.City.Value.ToString() + ", ";
                    if (client.State.Value != null)
                        _clientAddress += client.State.Value.ToString() + " ";
                    if (client.Zip.Value != null)
                        _clientAddress += client.Zip.Value.ToString();
                }
            }
            ModalityObject modality = new ModalityObject();
            modality.ModalityId.Value = study.ModalityId.Value;
            modality.Load();
            if (modality.IsLoaded)
            {
                _modality = modality.Name.Value.ToString();
            }
            if (study.IsManual.Value != null && study.IsManual.Value.ToString().Equals("Y"))
            {
                _manualStatus = "This report was imported from another system.";
            }
            PatientObject patient = new PatientObject();
            patient.GetPrimaryKey().Value = study.PatientId.Value;
            patient.Load();
            if (patient.IsLoaded)
            {
                _patientId = (int)patient.PatientId.Value;
                _patientName = (string)patient.Name.Value;
                if (patient.DateOfBirth.Value != null)
                {
                    _dateOfBirth = ((DateTime)patient.DateOfBirth.Value).ToShortDateString();
                }
            }
            if (study.ReferringPhysicianId != null && study.ReferringPhysicianId.Value != null)
            {
                UserObject user = new UserObject();
                user.UserId.Value = study.ReferringPhysicianId.Value;
                user.Load();
                _referringPhysician = user.Name.Value.ToString();

            }
            else
            {
                _referringPhysician = "(N/A)";
            }
            _studyDate = ((DateTime)study.StudyDate.Value).ToShortDateString();

            FindingObject finding = new FindingObject();
            finding.FindingId.Value = (int)study.LatestFindingId.Value;
            finding.Load();
            if (finding.IsLoaded)
            {
                _transcription = GetTrascription((string)finding.TextualTranscript.Value);
                if (finding.AudioDate.Value != null)
                {
                    _reportDateTime = ((DateTime)finding.AudioDate.Value).ToString();
                    _reportDate = ((DateTime)finding.AudioDate.Value).ToShortDateString();
                }

                if (finding.AudioUserId.Value != null)
                {
                    UserObject radiologist = new UserObject();
                    radiologist.UserId.Value = finding.AudioUserId.Value;
                    radiologist.Load();
                    if (radiologist.IsLoaded)
                    {
                        string[] names = radiologist.Name.Value.ToString().Split(',');
                        if (names != null && names.Length == 2)
                        {
                            string space = " ";
                            if (isHTML) space = "&nbsp;" ;
                            _radiologist = names[1] + space + names[0] + "," + space + "M.D.";
                        }
                        else
                        {
                            _radiologist = radiologist.Name.Value.ToString();
                        }
                    }
                }
            }
            StudyStatusTypeObject studyStatus = new StudyStatusTypeObject();
            studyStatus.StudyStatusTypeId.Value = study.StudyStatusId.Value;
            studyStatus.Load();
            if (studyStatus.IsLoaded)
            {
                _status = (string)studyStatus.Status.Value;
            }

            HospitalObject hospital = new HospitalObject();
            hospital.HospitalId.Value = study.HospitalId.Value;
            hospital.Load();
            if (hospital.IsLoaded)
            {
                _hospitalName = hospital.Name.Value.ToString();
                if (hospital.Fax.Value != null)
                {
                    _fax = (string)hospital.Fax.Value;
                }
            }
            return true;
        }
        return false;
    }
Ejemplo n.º 19
0
 public Notes[] GetNotes(PatientObject patient)
 {
     return Connection.Servicer.getPatientNotes(patient);
 }
Ejemplo n.º 20
0
 public Boolean AddNote(PatientObject patient, UserObject user, String data)
 {
     return(Connection.Servicer.addPatientNote(patient, user, data));
 }
Ejemplo n.º 21
0
 public List<movement_web_service.Test> RetrieveHistory(PatientObject patient)
 {
     return new List<global::Movement.UserInterface.movement_web_service.Test>(Connection.Servicer.getTests(0, patient));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// This function is a wrapper to the FindPatient method
 /// </summary>
 /// <returns>A Movement.Database.Patient collection of all the patients found that match the criteria</returns>
 private ReadOnlyCollection <Movement.Database.Patient> FindAPatient(PatientObject patient)
 {
     return(Movement.Database.Patient.FindPatient(patient.name, patient.dob, patient.ssn));
 }
Ejemplo n.º 23
0
    protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
    {
        string status = hfStatus.Value;

        PatientObject patient = new PatientObject();
        patient.ExternalPatientId.Value = tbPatId.Text;
        patient.Load(loggedInUserId);
        patient.DateOfBirth.Value = dcDOB.Date;
        patient.Name.Value = RISUtility.GetFullName(tbPatFName.Text, tbPatLName.Text);
        patient.Gender.Value = rblGender.SelectedValue;
        patient.Save(loggedInUserId);
        StudyObject study = new StudyObject();
        study.PatientId.Value = patient.PatientId.Value;
        Random rand = new Random();
        study.StudyInstance.Value = rand.Next().ToString();
        DateTime dateTime = new DateTime(dcExamDate.Year, dcExamDate.Month, dcExamDate.Day);
        study.StudyDate.Value = dateTime;
        study.ReferringPhysicianId.Value = ddlRef.SelectedValue;
        study.IsManual.Value = "Y";
        study.StudyStatusId.Value = hfStatus.Value;
        study.ModalityId.Value = ddlModality.SelectedValue;
        study.ProcedureId.Value = ddlProcedures.SelectedValue;
        if (ddlClient.SelectedIndex > 0)
        {
            study.ClientId.Value = ddlClient.SelectedValue;
        }
        if (ddlHospital.SelectedIndex > 0)
        {
            study.HospitalId.Value = ddlHospital.SelectedValue;
        }
        study.Save(loggedInUserId);

        study.TechComments.Value = tbTechComments.Text;
        study.Save(loggedInUserId);
        //code for logging
        LogObject log = new LogObject();
        log.UserId.Value = loggedInUserId;
        log.Action.Value = Constants.LogActions.MarkedStudyForVerification;
        log.ActionTime.Value = DateTime.Now;
        log.Save();
        /////
        /// Get User Groups
        //DataTable userGroups = new DataTable();
        //userGroups = RISProcedureCaller.GetUserGroupsWithDefaults(loggedInUserId);
        //if (userGroups.Rows.Count > 0)
        //{
        //    for (int RowCounter = 0; RowCounter <= userGroups.Rows.Count - 1; RowCounter++)
        //    {
        //        StudyGroupObject studygroup = new StudyGroupObject();
        //        studygroup.GroupId.Value  = userGroups.Rows[RowCounter][0];
        //        studygroup.StudyId.Value  = study.StudyId.Value;
        //        studygroup.Save(loggedInUserId);
        //    }
        //}
        StringBuilder args = new StringBuilder();
        args.Append(ParameterNames.Request.ExternalPatientId);
        args.Append("=");
        args.Append(patient.ExternalPatientId.Value);
        args.Append("&");
        args.Append(ParameterNames.Request.PatientName);
        args.Append("=");
        args.Append(patient.Name.Value);
        args.Append("&");
        args.Append(ParameterNames.Request.ReturnPage);
        args.Append("=");
        args.Append(PagesFactory.Pages.AddStudyPage);
        PagesFactory.Transfer(PagesFactory.Pages.DataSavedPage,args.ToString());
    }
Ejemplo n.º 24
0
    public int addPatient(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            Movement.Database.Patient filler;
            ReadOnlyCollection<Movement.Database.Patient> p1;
            try
            {
                p1 = FindAPatient(patient);

                if (!p1.Count.Equals(0))
                {
                    return -1;
                }
                else
                {
                    filler = Movement.Database.Patient.CreatePatient(patient.name,
                                                            patient.address,
                                                            patient.ContactInfo,
                                                            patient.sex,
                                                            patient.dob,
                                                            patient.handedness,
                                                            patient.ssn);

                    return filler.PatientID;
                }
            }
            catch (Exception e)
            {
                Log(e);
                return -5;
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 25
0
        //public List<MedicineObject> getMedicineList()
        //{
        //    object _input;
        //    string[] medparam = new string[5];
        //    int rCnt;
        //    int cCnt;
        //    int rw = 0;
        //    int cl = 0;
        //    string currentDir = Environment.CurrentDirectory;
        //    string filePath = "MedicineList.xlsx";
        //    string fullPath = Path.Combine(currentDir, filePath);
        //    var xlApp = new Excel.Application();
        //    var xlWorkBook = xlApp.Workbooks.Open(fullPath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
        //    var xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
        //    var range = xlWorkSheet.UsedRange;
        //    rw = range.Rows.Count;
        //    cl = range.Columns.Count;
        //    List<MedicineObject> medicineList = new List<MedicineObject>();


        //    for (rCnt = 1; rCnt <= rw; rCnt++)
        //    {

        //            for (cCnt = 1; cCnt <= cl; cCnt++)
        //        {

        //            _input = (range.Cells[rCnt, cCnt] as Excel.Range).Value2;
        //            //_input = (range.Cells[rCnt, cCnt] as Excel.Range).Value2;

        //            string input = _input.ToString();
        //            medparam[cCnt] = input;
        //        }

        //        medicineList.Add(new MedicineObject(medparam[1], medparam[2], medparam[3], medparam[4]));

        //    }

        //    xlWorkBook.Close(true, null, null);
        //    xlApp.Quit();

        //    Marshal.ReleaseComObject(xlWorkSheet);
        //    Marshal.ReleaseComObject(xlWorkBook);
        //    Marshal.ReleaseComObject(xlApp);
        //    return medicineList;

        //}



        public PatientObject getPatientObject(string barCode)
        {
            string[] c = new string[2];
            object   medicineDetail;
            //string medMax;
            //string medMin;
            //string medUnit;
            //string patientName;
            int    rCnt;
            int    cCnt;
            int    rw = 0;
            int    cl = 0;
            string patientDatabaseDir = Environment.CurrentDirectory + @"\PatientDatabase";
            string fileName           = barCode + ".xlsx";
            string fullPath           = Path.Combine(patientDatabaseDir, fileName);
            var    patientObject      = new PatientObject();
            bool   isExist            = false;
            bool   medicineExist      = false;
            ObservableCollection <Medicine> _medicineList = new ObservableCollection <Medicine>();

            string[] barCodeList = Directory.GetFiles(patientDatabaseDir, "*.xlsx");


            foreach (var codeList in barCodeList)
            {
                if (fullPath == codeList)
                {
                    var xlApp       = new Excel.Application();
                    var xlWorkBook  = xlApp.Workbooks.Open(fullPath, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "\t", false, false, 0, true, 1, 0);
                    var xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
                    var range       = xlWorkSheet.UsedRange;
                    rw      = range.Rows.Count;
                    cl      = range.Columns.Count;
                    isExist = true;

                    for (rCnt = 1; rCnt <= rw; rCnt++)
                    {
                        object catchDetail = (range.Cells[rCnt, 2] as Excel.Range).Value2;
                        if (rCnt == 1)
                        {
                            patientObject.Name = catchDetail.ToString();
                        }

                        if (rCnt == 2)
                        {
                            patientObject.IC = catchDetail.ToString();
                        }

                        if (rCnt >= 4)
                        {
                            //MessageBox.Show(str);
                            var medicine = new Medicine();
                            for (cCnt = 1; cCnt <= cl; cCnt++)
                            {
                                medicineDetail = (range.Cells[rCnt, cCnt] as Excel.Range).Value2;

                                if (medicineDetail != null)
                                {
                                    if (cCnt == 1)
                                    {
                                        medicine.Name = medicineDetail.ToString();
                                    }

                                    if (cCnt == 2)
                                    {
                                        medicine.Min = medicineDetail.ToString();
                                    }

                                    if (cCnt == 3)
                                    {
                                        medicine.Add = medicineDetail.ToString();
                                    }

                                    if (cCnt == 4)
                                    {
                                        medicine.Max = medicineDetail.ToString();
                                    }

                                    if (cCnt == 5)
                                    {
                                        medicine.Unit = medicineDetail.ToString();
                                    }

                                    medicineExist = true;
                                }
                            }
                            if (medicineExist)
                            {
                                _medicineList.Add(medicine);
                                medicineExist = false;
                            }
                        }
                    }

                    patientObject.medicine = _medicineList;
                    xlWorkBook.Close(true, null, null);
                    xlApp.Quit();

                    Marshal.ReleaseComObject(xlWorkSheet);
                    Marshal.ReleaseComObject(xlWorkBook);
                    Marshal.ReleaseComObject(xlApp);
                }
            }



            if (isExist)
            {
                return(patientObject);
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 26
0
 /// <summary>
 /// Set this patient's current Hotspot
 /// </summary>
 /// <param name="po"></param>
 public void PatientHotspot(PatientObject po)
 {
     hotspot = po;
 }
Ejemplo n.º 27
0
    public List <PatientObject> findPatient(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            try
            {
                bool          flag = false;
                PatientObject filler;
                ReadOnlyCollection <Movement.Database.Patient> p1;
                ReadOnlyCollection <Movement.Database.Patient> p2;
                ReadOnlyCollection <Movement.Database.Patient> p3;
                List <PatientObject> finalCollection = new List <PatientObject>();
                p1 = Movement.Database.Patient.FindPatient(patient.name, patient.dob);
                p2 = Movement.Database.Patient.FindPatient(patient.name, patient.ssn);
                p3 = Movement.Database.Patient.FindPatient(patient.dob, patient.ssn);

                for (int i = 0; i < p1.Count; i++)
                {
                    filler.name        = p1[i].Name;
                    filler.ssn         = p1[i].SSN4;
                    filler.sex         = p1[i].Sex;
                    filler.handedness  = p1[i].Handedness;
                    filler.dob         = p1[i].DOB;
                    filler.ContactInfo = p1[i].ContactInfo;
                    filler.address     = p1[i].Address;
                    filler.ID          = p1[i].PatientID;
                    finalCollection.Add(filler);
                }

                for (int i = 0; i < p2.Count; i++)
                {
                    flag = false;
                    for (int j = 0; j < finalCollection.Count; j++)
                    {
                        if (finalCollection[j].ID == p2[i].PatientID)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag == false)
                    {
                        filler.name        = p2[i].Name;
                        filler.ssn         = p2[i].SSN4;
                        filler.sex         = p2[i].Sex;
                        filler.handedness  = p2[i].Handedness;
                        filler.dob         = p2[i].DOB;
                        filler.ContactInfo = p2[i].ContactInfo;
                        filler.address     = p2[i].Address;
                        filler.ID          = p2[i].PatientID;
                        finalCollection.Add(filler);
                    }
                }
                for (int i = 0; i < p3.Count; i++)
                {
                    flag = false;
                    for (int j = 0; j < finalCollection.Count; j++)
                    {
                        if (finalCollection[j].ID == p3[i].PatientID)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag == false)
                    {
                        filler.name        = p3[i].Name;
                        filler.ssn         = p3[i].SSN4;
                        filler.sex         = p3[i].Sex;
                        filler.handedness  = p3[i].Handedness;
                        filler.dob         = p3[i].DOB;
                        filler.ContactInfo = p3[i].ContactInfo;
                        filler.address     = p3[i].Address;
                        filler.ID          = p3[i].PatientID;
                        finalCollection.Add(filler);
                    }
                }
                return(finalCollection);
            }
            catch (Exception e)
            {
                Log(e);
                return(null);
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 28
0
 public List <movement_web_service.Test> RetrieveHistory(PatientObject patient)
 {
     return(new List <global::Movement.UserInterface.movement_web_service.Test>(Connection.Servicer.getTests(0, patient)));
 }
Ejemplo n.º 29
0
        public override void VisitStart(OfficeWorld world)
        {
            base.VisitStart(world);

            this.levelData = Serializer.Deserialize(this.pathLevel);

            // Create Objects
            OfficeObject office = new OfficeObject();

            PatientObject patient = new PatientObject();

            patient.Alias = "main";
            ToubibObject toubib = new ToubibObject();

            toubib.Alias = "main";
            NotebookObject notebook = new NotebookObject();

            notebook.Alias = "main";
            BubbleObject bubble = new BubbleObject();

            bubble.Alias = "main";
            TimerObject timer = new TimerObject();

            timer.Alias = "main";

            QueueTalkObject queueTalk = new QueueTalkObject();

            queueTalk.Alias = "main";
            QueueDreamObject queueDream = new QueueDreamObject();

            queueDream.Alias = "main";

            //TestObject test = new TestObject();

            DialogueObject dialoguePatient = DialogueFactory.CreateDialogueFactory(60, this.levelData.PatientDialogue);

            dialoguePatient.Alias = "patient";

            DialogueObject dialogueToubib = DialogueFactory.CreateDialogueFactory(60, this.levelData.ToubibDialogue);

            dialogueToubib.Alias = "toubib";

            DialogueObject dialogueAnswer = DialogueFactory.CreateDialogueFactory(30, this.levelData.AnswerTokens);

            dialogueAnswer.Alias = "answer";

            DialogueObject dialogueSuccessAnswer = DialogueFactory.CreateDialogueFactory(60, this.levelData.PatientSuccessAnswer, TokenType.NORMAL);

            dialogueSuccessAnswer.Alias = "successAnswer";

            DialogueObject dialogueFailAnswer = DialogueFactory.CreateDialogueFactory(60, this.levelData.PatientFailAnswer, TokenType.NORMAL);

            dialogueFailAnswer.Alias = "failAnswer";

            DialogueObject dialogueComing = DialogueFactory.CreateDialogueFactory(30, "Hum, Entrez ...", TokenType.NORMAL);

            dialogueComing.Alias = "coming";

            AToken timerToken = DialogueFactory.CreateToken(string.Empty, TokenType.TIMER);

            timerToken.Alias = "main";

            // Create layers
            Layer background   = new Layer();
            Layer middleground = new Layer();
            Layer foreground   = new Layer();
            Layer textLayer    = new Layer();
            Layer answerLayer  = new Layer();

            // Add Resources
            List <string> resourcesToLoad = new List <string>();

            resourcesToLoad.Add(this.LevelName);

            resourcesToLoad.Add(office.Id);

            resourcesToLoad.Add(toubib.Id);
            resourcesToLoad.Add(patient.Id);

            resourcesToLoad.Add(notebook.Id);
            resourcesToLoad.Add(bubble.Id);

            resourcesToLoad.Add(queueTalk.Id);
            resourcesToLoad.Add(queueDream.Id);

            resourcesToLoad.Add(timer.Id);

            resourcesToLoad.Add("normalToken");
            resourcesToLoad.Add("sanctuaryToken");
            resourcesToLoad.Add("answerToken");

            resourcesToLoad.Add("lampClipped");
            resourcesToLoad.Add("wordPicked");
            resourcesToLoad.Add("bubbleClosed");
            resourcesToLoad.Add("bubbleOpened");
            resourcesToLoad.Add("wordInserted");
            resourcesToLoad.Add("wordDroped");

            resourcesToLoad.Add("dialoguePatient");
            resourcesToLoad.Add("dialogueToubib");
            resourcesToLoad.Add("dialogueReflexion");
            resourcesToLoad.Add("dialoguePatientSuccess");
            resourcesToLoad.Add("dialoguePatientFail");
            resourcesToLoad.Add("doorKnock");
            resourcesToLoad.Add("endTimer");

            resourcesToLoad.Add("validationSuccess");
            resourcesToLoad.Add("validationFail");

            /*resourcesToLoad.Add(patient.Id);
             * resourcesToLoad.Add(toubib.Id);*/
            world.NotifyResourcesToLoad(resourcesToLoad);

            // Add Layers
            world.AddLayer(background);
            world.AddLayer(middleground);
            world.AddLayer(foreground);
            world.AddLayer(textLayer);
            world.AddLayer(answerLayer);

            // Add Objects

            /*world.AddObject(test, 0);
             * world.AddObject(patient, 0);
             * world.AddObject(toubib, 0);*/
            world.AddObject(office, 0);

            world.AddObject(toubib, 1);
            world.AddObject(patient, 1);

            world.AddObject(queueTalk, 2);
            world.AddObject(queueDream, 2);

            world.AddObject(timer, 2);
            world.AddObject(timerToken, 3);

            world.AddObject(notebook, 2);
            world.AddObject(bubble, 2);

            world.AddObject(dialoguePatient, 3);
            world.AddObject(dialogueToubib, 3);
            world.AddObject(dialogueAnswer, 4);
            world.AddObject(dialogueFailAnswer, 3);
            world.AddObject(dialogueSuccessAnswer, 3);
            world.AddObject(dialogueComing, 3);

            // Set Object Position.
            office.SetKinematicParameters(new Vector2f(0, 0), new Vector2f(0, 0));

            toubib.SetKinematicParameters(new Vector2f(150, 160), new Vector2f(0, 0));
            patient.SetKinematicParameters(new Vector2f(-550, 140), new Vector2f(0, 0));

            notebook.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));
            bubble.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));

            queueTalk.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));
            queueDream.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));

            timer.SetKinematicParameters(new Vector2f(10000, 10000), new Vector2f(0, 0));
            timerToken.SetKinematicParameters(new Vector2f(400, 260), new Vector2f(0f, 0f));

            queueTalk.SetAnimationIndex(1);
            queueDream.SetAnimationIndex(1);
        }
Ejemplo n.º 30
0
    protected override void Page_Load_Extended(object sender, EventArgs e)
    {
        if (IsPostBack == false)
        {
            lblStudyId.Value = Request[ParameterNames.Request.StudyId];
            if (IsFindingInRequest)
                lblFindingId.Value = Request[ParameterNames.Request.FindingId];
            ShowButtons();

            StudyObject study = new StudyObject();
            study.StudyId.Value = int.Parse(Request[ParameterNames.Request.StudyId]);
            study.Load(loggedInUserId);
            lblExamDate.Text = study.StudyDate.Value.ToString();
            PatientObject patient = new PatientObject();
            patient.PatientId.Value = study.PatientId.Value;
            patient.Load(loggedInUserId);
            lblPatientId.Text = (string)patient.ExternalPatientId.Value;
            lblPatientName.Text = (string)patient.Name.Value;
            StudyStatusTypeObject studyStatusType = new StudyStatusTypeObject();
            studyStatusType.StudyStatusTypeId.Value = study.StudyStatusId.Value;
            studyStatusType.Load(loggedInUserId);
            lblStatus.Text = (string)studyStatusType.Status.Value;
            ProcedureObject procedure = new ProcedureObject();
            procedure.ProcedureId.Value = study.ProcedureId.Value;
            procedure.Load(loggedInUserId);
            if (procedure.IsLoaded)
            {
                lblProcedure.Text = (string)procedure.Name.Value;
            }
            ModalityObject modality = new ModalityObject();
            modality.ModalityId.Value = procedure.ModalityId.Value;
            modality.Load(loggedInUserId);
            lblModality.Text = (string)modality.Name.Value;
            if (study.ReferringPhysicianId.Value != null)
            {
                UserObject referringPhysician = new UserObject();
                referringPhysician.UserId.Value = study.ReferringPhysicianId.Value;
                referringPhysician.Load(loggedInUserId);
                lblPhysician.Text = (string)referringPhysician.Name.Value;
            }
            FindingObject finding = new FindingObject();
            if (IsFindingInRequest)
            {
                finding.GetPrimaryKey().Value = int.Parse(Request[ParameterNames.Request.FindingId]);
                finding.Load(loggedInUserId);
            }
            else if (study.LatestFindingId.Value != null)
            {
                finding.FindingId.Value = study.LatestFindingId.Value;
                finding.Load(loggedInUserId);
            }
            if (finding.IsLoaded)
            {
                tbTrancription.Text = (string)finding.TextualTranscript.Value;
                if (finding.AudioUserId.Value != null)
                {
                    UserObject radiologist = new UserObject();
                    radiologist.UserId.Value = finding.AudioUserId.Value;
                    radiologist.Load(loggedInUserId);
                    lblRadiologist.Text = (string)radiologist.Name.Value;
                }
            }
            int studyStatusId = (int)study.StudyStatusId.Value;

            LogObject log = new LogObject();
            log.UserId.Value = loggedInUserId;
            log.StudyId.Value = study.StudyId.Value;
            log.PatientId.Value = study.PatientId.Value;
            log.Action.Value = Constants.LogActions.ViewedStudy;
            log.ActionTime.Value = DateTime.Now;
            log.Save();
        }
    }
Ejemplo n.º 31
0
 public bool addPatientNote(PatientObject patient, UserObject user, String data)
 {
     if (Authenticated_AorC())
     {
         ReadOnlyCollection<Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 //Movement.Database.User filler = Movement.Database.User.Login(user.userName, user.password);
                 patientList[0].RecordNote(UserInfo, data);
                 return true;
             }
             catch (Exception e)
             {
                 Log(e);
                 return false;
             }
         }
         else
         {
             return false;
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 32
0
 public bool deletePatient(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         ReadOnlyCollection<Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 Movement.Database.Patient.RemovePatient(patientList[0].PatientID);
                 return true;
             }
             catch (Exception e)
             {
                 Log(e);
                 return false;
             }
         }
         else
         {
             return false;
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 33
0
 private void LoadPatientData()
 {
     PatientObject patient = new PatientObject();
     patient.ExternalPatientId.Value = tbPatId.Text;
     patient.Load();
     if (patient.IsLoaded)
     {
         if (patient.Name.Value != null)
         {
             string[] names = ((string)patient.Name.Value).Split(',');
             if (names.Length > 1)
             {
                 tbPatLName.Text = names[0].Trim();
                 tbPatFName.Text = names[1].Trim();
             }
             else
             {
                 tbPatFName.Text = names[0].Trim();
             }
         }
         if (patient.DateOfBirth.Value != null)
             dcDOB.Date = (DateTime)patient.DateOfBirth.Value;
         if (patient.Gender.Value != null)
             rblGender.SelectedValue = (string)patient.Gender.Value;
         else
             rblGender.ClearSelection();
     }
     else
     {
         tbPatFName.Text = "";
         dcDOB.ClearSelection();
         rblGender.ClearSelection();
     }
 }
Ejemplo n.º 34
0
    public List<PatientObject> findPatient(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            try
            {
                bool flag = false;
                PatientObject filler;
                ReadOnlyCollection<Movement.Database.Patient> p1;
                ReadOnlyCollection<Movement.Database.Patient> p2;
                ReadOnlyCollection<Movement.Database.Patient> p3;
                List<PatientObject> finalCollection = new List<PatientObject>();
                p1 = Movement.Database.Patient.FindPatient(patient.name, patient.dob);
                p2 = Movement.Database.Patient.FindPatient(patient.name, patient.ssn);
                p3 = Movement.Database.Patient.FindPatient(patient.dob, patient.ssn);

                for (int i = 0; i < p1.Count; i++)
                {
                    filler.name = p1[i].Name;
                    filler.ssn = p1[i].SSN4;
                    filler.sex = p1[i].Sex;
                    filler.handedness = p1[i].Handedness;
                    filler.dob = p1[i].DOB;
                    filler.ContactInfo = p1[i].ContactInfo;
                    filler.address = p1[i].Address;
                    filler.ID = p1[i].PatientID;
                    finalCollection.Add(filler);
                }

                for (int i = 0; i < p2.Count; i++)
                {
                    flag = false;
                    for (int j = 0; j < finalCollection.Count; j++)
                    {
                        if (finalCollection[j].ID == p2[i].PatientID)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag == false)
                    {
                        filler.name = p2[i].Name;
                        filler.ssn = p2[i].SSN4;
                        filler.sex = p2[i].Sex;
                        filler.handedness = p2[i].Handedness;
                        filler.dob = p2[i].DOB;
                        filler.ContactInfo = p2[i].ContactInfo;
                        filler.address = p2[i].Address;
                        filler.ID = p2[i].PatientID;
                        finalCollection.Add(filler);
                    }
                }
                for (int i = 0; i < p3.Count; i++)
                {
                    flag = false;
                    for (int j = 0; j < finalCollection.Count; j++)
                    {
                        if (finalCollection[j].ID == p3[i].PatientID)
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (flag == false)
                    {
                        filler.name = p3[i].Name;
                        filler.ssn = p3[i].SSN4;
                        filler.sex = p3[i].Sex;
                        filler.handedness = p3[i].Handedness;
                        filler.dob = p3[i].DOB;
                        filler.ContactInfo = p3[i].ContactInfo;
                        filler.address = p3[i].Address;
                        filler.ID = p3[i].PatientID;
                        finalCollection.Add(filler);
                    }
                }
                return finalCollection;
            }
            catch (Exception e)
            {
                Log(e);
                return null;
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 35
0
        /// <summary>
        /// Sends a completed test taken by a patient to the sever
        /// </summary>
        /// <param name="patient">Patient taking the test</param>
        /// <param name="user">Current user logged into Movement</param>
        /// <param name="samples">Data captured during the test</param>
        /// <param name="id">Script ID</param>
        /// <returns></returns>
        public Boolean SendTestData(PatientObject patient, UserObject user, List<global::Movement.TestEngine.Capture.CalibratedInkSample> samples, int id)
        {
            movement_web_service.Test completed_test = new global::Movement.UserInterface.movement_web_service.Test();
            ScriptInfo tempScript = new ScriptInfo();
            tempScript.scriptID = id;
            Scripting.ScriptEngine script_engine = new global::Movement.Scripting.ScriptEngine(Connection.Servicer.getScript(tempScript).scriptData);
            Data[] test_data = new Data[samples.Count];
            short average_x =0, average_y=0;
            Data temp;

            //get the data in a form to send to the server
            for (int x = 0; x < samples.Count; x++)
            {
                temp = new Data();
                temp.pressure = (short)samples[x].Pressure;
                temp.time = samples[x].Time;
                temp.x = (short)samples[x].X;
                temp.y = (short)samples[x].Y;

                //we also need to compute the average x and y coordinates
                average_x += temp.x;
                average_y += temp.y;

                test_data[x] = temp;
            }

            //get the rest of the information about the test together to send to the sever
            completed_test.hand = patient.handedness;
            completed_test.patient = patient;
            completed_test.user = user;
            if(script_engine.Cognitive)
                completed_test.mode = 'C';
            else
                completed_test.mode = 'D';

            completed_test.rotation = 0;
            completed_test.avg_X = average_x/samples.Count;
            completed_test.avg_Y = average_y/samples.Count;
            completed_test.script = new Script();
            completed_test.script.scriptID = id;
            completed_test.data = test_data;

            //try to store the completed test
            if (Connection.Servicer.storeTest(completed_test))
                return true;

            return false;
        }
Ejemplo n.º 36
0
    public List<Notes> getPatientNotes(PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            ReadOnlyCollection<Movement.Database.Patient> patientList = FindAPatient(patient);
            Movement.Database.PatientNote newNote;
            List<Notes> allNotes = new List<Notes>();
            Notes filler = new Notes();
            if (patientList.Count == 1)
            {
                try
                {
                    for (int i = 0; i < patientList[0].Notes.Count; i++)
                    {
                        newNote = patientList[0].Notes[i];
                        filler.author = newNote.Author.Name;
                        filler.note = newNote.Data;
                        filler.time = newNote.Timestamp;
                        allNotes.Add(filler);

                    }
                    return allNotes;
                }
                catch (Exception e)
                {
                    Log(e);
                    return null;
                }
            }
            return null;

        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform that action!");
        }
    }
Ejemplo n.º 37
0
 public Notes[] GetNotes(PatientObject patient)
 {
     return(Connection.Servicer.getPatientNotes(patient));
 }
Ejemplo n.º 38
0
    public List<Test> getTests(Int32 numTests, PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            try
            {
                List<Test> tests = new List<Test>();
                Test filler = new Test();
                filler.anal = new List<AnalysisData>();
                Movement.Database.Patient p1 = new Movement.Database.Patient(patient.ID);
                ReadOnlyCollection<Movement.Database.Test> testList;
                testList = p1.GetAllTests();
                AnalysisData d1 = new AnalysisData();

                if (numTests == 0)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[i].Hand;
                        filler.mode = testList[i].Mode;
                        filler.ID = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp = testList[i].Timestamp;
                        filler.rotation = testList[i].Rotation;
                        filler.script.type = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }

                }
                else if (numTests < testList.Count)
                {
                    for (int j = 0; j < numTests; j++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[j].Hand;
                        filler.mode = testList[j].Mode;
                        filler.ID = testList[j].TestID;
                        filler.script.scriptID = testList[j].TestScript.ScriptID;
                        filler.timestamp = testList[j].Timestamp;
                        filler.rotation = testList[j].Rotation;
                        filler.script.type = testList[j].TestScript.ScriptType.Name;
                        filler.isNormal = testList[j].AnalysisIsNormal;

                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[j].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }

                }
                else if (numTests > testList.Count)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal = new List<AnalysisData>();
                        filler.hand = testList[i].Hand;
                        filler.mode = testList[i].Mode;
                        filler.ID = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp = testList[i].Timestamp;
                        filler.rotation = testList[i].Rotation;
                        filler.script.type = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair<Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {

                            d1.metric = data.Key;
                            d1.max = data.Value.Max;
                            d1.min = data.Value.Min;
                            d1.mean = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }
                }

                return tests;
            }
            catch (Exception e)
            {
                Log(e);
                return new List<Test>();
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform this action!");
        }
    }
Ejemplo n.º 39
0
 public Boolean AddNote(PatientObject patient, UserObject user, String data)
 {
     return Connection.Servicer.addPatientNote(patient, user, data);
 }
Ejemplo n.º 40
0
 public PatientObject retrievePatientData(PatientObject patient)
 {
     if (Authenticated_AorC())
     {
         PatientObject newPatient = new PatientObject();
         ReadOnlyCollection<Movement.Database.Patient> patientList = FindAPatient(patient);
         if (patientList.Count == 1)
         {
             try
             {
                 newPatient.name = patientList[0].Name;
                 newPatient.address = patientList[0].Address;
                 newPatient.ContactInfo = patientList[0].ContactInfo;
                 newPatient.sex = patientList[0].Sex;
                 newPatient.dob = patientList[0].DOB;
                 newPatient.handedness = patientList[0].Handedness;
                 newPatient.ssn = patientList[0].SSN4;
                 return newPatient;
             }
             catch (Exception e)
             {
                 Log(e);
                 return newPatient;
             }
         }
         else
         {
             return newPatient;
         }
     }
     else
     {
         throw new UnauthorizedAccessException("You are not authorized to perform that action!");
     }
 }
Ejemplo n.º 41
0
 /// <summary>
 /// This function is a wrapper to the FindPatient method
 /// </summary>
 /// <returns>A Movement.Database.Patient collection of all the patients found that match the criteria</returns>
 private ReadOnlyCollection<Movement.Database.Patient> FindAPatient(PatientObject patient)
 {
     return Movement.Database.Patient.FindPatient(patient.name, patient.dob, patient.ssn);
 }
Ejemplo n.º 42
0
    public List <Test> getTests(Int32 numTests, PatientObject patient)
    {
        if (Authenticated_AorC())
        {
            try
            {
                List <Test> tests  = new List <Test>();
                Test        filler = new Test();
                filler.anal = new List <AnalysisData>();
                Movement.Database.Patient p1 = new Movement.Database.Patient(patient.ID);
                ReadOnlyCollection <Movement.Database.Test> testList;
                testList = p1.GetAllTests();
                AnalysisData d1 = new AnalysisData();

                if (numTests == 0)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal            = new List <AnalysisData>();
                        filler.hand            = testList[i].Hand;
                        filler.mode            = testList[i].Mode;
                        filler.ID              = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp       = testList[i].Timestamp;
                        filler.rotation        = testList[i].Rotation;
                        filler.script.type     = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair <Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {
                            d1.metric = data.Key;
                            d1.max    = data.Value.Max;
                            d1.min    = data.Value.Min;
                            d1.mean   = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }
                }
                else if (numTests < testList.Count)
                {
                    for (int j = 0; j < numTests; j++)
                    {
                        filler.anal            = new List <AnalysisData>();
                        filler.hand            = testList[j].Hand;
                        filler.mode            = testList[j].Mode;
                        filler.ID              = testList[j].TestID;
                        filler.script.scriptID = testList[j].TestScript.ScriptID;
                        filler.timestamp       = testList[j].Timestamp;
                        filler.rotation        = testList[j].Rotation;
                        filler.script.type     = testList[j].TestScript.ScriptType.Name;
                        filler.isNormal        = testList[j].AnalysisIsNormal;

                        foreach (KeyValuePair <Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[j].Analysis.Components)
                        {
                            d1.metric = data.Key;
                            d1.max    = data.Value.Max;
                            d1.min    = data.Value.Min;
                            d1.mean   = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }
                }
                else if (numTests > testList.Count)
                {
                    for (int i = 0; i < testList.Count; i++)
                    {
                        filler.anal            = new List <AnalysisData>();
                        filler.hand            = testList[i].Hand;
                        filler.mode            = testList[i].Mode;
                        filler.ID              = testList[i].TestID;
                        filler.script.scriptID = testList[i].TestScript.ScriptID;
                        filler.timestamp       = testList[i].Timestamp;
                        filler.rotation        = testList[i].Rotation;
                        filler.script.type     = testList[i].TestScript.ScriptType.Name;
                        foreach (KeyValuePair <Movement.Analysis.AnalysisMetric, Movement.Database.TestAnalysisComponent> data in testList[i].Analysis.Components)
                        {
                            d1.metric = data.Key;
                            d1.max    = data.Value.Max;
                            d1.min    = data.Value.Min;
                            d1.mean   = data.Value.Mean;
                            d1.stdDev = data.Value.StdDev;

                            filler.anal.Add(d1);
                        }

                        tests.Add(filler);
                    }
                }

                return(tests);
            }
            catch (Exception e)
            {
                Log(e);
                return(new List <Test>());
            }
        }
        else
        {
            throw new UnauthorizedAccessException("You are not authorized to perform this action!");
        }
    }