Example #1
0
 //Generate random patient type based on 3 patient type reneging,normal,emergency(ambulance)
 public PatientType RandomPatientType()
 {
     //if(RandomClass.willRenege()){
     //    return PatientType.Reneging;
     //}
     return((PatientType)(UnityEngine.Random.Range(1, PatientType.GetNames(typeof(PatientType)).Length)));
 }
        public async Task <IActionResult> Edit(int id, [Bind("PatientTypeId,Name")] PatientType patientType)
        {
            if (id != patientType.PatientTypeId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(patientType);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PatientTypeExists(patientType.PatientTypeId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(patientType));
        }
Example #3
0
    protected int PatientToNumber(PatientType type) //gives the number of the room the patient is in.
    {
        int result = 0;

        switch (type)
        {
        case PatientType.adult:
            result = 306;
            break;

        case PatientType.child:
            result = 305;
            break;

        case PatientType.pregnant:
            result = 304;
            break;

        case PatientType.senior:
            result = 307;
            break;

        default:
            result = -1;
            break;
        }
        return(result);
    }
        public bool Save(PatientType obj)
        {
            Connect();
            SqlCommand cmd = new SqlCommand("IUPatientType1", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@HospitalID", HospitalID);
            cmd.Parameters.AddWithValue("@LocationID", LocationID);
            if (obj.PatientTypeID == "" || obj.PatientTypeID == null)
            {
                cmd.Parameters.AddWithValue("@PatientTypeID", 0);
                cmd.Parameters.AddWithValue("@Mode", "Add");
            }
            else
            {
                cmd.Parameters.AddWithValue("@PatientTypeID", obj.PatientTypeID);
                cmd.Parameters.AddWithValue("@Mode", "Edit");
            }
            cmd.Parameters.AddWithValue("@PatientType", obj.PatientTypeName);

            cmd.Parameters.AddWithValue("@CreationID", UserID);
            con.Open();
            int i = cmd.ExecuteNonQuery();

            con.Close();
            if (i > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #5
0
 public Patient(Guid id, string name, string email, DateTime registrationDate, PatientType patientType)
 {
     Id               = id;
     Name             = name;
     Email            = email;
     RegistrationDate = registrationDate;
     PatientType      = patientType;
 }
        public static CertAndHeaderInfo Get(string certSerial, string serialHPIO, PatientType patientType)
        {
            var result = new CertAndHeaderInfo();

            result.Certificate = Support.CertificateHelper.GetCertificate(certSerial);
            result.Header      = Support.PcehrHeaderHelper.CreateHeader(patientType, serialHPIO);
            return(result);
        }
Example #7
0
        public IEnumerable <Patient> GetPatientByType(PatientType patientType)
        {
            var doctors  = _doctorRepository.GetAllEager();
            var patients = GetAll().Where(patient => patient.PatientType == patientType);

            patients.ToList().ForEach(patient => patient.SelectedDoctor = GetDoctorByID(patient.SelectedDoctor, doctors));

            return(patients);
        }
Example #8
0
 public PatientModel(int pid, string firstName, string lastName, string emailID, string pwd,
                     DateTime dateOfBirth, string securityQn, string securityAns, string phone, string address,
                     string gender, bool isActive, PatientType patientType)
 //: base(pid, firstName, lastName, emailID, pwd,
 //dateOfBirth, securityQn, securityAns, phone, address,
 //gender, isActive)
 {
     //this.patientType = patientType;
 }
        //public static string UploadingHPIO = "8003629900019338";

        public static CommonPcehrHeader CreateHeader(PatientType patientType, string uploadingHPIO)
        {
            var    pcehrHeader = new CommonPcehrHeader();
            string PatientName = string.Empty;

            switch (patientType)
            {
            case PatientType.FrankHarding:
                PatientName           = "Frank Harding";
                pcehrHeader.IhiNumber = "8003608666701594";
                break;

            case PatientType.CalebDerrington:
                PatientName           = "Caleb Derrington";
                pcehrHeader.IhiNumber = "8003608000045922";
                break;

            case PatientType.JackieHunt:
                PatientName           = "Jackie Hunt";
                pcehrHeader.IhiNumber = "8003608500179916";
                break;

            case PatientType.MaxwellThomas:
                PatientName           = "Maxwell Thomas";
                pcehrHeader.IhiNumber = "8003608666889084";
                break;

            case PatientType.LudwigHOBBS:
                PatientName           = "Ludwig HOBBS";
                pcehrHeader.IhiNumber = "8003608333345684";
                break;

            case PatientType.LarryBLAKE:
                PatientName           = "Larry BLAKE";
                pcehrHeader.IhiNumber = "8003608833499130";
                break;

            case PatientType.AliceLAMM:
                PatientName           = "Alice LAMM";
                pcehrHeader.IhiNumber = "8003608000166041";
                break;

            case PatientType.MarieVOSLOO:
                PatientName           = "Marie VOSLOO";
                pcehrHeader.IhiNumber = "8003608333357747";
                break;

            default:
                break;
            }

            Console.WriteLine($"-Patient--------------------------------------------------------------");
            Console.WriteLine($"Name: {PatientName}");
            Console.WriteLine($"IHI: {pcehrHeader.IhiNumber}");
            Console.WriteLine($"----------------------------------------------------------------------");
            return(Common(pcehrHeader, uploadingHPIO));
        }
Example #10
0
    //Following added by stefan

    public Patient(Patient patient)  //this constructor will clone another patient
    {
        this.mID        = patient.mID;
        this.mName      = patient.mName;
        this.mAge       = patient.mAge;
        this.mWeight    = patient.mWeight;
        this.mType      = patient.mType;
        this.mSex       = patient.mSex;
        this.mAllergies = patient.mAllergies;
    }
Example #11
0
        public PatientBase GetRandomPatient(PatientType _type)
        {
            PatientDataHolder dataHolder = GetPatientData(_type);

            if (dataHolder == null)
            {
                return(null);
            }
            return(dataHolder.GetRandomPatient());
        }
Example #12
0
 public ActionResult Edit([Bind(Include = "TypeID,TypeName,deleted")] PatientType patientType)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patientType).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(patientType));
 }
        public ActionResult PatientType(PatientType obj, FormCollection fc)
        {
            BL_PatientType objPatient = new BL_PatientType();

            try
            {
                //if (obj.PatientTypeID == null || obj.PatientTypeID == "" )
                //{
                //    obj.PatientTypeID ="0";
                //}
                //else
                //{
                //    obj.PatientTypeID = (fc["PatientTypeID"]).ToString();
                //}
                //if (fc["PatientTypeName"].ToString() == null || fc["PatientTypeName"].ToString() == "")
                //{
                //    obj.PatientTypeName = "";
                //}
                //else
                //{
                //    obj.PatientTypeName = fc["PatientTypeName"].ToString();
                //}
                if (objPatient.CheckPatientType(obj.PatientTypeID, obj.PatientTypeName))
                {
                    if (objPatient.Save(obj))
                    {
                        if (Convert.ToInt32(obj.PatientTypeID) > 0)
                        {
                            ModelState.Clear();
                            TempData["Msg"] = "PatientType Update Successfully";
                            return(RedirectToAction("PatientType", "PatientType"));
                        }
                        else
                        {
                            ModelState.Clear();
                            TempData["Msg"] = "PatientType Saved Successfully";
                            return(RedirectToAction("PatientType", "PatientType"));
                        }
                    }
                }
                else
                {
                    //TempData["Msg"] = "Error";
                    TempData["Msg"] = "PatientType Already Exist's";
                    return(RedirectToAction("PatientType", "PatientType"));
                }

                return(RedirectToAction("PatientType", "PatientType"));
            }
            catch (Exception ex)
            {
                TempData["Msg"] = ex.Message;
                return(RedirectToAction("PatientType", "PatientType"));
            }
        }
        public async Task <IActionResult> Create([Bind("PatientTypeId,Name")] PatientType patientType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(patientType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(patientType));
        }
Example #15
0
        public ActionResult Create([Bind(Include = "TypeID,TypeName,deleted")] PatientType patientType)
        {
            if (ModelState.IsValid)
            {
                patientType.deleted = "0";
                db.PatientTypes.Add(patientType);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(patientType));
        }
Example #16
0
        /// <inheritdoc/>
        public string ToDelimitedString()
        {
            CultureInfo culture = CultureInfo.CurrentCulture;

            return(string.Format(
                       culture,
                       StringHelper.StringFormatSequence(0, 44, Configuration.FieldSeparator),
                       Id,
                       SetIdFt1.HasValue ? SetIdFt1.Value.ToString(culture) : null,
                       TransactionId,
                       TransactionBatchId,
                       TransactionDate?.ToDelimitedString(),
                       TransactionPostingDate.HasValue ? TransactionPostingDate.Value.ToString(Consts.DateTimeFormatPrecisionSecond, culture) : null,
                       TransactionType?.ToDelimitedString(),
                       TransactionCode?.ToDelimitedString(),
                       TransactionDescription,
                       TransactionDescriptionAlt,
                       TransactionQuantity.HasValue ? TransactionQuantity.Value.ToString(Consts.NumericFormat, culture) : null,
                       TransactionAmountExtended?.ToDelimitedString(),
                       TransactionAmountUnit?.ToDelimitedString(),
                       DepartmentCode?.ToDelimitedString(),
                       HealthPlanId?.ToDelimitedString(),
                       InsuranceAmount?.ToDelimitedString(),
                       AssignedPatientLocation?.ToDelimitedString(),
                       FeeSchedule?.ToDelimitedString(),
                       PatientType?.ToDelimitedString(),
                       DiagnosisCodeFt1 != null ? string.Join(Configuration.FieldRepeatSeparator, DiagnosisCodeFt1.Select(x => x.ToDelimitedString())) : null,
                       PerformedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, PerformedByCode.Select(x => x.ToDelimitedString())) : null,
                       OrderedByCode != null ? string.Join(Configuration.FieldRepeatSeparator, OrderedByCode.Select(x => x.ToDelimitedString())) : null,
                       UnitCost?.ToDelimitedString(),
                       FillerOrderNumber?.ToDelimitedString(),
                       EnteredByCode != null ? string.Join(Configuration.FieldRepeatSeparator, EnteredByCode.Select(x => x.ToDelimitedString())) : null,
                       ProcedureCode?.ToDelimitedString(),
                       ProcedureCodeModifier != null ? string.Join(Configuration.FieldRepeatSeparator, ProcedureCodeModifier.Select(x => x.ToDelimitedString())) : null,
                       AdvancedBeneficiaryNoticeCode?.ToDelimitedString(),
                       MedicallyNecessaryDuplicateProcedureReason?.ToDelimitedString(),
                       NdcCode?.ToDelimitedString(),
                       PaymentReferenceId?.ToDelimitedString(),
                       TransactionReferenceKey != null ? string.Join(Configuration.FieldRepeatSeparator, TransactionReferenceKey.Select(x => x.ToString(Consts.NumericFormat, culture))) : null,
                       PerformingFacility != null ? string.Join(Configuration.FieldRepeatSeparator, PerformingFacility.Select(x => x.ToDelimitedString())) : null,
                       OrderingFacility?.ToDelimitedString(),
                       ItemNumber?.ToDelimitedString(),
                       ModelNumber,
                       SpecialProcessingCode != null ? string.Join(Configuration.FieldRepeatSeparator, SpecialProcessingCode.Select(x => x.ToDelimitedString())) : null,
                       ClinicCode?.ToDelimitedString(),
                       ReferralNumber?.ToDelimitedString(),
                       AuthorizationNumber?.ToDelimitedString(),
                       ServiceProviderTaxonomyCode?.ToDelimitedString(),
                       RevenueCode?.ToDelimitedString(),
                       PrescriptionNumber,
                       NdcQtyAndUom?.ToDelimitedString()
                       ).TrimEnd(Configuration.FieldSeparator.ToCharArray()));
        }
