Beispiel #1
0
 public static BloodPressureReadingDto Create(BloodPressureReading bloodPressureReading)
 {
     return(new BloodPressureReadingDto
     {
         Id = bloodPressureReading.Id,
         Systole = bloodPressureReading.Systole,
         Diastole = bloodPressureReading.Diastole,
         HeartRate = bloodPressureReading.HeartRate,
         DateTaken = new DateTimeOffset(bloodPressureReading.DateTaken).UtcDateTime
     });
 }
        public async Task <ActionResult> Put(Guid id, [FromBody] BloodPressureReadingInput bloodPressureReadingInput)
        {
            var bloodPressureReadingToEdit = new BloodPressureReading(id, bloodPressureReadingInput.Systole, bloodPressureReadingInput.Diastole, bloodPressureReadingInput.HeartRate);

            bloodPressureReadingToEdit.DateTaken = bloodPressureReadingInput.DateTaken;
            bloodPressureReadingToEdit.PersonId  = _contextData.CurrentUser.Id;

            _healthWiseDbContext.Attach <BloodPressureReading>(bloodPressureReadingToEdit).State = EntityState.Modified;
            await _healthWiseDbContext.SaveChangesAsync();

            return(NoContent());
        }
        public async Task <ActionResult> Post([FromBody] BloodPressureReadingInput bloodPressureReadingInput)
        {
            var bloodPressureReadingToCreate = new BloodPressureReading(bloodPressureReadingInput.Systole, bloodPressureReadingInput.Diastole, bloodPressureReadingInput.HeartRate);

            bloodPressureReadingToCreate.DateTaken = bloodPressureReadingInput.DateTaken;
            bloodPressureReadingToCreate.PersonId  = _contextData.CurrentUser.Id;

            await _healthWiseDbContext.BloodPressureReadings.AddAsync(bloodPressureReadingToCreate);

            await _healthWiseDbContext.SaveChangesAsync();

            return(CreatedAtAction(nameof(this.Get), new { id = bloodPressureReadingToCreate.Id }, BloodPressureReadingDto.Create(bloodPressureReadingToCreate)));
        }
Beispiel #4
0
        protected void buttonPermissionApprove_ServerClick(object sender, EventArgs e)
        {
            try
            {
                string nric = ViewState["GridViewPatientSelectedNRIC"].ToString();

                short permission = 0;

                if (CheckBoxTypeHeightMeasurement.Checked)
                {
                    permission += new HeightMeasurement().permissionFlag;
                }
                if (CheckBoxTypeWeightMeasurement.Checked)
                {
                    permission += new WeightMeasurement().permissionFlag;
                }
                if (CheckBoxTypeTemperatureReading.Checked)
                {
                    permission += new TemperatureReading().permissionFlag;
                }
                if (CheckBoxTypeBloodPressureReading.Checked)
                {
                    permission += new BloodPressureReading().permissionFlag;
                }
                if (CheckBoxTypeECGReading.Checked)
                {
                    permission += new ECGReading().permissionFlag;
                }
                if (CheckBoxTypeMRI.Checked)
                {
                    permission += new MRI().permissionFlag;
                }
                if (CheckBoxTypeXRay.Checked)
                {
                    permission += new XRay().permissionFlag;
                }
                if (CheckBoxTypeGait.Checked)
                {
                    permission += new Gait().permissionFlag;
                }

                patientBLL.ApproveRequest(nric, permission);
                Bind_GridViewTherapist();
                Update_UpdatePanelPermissions(nric);
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['success']('Request Approved, Permissions of " + nric + " has been Updated.');", true);
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "toastr['error']('Error occured when Updating Permissions.');", true);
            }
        }
Beispiel #5
0
        protected void buttonRequest_ServerClick(object sender, EventArgs e)
        {
            try
            {
                string nric       = ViewState["GridViewPatientSelectedNRIC"].ToString();
                short  permission = 0;

                if (CheckBoxTypeHeightMeasurement.Checked)
                {
                    permission += new HeightMeasurement().permissionFlag;
                }
                if (CheckBoxTypeWeightMeasurement.Checked)
                {
                    permission += new WeightMeasurement().permissionFlag;
                }
                if (CheckBoxTypeTemperatureReading.Checked)
                {
                    permission += new TemperatureReading().permissionFlag;
                }
                if (CheckBoxTypeBloodPressureReading.Checked)
                {
                    permission += new BloodPressureReading().permissionFlag;
                }
                if (CheckBoxTypeECGReading.Checked)
                {
                    permission += new ECGReading().permissionFlag;
                }
                if (CheckBoxTypeMRI.Checked)
                {
                    permission += new MRI().permissionFlag;
                }
                if (CheckBoxTypeXRay.Checked)
                {
                    permission += new XRay().permissionFlag;
                }
                if (CheckBoxTypeGait.Checked)
                {
                    permission += new Gait().permissionFlag;
                }

                therapistBLL.SubmitRequest(nric, permission);
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "$('#modalSelectPermissions').modal('hide');toastr['success']('Request Submitted to " + nric + " for Permissions.');", true);
                Bind_GridViewPatient();
            }
            catch
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "alert", "$('#modalSelectPermissions').modal('hide');toastr['error']('Error occured when Submitting Request.');", true);
            }
        }
Beispiel #6
0
        public static async Task Seed(HealthWiseDbContext healthWiseDbContext, IContextData contextData, IDateTimeManager datetimeManager, IOptions <AppOptions> appOptions)
        {
            if (!healthWiseDbContext.BloodPressureReadings.Any())
            {
                var personId = appOptions.Value.TestUser;

                var bp1 = new BloodPressureReading(119, 82, 80);
                bp1.DateTaken = datetimeManager.Today;
                bp1.PersonId  = personId;

                var bp2 = new BloodPressureReading(113, 78, 75);
                bp2.DateTaken = datetimeManager.Today.AddDays(1);
                bp2.PersonId  = personId;

                var bp3 = new BloodPressureReading(115, 79, 82);
                bp3.DateTaken = datetimeManager.Today.AddDays(-1);
                bp3.PersonId  = personId;

                await healthWiseDbContext.BloodPressureReadings.AddRangeAsync(new[] { bp1, bp2, bp3 });

                await healthWiseDbContext.SaveChangesAsync();
            }
        }