Ejemplo n.º 1
0
        public ActionResult EditPersonAudit(EditPersonAuditDto model)
        {
            var dbPerson = this.COVID19Entities.People.First(x => x.Personid == model.PersonID);

            var dbPatient = dbPerson.Patients.FirstOrDefault();


            if (dbPatient == null)
            {
                dbPerson.Patients.Add(new Patient
                {
                    EffectDate = DateTime.Now
                });
                this.COVID19Entities.SaveChanges();
            }

            var dbPatientHistory = new PatientHistory
            {
                ActionID    = model.PatientActionID,
                EffectDate  = DateTime.Now,
                Datetime    = DateTime.Now,
                Observation = User.Identity.Name + " creó el nuevo registro con éxito",
                PatientID   = dbPatient.PatientID
            };

            this.COVID19Entities.PatientHistories.Add(dbPatientHistory);
            this.COVID19Entities.SaveChanges();

            return(RedirectToAction("PersonalInfo", "Person", new { id = model.PersonID }));
        }
        public List <PatientHistory> GetAllHistory(string voterId)
        {
            SqlQuery        = "SELECT * FROM view_patient_information WHERE voter_id='" + voterId + "'";
            DbSqlConnection = new SqlConnection(ConnectionString);
            DbSqlConnection.Open();
            DbSqlCommand    = new SqlCommand(SqlQuery, DbSqlConnection);
            DbSqlDataReader = DbSqlCommand.ExecuteReader();
            List <PatientHistory> patientHistories = new List <PatientHistory>();

            if (DbSqlDataReader.HasRows)
            {
                while (DbSqlDataReader.Read())
                {
                    PatientHistory aPatientHistory = new PatientHistory();
                    aPatientHistory.VoterId  = DbSqlDataReader["voter_id"].ToString();
                    aPatientHistory.Center   = DbSqlDataReader["center_name"].ToString();
                    aPatientHistory.Date     = Convert.ToDateTime(DbSqlDataReader["date"]);
                    aPatientHistory.Disease  = DbSqlDataReader["disease_name"].ToString();
                    aPatientHistory.Doctor   = DbSqlDataReader["doctor_name"].ToString();
                    aPatientHistory.Dose     = DbSqlDataReader["dose"].ToString();
                    aPatientHistory.Rule     = DbSqlDataReader["dose_rules"].ToString();
                    aPatientHistory.Medicine = DbSqlDataReader["medicine_name"] + "," + DbSqlDataReader["power"] +
                                               DbSqlDataReader["type"];
                    aPatientHistory.Observation = DbSqlDataReader["observation"].ToString();
                    aPatientHistory.Quantity    = (int)DbSqlDataReader["quantity"];
                    patientHistories.Add(aPatientHistory);
                }
            }
            DbSqlConnection.Close();
            return(patientHistories);
        }
        private void cbPatient_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cbPatient.SelectedIndex != 0)
            {
                PatientHistory objPatientHistory = new PatientHistory();
                objPatient.Firstname = cbPatient.SelectedItem.ToString().Split(' ')[0];
                objPatient.Lastname  = cbPatient.SelectedItem.ToString().Split(' ')[1];

                objPatientHistory.Patientid = objPatient.GetPatientId(objPatient);
                DataSet dsPatientHistory = objPatientHistory.GetPatientDetails(objPatientHistory);
                if (dsPatientHistory.Tables[0].Rows.Count > 0)
                {
                    lblFirstnameValue.Text      = dsPatientHistory.Tables[0].Rows[0]["PATIENT_NAME"].ToString();
                    lblAppartmentNoValue.Text   = dsPatientHistory.Tables[0].Rows[0]["ADDRESS_LINE_1"].ToString();
                    lblStreetNameValue.Text     = dsPatientHistory.Tables[0].Rows[0]["ADDRESS_LINE_2"].ToString();
                    lblCityValue.Text           = dsPatientHistory.Tables[0].Rows[0]["CITY"].ToString();
                    lblProvienceValue.Text      = dsPatientHistory.Tables[0].Rows[0]["PROVIENCE_DESCRIPTION"].ToString();
                    lblPostalCodeValue.Text     = dsPatientHistory.Tables[0].Rows[0]["POSTAL_CODE"].ToString();
                    lblDateofBirthValue.Text    = dsPatientHistory.Tables[0].Rows[0]["DOB"].ToString();
                    lblEmailValue.Text          = dsPatientHistory.Tables[0].Rows[0]["EMAIL"].ToString();
                    lblContactNoValue.Text      = dsPatientHistory.Tables[0].Rows[0]["CONTACT_NO"].ToString();
                    panelPatientDetails.Visible = true;
                    panelAppointment.Visible    = true;
                }
            }
            else
            {
                ClearPatientDetails();
            }
        }