Example #17
0
    public Patient() // == unknown patient
    {
        mID   = 0;
        mName = "John Doe";

        mAge       = 45;
        mWeight    = 80;
        mSex       = Sex.male;
        mAllergies = new List <string>();

        mType = PatientType.adult;
    }
Example #18
0
        // GET: PatientTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientType patientType = db.PatientTypes.Find(id);

            if (patientType == null)
            {
                return(HttpNotFound());
            }
            return(View(patientType));
        }
Example #19
0
    //create each patient with patient type and give them global timestamp which will tell how long each patient waiting.
    public Patient(PatientType patType, float waitingFor)
    {
        this.patientType = patType.ToString();
        this.waitingFor  = waitingFor;
        this.willRenege  = RandomClass.willRenege();

        //If the patient type is normal then their treatment time will be 5 min to 15 min
        if (this.patientType == PatientType.Normal.ToString())
        {
            //set treatmentTime to random Time
        }
        //If the patient type is emergeny then their treatment time will be 20 min to 45 min
        if (this.patientType == PatientType.Emergency.ToString())
        {
        }
    }
        public override T ObjectConvert <T, U>(U entity)
        {
            PatientType patientType = entity as PatientType;

            if (patientType == null)
            {
                return(default(T));
            }

            BO.Common.PatientType boPatType = new BO.Common.PatientType();

            boPatType.ID = patientType.Id;
            boPatType.PatientTypeText = patientType.PatientTypeText;
            boPatType.IsDeleted       = patientType.IsDeleted;

            return((T)(object)boPatType);
        }
