Exemple #1
0
        public async Task <IActionResult> PutPatientReadings(int id, PatientReadings patientReadings)
        {
            if (id != patientReadings.PatientId)
            {
                return(BadRequest());
            }

            _context.Entry(patientReadings).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!PatientReadingsExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
        public void TestDisplayModuleReadings()
        {
            string resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            PatientReadings pRead = new PatientReadings();

            pRead.PatientId = 2;


            string resp2 = UnitTest2.displayModuleReadings(dbC.getConn(), pRead, "pulseRate");

            Assert.IsNotNull(resp2);
        }
        public void TestAddPatientReading()
        {
            string resp = dbC.connect();

            Assert.AreEqual("Done", resp);

            PatientReadings pRead = new PatientReadings();

            pRead.PatientId     = 2;
            pRead.PulseRate     = 23;
            pRead.BreathingRate = 23;
            pRead.Systolic      = 23;
            pRead.Diastolic     = 23;
            pRead.Temperature   = 23;
            pRead.DateTime      = "12/1/2019 6:10:21 PM";


            UnitTest2.addPatientReading(dbC.getConn(), pRead);
        }
Exemple #4
0
        public async Task <ActionResult <PatientReadings> > PostPatientReadings(PatientReadings patientReadings)
        {
            _context.PatientReadings.Add(patientReadings);
            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateException)
            {
                if (PatientReadingsExists(patientReadings.PatientId))
                {
                    return(Conflict());
                }
                else
                {
                    throw;
                }
            }

            return(CreatedAtAction("GetPatientReadings", new { id = patientReadings.PatientId }, patientReadings));
        }