public async Task <IHttpActionResult> UpdatePatientHistory(PatientHistoryModel patientHistory)
        {
            if (patientHistory == null)
            {
                return(BadRequest("Please provide valid inputs!"));
            }

            //CommonResponse validatedResponse = await AuthService.ValidateUserAndToken();
            //if (!validatedResponse.IsError)
            {
                if (await PatientHistoryService.UpdatePatientHistory(patientHistory))
                {
                    return(Ok("Patient History Updated Successfully!"));
                }
                else
                {
                    return(BadRequest("Failed to Update Patient History!"));
                }
                //}
                //else
                //{
                //    return Unauthorized();
                //}
            }
        }
        public async Task <IHttpActionResult> SearchPatientHistory(PatientHistoryModel patientHistory)
        {
            //CommonResponse validatedResponse = await AuthService.ValidateUserAndToken();
            //if (!validatedResponse.IsError)
            //{
            var patientsHistories = await PatientHistoryService.SearchPatientHistory(patientHistory);

            if (patientsHistories.Count > 0)
            {
                return(Ok(patientsHistories));
            }
            else
            {
                return(BadRequest("No Such Patient Exists!"));
            }
            //}
            //else
            //{
            //    return Unauthorized();
            //}
        }
        public async Task <IHttpActionResult> GetPatientHistory()
        {
            //CommonResponse validatedResponse = await AuthService.ValidateUserAndToken();
            //if (!validatedResponse.IsError)
            //{
            var patientHIstories = await PatientHistoryService.GetPatientHistory();

            if (patientHIstories.Count > 0)
            {
                return(Ok(patientHIstories));
            }
            else
            {
                return(BadRequest("No History Data Found!"));
            }
            //}
            //else
            //{
            //    return Unauthorized();
            //}
        }
        public List <History> getHospitalRecordByPatientID(string id)
        {
            PatientHistoryService patientHistoryService = new PatientHistoryService();

            return(patientHistoryService.getHistoryByPatientId(id));
        }
Exemple #5
0
        public string GetHospitalRecordByHospitalID(long hospital_id)
        {
            IPatientHistoryService patientHistoryService = new PatientHistoryService();

            return(patientHistoryService.GetHistoryByHospitalId(hospital_id));
        }
Exemple #6
0
        // -------------------------------- Patient History Services
        public string GetHospitalRecord(long id)
        {
            IPatientHistoryService patientHistoryService = new PatientHistoryService();

            return(patientHistoryService.GetHistory(id));
        }
Exemple #7
0
        public string GetHospitalRecordByDate(string date)
        {
            IPatientHistoryService patientHistoryService = new PatientHistoryService();

            return(patientHistoryService.GetHistoryByDate(date));
        }
Exemple #8
0
        public string GetHospitalRecordByDoctorID(long doctor_id)
        {
            IPatientHistoryService patientHistoryService = new PatientHistoryService();

            return(patientHistoryService.GetHistoryByDoctorId(doctor_id));
        }