Ejemplo n.º 4
0
        public override async Task <Diagonosis> Examine(PatientHistory history)
        {
            var vsinfo = await GetWindowsInfo();

            var sentinelFiles = new List <string>();

            foreach (var vi in vsinfo)
            {
                if (vi.Version.IsCompatible(MinimumVersion, ExactVersion))
                {
                    ReportStatus($"{vi.Version} - {vi.Path}", Status.Ok);

                    var sentinel = Path.Combine(vi.Path, "MSBuild\\Current\\Bin\\SdkResolvers\\Microsoft.DotNet.MSBuildSdkResolver\\EnableWorkloadResolver.sentinel");
                    sentinelFiles.Add(sentinel);
                }
                else
                {
                    ReportStatus($"{vi.Version}", null);
                }
            }

            if (sentinelFiles.Any())
            {
                history.AddNotes(this, "sentinel_files", sentinelFiles.ToArray());
            }

            if (vsinfo.Any(vs => vs.Version.IsCompatible(MinimumVersion, ExactVersion)))
            {
                return(Diagonosis.Ok(this));
            }

            return(new Diagonosis(Status.Error, this));
        }
Ejemplo n.º 5
0
        public async Task <dynamic> UpdatePatientHistory(object data)
        {
            return(await Task.Run(() =>
            {
                PatientHistory ph = data.ToObject <PatientHistory>();
                if (ph.Id == 0)
                {
                    PatientHistory newph = new PatientHistory();
                    newph.MedicineName = ph.MedicineName;
                    newph.Unit = ph.Unit;
                    newph.Count = ph.Count;
                    newph.Price = ph.Price;
                    newph.Date = ph.Date;
                    newph.PatientId = ph.PatientId;
                    newph.Description = ph.Description;
                    UOW.PatientHistoryRepository.Insert(newph);

                    ph.Id = newph.Id;
                }
                else
                {
                    int id = ph.Id;
                    PatientHistory src = UOW.PatientHistoryRepository.GetById(id);
                    src.MedicineName = ph.MedicineName;
                    src.Unit = ph.Unit;
                    src.Count = ph.Count;
                    src.Price = ph.Price;
                    src.Description = ph.Description;
                    UOW.PatientHistoryRepository.Update(src);
                }
                UOW.Commit();
                return ph;
            }));
        }
        public List <PatientHistory> GetTreatmentList(string voterId)
        {
            List <Treatment>      treatments       = centerGateway.GetTreatmentList(voterId);
            List <PatientHistory> patientHistories = new List <PatientHistory>();

            foreach (Treatment treatment in treatments)
            {
                PatientHistory patientHistory = new PatientHistory();
                patientHistory.CenterId = treatment.CenterId;
                Center center = centerGateway.GetCenterById(treatment.CenterId);
                patientHistory.CenterName   = center.Name;
                patientHistory.DoctorId     = treatment.DoctorId;
                patientHistory.DoctorName   = centerGateway.GetDoctorById(treatment.DoctorId).Name;
                patientHistory.DiseaseId    = treatment.DiseaseId;
                patientHistory.DiseaseName  = headGateway.GetDiseaseNamebyId(treatment.DiseaseId).Name;
                patientHistory.MedicineId   = treatment.MedicineId;
                patientHistory.MedicineName = headGateway.GetMedicineNamebyId(treatment.MedicineId).GenericName;
                patientHistory.DistrictName = headGateway.GetDistrictNameById(center.DistrictId);
                patientHistory.ThanaName    = headGateway.GetThanaNameById(center.ThanaId);
                patientHistory.Quantity     = treatment.Quantity;
                patientHistory.Note         = treatment.Note;
                patientHistory.DateTime     = (treatment.TodayDateTime).ToString();;
                patientHistories.Add(patientHistory);
            }
            return(patientHistories);
        }