Example #21
0
 public PersonModel(int pid, string firstName, string lastName, string emailID, string pwd,
                    DateTime dateOfBirth, string securityQn, string securityAns, string phone, string address,
                    string gender, bool isActive, PatientType patientType)
 {
     this.pid         = pid;
     this.firstName   = firstName;
     this.lastName    = lastName;
     this.emailID     = emailID;
     this.pwd         = pwd;
     this.dateOfBirth = dateOfBirth;
     this.securityQn  = this.securityQn;
     this.securityAns = securityAns;
     this.phone       = phone;
     this.address     = address;
     this.gender      = gender;
     this.isActive    = isActive;
     this.patientType = patientType;
 }
Example #22
0
        public Pagination <Domain.EntityViews.Patient.Patient> List(
            Guid?userId,
            PatientType type,
            int start,
            int end,
            Guid?facilityId      = null,
            string firstName     = null,
            string lastName      = null,
            string dateOfBirth   = null,
            string gender        = null,
            string race          = null,
            string medicalScheme = null,
            bool superAdmin      = false)
        {
            HasToBeAuthenticated();

            return(_patientService.List(userId, facilityId, type, start, end, firstName, lastName, dateOfBirth, gender, race, medicalScheme, superAdmin));
        }
Example #23
0
        private void readPatientChancesTable(string rawText)
        {
            string[] lines = Regex.Split(getTableText(rawText, "patientChances"), ",");
            for (int i = 0; i < lines.Length - 1; i++)
            {
                PatientType type = new PatientType();

                string[] parameters = Regex.Split(lines[i], "=");
                string   name       = parameters[0];
                type.chance = 0; // Int32.Parse(parameters[1]);

                string imagePath = m_DataFolderPath + @"images\patients\" + @name + @"\sel.png";
                if (File.Exists(imagePath))
                {
                    Bitmap img = new Bitmap(imagePath);
                    img = img.Clone(new Rectangle(0, 0, img.Width, img.Width), img.PixelFormat);

                    type.image = new Bitmap(img);
                }
                m_PatientTypes.Add(type);
            }
        }
