///<summary>Inserts one Patient into the database. Returns the new priKey.</summary> internal static long Insert(Patient patient) { if(DataConnection.DBtype==DatabaseType.Oracle) { patient.PatNum=DbHelper.GetNextOracleKey("patient","PatNum"); int loopcount=0; while(loopcount<100){ try { return Insert(patient,true); } catch(Oracle.DataAccess.Client.OracleException ex){ if(ex.Number==1 && ex.Message.ToLower().Contains("unique constraint") && ex.Message.ToLower().Contains("violated")){ patient.PatNum++; loopcount++; } else{ throw ex; } } } throw new ApplicationException("Insert failed. Could not generate primary key."); } else { return Insert(patient,false); } }
public LetterBestPrintHistory(int letter_print_history_id, int letter_id, int patient_id, DateTime date) { this.letter_print_history_id = letter_print_history_id; this.letter = letter_id == -1 ? null : new LetterBest(letter_id); this.patient = patient_id == -1 ? null : new Patient(patient_id); this.date = date; }
public Invoice(int invoice_id, int entity_id, int invoice_type_id, int booking_id, int payer_organisation_id, int payer_patient_id, int non_booking_invoice_organisation_id, string healthcare_claim_number, int reject_letter_id, string message, int staff_id, int site_id, DateTime invoice_date_added, decimal total, decimal gst, decimal receipts_total, decimal vouchers_total, decimal credit_notes_total, decimal refunds_total, bool is_paid, bool is_refund, bool is_batched, int reversed_by, DateTime reversed_date, DateTime last_date_emailed) { this.invoice_id = invoice_id; this.entity_id = entity_id; this.invoice_type = new IDandDescr(invoice_type_id); this.booking = booking_id == -1 ? null : new Booking(booking_id); this.payer_organisation = payer_organisation_id == 0 ? null : new Organisation(payer_organisation_id); this.payer_patient = payer_patient_id == -1 ? null : new Patient(payer_patient_id); this.non_booking_invoice_organisation = non_booking_invoice_organisation_id == -1 ? null : new Organisation(non_booking_invoice_organisation_id); this.healthcare_claim_number = healthcare_claim_number; this.reject_letter = reject_letter_id == -1 ? null : new Letter(reject_letter_id); this.message = message; this.staff = new Staff(staff_id); this.site = site_id == -1 ? null : new Site(site_id); this.invoice_date_added = invoice_date_added; this.total = total; this.gst = gst; this.receipts_total = receipts_total; this.vouchers_total = vouchers_total; this.credit_notes_total = credit_notes_total; this.refunds_total = refunds_total; this.is_paid = is_paid; this.is_refund = is_refund; this.is_batched = is_batched; this.reversed_by = reversed_by == -1 ? null : new Staff(reversed_by); this.reversed_date = reversed_date; this.last_date_emailed = last_date_emailed; }
public static void AddACOfferings(ref Hashtable offerings, ref Patient patient) { if (patient.ACInvOffering != null) patient.ACInvOffering = (Offering)offerings[patient.ACInvOffering.OfferingID]; if (patient.ACPatOffering != null) patient.ACPatOffering = (Offering)offerings[patient.ACPatOffering.OfferingID]; }
public ActionResult Announce( String Command,Patient P) { String HostName = Dns.GetHostName(); String MyIP = Dns.GetHostByName(HostName).AddressList[0].ToString(); Patient curPatient = new Patient(); var counter = (from r in db.IPs where r.IP_Address == MyIP select r.Name); counter.Take(1); foreach (var item in counter) { ViewBag.CounterName = item; } var Patientinfo = (from r in db.Patients where r.PatientId == P.PatientId select r).Single(); if ((Patientinfo.Status == "NEW"|| Patientinfo.Status=="MISSED") && Command!="CALL") return View(Patientinfo); Patientinfo.Status = Command; db.SaveChanges(); Patientinfo.IP = MyIP; db.SaveChanges(); Patientinfo.TimeStamp = DateTime.Now; db.SaveChanges(); ModelState.Clear(); if (Command != "CALL") { return RedirectToAction("PatientSelection"); } return View(Patientinfo); }
public void Insert(Guid Guid, Guid ServerPartitionGUID, string PatientsName, string PatientId, string IssuerOfPatientId, int NumberOfPatientRelatedStudies, int NumberOfPatientRelatedSeries, int NumberOfPatientRelatedInstances, string SpecificCharacterSet) { var item = new Patient(); item.Guid = Guid; item.ServerPartitionGUID = ServerPartitionGUID; item.PatientsName = PatientsName; item.PatientId = PatientId; item.IssuerOfPatientId = IssuerOfPatientId; item.NumberOfPatientRelatedStudies = NumberOfPatientRelatedStudies; item.NumberOfPatientRelatedSeries = NumberOfPatientRelatedSeries; item.NumberOfPatientRelatedInstances = NumberOfPatientRelatedInstances; item.SpecificCharacterSet = SpecificCharacterSet; item.Save(UserName); }
public RegisterPatient(int register_patient_id, int organisation_id, int patient_id, DateTime register_patient_date_added) { this.register_patient_id = register_patient_id; this.organisation = new Organisation(organisation_id); this.patient = new Patient(patient_id); this.register_patient_date_added = register_patient_date_added; }
public void GetOpenQueries() { //Arrange var dataStorage = new Mock<IDataStorage>(); var clinic = new Clinic {Caption = "Clinic1"}; var doctor1 = new User {FirstName = "DoctorFirst1", LastName = "DoctorLast1", Clinic = clinic}; var doctor2 = new User {FirstName = "DoctorFirst2", LastName = "DoctorLast2", Clinic = clinic}; var patient1 = new Patient {PatientNumber = 11, Doctor = doctor1}; var patient2 = new Patient {PatientNumber = 12, Doctor = doctor2}; var visit1 = new Visit {Caption = "Visit1", Patient = patient1}; var visit2 = new Visit {Caption = "Visit2", Patient = patient2}; var form1 = new Form {FormType = FormType.Happiness, Visit = visit1}; var form2 = new Form {FormType = FormType.Demographics, Visit = visit2}; var question1 = new Question {Form = form1}; var question2 = new Question {Form = form2}; var query1 = new Query {Id = 1, QueryText = "Text1", Question = question1}; var query2 = new Query {Id = 2, QueryText = "Text2", AnswerText = "Answer1", Question = question2}; var repository = new QueryRepository(dataStorage.Object); dataStorage.Setup(ds => ds.GetData<Query>()).Returns(new List<Query> {query1, query2}); //Act var result = repository.GetOpenQueries(); //Assert Assert.That(result, Is.Not.Null); Assert.That(result.Count(), Is.EqualTo(1)); var query = result.ToList()[0]; Assert.That(query.FormType, Is.EqualTo(FormType.Happiness)); Assert.That(query.ClinicName, Is.EqualTo("Clinic1")); Assert.That(query.DoctorName, Is.EqualTo("DoctorLast1")); Assert.That(query.QuestionText, Is.EqualTo("Text1")); Assert.That(query.PatientNumber, Is.EqualTo(11)); Assert.That(query.VisitName, Is.EqualTo("Visit1")); }
protected void BaseInit(int damageOnInit, int damagePerTick, int tickExtraDelaySeconds, int tickRepeatRate){ this.damagePerTick = damagePerTick; this.damageOnInit = damageOnInit; p = Camera.main.gameObject.GetComponent<Patient>(); InvokeRepeating("doDamage",tickExtraDelaySeconds,tickRepeatRate); damageOnSpawn(); }
public static int Main() { Patient bob = new Patient(); bob["age"] = 32.0; if ((bool)bob["dead"]) return 1; return 0; }
/// <summary> /// Creates a patient object from the given data. /// </summary> /// <param name="last">Patient's last name</param> /// <param name="middle">Patient's middle initial</param> /// <param name="first">Patient's first name</param> /// <param name="birthdate">Patient's birthdate</param> /// <param name="gender">Patient's gender</param> /// <param name="ssn">Patient's ssn</param> /// <param name="addr">Patient's address</param> /// <param name="city">Patient's city</param> /// <param name="state">Patient's state</param> /// <param name="zip">Patient's zip</param> /// <param name="phone">Patient's phone</param> /// <returns>A patient object with the specified information upon creation, otherwise null</returns> public static Patient CreatePatient(string last, char middle, string first, string birthdate, char gender, string ssn, string addr, string city, string state, string zip, string phone) { Patient newPatient = new Patient(); try { newPatient.LastName = last; newPatient.MiddleInitial = middle; newPatient.FirstName = first; newPatient.DateOfBirth = DateTime.Parse(birthdate); newPatient.Gender = gender; newPatient.Ssn = ssn; newPatient.Address = addr; newPatient.City = city; newPatient.State = state; newPatient.Zip = zip; newPatient.Phone = phone; return newPatient; } catch (Exception ex) { MessageBox.Show(ex.Message, ex.GetType().ToString(), MessageBoxButtons.OK); } return null; }
/// <summary> /// Creates a patient structure /// </summary> /// <param name="id">The unique identifier</param> /// <param name="name">The name of the patient</param> /// <param name="addr">The primary address</param> /// <param name="telecom">A primary telecom</param> /// <returns>A constructed patient structure</returns> public static Patient CreatePatient( II id, EN name, AD addr, TEL telecom ) { // Instantiate the object var retVal = new Patient(); // Populate address retVal.Addr = BAG<AD>.CreateBAG(addr); // Confidentiality Code retVal.ConfidentialityCode = "N"; // Effective Time of the types // High is populated as "Not Applicable" retVal.EffectiveTime = new IVL<TS>( (TS)DateTime.Now, new TS() { NullFlavor = NullFlavor.NotApplicable } ); // Telecom address retVal.Telecom = BAG<TEL>.CreateBAG(telecom); // Populate the ID retVal.Id = SET<II>.CreateSET(id); // Status Code retVal.StatusCode = RoleStatus.Active; // Return result return retVal; }
private static void AddToPatientList() { Patient patient = new Patient(); Console.WriteLine("Enter patient name only capital letters"); string name = Console.ReadLine(); patient.FullName = name; Console.WriteLine("Enter patient egn "); long egn = long.Parse(Console.ReadLine()); patient.EGN = egn; Console.WriteLine("Enter patient age"); byte age = byte.Parse(Console.ReadLine()); patient.Age = age; Console.WriteLine("Enter doctor name only capital letters"); string dname = Console.ReadLine(); patient.DoctorName = dname; Console.WriteLine("Enter diagnoses name only capital letters"); string diagnoses = Console.ReadLine(); patient.Diagnosis = diagnoses; string binFileToStr = BinaryFile.ReadOnBinaryFile("listOFPatient"); DynamicList dinamicList = new DataArranger(binFileToStr).ListOfPatients; IsEGNCorrect(dinamicList, patient); dinamicList.Add(patient); BinaryFile.WriteOnBinaryFile("listOFPatient", dinamicList); }
protected void Page_Init(object sender, EventArgs e) { ctx = new AriClinicContext("AriClinicContext"); // security control, it must be a user logged if (Session["User"] == null) Response.Redirect("Default.aspx"); else { user = CntAriCli.GetUser((Session["User"] as User).UserId, ctx); Process proc = (from p in ctx.Processes where p.Code == "policy" select p).FirstOrDefault<Process>(); per = CntAriCli.GetPermission(user.UserGroup, proc, ctx); } // cheks if is call from another form if (Request.QueryString["Type"] != null) type = Request.QueryString["Type"]; // read the realated patient if (Request.QueryString["PatientId"] != null) { patientId = Int32.Parse(Request.QueryString["PatientId"]); pat = CntAriCli.GetPatient(patientId, ctx); cus = pat.Customer; } if (Request.QueryString["CustomerId"] != null) { customerId = Int32.Parse(Request.QueryString["CustomerId"]); cus = CntAriCli.GetCustomer(customerId, ctx); } // translate filters CntWeb.TranslateRadGridFilters(RadGrid1); }
public PatientMatchesResponse matchPatients(Patient patient) { string request = buildMatchPatientsRequest(patient); string response = (string)cxn.query(request); string hl7 = extractHL7Message(response); return new PatientMatchesResponse(hl7); }
public void EditPatient(Patient patient) { using (var conn = CreateConnection()) { try { var cmd = new SqlCommand("appSchema.usp_updatepatient", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Fnamn", SqlDbType.VarChar, 50).Value = patient.FirstName; cmd.Parameters.Add("@Enamn", SqlDbType.VarChar, 50).Value = patient.LastName; cmd.Parameters.Add("@Adress", SqlDbType.VarChar, 50).Value = patient.Address; cmd.Parameters.Add("@Postnr", SqlDbType.VarChar, 6).Value = patient.PostalCode; cmd.Parameters.Add("@Ort", SqlDbType.VarChar, 25).Value = patient.City; cmd.Parameters.Add("@LäkarID", SqlDbType.Int, 4).Value = patient.DoctorID; cmd.Parameters.Add("@PatientID", SqlDbType.Int, 4).Value = patient.PatientID; conn.Open(); cmd.ExecuteNonQuery(); } catch { throw new ApplicationException("Ett fell uppstod"); } } }
public void AddAdverseEventVisit(Patient patient) { var visit = clinicalStudyDesign.AddAdverseEventVisit(patient.Id); var day1Date = patient.Visits.FirstOrDefault(v => v.VisitTypeValue == (int) VisitType.Day1).VisitDate; SetRealVisitDateAndTime(visit, day1Date.Value.AddDays(randomGenerator.Next(9))); //vitals form var form = visit.Forms.ToList().OrderBy(f => f.OrderNo).Last(f => f.FormType == FormType.AdverseEvent); form.FormState = FormState.Completed; var formData = adverseEventFormDataRepository.GetFormDataByFormId(form.Id); formData.AdverseExperience.Value = GetRandomAdverseEvent(); formData.RelationshipToInvestigationalDrug.Value = ((int)(AdverseEventRelanshionship)(randomGenerator.Next(4) + 1)).ToString(); formData.Outcome.Value = ((int)(AdverseEventOutcome)(randomGenerator.Next(2) + 1)).ToString(); formData.Intensity.Value = ((int)(AdverseEventIntensity)(randomGenerator.Next(3) + 1)).ToString(); int onsetHour = randomGenerator.Next(0, 23); int onsetMinute = randomGenerator.Next(0, 60); onsetMinute = onsetMinute - onsetMinute % 10; var onsetDate = visit.VisitDate.Value.AddDays(-(randomGenerator.Next(3) + 1)).Date; onsetDate = onsetDate.AddHours(onsetHour); onsetDate = onsetDate.AddMinutes(onsetMinute); formData.OnsetDate.Value = onsetDate.Date.ToString(); formData.OnsetTime.Value = onsetDate.ToString(); var endDate = onsetDate.AddMinutes(randomGenerator.Next(3, 36)*10); formData.EndDate.Value = endDate.Date.ToString(); formData.EndTime.Value = endDate.ToString(); }
public ActionResult Register(Patient patientinfo) { using (QMS_db db = new QMS_db()) { String HostName = Dns.GetHostName(); db.Patients.Add(new Patient { PatientId = patientinfo.PatientId, PatientName = patientinfo.PatientName, Status = "NEW", TimeStamp = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")), IP = "", }); db.SaveChanges(); } using (QMS_db db = new QMS_db()) { var item = (from p in db.Patients where (p.PatientId == patientinfo.PatientId && p.PatientName == patientinfo.PatientName && p.Status == "NEW") select p).Single(); return RedirectToAction("Index", new { Token = item.Token }); } }
public PatientHistory(Patient patient) { InitializeComponent(); this.CenterToScreen(); this.patient = patient; FillTabe(); }
// %HR less 120 bool EvaluateCondition( string item ) { if ( patient == null ) patient = Component.FindObjectOfType(typeof(Patient)) as Patient; if ( patient == null ) return false; if ( item.ToLower ().Contains ("%") == true ) { string[] tokens = item.Split (); DecisionVariable dv = patient.GetDecisionVariable(tokens[0]); if ( dv != null && tokens.Length == 3 ) { // test decision variable condition if ( dv.Test(tokens[2],tokens[1]) ) { if ( ConditionStartTime == -1 ) ConditionStartTime = (int)Brain.GetInstance().elapsedTime; return true; } } } return false; }
public void AddPatient(Patient patient, string userName, string defaultPassword) { using (TransactionScope scope = new TransactionScope()) { using (var dataContext = new HealthReunionEntities()) { if (CheckIfUserNameExists(userName)) throw new Exception("User name already exist"); // Add provider enity dataContext.Patients.Add(patient); // Save changes so that it will insert records into database. dataContext.SaveChanges(); var user = new User(); user.UserName = userName; user.Password = defaultPassword; user.PatientId = patient.PatientId; user.IsDefaultPassword = true; // Add user entity dataContext.Users.Add(user); dataContext.SaveChanges(); // Complete the transaction if everything goes well. scope.Complete(); } } }
public TestPatient(Patient p) { if ((p.Documents != null) && (p.Documents.Length != 0)) { documents = new List<TestDocument>(); foreach (DocumentDto i in p.Documents) documents.Add(new TestDocument(i)); } if ((p.Addresses != null) && (p.Addresses.Length != 0)) { addreses = new List<TestAddress>(); foreach (AddressDto i in p.Addresses) addreses.Add(new TestAddress(i)); } if ((p.ContactDtos != null) && (p.ContactDtos.Length != 0)) { contacts = new List<TestContact>(); foreach (ContactDto i in p.ContactDtos) contacts.Add(new TestContact(i)); } if ((p.Jobs != null) && (p.Jobs.Length != 0)) { jobs = new List<TestJob>(); foreach (Job i in p.Jobs) jobs.Add(new TestJob(i)); } if ((p.Privileges != null) && (p.Privileges.Length != 0)) { privileges = new List<TestPrivilege>(); foreach (Privilege i in p.Privileges) privileges.Add(new TestPrivilege(i)); } if (p.Person != null) person = new TestPerson(p.Person); }
public override bool Connected (){ if (patient == null) patient = Component.FindObjectOfType(typeof(Patient)) as Patient; if (patient == null) return false; return(patient.GetAttribute("autobpplaced")=="True" && patient.GetAttribute ("cufferror")!="True"); }
//Main class function, export the mutationList to DOCX file, sets file name to patient's testName. public static void saveDOC(Patient patient, List<Mutation> mutationList, bool includePersonalDetails) { WordprocessingDocument myDoc = null; string fullPath = Properties.Settings.Default.ExportSavePath + @"\" + patient.TestName; if (includePersonalDetails) fullPath += "_withDetails"; fullPath += ".docx"; try { myDoc = WordprocessingDocument.Create(fullPath, WordprocessingDocumentType.Document); } catch(IOException ) { throw ; } MainDocumentPart mainPart = myDoc.AddMainDocumentPart(); mainPart.Document = new Document(); Body body = new Body(); Paragraph paragraph = new Paragraph(); Run run_paragraph = new Run(); paragraph.Append(run_paragraph); //add paragraph for each detail of the patient. body.Append(generateParagraph("Test Name",true)); body.Append(generateParagraph(patient.TestName,false)); //add personal details of the patien, if includePersonalDetails=true if (includePersonalDetails) { body.Append(generateParagraph("ID", true)); body.Append(generateParagraph(patient.PatientID, false)); body.Append(generateParagraph("First Name", true)); body.Append(generateParagraph(patient.FName, false)); body.Append(generateParagraph("Last Name", true)); body.Append(generateParagraph(patient.LName, false)); } body.Append(generateParagraph("Pathological Number", true)); body.Append(generateParagraph(patient.PathoNum, false)); body.Append(generateParagraph("Run Number", true)); body.Append(generateParagraph(patient.RunNum, false)); body.Append(generateParagraph("Tumour Site", true)); body.Append(generateParagraph(patient.TumourSite, false)); body.Append(generateParagraph("Disease Level", true)); body.Append(generateParagraph(patient.DiseaseLevel, false)); body.Append(generateParagraph("Backgroud", true)); body.Append(generateParagraph(patient.Background, false)); body.Append(generateParagraph("Previous Treatment", true)); body.Append(generateParagraph(patient.PrevTreatment, false)); body.Append(generateParagraph("Current Treatment", true)); body.Append(generateParagraph(patient.CurrTreatment, false)); body.Append(generateParagraph("Conclusion", true)); body.Append(generateParagraph(patient.Conclusion, false)); //Add related mutation of the patient. CreateTable(body, mutationList); mainPart.Document.Append(body); mainPart.Document.Save(); myDoc.Close(); }
public static Patient CreatePatient(string mrn) { Patient patient = new Patient(); PatientProfile profile = new PatientProfile( new PatientIdentifier(mrn, new InformationAuthorityEnum("UHN", "UHN", "")), null, new HealthcardNumber("1111222333", new InsuranceAuthorityEnum("OHIP", "OHIP", ""), null, null), new PersonName("Roberts", "Bob", null, null, null, null), DateTime.Now - TimeSpan.FromDays(4000), Sex.M, new SpokenLanguageEnum("en", "English", null), new ReligionEnum("X", "unknown", null), false, null, null, null, null, null, null, null, patient ); patient.AddProfile(profile); return patient; }
static void Main(string[] args) { IPatient patient = new Patient { Name = "John Wick", Complaint = "I can't run fast!", Diagnosis = "Not viewed", Recipe = "Not writed" }; IInsuranceCompany insuranceCompany = new InsuranceCompany(); Console.WriteLine("*** Clinic of \"Eternal Rest\" greeting You! ***"); Console.WriteLine(); IHospital hospital = new Hospital(patient); Console.WriteLine("Name: {0}", patient.Name); Console.WriteLine("Complaint: {0}", patient.Complaint); Console.WriteLine(); hospital.DoctorVisit(patient); Console.WriteLine("{0}, your diagnosis is \"{1}\".", patient.Name, patient.Diagnosis); Console.WriteLine("Recipe: {0}.", patient.Recipe); insuranceCompany.onInvoicePaid += hospital.Healing; Console.WriteLine("Invoice is sended to your Insurance Company... waiting for payment..."); insuranceCompany.Paying(hospital.GetInvoice()); Console.WriteLine(); Console.WriteLine("Your current diagnosis is \"{0}\".", patient.Diagnosis); Console.Read(); }
public void AddPatient(Patient patient, string userName) { using (TransactionScope scope = new TransactionScope()) { using (var dataContext = new HealthReunionEntities()) { // Add provider enity dataContext.Patients.Add(patient); // Save changes so that it will insert records into database. dataContext.SaveChanges(); var user = new User(); user.UserName = userName; user.Password = "******"; user.PatientId = patient.PatientId; // Add user entity dataContext.Users.Add(user); dataContext.SaveChanges(); // Complete the transaction if everything goes well. scope.Complete(); } } }
// Use this for initialization protected override void Start() { base.Start(); patient = Component.FindObjectOfType(typeof(Patient)) as Patient; parser = GetComponent<VitalsParser>(); }
//When save clicked, gets all patient details from textBoxs and save patient to database. private void _savePatientButton_Click(object sender, EventArgs e) { string testName = _testNameTextBox.Text; string id = _idTextBox.Text; string fName = _firstNameTextBox.Text; string lName = _lastNameTextBox.Text; string pathoNum = _pathologicalNoTextBox.Text; string runNum = _runNoTextBox.Text; string tumourSite = _tumorSiteTextBox.Text; string diseaseLevel = _diseaseLevelTextBox.Text; string prevTreatment = _previousTreatmentTextBox.Text; string currTreatment = _currentTreatmentTextBox.Text; string background = _backgroundTextBox.Text; string conclusion = _conclusionsTextBox1.Text; //validate textboxs text if (!(id.Equals("") || fName.Equals("") || lName.Equals(""))) //removed runNum.Equals("") || pathoNum.Equals("") || tumourSite.Equals("") { //check if patient with same test name allready exist. Patient p = new Patient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, background, prevTreatment, currTreatment, conclusion); try { //If Exist, show message for overwriting. if (MainBL.patientExistByTestName(testNmae)) { if (MessageBox.Show("TEST NAME allready exist, Overwrite?", "Notice", MessageBoxButtons.YesNo) == DialogResult.Yes) { MainBL.updatePatient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, background, prevTreatment, currTreatment, conclusion); _mainForm.CurrPatient = p; _mutationList = MainBL.getMutationListByTestName(p.TestName); _mainForm.MutationList = _mutationList; MessageBox.Show("Patient saved successfully"); } } //If not Exist, insert new patient to database. else { MainBL.addPatient(testName, id, fName, lName, pathoNum, runNum, tumourSite, diseaseLevel, prevTreatment, currTreatment, background, conclusion); _mainForm.CurrPatient = p; _mainForm.MutationList = _mutationList; foreach (Mutation m in _mutationList) { MainBL.addMatch(testName, m.MutId); } MessageBox.Show("Patient saved successfully"); } } catch (Exception) { GeneralMethods.showErrorMessageBox("Something Went Wrong, Please try Again"); } } else { ToolTip errorToolTip = new ToolTip(); errorToolTip.SetToolTip(_savePatientButton, "digit only"); errorToolTip.Show("Please Fill All Details", _savePatientButton, 800); } colorTextBoxs(); }
public override AlertNotification Test(Patient patient, IPersistenceContext context) { if (patient.Allergies.Count == 0) return null; var reasons = CollectionUtils.Map<Allergy, string>(patient.Allergies, allergy => allergy.AllergenDescription); return new AlertNotification(this.Id, reasons); }
private void button1_Click(object sender, EventArgs e) { listBox1.Items.Clear(); if (String.IsNullOrEmpty(textBox1.Text)) { List <Patient> patients = connDB.GetListOfAllPatients(); foreach (var l in patients) { string name; try { name = l.Name[0].GivenElement[0].ToString(); } catch { name = null; } if (!String.IsNullOrEmpty(name)) { string outS = l.Id + "---" + l.Name[0].GivenElement[0] + "---" + l.Name[0].Family; listBox1.Items.Add(outS); } } } else { if (radioButton1.Checked) { List <Patient> patients = connDB.GetListOfPatients(textBox1.Text); foreach (var l in patients) { string name; try { name = l.Name[0].GivenElement[0].ToString(); } catch { name = null; } if (!String.IsNullOrEmpty(name)) { string outS = l.Id + "---" + l.Name[0].GivenElement[0] + "---" + l.Name[0].Family; listBox1.Items.Add(outS); } } } else { Patient l = connDB.GetPatientByID(textBox1.Text); string name; try { name = l.Name[0].GivenElement[0].ToString(); } catch { name = null; } if (!String.IsNullOrEmpty(name)) { string outS = l.Id + " \t " + l.Name[0].GivenElement[0] + " \t " + l.Name[0].Family; listBox1.Items.Add(outS); } } } textBox1.Clear(); }
public async Task <Haematology> GetHaematologyWithChildrenAsync(long id) { //One to One var patient = new Patient { PatientID = 12345, Name = "Name", Age = "Age", Sex = "Sex", RefBy = "RefBy" }; return(new Haematology { SerialNo = 12345, PatientID = 12345, TDate = DateTime.Now, Hb = "Hb", HBUnit = "HBUnit", HBNor = "HBNor", Tlc = "Tlc", TLCUnit = "TLCUnit", TLCNor = "TLCNor", Esr = "Esr", ESRUnit = "ESRUnit", ESRNor = "ESRNor", Bt = "Bt", BTUnit = "BTUnit", BTNor = "BTNor", Ct = "Ct", CTUnit = "CTUnit", CTNor = "CTNor", PlateletsCount = "PlateletsCount", PlateletsCountUnit = "PlateletsCountUnit", PlateletsCountNor = "PlateletsCountNor", Pt = "Pt", PTUnit = "PTUnit", PTNor = "PTNor", Dlc = "Dlc", DLCUnit = "DLCUnit", DLCNor = "DLCNor", Polymorphs = "Polymorphs", PolymorphsUnit = "PolymorphsUnit", PolymorphsNor = "PolymorphsNor", Lymphocytes = "Lymphocytes", LymphocytesUnit = "LymphocytesUnit", LymphocytesNor = "LymphocytesNor", Monocyte = "Monocyte", MonocyteUnit = "MonocyteUnit", MonocyteNor = "MonocyteNor", Eosinophil = "Eosinophil", EosinophilUnit = "EosinophilUnit", EosinophilNor = "EosinophilNor", Basophil = "Basophil", BasophilUnit = "BasophilUnit", BasophilNor = "BasophilNor", MalariaParasites = "MalariaParasites", MalariaParasitesUnit = "MalariaParasitesUnit", MalariaParasitesNor = "MalariaParasitesNor", BloodGroup = "BloodGroup", BloodGroupUnit = "BloodGroupUnit", BloodGroupNor = "BloodGroupNor", RHFactor = "RHFactor", RHFactorUnit = "RHFactorUnit", RHFactorNor = "RHFactorNor", TotalRBC = "TotalRBC", TotalRBCUnit = "TotalRBCUnit", TotalRBCNor = "TotalRBCNor", PVCHaematorcrit = "PVCHaematorcrit", PVCHaematorcritUnit = "PVCHaematorcritUnit", PVCHaematorcritNor = "PVCHaematorcritNor", MCV = "MCV", MCVUnit = "MCVUnit", MCVNor = "MCVNor", MCH = "MCH", MCHUnit = "MCHUnit", MCHNor = "MCHNor", MCHC = "MCHC", MCHCUnit = "MCHCUnit", MCHCNor = "MCHCNor", Fee = 12345, //One to One Patient = patient }); }
// GET: Patient/Delete/5 public ActionResult Delete(Guid id) { Patient currentPatient = GetContact(id); return(View(currentPatient)); }
public PatientNotification(Patient patient, bool read, string message) { Patient = patient; Read = read; Message = message; }
/// <summary> /// Constructor. /// </summary> /// <param name="thePartition"></param> /// <param name="location"></param> /// <param name="thePatient"></param> /// <param name="theStudy"></param> public StudyEditor(ServerPartition thePartition, StudyStorageLocation location, Patient thePatient, Study theStudy) { FailureReason = string.Empty; Platform.CheckForNullReference(thePartition, "thePartition"); Platform.CheckForNullReference(location, "location"); Platform.CheckForNullReference(thePatient, "thePatient"); Platform.CheckForNullReference(theStudy, "theStudy"); ServerPartition = thePartition; StorageLocation = location; Patient = thePatient; Study = theStudy; // Scrub for invalid characters that may cause a failure when the Xml is generated for the history Patient.PatientId = XmlUtils.XmlCharacterScrub(Patient.PatientId); Patient.PatientsName = XmlUtils.XmlCharacterScrub(Patient.PatientsName); Study.StudyDescription = XmlUtils.XmlCharacterScrub(Study.StudyDescription); Study.ReferringPhysiciansName = XmlUtils.XmlCharacterScrub(Study.ReferringPhysiciansName); Study.PatientId = XmlUtils.XmlCharacterScrub(Study.PatientId); Study.PatientsName = XmlUtils.XmlCharacterScrub(Study.PatientsName); }
protected void pdfButton_Click(object sender, EventArgs e) { Document doc = new Document(PageSize.A4, 36, 72, 108, 180); string path = @"D:\"; PdfWriter.GetInstance(doc, new FileStream(path + "/Treatment.pdf", FileMode.Create)); doc.Open(); Voter aVoter = new Voter(); aVoter.Id = nationalIdTextBox.Text; aVoter.Name = nameTextBox.Text; aVoter.Address = addressTextBox.Text; Paragraph paragraph = new Paragraph(); paragraph.Add("National Id : " + aVoter.Id); paragraph.Add(Environment.NewLine); paragraph.Add("Name : " + aVoter.Name); paragraph.Add(Environment.NewLine); paragraph.Add("Address :" + aVoter.Address); paragraph.Add(Environment.NewLine); paragraph.Add(Environment.NewLine); doc.Add(paragraph); Patient aPatient = new Patient(); aPatient.VoterId = nationalIdTextBox.Text; GetPatientInformation(aPatient.VoterId); aPatient.Id = patientManager.GetPatientId(aPatient); int count = 0; List <Treatment> ObservationList = treatmentManager.GetObservationList(aPatient); foreach (var observation in ObservationList) { count++; PdfPTable table = new PdfPTable(1); Paragraph aParagraph = new Paragraph(); Chunk chunk = new Chunk("Treatment-" + count, FontFactory.GetFont("dax-black")); chunk.SetUnderline(0.5f, -1.5f); doc.Add(chunk); string centerName = centerManager.GetCenterName(observation.CenterId); aParagraph.Add("Center Name : " + centerName); aParagraph.Add(Environment.NewLine); string Date = observation.Date; aParagraph.Add("Date : " + Date); aParagraph.Add(Environment.NewLine); string DoctorName = doctorManager.GetDoctorName(observation.DoctorId); aParagraph.Add("Doctor Name : " + DoctorName); aParagraph.Add(Environment.NewLine); string Observation = observation.Observation; aParagraph.Add("Observation : " + Observation); aParagraph.Add(Environment.NewLine); table.AddCell(aParagraph); doc.Add(table); List <Treatment> treatmentList = treatmentManager.GetTreatmentList(observation.ObservationId); List <Treatment> aTreatmentList = new List <Treatment>(); foreach (var treatment in treatmentList) { string diseaseName = diseaseManager.GetDiseaseName(treatment.DiseaseId); string medicineName = medicineManager.GetMedicineName(treatment.MedicineId); Treatment aTreatment = new Treatment(); aTreatment.NameOfDisease = diseaseName; aTreatment.NameOfMedicine = medicineName; aTreatment.Dose = treatment.Dose; aTreatment.TakenTime = treatment.TakenTime; aTreatment.Quantity = treatment.Quantity; aTreatment.Note = treatment.Note; aTreatmentList.Add(aTreatment); } ShowAllTreatment(centerName, Date, DoctorName, Observation, count, aTreatmentList); PdfPTable aTable = new PdfPTable(6); aTable.AddCell("Disease"); aTable.AddCell("Medicine"); aTable.AddCell("Dose"); aTable.AddCell("Before/After meal"); aTable.AddCell("Quantity"); aTable.AddCell("Note"); foreach (var eachTreatment in aTreatmentList) { aTable.AddCell(eachTreatment.NameOfDisease); aTable.AddCell(eachTreatment.NameOfMedicine); aTable.AddCell(eachTreatment.Dose); aTable.AddCell(eachTreatment.TakenTime); aTable.AddCell(eachTreatment.Quantity.ToString()); aTable.AddCell(eachTreatment.Note); } doc.Add(aTable); } doc.Close(); Response.Redirect("OpenPdfUI.aspx"); megLabel.Text = "PDF Creation Successful!"; }
public PhysicianShellModel() { bl = new BLImplementation(); this.CurrentPatient = new Patient(); }
private void FillGrid() { gridRemainTimeUnits.BeginUpdate(); gridRemainTimeUnits.ListGridRows.Clear(); List <PatPlan> listPatPlans = PatPlans.Refresh(_patCur.PatNum); List <InsSub> listInsSubs = InsSubs.GetMany(listPatPlans.Select(x => x.InsSubNum).ToList()); List <Benefit> listPatBenefits = Benefits.Refresh(listPatPlans, listInsSubs); if (listPatBenefits.IsNullOrEmpty()) { gridRemainTimeUnits.EndUpdate(); return; } List <InsPlan> listInsPlans = InsPlans.GetByInsSubs(listInsSubs.Select(x => x.InsSubNum).ToList()); List <Carrier> listCarriers = Carriers.GetCarriers(listInsPlans.Select(x => x.CarrierNum).ToList()); //Get the LIM information for all potential subscribers. List <Patient> listSubscribers = Patients.GetLimForPats(listInsSubs.Select(x => x.Subscriber).ToList()); GridRow gridRow; //Get the last year of completed procedures because there is no current TimePeriod for benefits that will care about older procedures. //A subset of these procedures will be used for each specific benefit in order to correctly represent the time units remaining. List <Procedure> listCompletedProcs = Procedures.GetCompletedForDateRange( DateTime.Today.AddYears(-1), DateTimeOD.Today, listPatNums: new List <long> { _patCur.PatNum }); //Get all of the claimprocs associated to the completed procedures in order to link procedures to insurance plans. List <ClaimProc> listClaimProcs = ClaimProcs.GetForProcs(listCompletedProcs.Select(x => x.ProcNum).ToList()); foreach (Benefit benefit in listPatBenefits) { if (benefit.CovCatNum == 0 || //no category benefit.BenefitType != InsBenefitType.Limitations || //benefit type is not limitations (benefit.TimePeriod != BenefitTimePeriod.CalendarYear && //neither calendar year, serviceyear, or 12 months benefit.TimePeriod != BenefitTimePeriod.ServiceYear && benefit.TimePeriod != BenefitTimePeriod.NumberInLast12Months) || benefit.Quantity < 0 || //quantity is negative (negatives are allowed in FormBenefitEdit) benefit.QuantityQualifier != BenefitQuantity.NumberOfServices || //qualifier us not the number of services (benefit.CoverageLevel != BenefitCoverageLevel.Family && //neither individual nor family coverage level benefit.CoverageLevel != BenefitCoverageLevel.Individual)) { continue; } List <Procedure> listProcs; //for calendar year, get completed procs from January.01.CurYear ~ Curdate if (benefit.TimePeriod == BenefitTimePeriod.CalendarYear) { //01/01/CurYear. is there a better way? listProcs = listCompletedProcs.FindAll(x => x.ProcDate >= new DateTime(DateTimeOD.Today.Year, 1, 1)); } else if (benefit.TimePeriod == BenefitTimePeriod.NumberInLast12Months) { //today - 12 months - 1 day. Procedures exactly 1 year ago are not counted in the range listProcs = listCompletedProcs.FindAll(x => x.ProcDate >= DateTimeOD.Today.AddYears(-1).AddDays(1)); } else //if not calendar year, then it must be service year { int monthRenew = InsPlans.RefreshOne(benefit.PlanNum).MonthRenew; //monthrenew only stores the month as an int. if (DateTimeOD.Today.Month >= monthRenew) //if the the current date is past the renewal month, use the current year { listProcs = listCompletedProcs.FindAll(x => x.ProcDate >= new DateTime(DateTimeOD.Today.Year, monthRenew, 1)); } else //otherwise use the previous year { listProcs = listCompletedProcs.FindAll(x => x.ProcDate >= new DateTime(DateTimeOD.Today.Year - 1, monthRenew, 1)); } } Dictionary <long, List <ClaimProc> > dictClaimProcsPerSub; if (benefit.PatPlanNum != 0) { //The list of benefits that we are looping through was filled via listPatPlans so this will never fail. //If this line fails then it means that there was a valid PlanNum AND a valid PatPlanNum set on the benefit which is invalid ATM. dictClaimProcsPerSub = listClaimProcs.FindAll(x => x.InsSubNum == listPatPlans.First(y => y.PatPlanNum == benefit.PatPlanNum).InsSubNum) .GroupBy(x => x.InsSubNum) .ToDictionary(x => x.Key, x => x.ToList()); } else //benefit.PatPlanNum was not set so benefit.PlanNum must be set. { dictClaimProcsPerSub = listClaimProcs.FindAll(x => x.PlanNum == benefit.PlanNum) .GroupBy(x => x.InsSubNum) .ToDictionary(x => x.Key, x => x.ToList()); } foreach (long insSubNum in dictClaimProcsPerSub.Keys) { //The insSubNum should have a corresponding entry within listInsSubs. InsSub insSub = listInsSubs.FirstOrDefault(x => x.InsSubNum == insSubNum); if (insSub == null) { continue; //If not found then there are claimprocs associated to an inssub that is associated to a dropped or missing plan. } InsPlan insPlan = listInsPlans.FirstOrDefault(x => x.PlanNum == insSub.PlanNum); Carrier carrier = listCarriers.FirstOrDefault(x => x.CarrierNum == insPlan.CarrierNum); Patient subscriber = listSubscribers.FirstOrDefault(x => x.PatNum == insSub.Subscriber); CovCat category = CovCats.GetCovCat(benefit.CovCatNum); //Filter out any procedures that are not associated to the insurance plan of the current benefit. List <Procedure> listFilterProcs = listProcs.FindAll(x => x.ProcNum.In(dictClaimProcsPerSub[insSubNum].Select(y => y.ProcNum))); //Calculate the amount used for one benefit. double amtUsed = CovCats.GetAmtUsedForCat(listFilterProcs, category); double amtRemain = benefit.Quantity - amtUsed; gridRow = new GridRow((carrier == null) ? "Unknown" : carrier.CarrierName, (subscriber == null) ? "Unknown" : subscriber.GetNameFL(), category.Description.ToString(), benefit.Quantity.ToString(), amtUsed.ToString("F"), (amtRemain > 0) ? amtRemain.ToString("F") : "0"); gridRemainTimeUnits.ListGridRows.Add(gridRow); } } gridRemainTimeUnits.EndUpdate(); }
private void SeedData() { _fakeIdentityUsers = IdentityHelper.GetIdentityUsers(); var activity = new Episode { Id = 1, Description = "description" }; var activity02 = new Episode { Id = 2, Description = "description" }; _fakeEntities = new List <Episode> { activity, activity02 }; var patient = new Patient { Name = "jim", Bsn = "bsn", Email = "*****@*****.**", Dob = DateTime.Now, Gender = Gender.Male, PhoneNumber = "124124", City = "hank", Street = "lepelaarstraat", HouseNumber = "20", HouseNumberAddon = "", PostalCode = "4273cv", Country = "Netherlands" }; var type = new AdditionalExaminationType { Name = "typename", Unit = "GPS" }; var additional = new AdditionalExaminationResult { Value = "value", Date = DateTime.Now, AdditionalExaminationType = type }; var ipCode = new IcpcCode { Name = "Name", Code = "code" }; var episode = new Episode { Description = "Description", Priority = 10, Patient = patient, IcpcCode = ipCode }; var intolerance = new Intolerance { Description = "descrption", EndDate = DateTime.Now, StartDate = DateTime.Now, Patient = patient }; var physical = new PhysicalExamination { Value = "physical", Date = DateTime.Now, Patient = patient }; var consultation = new Consultation { Id = 1, Date = DateTime.Now, Comments = "comments", DoctorId = Guid.Parse(_fakeIdentityUsers[0].Id), Doctor = _fakeIdentityUsers[0], Patient = patient, AdditionalExaminationResults = new List <AdditionalExaminationResult> { additional }, Episodes = new List <Episode> { episode }, Intolerances = new List <Intolerance> { intolerance }, PhysicalExaminations = new List <PhysicalExamination> { physical } }; _constulatations = new List <Consultation> { consultation }; _patients = new List <Patient> { patient }; var code = new IcpcCode { Code = "code", Name = "name" }; _icpcCodes = new List <IcpcCode> { code }; }
public async Task <bool> updatePatientInfo(Patient patient) { return(await Task.Factory.StartNew(() => _repo.UpdatePatient(patient))); }
} // end of ToString #endregion #region Clone override public Event Clone() { return(new EventBookingSpecialServiceDue(ParentControlUnit, (EntityPatient)Patient.Clone(), ReturnDelegate, Availability)); } // end of Clone
public Claus(Patient proband) { RiskFactors = new ClausRiskFactors(); OwningPatient = proband; constructor_args = new object[] { }; }
private void Distribute() { if (this.txt_patientName.Text != null) { Patient patient = new Patient(); patient.PatientName = this.txt_patientName.Text.ToString(); DataTable dt = PatientManager.GetPatientInfo_FromPatientName(patient); if (dt.Rows[0][0] != null) { //retrieve the patientname key try{ this.tempKey = this.listbedNum.SelectedIndex; } catch (Exception ex) { MessageBox.Show(ex.StackTrace.ToString() + "请拣选合适的床位号,然后输入患者的姓名!"); } patient_Name[this.tempKey] = dt.Rows[0][0].ToString(); MessageBox.Show(patient_Name[this.tempKey]); this.age[tempKey] = dt.Rows[0][1].ToString(); this.sex[tempKey] = dt.Rows[0][2].ToString(); this.inHospital_Num[tempKey] = dt.Rows[0][4].ToString(); this.into_Date[tempKey] = dt.Rows[0][8].ToString(); Room room = new Room(); room.PatientName = patient_Name[this.tempKey]; room.Sex = this.sex[this.tempKey]; room.Status_R = "占用"; char[] ch = this.listbedNum.SelectedItem.ToString().ToCharArray(0, 3); string tempstrring = ""; foreach (char c in ch) { tempstrring += c.ToString(); } room.Room_Num = tempstrring; int middleposition = this.listbedNum.SelectedItem.ToString().IndexOf(" "); room.Bed_Num = Convert.ToString(this.listbedNum.SelectedItem.ToString().Substring(middleposition + 1)); RoomManager.UpdateRoom(room); //RenewCarView(); this.Refresh(); this.panels.Clear(); this.pic.Clear(); this.imageLists.Clear(); this.l_age.Clear(); this.l_bNum.Clear(); this.l_hNum.Clear(); this.l_inDate.Clear(); this.l_payType.Clear(); this.l_pName.Clear(); this.l_sex.Clear(); this.Refresh(); MessageBox.Show("再次唤醒执行前"); // this.Dispose(); MessageBox.Show("fifth step executed successfully"); } else { MessageBox.Show("您检索的的患者不存在!"); } } else { MessageBox.Show("请输入要分配患者的姓名!"); } }//不需要重写
///<summary>Returns null if there is no DFT defined for the enabled HL7Def.</summary> public static MessageHL7 GenerateDFT(List <Procedure> procList, EventTypeHL7 eventType, Patient pat, Patient guar, long aptNum, string pdfDescription, string pdfDataString) //add event (A04 etc) parameters later if needed //In \\SERVERFILES\storage\OPEN DENTAL\Programmers Documents\Standards (X12, ADA, etc)\HL7\Version2.6\V26_CH02_Control_M4_JAN2007.doc //On page 28, there is a Message Construction Pseudocode as well as a flowchart which might help. { Provider prov = Providers.GetProv(Patients.GetProvNum(pat)); Appointment apt = Appointments.GetOneApt(aptNum); MessageHL7 messageHL7 = new MessageHL7(MessageTypeHL7.DFT); HL7Def hl7Def = HL7Defs.GetOneDeepEnabled(); if (hl7Def == null) { return(null); } //find a DFT message in the def HL7DefMessage hl7DefMessage = null; for (int i = 0; i < hl7Def.hl7DefMessages.Count; i++) { if (hl7Def.hl7DefMessages[i].MessageType == MessageTypeHL7.DFT) { hl7DefMessage = hl7Def.hl7DefMessages[i]; //continue; break; } } if (hl7DefMessage == null) //DFT message type is not defined so do nothing and return { return(null); } for (int s = 0; s < hl7DefMessage.hl7DefSegments.Count; s++) { int countRepeat = 1; if (hl7DefMessage.hl7DefSegments[s].SegmentName == SegmentNameHL7.FT1) { countRepeat = procList.Count; } //for example, countRepeat can be zero in the case where we are only sending a PDF of the TP to eCW, and no procs. for (int repeat = 0; repeat < countRepeat; repeat++) //FT1 is optional and can repeat so add as many FT1's as procs in procList //if(hl7DefMessage.hl7DefSegments[s].SegmentName==SegmentNameHL7.FT1) { { if (hl7DefMessage.hl7DefSegments[s].SegmentName == SegmentNameHL7.FT1 && procList.Count > repeat) { prov = Providers.GetProv(procList[repeat].ProvNum); } SegmentHL7 seg = new SegmentHL7(hl7DefMessage.hl7DefSegments[s].SegmentName); seg.SetField(0, hl7DefMessage.hl7DefSegments[s].SegmentName.ToString()); for (int f = 0; f < hl7DefMessage.hl7DefSegments[s].hl7DefFields.Count; f++) { string fieldName = hl7DefMessage.hl7DefSegments[s].hl7DefFields[f].FieldName; if (fieldName == "") //If fixed text instead of field name just add text to segment { seg.SetField(hl7DefMessage.hl7DefSegments[s].hl7DefFields[f].OrdinalPos, hl7DefMessage.hl7DefSegments[s].hl7DefFields[f].FixedText); } else { //seg.SetField(hl7DefMessage.hl7DefSegments[s].hl7DefFields[f].OrdinalPos, //FieldConstructor.GenerateDFT(hl7Def,fieldName,pat,prov,procList[repeat],guar,apt,repeat+1,eventType,pdfDescription,pdfDataString)); Procedure proc = null; if (procList.Count > repeat) //procList could be an empty list { proc = procList[repeat]; } seg.SetField(hl7DefMessage.hl7DefSegments[s].hl7DefFields[f].OrdinalPos, FieldConstructor.GenerateDFT(hl7Def, fieldName, pat, prov, proc, guar, apt, repeat + 1, eventType, pdfDescription, pdfDataString)); } } messageHL7.Segments.Add(seg); } } return(messageHL7); }
public SurveyWindow() { InitializeComponent(); patient = (Patient)userController.ViewProfile(MainWindow.patient.Jmbg); searchSurveyForPatient = surveyController.ViewSurveyByJmbg(patient.Jmbg); if (searchSurveyForPatient != null) { survey = searchSurveyForPatient; if (survey.DoctorGrade == Grade.BAD) { baddoc.IsChecked = true; } else if (survey.DoctorGrade == Grade.GOOD) { gooddoc.IsChecked = true; } else if (survey.DoctorGrade == Grade.VERYGOOD) { verygooddoc.IsChecked = true; } else { excellentdoc.IsChecked = true; } if (survey.StaffGrade == Grade.BAD) { badstaff.IsChecked = true; } else if (survey.StaffGrade == Grade.GOOD) { goodstaff.IsChecked = true; } else if (survey.StaffGrade == Grade.VERYGOOD) { verygoodstaff.IsChecked = true; } else { excellentstaff.IsChecked = true; } if (survey.PrivacyGrade == Grade.BAD) { badprivacy.IsChecked = true; } else if (survey.PrivacyGrade == Grade.GOOD) { goodprivacy.IsChecked = true; } else if (survey.PrivacyGrade == Grade.VERYGOOD) { verygoodprivacy.IsChecked = true; } else { excellentprivacy.IsChecked = true; } comment.Text = survey.Content; button.Content = "Izmeni"; } }
public UnitOfWork(ApplicationDbContext context) { _context = context; Patient = new Patient(_context); Treatment = new Treatment(_context); }
private PlanSetup GetPlanSetup(Patient patient) { var courses = patient.Courses; return(courses.First().PlanSetups.First()); }
public void Dispose() { Patient.ClearAll(); Doctor.ClearAll(); }
public async Task <ActionResult> Register(RegisterViewModel model) { if (ModelState.IsValid) { var context = new Pharm4MeContext(); var context2 = new ApplicationDbContext(); int userpin = model.pin; if (model.RoleName == "Patient") { Patient check1 = context.Patients.Find(userpin); var check2 = context2.Users.FirstOrDefault(u => u.PatientId == model.pin); if (check1 != null && check2 == null) { var user = new ApplicationUser { UserName = model.Email, Email = model.Email, RoleName = model.RoleName, PatientId = model.pin }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { result = UserManager.AddToRole(user.Id, "Patient"); await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); Patient patient = db.Patients.Find(userpin); patient.Email = model.Email; db.SaveChanges(); return(RedirectToAction("Index", "Home")); } AddErrors(result); return(View(model)); } } else if (model.RoleName == "Clinician") { Doctor check1 = context.Doctors.Find(userpin); var check2 = context2.Users.FirstOrDefault(u => u.DoctorId == model.pin); if (check1 != null && check2 == null) { var user = new ApplicationUser { UserName = model.Email, Email = model.Email, RoleName = model.RoleName, DoctorId = model.pin }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { result = UserManager.AddToRole(user.Id, "Doctor"); await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); return(RedirectToAction("Index", "Home")); } AddErrors(result); return(View(model)); } } else if (model.RoleName == "Admin") { var user = new ApplicationUser { UserName = model.Email, Email = model.Email, RoleName = model.RoleName }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { result = UserManager.AddToRole(user.Id, "Admin"); await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); return(RedirectToAction("Index", "Home")); } AddErrors(result); return(View(model)); } else { Pharmacist check1 = context.Pharmacists.Find(userpin); var check2 = context2.Users.FirstOrDefault(u => u.PharmacistId == model.pin); if (check1 != null && check2 == null) { var user = new ApplicationUser { UserName = model.Email, Email = model.Email, RoleName = model.RoleName, PharmacistId = model.pin }; var result = await UserManager.CreateAsync(user, model.Password); if (result.Succeeded) { result = UserManager.AddToRole(user.Id, "Manager"); await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); return(RedirectToAction("Index", "Home")); } AddErrors(result); return(View(model)); } } AddCustomizeError("Invalid Pin Code"); } // If we got this far, something failed, redisplay form return(View(model)); }
public static bool HasGiven(this Patient patient, string given) { return(patient.Name.Exists(n => n.Given.Contains(given))); }
//EDIT PATIENT: POST public async Task <ActionResult> EditPatient(EditPatientViewModel model, String location) { using (var db = new ApplicationDbContext()) { if (ModelState.IsValid) { //var Db = new ApplicationDbContext(); Patient patient = db.Patients.First(u => u.PatientId == model.Id); IEnumerable <int> selectedIds = from f in db.Facilities.ToList() where f.Name == location select f.Id; patient.FirstName = model.FirstName; patient.LastName = model.LastName; patient.MiddleName = model.MiddleName; patient.IsActive = model.IsActive; patient.DateOfBirth = model.DateOfBirth; patient.AdmissionDate = model.AdmissionDate; if (model.DischargeDate != null) { patient.DischargeDate = model.DischargeDate; patient.IsActive = false; } bool isRegVisit = db.Visits.Any(u => u.PatientId == model.Id && u.VisitType == 0); if (isRegVisit && model.AdmissionDate != null) { patient.EligibileDate = Convert.ToDateTime(patient.AdmissionDate).AddDays(1); patient.DeadlineDate = Convert.ToDateTime(patient.AdmissionDate).AddDays(20); } foreach (int id in selectedIds) { patient.LocationId = id; } db.Entry(patient).State = EntityState.Modified; await db.SaveChangesAsync(); string facName = db.Patients.First(u => u.PatientId == model.Id).Facility.Name; IEnumerable <string> facilities = from fsc in db.Facilities.ToList() where fsc.IsActive select fsc.Name; var list = new SelectList(facilities.ToList(), facName); ViewBag.Facil = list; return(RedirectToAction("Patients", "Patient")); } else { //var db = new ApplicationDbContext(); string facName = db.Patients.First(u => u.PatientId == model.Id).Facility.Name; IEnumerable <string> facilities = from fsc in db.Facilities.ToList() where fsc.IsActive select fsc.Name; var list = new SelectList(facilities.ToList(), facName); ViewBag.Facil = list; // If we got this far, something failed, redisplay form return(View(model)); } } }
private void patientValidation(Patient currentPatient) { _currentPatient = currentPatient; }
} // Default constructor for serialization public Chemoprevention(Patient owner) { patientOwning = owner; }
public ActionResult AddPatient(AddPatientViewModel model, String location, String providerName) { using (var db = new ApplicationDbContext()) { if (ModelState.IsValid) { IEnumerable <int> selectId = from f in db.Facilities.ToList() where f.Name == location select f.Id; if (model.MiddleName == null) { model.MiddleName = " "; } Patient firstOrDefaultPatient = db.Patients.FirstOrDefault( u => u.FirstName == model.FirstName && u.LastName == model.LastName && u.MiddleName == model.MiddleName && u.DateOfBirth == model.DateOfBirth); if (firstOrDefaultPatient != null) { firstOrDefaultPatient.IsActive = true; } else { foreach (int id in selectId) { if (model.AdmissionDate != null && model.VisitDate != null) { db.Patients.Add(new Patient { LocationId = id, FirstName = model.FirstName, LastName = model.LastName, MiddleName = model.MiddleName, DateOfBirth = model.DateOfBirth, AdmissionDate = model.AdmissionDate, DischargeDate = null, EligibileDate = Convert.ToDateTime(model.VisitDate).AddDays(1), DeadlineDate = Convert.ToDateTime(model.VisitDate).AddDays(20), IsActive = true }); db.SaveChanges(); //------------------------------------------------------------------------- model.ProviderId = providerName; IEnumerable <string> selectedIds = from p in db.Providers.ToList() where p.User.UserName == model.ProviderId select p.ProviderId; int idPat = db.Patients.First( u => u.FirstName == model.FirstName && u.LastName == model.LastName && u.DateOfBirth == model.DateOfBirth).PatientId; foreach (string iD in selectedIds) { db.Visits.Add(new Visit { PatientId = idPat, VisitType = model.VisitType, VisitDate = model.VisitDate == null ? DateTime.Now : Convert.ToDateTime(model.VisitDate), ProviderId = iD, IsNoteComplete = false }); } //------------------------------------------------------------------------- } if (model.AdmissionDate == null && model.VisitDate != null) { db.Patients.Add(new Patient { LocationId = id, FirstName = model.FirstName, LastName = model.LastName, MiddleName = model.MiddleName, DateOfBirth = model.DateOfBirth, AdmissionDate = model.AdmissionDate, DischargeDate = null, EligibileDate = Convert.ToDateTime(model.VisitDate).AddDays(1), DeadlineDate = Convert.ToDateTime(model.VisitDate).AddDays(20), IsActive = true }); db.SaveChanges(); //------------------------------------------------------------------------- model.ProviderId = providerName; IEnumerable <string> selectedIds = from p in db.Providers.ToList() where p.User.UserName == model.ProviderId select p.ProviderId; int idPat = db.Patients.First( u => u.FirstName == model.FirstName && u.LastName == model.LastName && u.DateOfBirth == model.DateOfBirth).PatientId; foreach (string iD in selectedIds) { db.Visits.Add(new Visit { PatientId = idPat, VisitType = model.VisitType, VisitDate = model.VisitDate == null ? DateTime.Now : Convert.ToDateTime(model.VisitDate), ProviderId = iD, IsNoteComplete = false }); } } if (model.AdmissionDate != null && model.VisitDate == null) { db.Patients.Add(new Patient { LocationId = id, FirstName = model.FirstName, LastName = model.LastName, MiddleName = model.MiddleName, DateOfBirth = model.DateOfBirth, AdmissionDate = model.AdmissionDate, DischargeDate = null, EligibileDate = Convert.ToDateTime(model.AdmissionDate).AddDays(1), DeadlineDate = Convert.ToDateTime(model.AdmissionDate).AddDays(20), IsActive = true }); } if (model.AdmissionDate == null && model.VisitDate == null) { db.Patients.Add(new Patient { LocationId = id, FirstName = model.FirstName, LastName = model.LastName, MiddleName = model.MiddleName, DateOfBirth = model.DateOfBirth, AdmissionDate = model.AdmissionDate, DischargeDate = null, EligibileDate = null, DeadlineDate = null, IsActive = true }); } } } db.SaveChanges(); IEnumerable <string> facilities = from fsc in db.Facilities.ToList() where fsc.IsActive select fsc.Name; var list = new SelectList(facilities); ViewBag.Facil = list; //---------------------ADD VISIT---------------------------------- IEnumerable <string> provider = from prov in db.Providers.ToList() where prov.User.IsActive select prov.User.UserName; var listProv = new SelectList(provider.ToList()); ViewBag.Prov = listProv; //---------------------------------------------------------------- return(RedirectToAction("Patients", "Patient")); } else { IEnumerable <string> facilities = from fsc in db.Facilities.ToList() where fsc.IsActive select fsc.Name; var list = new SelectList(facilities.ToList()); ViewBag.Facil = list; //---------------------ADD VISIT---------------------------------- IEnumerable <string> provider = from prov in db.Providers.ToList() where prov.User.IsActive select prov.User.UserName; var listProv = new SelectList(provider.ToList()); ViewBag.Prov = listProv; //---------------------------------------------------------------- return(View(model)); } } }
public void InsertPatientIntoRegistration(Patient pat) { registrationLine.Add(pat); }
public void ImagingContextExample() { String ExamplePath(String prefix, Resource r) { return(Path.Combine(this.resourceDir, "..", "Examples", $"{prefix}.{r.TypeName}.{r.Id}.json")); } DocumentReference dr = new DocumentReference { Id = "ImagingContextExample", Status = DocumentReferenceStatus.Current, Subject = new ResourceReference("#Patient1"), Date = DateTimeOffset.Now }; { Patient p = new Patient { Id = "Patient1" }; p.Name.Add(new HumanName { Given = new String[] { "Bullwinkle" }, Family = "Moose" }); dr.Contained.Add(p); } dr.Content.Add(new DocumentReference.ContentComponent { Attachment = new Attachment { ContentType = "application/dicom", Data = new byte[0] } }); Extension e = new Extension { Url = Self.ImagingContextExtension.Value().Url }; dr.Extension.Add(e); { Extension studyUid = new Extension { Url = "studyUid", Value = new Oid("urn:oid:1.2.3.4.5") }; e.Extension.Add(studyUid); } //{ // Extension studyUid = new Extension // { // Url = ImageSeriesExtension.Value().Url, // Value = new Oid("urn:oid:2.25.4448") // }; // e.Extension.Add(studyUid); //} //{ // Extension instance = new Extension // { // Url = ImageInstanceExtension.Value().Url // }; // e.Extension.Add(instance); // { // Extension imageRegion = new Extension // { // Url = Self.ImageRegionExtension.Value().Url, // }; // instance.Extension.Add(imageRegion); // { // CodeSystem regionTypeCS = Self.GraphicTypeCS.Value(); // Extension regionType = new Extension // { // Url = "regionType", // Value = new Coding(regionTypeCS.Url, "POLYLINE") // }; // imageRegion.Extension.Add(regionType); // } // { // Extension coordinateList = new Extension // { // Url = "coordinates", // Value = new FhirString("105.2,276.5 89.1,352.5") // }; // imageRegion.Extension.Add(coordinateList); // } // } //} String path = ExamplePath("ImagingContext", dr); dr.SaveJson(path); }
public async Task GivenASearchParam_WhenUpdatingParam_ThenResourcesIndexedWithUpdatedParam() { Skip.If(true); var randomName = Guid.NewGuid().ToString().ComputeHash().Substring(28).ToLower(); var patient = new Patient { Name = new List <HumanName> { new HumanName { Family = randomName } } }; var searchParam = Samples.GetJsonSample <SearchParameter>("SearchParameter-Patient-foo"); searchParam.Name = randomName; searchParam.Url = searchParam.Url.Replace("foo", randomName); searchParam.Code = randomName; searchParam.Id = randomName; // POST a new patient FhirResponse <Patient> expectedPatient = await Client.CreateAsync(patient); // POST a new Search parameter FhirResponse <SearchParameter> searchParamPosted = null; try { searchParamPosted = await Client.CreateAsync(searchParam); // now update the new search parameter var randomNameUpdated = randomName + "U"; searchParamPosted.Resource.Name = randomNameUpdated; searchParamPosted.Resource.Url = "http://hl7.org/fhir/SearchParameter/Patient-" + randomNameUpdated; searchParamPosted.Resource.Code = randomNameUpdated; searchParamPosted = await Client.UpdateAsync(searchParamPosted.Resource); Uri reindexJobUri; FhirResponse <Parameters> reindexJobResult; // Reindex just a single patient, so we can try searching with a partially indexed search param (reindexJobResult, reindexJobUri) = await Client.PostReindexJobAsync(new Parameters(), $"Patient/{expectedPatient.Resource.Id}/"); Parameters.ParameterComponent param = reindexJobResult.Resource.Parameter.FirstOrDefault(p => p.Name == randomNameUpdated); if (param == null) { _output.WriteLine($"Parameter with name equal to randomly generated name of this test case: {randomNameUpdated} not found in reindex result."); } Assert.NotNull(param); Assert.Equal(randomName, param.Value.ToString()); // When job complete, search for resources using new parameter await ExecuteAndValidateBundle( $"Patient?{searchParamPosted.Resource.Code}:exact={randomName}", Tuple.Create("x-ms-use-partial-indices", "true"), expectedPatient.Resource); } catch (FhirException ex) when(ex.StatusCode == HttpStatusCode.BadRequest && ex.Message.Contains("not enabled")) { Skip.If(!_fixture.IsUsingInProcTestServer, "Reindex is not enabled on this server."); return; } catch (Exception e) { _output.WriteLine($"Exception: {e.Message}"); _output.WriteLine($"Stack Trace: {e.StackTrace}"); throw; } finally { // Clean up new SearchParameter await DeleteSearchParameterAndVerify(searchParamPosted?.Resource); } }
public async Task GivenASearchParameterWithMultipleBaseResourceTypes_WhenTargetingReindexJobToResourceType_ThenOnlyTargetedTypesAreReindexed() { var randomName = Guid.NewGuid().ToString().ComputeHash().Substring(0, 14).ToLower(); var searchParam = Samples.GetJsonSample <SearchParameter>("SearchParameter-Resource-idfoo"); searchParam.Name = searchParam.Name.Replace("foo", randomName); searchParam.Url = searchParam.Url.Replace("foo", randomName); searchParam.Code = randomName + "Code"; // POST a new appointment var appointment = Samples.GetJsonSample <Appointment>("Appointment"); FhirResponse <Appointment> expectedAppointment = await Client.CreateAsync(appointment); // POST a second appointment to show it is filtered and not returned when using the new search parameter var appointment2 = Samples.GetJsonSample <Appointment>("Appointment"); await Client.CreateAsync(appointment2); // POST a new patient var patient = new Patient { Name = new List <HumanName> { new HumanName { Family = randomName } } }; FhirResponse <Patient> expectedPatient = await Client.CreateAsync(patient); // POST a new Search parameter FhirResponse <SearchParameter> searchParamPosted = null; try { searchParamPosted = await Client.CreateAsync(searchParam); _output.WriteLine($"SearchParameter is posted {searchParam.Url}"); Uri reindexJobUri; // Start a reindex job var reindexParameters = new Parameters(); reindexParameters.Add("targetResourceTypes", new FhirString("Appointment")); (_, reindexJobUri) = await Client.PostReindexJobAsync(reindexParameters); await WaitForReindexStatus(reindexJobUri, "Completed"); FhirResponse <Parameters> reindexJobResult = await Client.CheckReindexAsync(reindexJobUri); Parameters.ParameterComponent searchParamListParam = reindexJobResult.Resource.Parameter.FirstOrDefault(p => p.Name == "searchParams"); Parameters.ParameterComponent targetResourcesParam = reindexJobResult.Resource.Parameter.FirstOrDefault(p => p.Name == JobRecordProperties.TargetResourceTypes); Parameters.ParameterComponent resourcesParam = reindexJobResult.Resource.Parameter.FirstOrDefault(p => p.Name == JobRecordProperties.Resources); // output reindex job for debugging _output.WriteLine("ReindexJobDocument:"); var serializer = new FhirJsonSerializer(); _output.WriteLine(serializer.SerializeToString(reindexJobResult.Resource)); Assert.Contains(searchParamPosted.Resource.Url, searchParamListParam.Value.ToString()); Assert.Equal("Appointment", targetResourcesParam.Value.ToString()); Assert.Equal("Appointment", resourcesParam.Value.ToString()); _output.WriteLine($"Reindex job is completed, it should have reindexed the resources of type Appointment only."); var floatParse = float.TryParse( reindexJobResult.Resource.Parameter.FirstOrDefault(predicate => predicate.Name == "resourcesSuccessfullyReindexed").Value.ToString(), out float resourcesReindexed); _output.WriteLine($"Reindex job is completed, {resourcesReindexed} resources Reindexed"); Assert.True(floatParse); Assert.True(resourcesReindexed > 0.0); // When job complete, search for resources using new parameter // When there are multiple instances of the fhir-server running, it could take some time // for the search parameter/reindex updates to propogate to all instances. Hence we are // adding some retries below to account for that delay. int retryCount = 0; bool success = true; do { success = true; retryCount++; try { await ExecuteAndValidateBundle( $"Appointment?{searchParam.Code}={expectedAppointment.Resource.Id}", Tuple.Create("x-ms-use-partial-indices", "true"), expectedAppointment.Resource); } catch (Exception ex) { _output.WriteLine($"Failed to validate bundle: {ex}"); success = false; await Task.Delay(10000); } // now searching for patient with same search parameter should not work var searchUrl = $"Patient?{searchParam.Code}={expectedPatient.Resource.Id}"; Bundle bundle = await Client.SearchAsync(searchUrl, Tuple.Create("x-ms-use-partial-indices", "true")); Assert.Empty(bundle.Entry); // finally searching with new SearchParam but without partial header should not use // new search parameter, because it should not be marked fully reindexed searchUrl = $"Patient?{searchParam.Code}={expectedPatient.Resource.Id}"; bundle = await Client.SearchAsync(searchUrl); Assert.DoesNotContain(searchParam.Code, bundle.SelfLink.ToString()); }while (!success && retryCount < 10); Assert.True(success); } catch (FhirException ex) when(ex.StatusCode == HttpStatusCode.BadRequest && ex.Message.Contains("not enabled")) { Skip.If(!_fixture.IsUsingInProcTestServer, "Reindex is not enabled on this server."); return; } catch (Exception e) { _output.WriteLine($"Exception: {e.Message}"); _output.WriteLine($"Stack Trace: {e.StackTrace}"); throw; } finally { // Clean up new SearchParameter await DeleteSearchParameterAndVerify(searchParamPosted?.Resource); } }
static void NewPatient() { Patient p = new Patient(); Console.WriteLine("Entrez nom"); p.NomPatient = Console.ReadLine(); Console.WriteLine("Entrez prénom"); p.PrenomPatient = Console.ReadLine(); Console.WriteLine("Entrez jour de naissance"); int j = Int32.Parse(Console.ReadLine()); Console.WriteLine("Entrez mois de naissance"); int m = Int32.Parse(Console.ReadLine()); Console.WriteLine("Entrez année de naissance"); int y = Int32.Parse(Console.ReadLine()); p.DateNaissance = new DateTime(y, m, j); Console.WriteLine("Entrez le genre du patient\n 1 : Homme\n 2 : Femme)"); int intSexe = Int32.Parse(Console.ReadLine()); if (intSexe == 1) { p.Sexe = "Homme"; } else { p.Sexe = "Femme"; } Console.WriteLine("adresse du patient"); p.Adresse = Console.ReadLine(); Console.WriteLine("Entrez la situation familiale\n 1 : célibataire\n 2 : marié(e))"); int intSitFamille = Int32.Parse(Console.ReadLine()); if (intSitFamille == 1) { p.SituationFamiliale = "celibataire"; } else { p.SituationFamiliale = "en couple"; } Console.WriteLine("Entrez l'assurance médicale :"); p.AssuranceMedicale = Console.ReadLine(); Console.WriteLine("Entrez le numero de téléphone :"); p.Tel = Console.ReadLine(); p.Tel_P_a_prevenir = ""; p.Codeassurance = ""; p.NomMere = ""; p.NomPere = ""; p.Nom_P_a_prevenir = ""; FacadeMetier.Add(p); }
public IActionResult AddPatient([FromBody] Patient patient) { var addedPatient = patientRepository.Add(patient); return(Ok(addedPatient)); }