Beispiel #1
0
        public ActionResult <Patient> PostPatient([FromBody] Patient patient)
        {
            Patient oldPatient = _db.Find <Patient>(patient.Id);

            if (oldPatient != null)
            {
                return(BadRequest());
            }

            _db.Patients.Add(patient);
            _db.SaveChanges();

            return(Ok(patient));
        }
        public ActionResult <Parameter> PostParameter([FromBody] Parameter parameter)
        {
            Parameter oldParameter = _db.Find <Parameter>(parameter.Id);

            if (oldParameter != null)
            {
                return(BadRequest());
            }

            _db.Parameters.Add(parameter);
            _db.SaveChanges();

            return(Ok(parameter));
        }
Beispiel #3
0
        public ActionResult <Prescription> PostPrescription([FromBody] Prescription prescription)
        {
            Prescription oldPrescription = _db.Find <Prescription>(prescription.Id);

            if (oldPrescription != null)
            {
                return(BadRequest());
            }

            _db.Prescriptions.Add(prescription);
            _db.SaveChanges();

            return(Ok(prescription));
        }
        public ActionResult <Treatment> PostTreatment([FromBody] Treatment treatment)
        {
            Treatment oldTreatment = _db.Find <Treatment>(treatment.Id);

            if (oldTreatment != null)
            {
                return(BadRequest());
            }

            _db.Treatments.Add(treatment);
            _db.SaveChanges();

            return(Ok(treatment));
        }
        public ActionResult <Diagnosis> PostDiagnosis([FromBody] Diagnosis diagnosis)
        {
            Diagnosis oldDiagnosis = _db.Find <Diagnosis>(diagnosis.Id);

            if (oldDiagnosis != null)
            {
                return(BadRequest());
            }

            _db.Diagnoses.Add(diagnosis);
            _db.SaveChanges();

            return(Ok(diagnosis));
        }
        public ActionResult <Examination> PostExamination([FromBody] Examination examination)
        {
            Examination oldExamination = _db.Find <Examination>(examination.Id);

            if (oldExamination != null)
            {
                return(BadRequest());
            }

            _db.Examinations.Add(examination);
            _db.SaveChanges();

            return(Ok(examination));
        }