Example #24
0
 public Patient(string userName,
                string password,
                string name,
                string surname,
                string middleName,
                Sex sex,
                DateTime dateOfBirth,
                string uidn,
                Address address,
                string homePhone,
                string cellPhone,
                string email1,
                string email2,
                EmergencyContact emergencyContact,
                PatientType patientType,
                Doctor selectedDoctor)
     : base(userName, password, name, surname, middleName, sex, dateOfBirth, uidn, address, homePhone, cellPhone, email1, email2)
 {
     _patientType      = patientType;
     _selectedDoctor   = selectedDoctor;
     _emergencyContact = emergencyContact;
 }
        public PatientType GetPatientType(int PatientTypeID)
        {
            Connect();
            PatientType obj = new PatientType();

            SqlCommand cmd = new SqlCommand("GetPatientType1", con);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@PatientTypeID", PatientTypeID));
            SqlDataAdapter sd = new SqlDataAdapter(cmd);
            DataTable      dt = new DataTable();

            con.Open();
            sd.Fill(dt);
            con.Close();
            foreach (DataRow dr in dt.Rows)
            {
                obj.PatientTypeID   = (dr["PatientTypeID"]).ToString();
                obj.PatientTypeName = Convert.ToString(dr["PatientType"]);
            }

            return(obj);
        }
        /// <summary>
        /// Gets the name.
        /// </summary>
        /// <param name="patientType">Type of the patient.</param>
        /// <returns></returns>
        public static string GetName(PatientType patientType)
        {
            string name = PatientTypeConstants.Normal;

            switch (patientType)
            {
            case PatientType.Priority6:
                name = PatientTypeConstants.Priority6;
                break;

            case PatientType.Priority80:
                name = PatientTypeConstants.Priority80;
                break;

            case PatientType.PriorityCode:
                name = PatientTypeConstants.PriorityCode;
                break;

            case PatientType.PriorityKT:
                name = PatientTypeConstants.PriorityKT;
                break;

            case PatientType.PriorityBN:
                name = PatientTypeConstants.PriorityBN;
                break;

            case PatientType.PriorityGT:
                name = PatientTypeConstants.PriorityGT;
                break;

            case PatientType.PriorityCT:
                name = PatientTypeConstants.PriorityCT;
                break;
            }

            return(name.ToUpper());
        }
