Exemple #1
0
        public void AcceptRequestTest()
        {
            string             identityCard       = RandomHelper.GenerateString();
            string             patientNo1         = RandomHelper.GenerateString();
            string             patientNo2         = RandomHelper.GenerateString();
            PatientCaseInfoDto patientCaseInfoDto = new PatientCaseInfoDto
            {
                IdentityCard    = identityCard,
                PatientName     = RandomHelper.GenerateString(),
                InsuranceNumber = RandomHelper.GenerateString(),
                PatientNo       = patientNo1,
                Age             = RandomHelper.GenerateString(),
                Gender          = "0",
                Birthday        = DateTime.Now,
                CreateTime      = DateTime.Now,
                LastEditTime    = DateTime.Now
            };

            PatientCaseInfoDto patientCaseInfoDtoNew = ConsultationPatientCaseService.CreatePatientCase(patientCaseInfoDto, null, "", "");

            NewConsultationRequestDto newConsultationRequestDto = new NewConsultationRequestDto
            {
                ConsultationType   = "0",
                ExpectedDate       = DateTime.Now,
                ExpectedTimeRange  = "0",
                PatientCaseID      = patientCaseInfoDtoNew.UniqueID,
                RequestPurpose     = RandomHelper.GenerateString(),
                RequestRequirement = RandomHelper.GenerateString(),
                SelectHospital     = "1"
            };

            string result = ConsultationService.CreateRequest(newConsultationRequestDto, "", "");

            RequestAcceptInfoDto requestAcceptInfoDto = new RequestAcceptInfoDto
            {
                ConsultationDate      = DateTime.Now,
                consultationStartTime = "1",
                RequestID             = result,
                ExpertList            = new List <string> {
                    "test"
                }
            };

            bool result2 = ConsultationService.AcceptRequest(requestAcceptInfoDto, "");

            Assert.AreEqual(true, result2);
        }
Exemple #2
0
        public IHttpActionResult AcceptRequest([FromBody] RequestAcceptInfoDto requestAcceptInfoDto)
        {
            var user = base.CurrentUser();

            return(Ok(_consultationService.AcceptRequest(requestAcceptInfoDto, user.Language)));
        }