public void RunTests(string id) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } var orderedTestList = _context.OrderedTests.Where(c => c.Id == id); if (orderedTestList == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } var aspNetUser = _context.AspNetUsers.SingleOrDefault(c => c.Id == id); if (aspNetUser == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } PatientRecord record = new PatientRecord(); TestPanel pendingList = new TestPanel(); List <List <TestClass> > builtList = new List <List <TestClass> >(); //For each test panel name (order) in orderedTestList, add the associated panel to builtList foreach (var order in orderedTestList) { pendingList.testSelector(order.test); builtList.Add(pendingList.panelTestList); } record.myTestResults = builtList; //gets provider currently logged in var orderingProvider = _context.AspNetUsers.Single(c => c.UserName == User.Identity.Name); //For each test panel foreach (var panel in record.myTestResults) { //create a PatientRecord object for each test in the test panel and save to DB foreach (var test in panel) { record.firstName = aspNetUser.FirstName; record.lastName = aspNetUser.LastName; record.medRecNumber = aspNetUser.Id; record.orderingProvider = orderingProvider.LastName + ", " + orderingProvider.FirstName; record.timeofTest = DateTime.Now.ToString("g"); record.testName = test.testName; record.result = test.result; record.minReferenceRange = test.minReferenceRange; record.maxReferenceRange = test.maxReferenceRange; record.units = test.units; _context.PatientRecords.Add(record); _context.SaveChanges(); } } }
public bool Add(PatientRecord PatientRecord) { PatientRecord.CreatedOn = DateTime.Now; PatientRecord.UpdatedOn = DateTime.Now; using (var sql = new NpgsqlConnection(strConnection)) { var resp = sql.Execute(@"INSERT INTO PatientsRecord (PatientID,MainComplaint,Alterations,Medicines,PsychologicalTreatment,Diagnose,CreatedOn,UpdatedOn,CreatedBy,UpdatedBy) VALUES (@PatientID,@MainComplaint,@Alterations,@Medicines,@PsychologicalTreatment,@Diagnose,@CreatedOn,@UpdatedOn,@CreatedBy,@UpdatedBy)", new { PatientID = PatientRecord.PatientID, MainComplaint = PatientRecord.MainComplaint, Alterations = PatientRecord.Alterations, Medicines = PatientRecord.Medicines, PsychologicalTreatment = PatientRecord.PsychologicalTreatment, Diagnose = PatientRecord.Diagnose, CreatedOn = PatientRecord.CreatedOn, UpdatedOn = PatientRecord.UpdatedOn, CreatedBy = PatientRecord.CreatedBy, UpdatedBy = PatientRecord.UpdatedBy }); return(Convert.ToBoolean(resp)); } }
public void UpdateAspNetUser(string id) { if (!ModelState.IsValid) { throw new HttpResponseException(HttpStatusCode.BadRequest); } var aspNetUserInDB = _context.AspNetUsers.SingleOrDefault(c => c.Id == id); if (aspNetUserInDB == null) { throw new HttpResponseException(HttpStatusCode.NotFound); } var pr = new PatientRecord(); var orderedTest = new TestClass(); pr.testId = orderedTest.testId; pr.firstName = aspNetUserInDB.FirstName; pr.lastName = aspNetUserInDB.LastName; pr.medRecNumber = aspNetUserInDB.Id; //pr.timeofTest = DateTime.Now.Date; _context.PatientRecords.Add(pr); try { _context.SaveChanges(); } catch (Exception exception) { } }
public ActionResult Create([Bind(Include = "Id,Date,PatientName,DateOfBirth,Address,HomeTelephone,CellPhone,IdentityNo,Employer,WorkNumber,EmergencyContact,NextOfKin,HomePhone,InsuranceName,PolicyNumber,InsuranceNumber,GenderId")] PatientRecord patientRecord) { if (ModelState.IsValid) { using (ApplicationDbContext db = new ApplicationDbContext()) { //Check if patients Id number is unique var exist = db.PatientRecords.Where(i => i.IdentityNo == patientRecord.IdentityNo); if (exist.Count() == 0) { patientRecord.Date = patientRecord.StartDate(); db.PatientRecords.Add(patientRecord); db.SaveChanges(); TempData["SM"] = "Successfully Registerd!"; return(RedirectToAction("Index")); /*Redirect to create patients default login details*/ } else { TempData["UM"] = "Patient Already Exists. Check List of Patients!"; return(RedirectToAction("Index")); } } } ViewBag.GenderId = new SelectList(db.Genders, "GenderId", "_Gender", patientRecord.GenderId); return(RedirectToAction("Index")); }
private void barButtonItem1_ItemClick(object sender, ItemClickEventArgs e) { PatientRecord patientRecord = new PatientRecord(); patientRecord.MdiParent = this; patientRecord.Show(); }
/// <summary> ///Method to add patients in to db /// </summary> /// <param name="patientdata"></param> /// <returns>1 for successful posting and 2 for conflicts in data</returns> public async Task <int> PostPatientRecord(PatientDataModel patientdata) { Guid gid = Guid.NewGuid(); PatientRecord pr = new PatientRecord() { PatientID = gid.ToString(), ForeName = patientdata.ForeName, SurName = patientdata.SurName, Gender = patientdata.Gender, DateofBirth = patientdata.DateofBirth, HomeNumber = patientdata.TelePhoneNumbers.HomeNumber, WorkNumber = patientdata.TelePhoneNumbers.WorkNumber, MobileNumber = patientdata.TelePhoneNumbers.MobileNumber, }; db.PatientRecords.Add(pr); try { await db.SaveChangesAsync(); } catch (DbUpdateException) { if (PatientRecordExists(pr.PatientID)) { return(2); } else { throw; } } return(1); }
//GET:PatientRecord/Edit/5 public ActionResult Edit(int id) { ViewBag.AuthorId = new SelectList(db.genders, "GenderId", "_Gender"); PatientRecord patient = interfaceobj.GetModelByID(id); return(View(patient)); }
private void spin() { while (STARTED) { var guid = m_Guids[m_Rnd.Next(m_Guids.Count - 1)]; var rec = BaseApplication.Objects.CheckOut(guid) as PatientRecord; if (rec == null) { rec = PatientRecord.Make <PatientRecord>(); rec.Create(); rec.fldID.Value = m_Rnd.Next(10000).ToString() + "-a"; rec.fldFirstName.Value = "Vsevolod_" + m_Rnd.Next(10000).ToString(); rec.fldLastName.Value = "Serdukovich_" + m_Rnd.Next(10000).ToString(); rec.fldDOB.Value = App.LocalizedTime.AddSeconds(-m_Rnd.Next(1000)); rec.fldContactPhone.Value = "(555) 123-121" + m_Rnd.Next(9).ToString(); rec.fldClassification.Value = "BUD"; rec.Post(); BaseApplication.Objects.CheckIn(guid, rec); continue; } lock (rec) { rec.Edit(); rec.fldLastName.Value = "Serdukovich_" + m_Rnd.Next(10000).ToString(); rec.Post(); } BaseApplication.Objects.CheckIn(guid, rec); Interlocked.Increment(ref COUNT); // Thread.Sleep(m_Rnd.Next(5)); } }
public async Task <IActionResult> PutPatientRecord(int id, PatientRecord patientRecord) { if (id != patientRecord.id) { return(BadRequest()); } _context.Entry(patientRecord).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PatientRecordExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <PatientRecord> > PostPatientRecord(PatientRecord patientRecord) { _context.patientRecords.Add(patientRecord); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPatientRecord", new { id = patientRecord.id }, patientRecord)); }
public void UpdateLastPatientRecord(PatientRecord patientRecord) { using (var con = new SQLiteConnection(CONNECTION_STRING)) { con.Open(); using (var command = new SQLiteCommand(con)) { command.CommandText = @"UPDATE [PatientRecord] SET [PatientName] = @patientName, [BirthYear] = @birthYear, [Gender] = @gender, [TownOrVillage] = @townOrVillage, [DoctorName] = @doctorName, [DoctorAmount] = @doctorAmount, [HospitalAmount] = @hospitalAmount, [Amount] = @amount, [VisitDate] = @visitDate WHERE rowid = (SELECT MAX(rowid) FROM [PatientRecord])"; command.Parameters.AddWithValue("@patientName", patientRecord.PatientName); command.Parameters.AddWithValue("@birthYear", patientRecord.BirthYear); command.Parameters.AddWithValue("@gender", (int)patientRecord.Gender); command.Parameters.AddWithValue("@townOrVillage", patientRecord.TownOrVillage); command.Parameters.AddWithValue("@doctorName", patientRecord.DoctorName); command.Parameters.AddWithValue("@doctorAmount", patientRecord.FinancialData.DoctorAmount); command.Parameters.AddWithValue("@hospitalAmount", patientRecord.FinancialData.HospitalAmount); command.Parameters.AddWithValue("@amount", patientRecord.FinancialData.Amount); command.Parameters.AddWithValue("@visitDate", patientRecord.VisitDate); command.ExecuteNonQuery(); } } }
public void AddPatientRecord(PatientRecord patientRecord) { using (var con = new SQLiteConnection(CONNECTION_STRING)) { con.Open(); using (var command = new SQLiteCommand(con)) { command.CommandText = @"INSERT INTO [PatientRecord] ( [PatientName], [BirthYear], [Gender], [TownOrVillage], [DoctorName], [DoctorAmount], [HospitalAmount], [Amount], [VisitDate]) VALUES(@patientName, @birthYear, @gender, @townOrVillage, @doctorName, @doctorAmount, @hospitalAmount, @amount, @visitDate );"; command.Parameters.AddWithValue("@patientName", patientRecord.PatientName); command.Parameters.AddWithValue("@birthYear", patientRecord.BirthYear); command.Parameters.AddWithValue("@gender", (int)patientRecord.Gender); command.Parameters.AddWithValue("@townOrVillage", patientRecord.TownOrVillage); command.Parameters.AddWithValue("@doctorName", patientRecord.DoctorName); command.Parameters.AddWithValue("@doctorAmount", patientRecord.FinancialData.DoctorAmount); command.Parameters.AddWithValue("@hospitalAmount", patientRecord.FinancialData.HospitalAmount); command.Parameters.AddWithValue("@amount", patientRecord.FinancialData.Amount); command.Parameters.AddWithValue("@visitDate", patientRecord.VisitDate); command.ExecuteNonQuery(); } } }
public ActionResult DeleteConfirmed(int id) { PatientRecord patientRecord = db.PatientRecords.Find(id); db.PatientRecords.Remove(patientRecord); db.SaveChanges(); return(RedirectToAction("Index")); }
private static PatientRecord ToPatient(DicomDataset record) { PatientRecord patient = new PatientRecord(); patient.PatientName = record.GetSingleValueOrDefault <string>(DicomTag.PatientName, null); patient.PatientID = record.GetSingleValueOrDefault <string>(DicomTag.PatientID, null); patient.PatientBirthDate = record.GetSingleValueOrDefault <string>(DicomTag.PatientBirthDate, null); patient.PatientSex = record.GetSingleValueOrDefault <string>(DicomTag.PatientSex, null); return(patient); }
public ActionResult New(Guid patientId) { var triageLevels = _context.TriageLevels.ToList(); var triageTypes = _context.TriageType.ToList(); var diagnosis = _context.Diagnosis.ToList(); var patientRecord = new PatientRecord(); var viewModel = new PatientRecordsFormViewModel(); return(View("PatientRecordsForm", viewModel)); }
private void getData() { PatientRecord ptr = (from tb in db.PatientRecords where tb.recordID == recordID select tb).SingleOrDefault(); if (ptr != null) { recordDate.Value = Convert.ToDateTime(ptr.recordDate); txteGFR.Text = ptr.eGFR.ToString(); txtCreatinine.Text = ptr.Creatinine.ToString(); txtWeight.Text = ptr.weight.ToString(); txtHeight.Text = ptr.height.ToString(); //การได้รับการรักษา cbTreatNone.Checked = ptr.treatNone.Value; cbTreatBelly.Checked = ptr.treatBelly.Value; cbTreatNeck.Checked = ptr.treatNeck.Value; cbTreatArm.Checked = ptr.treatArm.Value; //การออกกำลังกาย cbExwalk.Checked = ptr.exWalk.Value; cbExRun.Checked = ptr.exRun.Value; cbExBite.Checked = ptr.exBite.Value; cbExProgram.Checked = ptr.exProgram.Value; cbExReject.Checked = ptr.exReject.Value; //สุขศึกษา cbHealtEducation.Checked = ptr.healtEducation.Value; cbHealBenefit.Checked = ptr.healtBenefit.Value; //โปรแกรมการออกกำลังกาย cbProgrameEx1.Checked = ptr.programEx1.Value; cbProgrameEx2.Checked = ptr.programEx2.Value; //การประเมิน txtEst1.Text = ptr.estimate1.ToString(); txtEst2.Text = ptr.estimate2.ToString(); txtEst3.Text = ptr.estimate3.ToString(); txtEst4.Text = ptr.estimate4.ToString(); txtEst5.Text = ptr.estimate5.ToString(); txtEst6.Text = ptr.estimate6.ToString(); txtBarthelIndex.Text = ptr.BarthelIndex.ToString(); //Other Detail cbbTransfer.SelectedValue = ptr.Transfer; cbbBedMobility.SelectedValue = ptr.BedMobility; cbbBalance.SelectedValue = ptr.Balance; cbbAmbulateWith.SelectedValue = ptr.Ambulate; cbbMMTRUE.SelectedValue = ptr.MMTRightUE; cbbMMTLUE.SelectedValue = ptr.MMTLeftUE; cbbMMTRLE.SelectedValue = ptr.MMTRightLE; cbbMMTLLE.SelectedValue = ptr.MMTLeftLE; txtPain.Text = ptr.Pain; txtEdema.Text = ptr.Edema; cbtired.Checked = ptr.Tired.Value; txtOther.Text = ptr.Other; txtKnowlege.Text = ptr.Knowlege.ToString(); txtExcercise.Text = ptr.excercise.ToString(); } }
public ActionResult Edit([Bind(Include = "PatientRecordID,PatientID,PatientHistory")] PatientRecord patientRecord) { if (ModelState.IsValid) { db.Entry(patientRecord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "LastNamePatient", patientRecord.PatientID); return(View(patientRecord)); }
public ActionResult Edit([Bind(Include = "Id,Date,PatientName,DateOfBirth,Address,HomeTelephone,CellPhone,IdentityNo,Employer,WorkNumber,EmergencyContact,NextOfKin,HomePhone,InsuranceName,PolicyNumber,InsuranceNumber,GenderId")] PatientRecord patientRecord) { if (ModelState.IsValid) { db.Entry(patientRecord).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.GenderId = new SelectList(db.Genders, "GenderId", "_Gender", patientRecord.Id); return(View(patientRecord)); }
private void button2_Click(object sender, EventArgs e) { var tr = new TypeRegistry(TypeRegistry.RecordModelTypes, TypeRegistry.CommonCollectionTypes, TypeRegistry.BoxedCommonTypes, TypeRegistry.BoxedCommonNullableTypes); tr.Add(typeof(PatientRecord)); tr.Add(typeof(Person2)); tr.Add(typeof(System.Drawing.Point)); tr.Add(typeof(TimeSpan)); tr.Add(typeof(Kozel)); var p1 = PatientRecord.Make <PatientRecord>(); // make(); using (var ms = new FileStream(@"c:\NFX\PERSON2.slim", FileMode.Create)) //new MemoryStream()) { var s = new SlimSerializer(tr); s.Serialize(ms, p1); var clk = Stopwatch.StartNew(); for (var i = 1; i < 4000; i++) { ms.Seek(0, SeekOrigin.Begin); var p2 = s.Deserialize(ms); } Text = clk.ElapsedMilliseconds.ToString(); //Text = p2.Name; } //BINARY formatterr using (var ms = new FileStream(@"c:\NFX\PERSON2.bin", FileMode.Create)) //new MemoryStream()) { var s = new BinaryFormatter(); s.Serialize(ms, p1); var clk = Stopwatch.StartNew(); for (var i = 1; i < 4000; i++) { ms.Seek(0, SeekOrigin.Begin); var p2 = s.Deserialize(ms); } Text += " Binary formatter: " + clk.ElapsedMilliseconds.ToString(); } }
/// \method update /// /// \param PatientInfo insertPatient /// /// \return updated - True if updated false otherwise /// ///This method takes a object of PatientInfo and updates it in the patient database public bool update(PatientInfo patient) { bool updated = false; PatientRecord updatePatient = new PatientRecord(patient); if (DAL.UpdateRecords(updatePatient)) { updated = true; } return(updated); }
public List <PatientRecord> GetAllPatientRecords() { List <PatientRecord> PatientEntries = new List <PatientRecord>(); try { PatientRecord retrievedRecord; using (SqlConnection conn = new SqlConnection(PatientMatching.Resource1.ConnectString)) { conn.Open(); string getPatientsQuery = "select * from dbo.DataExport"; using (SqlCommand cmd = new SqlCommand(getPatientsQuery, conn)) { using (SqlDataReader reader = cmd.ExecuteReader()) { while (reader.Read()) { retrievedRecord = new PatientRecord() { AccountNum = reader["AccountNum"].ToString(), FirstName = reader["FirstName"].ToString().ToUpper(), MiddleInitial = reader["MiddleInitial"].ToString().ToUpper(), LastName = reader["LastName"].ToString().ToUpper(), DateOfBirth = string.IsNullOrEmpty(reader["DateOfBirth"].ToString()) ? DateTime.MinValue : DateTime.Parse(reader["DateOfBirth"].ToString()), Sex = reader["Sex"].ToString().ToUpper(), CurrentStreet1 = reader["CurrentStreet1"].ToString().ToUpper(), CurrentStreet2 = reader["CurrentStreet2"].ToString().ToUpper(), CurrentCity = reader["CurrentCity"].ToString().ToUpper(), CurrentState = reader["CurrentState"].ToString().ToUpper(), CurrentZipCode = string.IsNullOrEmpty(reader["CurrentZipCode"].ToString()) ? 0 : Int32.Parse(reader["CurrentZipCode"].ToString()), PreviousFirstName = reader["PreviousFirstName"].ToString().ToUpper(), PreviousMiddleInitial = reader["PreviousMiddleInitial"].ToString().ToUpper(), PreviousLastName = reader["PreviousLastName"].ToString().ToUpper(), PreviousStreet1 = reader["PreviousStreet1"].ToString().ToUpper(), PreviousStreet2 = reader["PreviousStreet2"].ToString().ToUpper(), PreviousCity = reader["PreviousCity"].ToString().ToUpper(), PreviousState = reader["PreviousState"].ToString().ToUpper(), PreviousZipCode = string.IsNullOrEmpty(reader["PreviousZipCode"].ToString()) ? 0 : Int32.Parse(reader["PreviousZipCode"].ToString()) }; PatientEntries.Add(retrievedRecord); } } } } return(PatientEntries); } catch (SqlException e) { return(PatientEntries); } }
private void PatientForm_Load(object sender, EventArgs e) { // record = BaseApplication.Objects.CheckOut(key) as PatientRecord; //for now if (record==null) record = Record.Make <BusinessLogic.PatientRecord>(); pnlRecord.AttachModel(record); record.StateChanged += (s, a) => setButtons(); setButtons(); }
public static PatientRecord GetPatientAnswer(Guid _pkey) { GuruETCEntities _etc = new GuruETCEntities(); long? ParentId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.Id).FirstOrDefault(); long? DoctorId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.DoctorId).FirstOrDefault(); List <PMed> Medi = new List <PMed>(); List <PSup> Supli = new List <PSup>(); List <PHos> Hosp = new List <PHos>(); PatientRecord _existrecord = new PatientRecord(); long?ExamId = _etc.PatientExams.Where(d => d.PatientId == ParentId && d.DoctorId == DoctorId).OrderByDescending(d => d.ExamId).Select(d => d.ExamId).FirstOrDefault(); PatientResultQuestion _pResult = _etc.PatientResultQuestions.Where(d => d.ExamId == ExamId).FirstOrDefault(); if (_pResult != null) { Medi = (from item in _etc.PatientMedications where (item.PHealthId == _pResult.PHealthId) select new PMed() { MedId = item.MedicationId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); Supli = (from item in _etc.PatientSupplements where (item.PHealthId == _pResult.PHealthId) select new PSup() { SupId = item.SupplementId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); Hosp = (from item in _etc.PatientHospitalizeds where (item.PHealthId == _pResult.PHealthId) select new PHos() { HosId = item.HospitalizationId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); _existrecord.Answer = _pResult.patient_concerns; _existrecord.meditation = Medi; _existrecord.Supliment = Supli; _existrecord.Hospital = Hosp; } return(_existrecord); }
/// \method insert /// /// \param PatientInfo patient /// /// \return inserted - True if inserted false otherwise /// ///This method takes a object of PatientInfo and inserts it into the patient database public bool insert(PatientInfo patient) { bool inserted = false; //Create PatientRecord PatientRecord insertPatient = new PatientRecord(patient); if (DAL.InsertNewRecord(insertPatient)) { inserted = true; } return(inserted); }
public PatientVisitTreeViewModel() { PatientModel patient = new PatientModel() { Name = "风湿口55522", ImagePath = @"/Image/Image1.jpg" }; PatientModel patient1 = new PatientModel() { Name = "哈皮吧555", ImagePath = @"/Image/Image2.jpg" }; PatientRecord patientRecord = new PatientRecord() { Conclusion = "脉搏弱", MedicalType = MedicalType.medicineandnedle, illNessDesc = "身体乏力", EffectDesc = "效果还死心", EffectLevel = EffectLevel.GOOD, Time = DateTime.Now }; PatientRecord patientRecord1 = new PatientRecord() { Conclusion = "脉搏弱1", MedicalType = MedicalType.medicineandnedle, illNessDesc = "身体乏力1", EffectDesc = "效果还死心1", EffectLevel = EffectLevel.BAD, Time = DateTime.Now }; PatientVisitModel patientVisitModel = new PatientVisitModel(patient) { ListVistTime = DateTime.Now.AddDays(-1), RecordCount = 211 }; patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord); patientVisitModel.PatientRecordList.Add(patientRecord1); PatientVisitModel patientVisitModel1 = new PatientVisitModel(patient) { ListVistTime = DateTime.Now.AddDays(-12), RecordCount = 1211 }; patientVisitModel1.PatientRecordList.Add(patientRecord); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); patientVisitModel1.PatientRecordList.Add(patientRecord1); PatientVisitList.Add(patientVisitModel); PatientVisitList.Add(patientVisitModel1); PatientVisitList.Add(patientVisitModel1); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientRecord patientRecord = db.PatientRecords.Find(id); if (patientRecord == null) { return(HttpNotFound()); } return(View(patientRecord)); }
public IEnumerable <PatientRecord> Get() { List <PatientRecord> records = new List <PatientRecord>(); foreach (BlobItem blobItem in _container.GetBlobs()) { BlobClient blob = _container.GetBlobClient(blobItem.Name); var patient = new PatientRecord { name = blob.Name, imageURI = blob.Uri.ToString() }; records.Add(patient); } return(records); }
/// \method search /// /// \param string patientLastName /// /// \return foundPatient - All patients information /// ///This method takes a object of PatientInfo and searches for it in the patient database public List <PatientInfo> search(string patientLastName) { PatientRecord searchPatient = new PatientRecord(); List <PatientRecord> foundPatients = DAL.GetRecords(PatientRecordsAccessor.GETREQUEST.LASTNAME, patientLastName); List <PatientInfo> patientInfoList = new List <PatientInfo>(); foreach (PatientRecord record in foundPatients) { patientInfoList.Add(record.GetPatientInfo()); } return(patientInfoList); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientRecord patientRecord = db.PatientRecord.Find(id); if (patientRecord == null) { return(HttpNotFound()); } ViewBag.PatientID = new SelectList(db.Patients, "PatientID", "LastNamePatient", patientRecord.PatientID); return(View(patientRecord)); }
// GET: PatientRecords/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PatientRecord patientRecord = db.PatientRecords.Find(id); if (patientRecord == null) { return(HttpNotFound()); } ViewBag.GenderId = new SelectList(db.Genders, "GenderId", "_Gender", patientRecord.Id); return(View(patientRecord)); }
public static PatientRecord GetPatientAnswer(Guid _pkey) { GuruETCEntities _etc = new GuruETCEntities(); long? ParentId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.Id).FirstOrDefault(); long? DoctorId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.DoctorId).FirstOrDefault(); List<PMed> Medi = new List<PMed>(); List<PSup> Supli = new List<PSup>(); List<PHos> Hosp = new List<PHos>(); PatientRecord _existrecord = new PatientRecord(); long? ExamId = _etc.PatientExams.Where(d => d.PatientId == ParentId && d.DoctorId == DoctorId).OrderByDescending(d => d.ExamId).Select(d => d.ExamId).FirstOrDefault(); PatientResultQuestion _pResult = _etc.PatientResultQuestions.Where(d => d.ExamId == ExamId).FirstOrDefault(); if (_pResult != null) { Medi = (from item in _etc.PatientMedications where (item.PHealthId == _pResult.PHealthId) select new PMed() { MedId = item.MedicationId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); Supli = (from item in _etc.PatientSupplements where (item.PHealthId == _pResult.PHealthId) select new PSup() { SupId = item.SupplementId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); Hosp = (from item in _etc.PatientHospitalizeds where (item.PHealthId == _pResult.PHealthId) select new PHos() { HosId = item.HospitalizationId, Title = item.Title, Date = item.DateAdded.Value }).ToList(); _existrecord.Answer = _pResult.patient_concerns; _existrecord.meditation = Medi; _existrecord.Supliment = Supli; _existrecord.Hospital = Hosp; } return _existrecord; }
public void LoadInfoXML(string filename) { Serializer<PatientInfo> serializer = new Serializer<PatientInfo>(); Info = serializer.Load(filename); Info.Debug(); // setup the info.startingDateTime Info.startingDateTime = DateTime.Now; if (Info.startingTime != ""){ // look for TraumaBrain and set the starting time there Brain tb = FindObjectOfType(typeof(Brain)) as Brain; if (tb != null){ tb.SetStartTime(Info.startingTime); } // make one for us, maybe we don't really need our own... string[] ss = Info.startingTime.Split (':') ; if (ss.Length == 2){ int hours = 0; int mins = 0; int.TryParse(ss[0],out hours); int.TryParse(ss[1],out mins); TimeSpan ts = new TimeSpan(hours, mins, 0); Info.startingDateTime = Info.startingDateTime.Date + ts; } } // initialize initial patient vitals Vitals = new PatientVitals(); Vitals.Set(Info.initialVitalState, 0.0f); VitalsMgr.GetInstance().SetCurrent(Vitals); // start behavior, null is nothing VitalsBehaviorManager.GetInstance().AddBehavior(Info.initialVitalsBehavior); VitalsBehaviorManager.GetInstance().StateChange += VitalsBehaviorChange; // lets create and load up the PatientRecords structure with this data if (PatientRecords == null){ PatientRecords = new List<PatientRecord>(); } Record = new PatientRecord(); Record.Name = "filename"; //we currently only ever have one Record.Info = Info; Record.XRayRecords = new List<ScanRecord>(); Record.FastRecords = new List<ScanRecord>(); Record.CTRecords = new List<ScanRecord>(); // load up the list of records Serializer<ScanRecord> scanSerializer = new Serializer<ScanRecord>(); foreach (string recordPath in Info.scanRecords){ // string pathname = "XML/Patient/Records"+recordPath.Replace (".xml",""); ScanRecord record = scanSerializer.Load(recordPath); LoadScanRecord( record ); } // set XRAY images // deprecate these !!! use the Record.XrayRecords, get by name. ChestXRAY = Info.chestXRAY; PelvicXRAY = Info.pelvicXRAY; gcs_eyes = Info.gcsEyes; gcs_verbal = Info.gcsVerbal; gcs_motor = Info.gcsMotor; gcs_total = Info.gcsTotal; /* ScanRecord chestXrayRecord = new ScanRecord(); chestXrayRecord.Name = "chest"; chestXrayRecord.Region = "Chest"; chestXrayRecord.Filename = Info.chestXRAY; Record.XRayRecords.Add (chestXrayRecord); // CreateStringXML( Info.fast); ScanRecord pelvicXrayRecord = new ScanRecord(); pelvicXrayRecord.Name = "pelvis"; pelvicXrayRecord.Region = "Pelvis"; pelvicXrayRecord.Filename = Info.pelvicXRAY; Record.XRayRecords.Add (pelvicXrayRecord); // make assumption about the order of fast filenames // perihepatic, perisplenic, pelvis, pericardium, chest ScanRecord perihepaticFastRecord = new ScanRecord(); perihepaticFastRecord.Name = "perihepatic"; perihepaticFastRecord.Region = "Perihepatic"; perihepaticFastRecord.Filename = Info.fast[0]; perihepaticFastRecord.Thumbnail = Info.fastThumbnail[0]; Record.FastRecords.Add(perihepaticFastRecord); ScanRecord perisplenicFastRecord = new ScanRecord(); perisplenicFastRecord.Name = "perisplenic"; perisplenicFastRecord.Region = "Perisplenic"; perisplenicFastRecord.Filename = Info.fast[1]; perisplenicFastRecord.Thumbnail = Info.fastThumbnail[1]; Record.FastRecords.Add(perisplenicFastRecord); ScanRecord pelvisFastRecord = new ScanRecord(); pelvisFastRecord.Name = "pelvis"; pelvisFastRecord.Region = "Pelvis"; pelvisFastRecord.Filename = Info.fast[2]; pelvisFastRecord.Thumbnail = Info.fastThumbnail[2]; Record.FastRecords.Add(pelvisFastRecord); ScanRecord pericardiumFastRecord = new ScanRecord(); pericardiumFastRecord.Name = "pericardium"; pericardiumFastRecord.Region = "Pericardium"; pericardiumFastRecord.Filename = Info.fast[3]; pericardiumFastRecord.Thumbnail = Info.fastThumbnail[3]; Record.FastRecords.Add(pericardiumFastRecord); if (Info.fast.Count > 4){ ScanRecord chestFastRecord = new ScanRecord(); chestFastRecord.Name = "chest"; chestFastRecord.Region = "Chest"; chestFastRecord.Filename = Info.fast[4]; chestFastRecord.Thumbnail = Info.fastThumbnail[4]; Record.FastRecords.Add(chestFastRecord); } // load CT results // make assumption about the order of fast filenames // brain, cspine, chest, abdomen, tlspine ScanRecord brainCTRecord = new ScanRecord(); brainCTRecord.Name = "brain"; brainCTRecord.Region = "Brain"; brainCTRecord.Filename = Info.CT[0]; brainCTRecord.Thumbnail = Info.CTThumbnail[0]; Record.CTRecords.Add(brainCTRecord); ScanRecord cspineCTRecord = new ScanRecord(); cspineCTRecord.Name = "cspine"; cspineCTRecord.Region = "C-Spine"; cspineCTRecord.Filename = Info.CT[1]; cspineCTRecord.Thumbnail = Info.CTThumbnail[1]; Record.CTRecords.Add(cspineCTRecord); ScanRecord chestCTRecord = new ScanRecord(); chestCTRecord.Name = "chest"; chestCTRecord.Region = "Chest"; chestCTRecord.Filename = Info.CT[2]; chestCTRecord.Thumbnail = Info.CTThumbnail[2]; Record.CTRecords.Add(chestCTRecord); ScanRecord abdomenCTRecord = new ScanRecord(); abdomenCTRecord.Name = "abdomen"; abdomenCTRecord.Region = "Abdomen"; abdomenCTRecord.Filename = Info.CT[3]; abdomenCTRecord.Thumbnail = Info.CTThumbnail[3]; Record.CTRecords.Add(abdomenCTRecord); ScanRecord tlspineCTRecord = new ScanRecord(); tlspineCTRecord.Name = "tlspine"; tlspineCTRecord.Region = "TL-Spine"; tlspineCTRecord.Filename = Info.CT[4]; tlspineCTRecord.Thumbnail = Info.CTThumbnail[4]; Record.CTRecords.Add(tlspineCTRecord); */ PatientRecords.Add(Record); // now these can be accessed with Patient.GetPatientRecord().GetXRay("name") etc // set initial state and seektimes // load decisions foreach( string decision in Info.decisions ) DecisionMgr.GetInstance().LoadXML(decision); }
public static void CreatePatientData(ISession session) { State newYork = new State { Abbreviation = "NY", FullName = "New York" }; State florida = new State { Abbreviation = "FL", FullName = "Florida" }; Physician drDobbs = new Physician { Name = "Dr Dobbs" }; Physician drWatson = new Physician { Name = "Dr Watson" }; PatientRecord bobBarkerRecord = new PatientRecord { Name = new PatientName { FirstName = "Bob", LastName = "Barker" }, Address = new PatientAddress { AddressLine1 = "123 Main St", City = "New York", State = newYork, ZipCode = "10001" }, BirthDate = new DateTime(1930, 1, 1), Gender = Gender.Male }; PatientRecord johnDoeRecord1 = new PatientRecord { Name = new PatientName { FirstName = "John", LastName = "Doe" }, Address = new PatientAddress { AddressLine1 = "123 Main St", City = "Tampa", State = florida, ZipCode = "33602" }, BirthDate = new DateTime(1969, 1, 1), Gender = Gender.Male }; PatientRecord johnDoeRecord2 = new PatientRecord { Name = new PatientName { FirstName = "John", LastName = "Doe" }, Address = new PatientAddress { AddressLine1 = "123 Main St", AddressLine2 = "Apt 2", City = "Tampa", State = florida, ZipCode = "33602" }, BirthDate = new DateTime(1969, 1, 1) }; Patient bobBarker = new Patient(new[] { bobBarkerRecord }, false, drDobbs); Patient johnDoe = new Patient(new[] { johnDoeRecord1, johnDoeRecord2 }, true, drWatson); session.Save(newYork); session.Save(florida); session.Save(drDobbs); session.Save(drWatson); session.Save(bobBarker); session.Save(johnDoe); }
public PatientRecord SetPatientRecord( string scenario ) // these are not going to work yet, each patient only has one { Record = GetPatientRecord(scenario); return Record; }