Example #27
0
        public void Execute(UpdatePatientModel model)
        {
            var dateOfBirth  = PatientDateOfBirth.Create(model.DateOfBirth);
            var sex          = PatientSex.Create(model.Sex);
            var patientType  = PatientType.Create(model.PatientType);
            var firstName    = PatientFirstName.Create(model.FirstName);
            var middleName   = PatientMiddleName.Create(model.MiddleName);
            var lastName     = PatientLastName.Create(model.LastName);
            var occupation   = PatientOccupation.Create(model.Occupation);
            var placeOfBirth = PatientPlaceOfBirth.Create(model.PlaceOfBirth);

            var patient = _databaseService.PatientsRepository.GetById(model.Id);

            patient.FirstName    = firstName;
            patient.MiddleName   = middleName;
            patient.LastName     = lastName;
            patient.DateOfBirth  = dateOfBirth;
            patient.PatientType  = patientType;
            patient.Occupation   = occupation;
            patient.PlaceOfBirth = placeOfBirth;
            patient.Sex          = sex;

            _databaseService.PatientsRepository.Update(patient);
        }
        public Guid Execute(CreatePatientModel model)
        {
            var firstName    = PatientFirstName.Create(model.FirstName);
            var middleName   = PatientMiddleName.Create(model.MiddleName);
            var lastName     = PatientLastName.Create(model.LastName);
            var dateOfBirth  = PatientDateOfBirth.Create(model.DateOfBirth);
            var placeOfBirth = PatientPlaceOfBirth.Create(model.PlaceOfBirth);
            var sex          = PatientSex.Create(model.Sex);
            var occupation   = PatientOccupation.Create(model.Occupation);
            var patientType  = PatientType.Create(model.PatientType);

            var patient = Patient.Create(firstName,
                                         middleName,
                                         lastName,
                                         dateOfBirth,
                                         placeOfBirth,
                                         occupation,
                                         sex,
                                         patientType);

            _databaseService.PatientsRepository.Add(patient);

            return(patient.Id);
        }
        public JsonResult EditPatientType(string PatientTypeID, string PatientTypeName, PatientType PatientType1)
        {
            string _Edit = null;

            if (objPatient.CheckPatientType(PatientTypeID, PatientTypeName))
            {
                if (objPatient.Save(PatientType1))
                {
                    _Edit = "PatientType Edited Successfully";
                }
            }
            else
            {
                _Edit = "PatientType Already Exist's";
            }
            return(new JsonResult {
                Data = _Edit, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }
Example #30
0
 public IEnumerable <Patient> GetPatientByType(PatientType patientType)
 => _patientRepository.GetPatientByType(patientType);