Ejemplo n.º 7
0
        public override Task <Diagonosis> Examine(PatientHistory history)
        {
            var jdks = FindJdks();

            var ok = false;

            foreach (var jdk in jdks)
            {
                if ((jdk.JavaC.FullName.Contains("microsoft") || jdk.JavaC.FullName.Contains("openjdk")) &&
                    jdk.Version.IsCompatible(MinimumVersion, ExactVersion))
                {
                    ok = true;
                    ReportStatus($"{jdk.Version} ({jdk.Directory})", Status.Ok);
                    Util.SetDoctorEnvironmentVariable("JAVA_HOME", jdk.Directory.FullName);
                }
                else
                {
                    ReportStatus($"{jdk.Version} ({jdk.Directory})", null);
                }
            }

            if (ok)
            {
                return(Task.FromResult(Diagonosis.Ok(this)));
            }

            return(Task.FromResult(new Diagonosis(Status.Error, this)));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,EndDate,ReservationId,DoctorId,DiseasId,PolyclinicId")] PatientHistory patientHistory)
        {
            if (id != patientHistory.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patientHistory);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientHistoryExists(patientHistory.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DiseasId"]      = new SelectList(_context.Diseas, "Id", "Id", patientHistory.DiseasId);
            ViewData["DoctorId"]      = new SelectList(_context.Doctor, "Id", "Id", patientHistory.DoctorId);
            ViewData["PolyclinicId"]  = new SelectList(_context.Polyclinic, "Id", "Id", patientHistory.PolyclinicId);
            ViewData["ReservationId"] = new SelectList(_context.Reservation, "Id", "Id", patientHistory.ReservationId);
            return(View(patientHistory));
        }
Ejemplo n.º 9
0
        public override Task <Diagonosis> Examine(PatientHistory history)
        {
            var files = new List <string>();

            var contributingCheckupIds = new[] { "dotnet", "visualstudio" };

            foreach (var checkupId in contributingCheckupIds)
            {
                if (history.TryGetNotes <string[]>(checkupId, "sentinel_files", out var dotnetSentinelFiles) && (dotnetSentinelFiles?.Any() ?? false))
                {
                    files.AddRange(dotnetSentinelFiles);
                }
            }

            var missingFiles = new List <string>();

            foreach (var file in files.Distinct())
            {
                // Check if exists
                if (!File.Exists(file))
                {
                    missingFiles.Add(file);
                }
            }

            if (missingFiles.Any())
            {
                return(Task.FromResult(
                           new Diagonosis(Status.Error, this, new Prescription("Create EnableWorkloadResolver.sentinel files.",
                                                                               missingFiles.Select(f => new CreateFileRemedy(f)).ToArray()))));
            }

            return(Task.FromResult(Diagonosis.Ok(this)));
        }
Ejemplo n.º 10
0
        public override async Task <Diagonosis> Examine(PatientHistory history)
        {
            var vsinfo = await GetMacInfo();

            var ok = false;

            foreach (var vs in vsinfo)
            {
                if (vs.Version.IsCompatible(MinimumVersion, ExactVersion))
                {
                    ok = true;
                    ReportStatus($"Visual Studio for Mac ({vs.Version})", Status.Ok);
                }
                else
                {
                    ReportStatus($"Visual Studio for Mac ({vs.Version})", null);
                }
            }

            if (ok)
            {
                return(Diagonosis.Ok(this));
            }

            return(new Diagonosis(Status.Error, this));
        }
Ejemplo n.º 11
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (valid())
            {
                PatientHistory objPatientHistory = new PatientHistory();
                objPatient.Firstname = cbPatient.SelectedItem.ToString().Split(' ')[0];
                objPatient.Lastname  = cbPatient.SelectedItem.ToString().Split(' ')[1];

                objPatientHistory.Patientid = objPatient.GetPatientId(objPatient);
                DataSet dsPatientHistory = objPatientHistory.GetPatientDetails(objPatientHistory);
                //dgvPatientHistory.DataSource = dsPatientHistory.Tables[0];
                DataTable dtPatientHistory = new DataTable("PATIENT_HISTORY");
                dtPatientHistory.Columns.Add("APPOINTMENT_ID");
                dtPatientHistory.Columns.Add("APPOINTMENT_DATE");
                dtPatientHistory.Columns.Add("PROCEDURE_DESCRIPTION");
                dtPatientHistory.Columns.Add("PAID");

                for (int i = 0; i < dsPatientHistory.Tables[0].Rows.Count; i++)
                {
                    DataRow row = dtPatientHistory.NewRow();
                    row["APPOINTMENT_ID"]        = dsPatientHistory.Tables[0].Rows[i]["APPOINTMENT_ID"].ToString();
                    row["APPOINTMENT_DATE"]      = dsPatientHistory.Tables[0].Rows[i]["APPOINTMENT_DATE"].ToString();
                    row["PROCEDURE_DESCRIPTION"] = dsPatientHistory.Tables[0].Rows[i]["PROCEDURE_DESCRIPTION"].ToString();
                    row["PAID"] = dsPatientHistory.Tables[0].Rows[i]["PAID"].ToString();
                    dtPatientHistory.Rows.Add(row);
                }
                dgvPatientHistory.DataSource = dtPatientHistory;
            }
        }
        public async Task <ActionResult> CreatePatientHistory([FromBody] PatientHistoryModel patientHistory)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            var instance = PatientHistory.Create(patientHistory.PatientId);

            try
            {
                var newPatientHistory = await _repository.AddAsync(instance);

                if (newPatientHistory == null)
                {
                    return(BadRequest(new ApiResponse {
                        Status = false
                    }));
                }
                return(CreatedAtRoute("GetPatientHistoryRoute", new { id = newPatientHistory.HistoryId },
                                      new ApiResponse {
                    Status = true, PatientHistory = newPatientHistory
                }));
            }
            catch
            {
                return(BadRequest(new ApiResponse {
                    Status = false
                }));
            }
        }
