public DoctorInfoModel DoctoreData(int treatmentRecordid)
        {
            var data        = _treatmentRecordServices.GetDoctorInfoByTreatmentRecordId(treatmentRecordid);
            var DoctorsData = new DoctorInfoModel();

            if (data != null)
            {
                DoctorsData.TreatmentRecordMasterId = (int)data.TreatmentRecordMasterId;
                DoctorsData.Comments       = data.Comments;
                DoctorsData.DoctorName     = data.DoctorName;
                DoctorsData.OrdersReviewed = (bool)data.OrdersReviewed;
                DoctorsData.OutPatient     = data.OutPatient;
                DoctorsData.Room           = data.Room;

                DoctorsData.Id = data.Id;
                DoctorsData.EducatioPreTreatmentId = data.EducatioPreTreatmentId;
            }


            return(DoctorsData);
        }
示例#2
0
 public ActionResult GetById(int Id)
 {
     try
     {
         ResultModel resultModel    = new ResultModel();
         var         doctorInfoData = _treatmentRecordsServices.GetDoctorInfoById(Id);
         var         model          = new DoctorInfoModel();
         model.DoctorName             = doctorInfoData.DoctorName;
         model.EducatioPreTreatmentId = doctorInfoData.EducatioPreTreatmentId;
         model.Id                      = doctorInfoData.Id;
         model.OrdersReviewed          = doctorInfoData.OrdersReviewed;
         model.OutPatient              = doctorInfoData.OutPatient;
         model.Room                    = doctorInfoData.Room;
         model.TreatmentRecordMasterId = (int)doctorInfoData.TreatmentRecordMasterId;
         resultModel.Message           = ValidationMessages.Success;
         resultModel.Status            = 1;
         resultModel.Response          = model;
         return(Ok(resultModel));
     }
     catch (Exception e)
     {
         return(Ok(e));
     }
 }
示例#3
0
        public ActionResult Create(DoctorInfoModel model)
        {
            ResultModel resultModel = new ResultModel();

            try
            {
                if (model.Id == 0)
                {
                    var DoctorData = new DoctorInfo();
                    DoctorData.DoctorName             = model.DoctorName;
                    DoctorData.EducatioPreTreatmentId = model.EducatioPreTreatmentId;
                    if (DoctorData.EducatioPreTreatmentId == (int)EducatioPreTreatment.Other)
                    {
                        DoctorData.Comments = model.Comments;
                    }
                    else
                    {
                        DoctorData.Comments = null;
                    }
                    DoctorData.OrdersReviewed          = model.OrdersReviewed;
                    DoctorData.OutPatient              = model.OutPatient;
                    DoctorData.Room                    = model.Room;
                    DoctorData.MarkComplete            = model.MarkComplete;
                    DoctorData.TreatmentRecordMasterId = model.TreatmentRecordMasterId;

                    _treatmentRecordsServices.InsertDoctorInfo(DoctorData);
                    //Bhawana(09/10/2019)
                    //Change treatment Record Status

                    _reportService.UpdateTreatmentStatusID((int)DoctorData.TreatmentRecordMasterId);
                    //12/10/19 aakansha
                    //model response
                    model.Id = DoctorData.Id;
                    model.TreatmentRecordMasterId = DoctorData.TreatmentRecordMasterId;

                    resultModel.Message  = ValidationMessages.Success;
                    resultModel.Status   = 1;
                    resultModel.Response = model;
                    return(Ok(resultModel));
                }
                else
                {
                    var DoctorData = _treatmentRecordsServices.GetDoctorInfoById(model.Id);
                    DoctorData.DoctorName             = model.DoctorName;
                    DoctorData.EducatioPreTreatmentId = model.EducatioPreTreatmentId;
                    if (DoctorData.EducatioPreTreatmentId == (int)EducatioPreTreatment.Other)
                    {
                        DoctorData.Comments = model.Comments;
                    }
                    else
                    {
                        DoctorData.Comments = null;
                    }
                    DoctorData.OrdersReviewed = model.OrdersReviewed;
                    DoctorData.OutPatient     = model.OutPatient;
                    DoctorData.Room           = model.Room;
                    //Mark Complete
                    DoctorData.MarkComplete            = model.MarkComplete;
                    DoctorData.TreatmentRecordMasterId = model.TreatmentRecordMasterId;
                    _treatmentRecordsServices.UpdateDoctorInfo(DoctorData);
                    //Bhawana(09/10/2019)
                    //Change treatment Record Status
                    _reportService.UpdateTreatmentStatusID((int)DoctorData.TreatmentRecordMasterId);
                    //12/10/19 aakansha
                    // model response
                    model.Id = DoctorData.Id;
                    model.TreatmentRecordMasterId = DoctorData.TreatmentRecordMasterId;
                    resultModel.Message           = ValidationMessages.Success;
                    resultModel.Status            = 1;
                    resultModel.Response          = model;
                    return(Ok(resultModel));
                }
            }
            catch
            {
                resultModel.Message  = ValidationMessages.Failure;
                resultModel.Status   = 0;
                resultModel.Response = null;
                return(Ok(resultModel));
            }
        }