Ejemplo n.º 13
0
        /// <summary>
        /// 根据数据绑定病史类
        /// </summary>
        /// <returns>病史类</returns>
        public PatientHistory GetPatientHistory()
        {
            PatientHistory ph = new PatientHistory();

            ph.PatientID      = FocusPatientID;
            ph.MensesFirstAge = MensesFirstAge;
            ph.Cycle          = Cycle;
            ph.LastDate       = LastDate;
            ph.LastAge        = LastAge;
            ph.FirstSexAge    = FirstSexAge;
            ph.PrimiparityAge = PrimiparityAge;
            ph.PregnancyNum   = PregnancyNum;
            ph.BirthNum       = BirthNum;
            ph.Suckle         = Suckle;
            ph.Contraception  = Contraception;
            ph.Severity       = Severity;
            ph.CIN            = CIN;
            ph.Stage          = Stage;
            ph.TreatWay       = TreatWay;
            ph.TreatDate      = TreatDate;
            ph.TumourHistory  = TumourHistory;
            ph.TumourPart     = TumourPart;
            ph.LeucorrheaNum  = LeucorrheaNum;
            ph.Hemolysis      = Hemolysis;
            ph.Waist          = Waist;
            return(ph);
        }
Ejemplo n.º 14
0
 public static PatientHistory[] GetByPatientID(int patient_id)
 {
     DataTable tbl = GetDataTable_ByPatientID(patient_id);
     PatientHistory[] list = new PatientHistory[tbl.Rows.Count];
     for (int i = 0; i < tbl.Rows.Count; i++)
         list[i] = LoadAll(tbl.Rows[i]);
     return list;
 }
 private void btnBookAppointment_Click(object sender, EventArgs e)
 {
     if (valid())
     {
         Patient objPatient = new Patient();
         objPatient.Firstname              = txtFirstname.Text;
         objPatient.Lastname               = txtLastname.Text;
         objPatient.Addresslineone         = txtAppartmentNo.Text;
         objPatient.Addresslinetwo         = txtStreet.Text;
         objPatient.City                   = txtCity.Text;
         objProvience.ProvienceDescription = cbProvience.SelectedItem.ToString();
         objPatient.ProvienceId            = objProvience.GetProvienceId(objProvience);
         objPatient.Postalcode             = txtPostalCode.Text;
         objPatient.Dob         = dtDateofbirth.Value;
         objPatient.Email       = txtEmail.Text;
         objPatient.Contactno   = txtContactNo.Text;
         objPatient.Datecreated = System.DateTime.Now;
         objPatient.Createdby   = this.sessionKey;
         int patientid = objPatient.InsertPatient(objPatient);
         if (patientid > 0)
         {
             objDoctor.Firstname = cbDoctor.SelectedItem.ToString().Split(' ')[0];
             objDoctor.Lastname  = cbDoctor.SelectedItem.ToString().Split(' ')[1];
             int doctorid = objDoctor.GetDoctorId(objDoctor);
             if (doctorid > 0)
             {
                 Appointment objAppointment = new Appointment();
                 objAppointment.Patientid       = patientid;
                 objAppointment.Doctorid        = doctorid;
                 objAppointment.Appointmentdate = dtAppointmentDate.Value;
                 objAppointment.Appointmenttime = cbAppointmentTime.SelectedItem.ToString();
                 objAppointment.Datecreated     = System.DateTime.Now;
                 objAppointment.Createdby       = this.sessionKey;
                 int appointmentid = objAppointment.InsertAppointment(objAppointment);
                 if (appointmentid > 0)
                 {
                     for (int i = 0; i < lbProcedureList.SelectedItems.Count; i++)
                     {
                         PatientHistory objPatientHistory = new PatientHistory();
                         objPatientHistory.Patientid       = patientid;
                         objPatientHistory.Appointmentid   = appointmentid;
                         objPatientHistory.Doctorid        = doctorid;
                         objProcedure.Proceduredescription = lbProcedureList.SelectedItems[i].ToString();
                         objPatientHistory.Procedureid     = objProcedure.GetProcedureId(objProcedure);
                         objPatientHistory.Datecreated     = System.DateTime.Now;
                         objPatientHistory.Createdby       = this.sessionKey;
                         int patienthistoryid = objPatientHistory.InsertPatientHistory(objPatientHistory);
                     }
                 }
             }
         }
         DisplayMessage("Appointment Booked.", "Successful..!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         Clear();
     }
 }
Ejemplo n.º 16
0
 public async Task <dynamic> DeleteMedicineHistory(object data)
 {
     return(await Task.Run(() =>
     {
         int id = int.Parse(data.ToString());
         PatientHistory ph = UOW.PatientHistoryRepository.GetById(id);
         UOW.PatientHistoryRepository.Delete(ph);
         UOW.Commit();
         return 1;
     }));
 }
Ejemplo n.º 17
0
    public static PatientHistory[] GetByPatientID(int patient_id)
    {
        DataTable tbl = GetDataTable_ByPatientID(patient_id);

        PatientHistory[] list = new PatientHistory[tbl.Rows.Count];
        for (int i = 0; i < tbl.Rows.Count; i++)
        {
            list[i] = LoadAll(tbl.Rows[i]);
        }
        return(list);
    }
Ejemplo n.º 18
0
    public static PatientHistory LoadAll(DataRow row)
    {
        PatientHistory p = Load(row);

        p.Title = IDandDescrDB.Load(row, "title_id", "descr");

        p.ModifiedFromThisBy              = StaffDB.Load(row, "staff_person_");
        p.ModifiedFromThisBy.Person       = PersonDB.Load(row, "staff_person_");
        p.ModifiedFromThisBy.Person.Title = IDandDescrDB.Load(row, "title_staff_title_id", "title_staff_descr");

        return(p);
    }
        public async Task <IActionResult> Create([Bind("Id,StartDate,ReservationId,PatientId,DiseasId,Complaint,Medication")] HistoryCreateVM modell)
        {
            bool isValidd = true;
            int  userId   = Convert.ToInt32(User.FindFirst(ClaimTypes.NameIdentifier).Value);
            var  docc     = await _context.Doctor.FirstOrDefaultAsync(x => x.UserId == userId);

            if (docc == null)
            {
                ModelState.AddModelError(string.Empty, "Doctor Does Not Exist!");
                isValidd = false;
            }

            if (ModelState.IsValid && isValidd)
            {
                var model = new PatientHistory
                {
                    DiseasId      = modell.DiseasId,
                    DoctorId      = docc.Id,
                    EndDate       = DateTime.Now,
                    PolyclinicId  = docc.PolyclinicId,
                    ReservationId = modell.ReservationId,
                    StartDate     = modell.StartDate,
                    PatientId     = modell.PatientId,
                    Complaint     = modell.Complaint
                };
                await _context.PatientHistory.AddAsync(model);

                await _context.SaveChangesAsync();

                List <PatientHistoryMedication> med = new List <PatientHistoryMedication>();
                foreach (var item in modell.Medication)
                {
                    med.Add(new PatientHistoryMedication {
                        MedicationId = item, PatientHistoryId = model.Id
                    });
                }
                await _context.PatientHistoryMedication.AddRangeAsync(med);

                await _context.SaveChangesAsync();

                var ress = await _context.Reservation.FirstOrDefaultAsync(x => x.Id == modell.ReservationId);

                ress.IsCompleted = true;
                _context.Reservation.Update(ress);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }

            ViewData["DiseasId"]     = new SelectList(_context.Diseas, "Id", "Name");
            ViewData["MedicationId"] = _context.Medication.ToList();
            return(View(modell));
        }
Ejemplo n.º 20
0
        public static List <PatientHistory> Patienthistory(PatientHistory PatientHistory)
        {
            DataValue dv = new DataValue();

            dv.Add("@FROMDATE", PatientHistory.FROMDATE, EnumCommand.DataType.Varchar);
            dv.Add("@TODATE", PatientHistory.TODATE, EnumCommand.DataType.Varchar);
            dv.Add("@OrgID", PatientHistory.OrgID, EnumCommand.DataType.Varchar);
            dv.Add("@P_KEY", PatientHistory.P_KEY, EnumCommand.DataType.Varchar);
            var Patienthistory = (List <PatientHistory>)SQLHelper.FetchData <PatientHistory>(Common.Queries.SP_PatientHistory, EnumCommand.DataSource.list, dv).DataSource.Data;

            return(Patienthistory);
        }
        public void TestNumberOfTransaction()
        {
            //Arrange
            var patient  = new NationalPatient(4532, "James", "Smith");
            var p        = new PatientHistory();
            var jaundise = new Disease("Jaundice", true);

            //Act
            p.AddPatientTransaction(patient, new DateTime(2014, 12, 26), jaundise);

            //Assert
            Assert.AreEqual(1, p.NumberOfTransactions());
        }
        public void TestTransactionsDetailForDateNotMatchDate()
        {
            //Arrange
            var patient  = new NationalPatient(4532, "James", "Smith");
            var p        = new PatientHistory();
            var jaundise = new Disease("Jaundice", true);

            //Act
            p.AddPatientTransaction(patient, new DateTime(2014, 12, 26), jaundise);

            //Assert
            Assert.IsFalse(p.CheckTransactionLogAvailability(patient, new DateTime(2042, 09, 21)));
        }
        public void TestTransactionDiseaseLog()
        {
            //Arrange
            var patient = new NationalPatient(4532, "James", "Smith");
            var p       = new PatientHistory();
            var cancer  = new Disease("Cancer", true);

            // Act
            p.AddPatientTransaction(patient, new DateTime(2015, 12, 26), cancer);

            //Assert
            Assert.AreEqual("Cancer", p.ReturnDiseaseLog(patient, new DateTime(2015, 12, 26)));
        }
Ejemplo n.º 24
0
        public void AddCheckPatient_本系统插入一条检查病人数据_返回bool()
        {
            string         patientNO      = "1004";
            RegisteModel   regModel       = new RegisteModel();
            DataTable      data           = regModel.GetHISPatientByNO(patientNO);
            int            registeBy      = 1002;
            string         admissionsType = "检查病人";
            PatientHistory ph             = new PatientHistory();

            ph.TreatDate = DateTime.Now;
            bool bol = regModel.AddCheckPatient(data, registeBy, admissionsType, ph);

            Assert.IsTrue(bol, "插入失败");
        }
        public void TestPatientID_Detail()
        {
            // Arrange
            var patient = new InternationalPatient(25495, "James", "Smith");
            var aids    = new Disease("AIDS", false);
            var history = new PatientHistory();
            var date    = new DateTime(2015, 11, 26);

            // Act
            history.AddPatientTransaction(patient, date, aids);

            // Assert
            Assert.AreEqual(25495, history.ReturnPatientDetails(date, aids).PatientID);
        }
Ejemplo n.º 26
0
        public override async Task <Diagonosis> Examine(PatientHistory history)
        {
            var installedWorkloads = workloadManager.GetInstalledWorkloads();

            var missingWorkloads = new List <Manifest.DotNetWorkload>();

            var requiredPacks = new List <WorkloadResolver.PackInfo>();

            foreach (var rp in RequiredWorkloads)
            {
                if (!installedWorkloads.Any(sp => sp == rp.Id))
                {
                    ReportStatus($"{rp.Id} not installed.", Status.Error);
                    missingWorkloads.Add(rp);
                }
                else
                {
                    ReportStatus($"{rp.Id} installed.", Status.Ok);

                    var workloadPacks = workloadManager.GetPacksInWorkload(rp.Id);

                    if (workloadPacks != null && workloadPacks.Any())
                    {
                        foreach (var wp in workloadPacks)
                        {
                            if (!(rp.IgnoredPackIds?.Any(ip => ip.Equals(wp.Id, StringComparison.OrdinalIgnoreCase)) ?? false))
                            {
                                requiredPacks.Add(wp);
                            }
                        }
                    }
                }
            }

            if (requiredPacks.Any())
            {
                history.AddNotes(this, "required_packs", requiredPacks.ToArray());
            }

            if (!missingWorkloads.Any())
            {
                return(Diagonosis.Ok(this));
            }

            return(new Diagonosis(
                       Status.Error,
                       this,
                       new Prescription("Install Missing SDK Workloads",
                                        new DotNetWorkloadInstallRemedy(SdkRoot, SdkVersion, missingWorkloads.ToArray(), NuGetPackageSources))));
        }
Ejemplo n.º 27
0
        public bool deletePatientHistory(int patientHistorytID)
        {
            int count = 0;

            using (Entities.Entities ctx = new Entities.Entities())
            {
                PatientHistory patientHistory = ctx.PatientHistories.Find(patientHistorytID);
                if (patientHistory != null)
                {
                    ctx.PatientHistories.Remove(patientHistory);
                    count = ctx.SaveChanges();
                }
            }
            return(count > 0 ? true : false);
        }
Ejemplo n.º 28
0
 public JsonResult FetchPatienthistory(PatientHistory PatientHistory)
 {
     try
     {
         PatientHistory.P_KEY          = "GV";
         PatientHistory.OrgID          = Session[Common.SESSION_VARIABLES.COMPANYCODE].ToString();
         PatientHistory.CreatedBy      = Session[Common.SESSION_VARIABLES.USERNAME].ToString();
         objViewModel.lipatienthistory = ReportsViewModel.Patienthistory(PatientHistory);
         return(Json(objViewModel, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         return(Json(ex));
     }
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (valid())
     {
         PatientHistory objPatientHistory = new PatientHistory();
         objPatientHistory.Paid          = "Y";
         objPatientHistory.Datemodified  = System.DateTime.Now;
         objPatientHistory.Modifiedby    = this.sessionKey;
         objPatientHistory.Appointmentid = Convert.ToInt32(cbAppointmentDetails.SelectedItem.ToString().Split('|')[0].Trim());
         objPatientHistory.UpdatePatientHistory(objPatientHistory);
         DisplayMessage("Payment Done.", "Successful..!!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button2);
         ClearAppointmentDetails();
         Clear();
         objAppointment.GetAppointmentList(cbAppointmentDetails);
     }
 }
Ejemplo n.º 30
0
        public bool addNewPatinetHistory(PatientHistoryViewModel patientHistory)
        {
            int count = 0;

            using (Entities.Entities ctx = new Entities.Entities())
            {
                PatientHistory patientHistoryEntity = ctx.PatientHistories.Create();
                patientHistoryEntity.PatientID    = patientHistory.PatientID;
                patientHistoryEntity.Name         = patientHistory.Name;
                patientHistoryEntity.Descripation = patientHistory.Descripation;

                ctx.PatientHistories.Add(patientHistoryEntity);
                count = ctx.SaveChanges();
            }
            return(count > 0 ? true : false);
        }
Ejemplo n.º 31
0
        public override async Task <Diagonosis> Examine(PatientHistory history)
        {
            var info = await GetInfo();

            if (NuGetVersion.TryParse(info.Version?.ToString(), out var semVer))
            {
                if (semVer.IsCompatible(MinimumVersion, ExactVersion))
                {
                    ReportStatus($"XCode.app ({info.Version} {info.Build})", Status.Ok);
                    return(Diagonosis.Ok(this));
                }
            }

            ReportStatus($"XCode.app ({info.Version}) not installed.", Status.Error);

            return(new Diagonosis(Status.Error, this, new Prescription($"Download XCode {MinimumVersion.ThisOrExact(ExactVersion)}")));
        }