示例#1
0
        public JsonResult AddPatient(FormCollection form)
        {
            var patient = new PatientDto
            {
                FirstName      = form["firstname"],
                SecondName     = form["secondname"],
                Surname        = form["surname"],
                Street         = form["street"],
                BuildingNumber = form["buildingnumber"],
                FlatNumber     = form["flatnumber"],
                ZipCode        = form["zipcode"],
                City           = form["city"],
                CountryId      = Convert.ToInt32(form["Countries"]),
                PhoneNumber    = form["phonenumber"],
                DateOfBirth    = Convert.ToDateTime(form["dateofbirth"]),
                CityOfBirth    = form["cityofbirth"],
                Pesel          = form["pesel"],
                NationalityId  = Convert.ToInt32(form["nationality"])
            };

            var patientId = _repository.AddPatient(patient);

            return(Json(new
            {
                type = patientId > 0 ? "OK" : "Error",
                message = patientId > 0 ? "Poprawnie dodano pacjenta" : "Wystąpił błąd!",
                url = $"edytuj-pacjenta/{patientId}"
            }));
        }
示例#2
0
        public ActionResult EditPatientData(FormCollection form)
        {
            var patient = new PatientDto
            {
                Id             = Convert.ToInt32(form["Id"]),
                FirstName      = form["FirstName"],
                SecondName     = form["SecondName"],
                Surname        = form["Surname"],
                Street         = form["Street"],
                BuildingNumber = form["BuildingNumber"],
                FlatNumber     = form["FlatNumber"],
                ZipCode        = form["ZipCode"],
                City           = form["City"],
                CountryId      = Convert.ToInt32(form["CountryId"]),
                PhoneNumber    = form["PhoneNumber"],
                DateOfBirth    = Convert.ToDateTime(form["DateOfBirth"]),
                CityOfBirth    = form["CityOfBirth"],
                Pesel          = form["Pesel"],
                NationalityId  = Convert.ToInt32(form["NationalityId"])
            };
            var userId = User.Identity.GetUserId();

            var result = _repository.EditPatient(patient, userId);

            return(Json(new
            {
                type = result ? "OK" : "Error",
                message = result ? "Poprawnie zapisano dane pacjenta" : "Wystąpił błąd!"
            }));
        }
示例#3
0
        public async Task <ActionResult> Create(string assessmentId = null)
        {
            var patientDto = new PatientDto();

            patientDto.Name = new PersonName("X", "X");

            //TODO: Pilot Only
            patientDto.Gender = new LookupDto {
                Code = Gender.Female.Code
            };
            patientDto.DateOfBirth = new DateTime(2001, 1, 1);

            var requestDispatcher = CreateAsyncRequestDispatcher();

            AddLookupRequests(requestDispatcher, typeof(PatientDto));
            requestDispatcher.Add(new CreatePatientRequest {
                PatientDto = patientDto
            });
            var response = await requestDispatcher.GetAsync <SaveDtoResponse <PatientDto> >();

            AddLookupResponsesToViewData(requestDispatcher);
            return(RedirectToAction("Edit", new { id = response.DataTransferObject.Key }));

            ViewData["AssessmentId"] = assessmentId;
            ViewData["Patient"]      = patientDto;

            return(View("Edit", patientDto));
        }
示例#4
0
        public async Task <IHttpActionResult> PatientAsync(PatientDto patient)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Patient dbPatient = new Patient
                    {
                        DateOfBirth = patient.DateOfBirth,
                        FirstName   = patient.FirstName,
                        LastName    = patient.LastName,
                        Gender      = patient.Gender
                    };

                    _unitOfWork.Patients.Add(dbPatient);

                    await _unitOfWork.CompleteAsync();

                    patient.Id = dbPatient.Id;

                    return(Created(new Uri(Request.RequestUri + "/" + patient.Id), patient));
                }
                _logger.Warn(string.Join(" | ", ModelState.Values.SelectMany(e => e.Errors.Take(1)).Select(e => e.ErrorMessage)));
                return(BadRequest(ModelState));
            }
            catch (Exception ex)
            {
                if (_logger.IsDebugEnabled)
                {
                    _logger.Debug(ex);
                    return(InternalServerError(ex));
                }
                return(InternalServerError());
            }
        }
示例#5
0
        public async Task <ApiResponse> UpdatePatientAsync(int patientID, PatientDto patient)
        {
            var _test = await _dbContext.Patients.Where(t => t.PatientID == patientID).SingleOrDefaultAsync();

            if (_test != null)
            {
                var modifiedData = _mapper.Map <Patient>(patient);
                modifiedData.UpdatedBy               = 1;
                modifiedData.CreatedOn               = _test.CreatedOn;
                modifiedData.CreatedBy               = _test.CreatedBy;
                modifiedData.UpdatedOn               = DateTime.Now;
                _dbContext.Entry(_test).State        = EntityState.Detached;
                _dbContext.Entry(modifiedData).State = EntityState.Modified;
                _dbContext.SaveChanges();
                return(new ApiResponse {
                    Data = patient, Message = "Success", StatusCode = StatusCode.Ok
                });
            }
            else
            {
                return(new ApiResponse {
                    Message = $"Patient not found with id {patientID}", StatusCode = StatusCode.NotFound
                });
            }
        }
示例#6
0
        public void Should_return_zero_search_results()
        {
            PatientDto expectedDto = new PatientDto()
            {
                Id     = Guid.NewGuid(),
                Name   = "Jeff Carley",
                Status = "Active",
                Street = "123 Main St",
                City   = "Madison",
                State  = "WI",
                Zip    = "53571"
            };

            var query = new EnumerableQuery <PatientDto>(new List <PatientDto>()
            {
                expectedDto
            });

            IReportingRepository <PatientDto> repository = MockRepository.GenerateMock <IReportingRepository <PatientDto> >();

            repository.Stub(repo => repo.GetAll()).Return(query);

            PatientSearchViewModel viewModel = new PatientSearchViewModel(repository);

            // searchs are exact only
            viewModel.SearchText = "Jeff";
            viewModel.Search.Execute(null);

            viewModel.PatientResults.ShouldBeEmpty();
        }
示例#7
0
        public void CreateAmbCaseWithTfomsInfoFull()
        {
            using (TestPixServiceClient c = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                c.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient client = new TestEmkServiceClient())
            {
                CaseAmb caseAmb = (new SetData()).MinCaseAmbSetForCreate();
                caseAmb.MedRecords = new List <MedRecord>
                {
                    MedRecordData.tfomsInfo
                };

                client.CreateCase(Global.GUID, caseAmb);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
示例#8
0
        public void AddStatStep_Ref()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseStat);

                StepStat stepStat = (new SetData()).MinStepStatSet();
                stepStat.MedRecords = new List <MedRecord>
                {
                    MedRecordData.referral
                };
                EmkClient.AddStepToCase(Global.GUID, Data.idlpu, caseStat.IdPatientMis, caseStat.IdCaseMis, stepStat);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
示例#9
0
 public void UpdateStatCaseRef_ToStep()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSet();
         EmkClient.AddCase(Global.GUID, caseStat);
         StepStat stepStat = (new SetData()).MinStepStatSet();
         stepStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.referral
         };
         caseStat.Steps = new List <StepStat>
         {
             stepStat
         };
         EmkClient.UpdateCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
示例#10
0
 public void CloseStatCaseFullRef()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseStat caseStat = (new SetData()).MinCaseStatSetForCreate();
         EmkClient.CreateCase(Global.GUID, caseStat);
         caseStat            = (new SetData()).MinCaseStatSetForClose();
         caseStat.MedRecords = new List <MedRecord>
         {
             MedRecordData.referral,
             (new SetData()).MinClinicMainDiagnosis()
         };
         EmkClient.CloseCase(Global.GUID, caseStat);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
示例#11
0
 public void CreateAmbCaseFullRef()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseAmb caseAmb = (new SetData()).MinCaseAmbSetForCreate();
         caseAmb.MedRecords = new List <MedRecord>
         {
             MedRecordData.referral
         };
         EmkClient.CreateCase(Global.GUID, caseAmb);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
示例#12
0
 public void UpdateAmbCaseMinRef()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseAmb caseAmb = (new SetData()).MinCaseAmbSet();
         EmkClient.AddCase(Global.GUID, caseAmb);
         caseAmb.MedRecords = new List <MedRecord>
         {
             (new SetData()).MinRefferal(),
             (new SetData()).MinClinicMainDiagnosis()
         };
         EmkClient.UpdateCase(Global.GUID, caseAmb);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
        public void SearchNullPatient()
        {
            PatientDto          searchPatient = null;
            Result <PatientDto> response      = _PhekoServiceClient.Search(searchPatient);

            Assert.AreEqual(response.Models.Count, 0);
        }
        public void SearchEmptyPatient()
        {
            PatientDto          searchPatient = new PatientDto();
            Result <PatientDto> response      = _PhekoServiceClient.Search(searchPatient);

            Assert.IsTrue(response.Models.Count > 0);
        }
示例#15
0
        public async Task <IActionResult> UpdatePatient(Guid patientId, [FromBody] PatientDto patient)
        {
            await _patientService.UpdatePatient(patientId, patient.Street, patient.PostCode,
                                                patient.PhoneNumber, patient.City);

            return(NoContent());
        }
示例#16
0
 public void AddPatient(string guid, string idlpu, PatientDto patient)
 {
     TestPatient p = new TestPatient(guid, idlpu, patient);
     try
     {
         p.DeletePatient();
         client.AddPatient(guid, idlpu, patient);
         p = new TestPatient(guid, idlpu, patient);
         TestPatient a = TestPatient.BuildPatientFromDataBaseData(guid, idlpu, patient.IdPatientMIS);
         if (!p.CheckPatientInDataBase())
         {
             Global.errors1.AddRange(Global.errors2);
             Global.errors1.Add("Не совпадение значений объектов");
         }
     }
     catch (System.ServiceModel.FaultException<PixServiseTests.PixServise.RequestFault> we)
     {
         if (we.Detail.Message == reinclusionString)
         {
             TestPatient wwww = TestPatient.BuildPatientFromDataBaseData(guid ,idlpu, patient.IdPatientMIS);
             if (TestPatient.BuildPatientFromDataBaseData(guid ,idlpu, patient.IdPatientMIS) == null)
                 Global.errors1.Add("Ошибочное сообщение о попытке повторного добавления");
             else
                 Global.errors1.Add(we.Detail.Message);
         }
         else
         {
             Global.errors1.Add(we.Detail.Message);
         }
     }
 }
        public async Task <ActionResult <PatientDto> > PutAsync(int id, [FromBody] PatientDto patientDto)
        {
            var command = new PutPatient.Command(id, patientDto);
            var result  = await _mediator.Send(command);

            return(Ok(result));
        }
        public async Task <ReturnPatientInformationModel> GetByIdentificationNumber([FromUri] GetPatientInformationModel model)
        {
            if (!ModelState.IsValid)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            PatientDto patientDto = await PatientFacade.GetPatientByIdentificationNumberAsync(model.IdentificationNumber);

            if (patientDto == null)
            {
                throw new HttpResponseException(HttpStatusCode.BadRequest);
            }

            ReturnPatientInformationModel patientInfo = new ReturnPatientInformationModel();

            patientInfo.Name                 = patientDto.Name;
            patientInfo.Surname              = patientDto.Surname;
            patientInfo.DateOfBirth          = patientDto.DateOfBirth;
            patientInfo.Email                = patientDto.Email;
            patientInfo.IdentificationNumber = patientDto.IdentificationNumber;
            patientInfo.ProfileCreationDate  = patientDto.ProfileCreationDate;
            patientInfo.Doctors              = patientDto.Doctors.Select(dto =>
                                                                         new Tuple <string, Specialization>($"{dto.Name} {dto.Surname}", dto.Specialization));
            return(patientInfo);
        }
示例#19
0
        public bool CheckIfUnique(string parameter, PatientDto entity)
        {
            bool isUnique = false;

            switch (parameter)
            {
            case FISCAL_CODE_PARAMETER:
                isUnique = _ctx.Patients.Any(p => p.FiscalCode == entity.FiscalCode);
                break;

            case NAME_PARAMETER:
                isUnique = _ctx.Patients.Any(p => p.Name == entity.Name);
                break;

            case SURNAME_PARAMETER:
                isUnique = _ctx.Patients.Any(p => p.Surname == entity.Surname);
                break;

            case PHONE_PARAMETER:
                isUnique = _ctx.Patients.Any(p => p.Phone == entity.Phone);
                break;

            case EMAIL_PARAMETER:
                isUnique = _ctx.Patients.Any(p => p.Email == entity.Email);
                break;
            }

            return(isUnique);
        }
示例#20
0
 public void AddAmbCaseRef_ToStep()
 {
     using (TestPixServiceClient PixClient = new TestPixServiceClient())
     {
         PatientDto patient = (new SetData()).PatientSet();
         PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
     }
     using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
     {
         CaseAmb caseAmb = (new SetData()).MinCaseAmbSet();
         StepAmb stepAmb = (new SetData()).MinStepAmbSet();
         stepAmb.MedRecords = new List <MedRecord>
         {
             MedRecordData.referral
         };
         caseAmb.Steps = new List <StepAmb>
         {
             stepAmb
         };
         EmkClient.AddCase(Global.GUID, caseAmb);
     }
     if (Global.errors == "")
     {
         Assert.Pass();
     }
     else
     {
         Assert.Fail(Global.errors);
     }
 }
示例#21
0
        public ActionResult <Patient> CreatePatient(PatientDto patientDto)
        {
            var patient = _mapper.Map <PatientDto, Patient>(patientDto);
            var result  = _patientsService.Create(patient).Result;

            return(Ok(result));
        }
示例#22
0
文件: FuncForGet.cs 项目: knastya/Pix
        public List<string> CheckDB_AfterGet(PatientDto patient)
        {
            var errorList = new List<string>();
            CommonFun f = new CommonFun();
            errorList.AddRange(f.Check_MainDataInDB(patient.IdGlobal, patient));
            if (patient.Job != null)
                errorList.AddRange(f.Check_JobInDB(patient.IdGlobal, patient.Job));
            if (patient.BirthPlace != null)
                errorList.AddRange(f.Check_BirthPlaceInDB(patient.IdGlobal, patient.BirthPlace));
            if (patient.Contacts != null)
            {
                foreach (ContactDto contact in patient.Contacts)
                    errorList.AddRange(f.Check_ContactInDB(patient.IdGlobal, contact));
            }
            if (patient.Documents != null)
            {
                foreach (DocumentDto document in patient.Documents)
                    errorList.AddRange(f.Check_DocumentInDB(patient.IdGlobal, document));
            }
            if (patient.Addresses != null)
            {
                foreach (AddressDto address in patient.Addresses)
                    errorList.AddRange(f.Check_AddressInDB(patient.IdGlobal, address));
            }
            if (patient.Privilege != null)
                errorList.AddRange(f.Check_PrivilegeInDB(patient.IdGlobal, patient.Privilege));

            return errorList;
        }
示例#23
0
        public async Task <bool> Update(PatientDto model)
        {
            _patientRepository.Update(_mapper.Map <TPatient>(model));
            var recordUpdated = await _patientRepository.SaveChangeAsync();

            return(recordUpdated > 0);
        }
示例#24
0
        public async Task <ActionResult <PatientDto> > Put(int id, PatientDto model)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest("Model is not valid"));
                }

                var oldPatient = await _patientServices.GetPatientsByIdAsync(id);

                if (oldPatient == null)
                {
                    return(NotFound($"Could not find patient with id of {id}"));
                }

                var updatedPatient = _mapper.Map(model, oldPatient);

                if (await _patientServices.UpdatePatient(updatedPatient))
                {
                    return(Ok(updatedPatient));
                }
            }
            catch (Exception e)
            {
                return(this.StatusCode(StatusCodes.Status500InternalServerError, $"Database Failure: {e}"));
            }

            return(BadRequest());
        }
示例#25
0
        public Result <PatientDto> Search(PatientDto searchPatient, ModelPager modelPager)
        {
            Result <PatientDto> response = new Result <PatientDto>();

            using (UnitOfWork unitOfWork = new UnitOfWork())
            {
                Expression <Func <Patient, bool> > searchFilter = null;

                if (searchPatient != null)
                {
                    searchFilter = p => (searchPatient.PatientId == null || p.PatientId == searchPatient.PatientId) &&
                                   (string.IsNullOrEmpty(searchPatient.FirstName) || p.FirstName.Contains(searchPatient.FirstName)) &&
                                   (string.IsNullOrEmpty(searchPatient.LastName) || p.LastName.Contains(searchPatient.LastName)) &&
                                   (searchPatient.BirthDate == null || p.BirthDate == searchPatient.BirthDate) &&
                                   (string.IsNullOrEmpty(searchPatient.IDNumber) || p.IDNumber.Contains(searchPatient.IDNumber));
                }

                response.Models = unitOfWork.PatientRepository.GetPagedEntities(searchFilter, GetOrderExpression(modelPager), modelPager, "PostalAddress, PhysicalAddress")
                                  .Select(item => _PatientMapper.MapToPatientDto(item))
                                  .ToList <PatientDto>();
                response.Total = unitOfWork.PatientRepository.Count(searchFilter);
            }

            return(response);
        }
示例#26
0
        public async Task <IHttpActionResult> UpdatePatientAsync(PatientDto patient)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    Patient dbPatient = await _unitOfWork.Patients.GetAsync(patient.Id);

                    if (dbPatient == null)
                    {
                        return(NotFound());
                    }

                    dbPatient.DateOfBirth = patient.DateOfBirth;
                    dbPatient.FirstName   = patient.FirstName;
                    dbPatient.LastName    = patient.LastName;
                    dbPatient.Gender      = patient.Gender;

                    await _unitOfWork.CompleteAsync();

                    return(Ok(patient));
                }
                _logger.Warn(string.Join(" | ", ModelState.Values.SelectMany(e => e.Errors.Take(1)).Select(e => e.ErrorMessage)));
                return(BadRequest(ModelState));
            }
            catch (Exception ex)
            {
                if (_logger.IsDebugEnabled)
                {
                    _logger.Debug(ex);
                    return(InternalServerError(ex));
                }
                return(InternalServerError());
            }
        }
示例#27
0
        private PatientDetailResponse CreatePatient(PatientDto insertedPatient)
        {
            PatientDetailResponse response = _PatientBusinessRules.CreateCheck(insertedPatient);

            if (response.HasErrors)
            {
                return(response);
            }

            Patient patient = new Patient();

            _PatientMapper.MapToPatient(patient, insertedPatient);

            using (TransactionScope scope = new TransactionScope())
            {
                using (UnitOfWork unitOfWork = new UnitOfWork())
                {
                    unitOfWork.PatientRepository.Insert(patient);
                    unitOfWork.Save();

                    response.Patient = _PatientMapper.MapToPatientDto(unitOfWork.PatientRepository.GetByID(p => p.PatientId == patient.PatientId, "PostalAddress, PhysicalAddress"));
                }

                scope.Complete();
            }

            return(response);
        }
示例#28
0
        private PatientDetailResponse UpdatePatient(PatientDto updatedPatient)
        {
            PatientDetailResponse response = _PatientBusinessRules.UpdateCheck(updatedPatient);

            if (response.HasErrors)
            {
                return(response);
            }

            using (TransactionScope scope = new TransactionScope())
            {
                using (UnitOfWork unitOfWork = new UnitOfWork())
                {
                    Patient patient = unitOfWork.PatientRepository.GetByID(p => p.PatientId == updatedPatient.PatientId, "PostalAddress, PhysicalAddress");

                    _PatientMapper.MapToPatient(patient, updatedPatient);

                    if (updatedPatient.MedicalAidInd == null || !updatedPatient.MedicalAidInd.Value)
                    {
                        patient.PatientMedicalAidDependancies.ToList().ForEach(item => unitOfWork.PatientMedicalAidDependancyRepository.Delete(item));
                    }

                    unitOfWork.PatientRepository.Update(patient);
                    unitOfWork.Save();

                    response.Patient = _PatientMapper.MapToPatientDto(unitOfWork.PatientRepository.GetByID(p => p.PatientId == patient.PatientId, "PostalAddress, PhysicalAddress"));
                }

                scope.Complete();
            }

            return(response);
        }
示例#29
0
        public async Task GetAllAsync_ShouldReturnListPatient()
        {
            // Arrange
            var patientDto = new PatientDto {
                Id = 99
            };

            _mediator.Send(Arg.Any <GetAllPatient.Query>())
            .Returns(new GetAllPatient.Response(new List <PatientDto> {
                patientDto
            }));

            // Act
            var actionResult = await _sut.GetAllAsync();

            // Assert
            if (actionResult.Result is OkObjectResult result)
            {
                result.StatusCode.Should().Be(200);
                if (result.Value is List <PatientDto> value)
                {
                    value.Should().HaveCount(1);
                }
            }
        }
        public async Task UpdatePatient_ShouldCallRepo_WhenExist()
        {
            // Arrange
            var counter = 0;
            var patient = new Patient {
                Id = 99
            };

            _patientRepository.GetPatient(patient.Id).Returns(patient);
            _patientRepository.When(x => x.UpdatePatient(patient)).Do(x => counter++);

            // Act
            var patientDto = new PatientDto
            {
                Id          = 99,
                FamilyName  = "FamilyName",
                GivenName   = "GivenName",
                Gender      = Gender.Female,
                DateOfBirth = DateTime.Now.Subtract(new TimeSpan(24, 0, 0))
            };
            await _sut.UpdatePatient(99, patientDto);

            // Assert
            await _patientRepository.Received().UpdatePatient(patient);

            counter.Should().Be(1);
        }
示例#31
0
        public void AddAmbStep_SameIdMin()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseAmb caseAmb = (new SetData()).MinCaseAmbSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseAmb);

                StepAmb stepAmb = (new SetData()).MinOtherStepAmbSet();
                stepAmb.IdStepMis = CaseAmbData.step.IdStepMis;
                EmkClient.AddStepToCase(Global.GUID, Data.idlpu, caseAmb.IdPatientMis, caseAmb.IdCaseMis, stepAmb);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
示例#32
0
        public void AddAmbStep_OtherIdFull()
        {
            using (TestPixServiceClient PixClient = new TestPixServiceClient())
            {
                PatientDto patient = (new SetData()).PatientSet();
                PixClient.AddPatient(Global.GUID, Data.idlpu, patient);
            }
            using (TestEmkServiceClient EmkClient = new TestEmkServiceClient())
            {
                CaseAmb caseAmb = (new SetData()).MinCaseAmbSetForCreate();
                EmkClient.CreateCase(Global.GUID, caseAmb);

                StepAmb stepAmb = CaseAmbData.otherStep;
                stepAmb.MedRecords = new List <MedRecord>
                {
                    (new SetData()).MinService(),
                    (new SetData()).MinAppointedMedication(),
                    (new SetData()).MinDiagnosis(),
                    MedRecordData.clinicMainDiagnosis,
                    MedRecordData.referral,
                    (new SetData()).MinLaboratoryReport()
                };
                EmkClient.AddStepToCase(Global.GUID, Data.idlpu, caseAmb.IdPatientMis, caseAmb.IdCaseMis, stepAmb);
            }
            if (Global.errors == "")
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail(Global.errors);
            }
        }
示例#33
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddEmptyPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#34
0
文件: FuncForGet.cs 项目: knastya/Pix
        public List<string> ComparePatient(PatientDto idealPatient, PatientDto patientForCompare)
        {
            var errorList = new List<string>();
            errorList.AddRange(CompareMainData(idealPatient, patientForCompare));

            if (idealPatient.Documents != null)
                errorList.AddRange(CompareDocument(idealPatient.Documents[0], patientForCompare.Documents));

            return errorList;
        }
示例#35
0
        public static PatientDto AssemblePatientDto(Patient patient)
        {
            var dto = new PatientDto();
            dto.Id = patient.Id.ToString();
            dto.PID = patient.Pid;

            dto.Weight = UnitValueDto.AssembleUnitValueDto(patient.Weight);
            dto.Height = UnitValueDto.AssembleUnitValueDto(patient.Height);

            return dto;
        }
示例#36
0
        public void Test_GetAfterUpdate_ContactOldType()
        {
            //добавляем пациента с адресом
            PatientDto patient = (new FuncForAdd()).OnlyRequiredParamCorrect();
            patient.Contacts = new ContactDto[] { (new CommonFun()).Set_Contact(PatientData.Contact_1) };
            // удаляем из БД, во избежание ошибки повторного добавления
            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);

            pixs.AddPatient(Data.guid, Data.idLPU, patient);
            // проверяем наличие пациента в БД
            var error = (new CommonFun()).CheckDB(patient);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));

            //пациент с таким же адресом
            PatientDto updatePatient = new PatientDto();
            updatePatient.IdPatientMIS = patient.IdPatientMIS;
            ContactDto contact = (new CommonFun()).Set_Contact(PatientData.Contact_1);
            contact.ContactValue = PatientData.Contact_2.ContactValue;
            updatePatient.Contacts = new ContactDto[] { contact };

            pixs.UpdatePatient(Data.guid, Data.idLPU, updatePatient);
            //проверка корректности обновления
            error = (new CommonFun()).CheckDB(updatePatient);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));

            PatientDto[] getPatient = pixs.GetPatient(Data.guid, Data.idLPU, updatePatient, SourceType.Reg);
            // Проверяем найденных пациентов
            foreach (PatientDto pat in getPatient)
            {
                if (pat.Contacts.Length == 2)
                {
                    //сравниваем заданного для поиска пациента и найденого
                    error.AddRange((new FuncForGet()).ComparePatient(updatePatient, pat));

                    //проверяем наличие найденного пациента в БД
                    error.AddRange((new FuncForGet()).CheckDB_AfterGet(pat));
                }
                else error.Add("Вернулось неверное количество контактов");
            }

            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));
        }
示例#37
0
 public TestPatient(string guid, string idlpu, PatientDto p)
 {
     patient = p;
     if ((guid != null) && (idlpu != null) && (p.IdPatientMIS != null))
         patient.IdGlobal = GetPatientId(guid, idlpu, p.IdPatientMIS);
     GUID = guid.ToLower();
     IDLPU = idlpu;
     if ((p.Documents != null) && (p.Documents.Length != 0))
     {
         List<TestDocument> doc = new List<TestDocument>();
         foreach (DocumentDto d in p.Documents)
         {
             doc.Add(new TestDocument(d));
         }
         documents = doc;
     }
     if ((p.Addresses != null) && (p.Addresses.Length != 0))
     {
         List<TestAddress> add = new List<TestAddress>();
         foreach (AddressDto a in p.Addresses)
         {
             add.Add(new TestAddress(a));
         }
         addreses = add;
     }
     if ((p.Contacts != null) && (p.Contacts.Length != 0))
     {
         List<TestContact> cont = new List<TestContact>();
         foreach(ContactDto c in p.Contacts)
         {
             cont.Add(new TestContact(c));
         }
         contacts = cont;
     }
     if (p.Job != null)
         job = new TestJob(p.Job);
     if (p.Privilege != null)
         privilege = new TestPrivilege(p.Privilege);
     if (p.BirthPlace != null)
         birthplace = new TestBirthplace(p.BirthPlace);
 }
示例#38
0
        public void Test_BirthPlaceUpdate()
        {
            PatientDto patient = (new FuncForAdd()).OnlyRequiredParamCorrect();
            // удаляем из БД, во избежание ошибки повторного добавления
            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);

            pixs.AddPatient(Data.guid, Data.idLPU, patient);

            // проверяем наличие пациента в БД
            var error = (new CommonFun()).CheckDB(patient);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));

            PatientDto updatePatient = new PatientDto();
            updatePatient.IdPatientMIS = patient.IdPatientMIS;
            updatePatient.BirthPlace = (new FuncForUpdate()).BirthPlaceUpdate();

            pixs.UpdatePatient(Data.guid, Data.idLPU, updatePatient);

            error = (new CommonFun()).CheckDB(updatePatient);
            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));
        }
示例#39
0
文件: FuncForGet.cs 项目: knastya/Pix
        private List<string> CompareMainData(PatientDto idealPatient, PatientDto patientForCompare)
        {
            var errorList = new List<string>();

            if (idealPatient.FamilyName != null && idealPatient.FamilyName != patientForCompare.FamilyName)
                errorList.Add("FamilyName не совпадает");
            if (idealPatient.GivenName != null && idealPatient.GivenName != patientForCompare.GivenName)
                errorList.Add("GivenName не совпадает");
            if (idealPatient.BirthDate != new DateTime() && idealPatient.BirthDate != patientForCompare.BirthDate)
                errorList.Add("BirthDate не совпадает");
            if (idealPatient.Sex != 0 && idealPatient.Sex != patientForCompare.Sex)
                errorList.Add("Sex  не совпадает");
            // не проверяем IdPatientMis (так как он не возвращается get'ом), он проверяется в CheckDB_AfterGet

            return errorList;
        }
示例#40
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddFullPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.DeathTime = new DateTime(2020, 02, 15);
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.IdBloodType = 1;
     patient.IdLivingAreaType = 1;
     patient.IdPatientMIS = "123456789010";
     patient.MiddleName = "Артемович";
     patient.Sex = 1;
     patient.SocialGroup = 2;
     patient.SocialStatus = "2.11";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 14;
     document.DocS = "1311";
     document.DocN = "113131";
     document.ExpiredDate = new DateTime(1999, 11, 12);
     document.IssuedDate = new DateTime(2012, 11, 12);
     document.ProviderName = "УФМС";
     document.RegionCode = "1221";
     patient.Documents = new PixServise.DocumentDto[] { document };
     PixServise.AddressDto address = new PixServise.AddressDto();
     address.IdAddressType = 1;
     address.StringAddress = "Улица Ленина 47";
     address.Street = "01000001000000100";
     address.Building = "1";
     address.City = "0100000000000";
     address.Appartment = "1";
     address.PostalCode = 1;
     address.GeoData = "1";
     PixServise.AddressDto address2 = new PixServise.AddressDto();
     address2.IdAddressType = 2;
     address2.StringAddress = "Улица Партизанская 47";
     address2.Street = "01000001000000100";
     address2.Building = "1";
     address2.City = "0100000000000";
     address2.Appartment = "1";
     address2.PostalCode = 1;
     address2.GeoData = "1";
     patient.Addresses = new PixServise.AddressDto[] { address, address2 };
     BirthPlaceDto birthplace = new BirthPlaceDto();
     birthplace.City = "Тутинск";
     birthplace.Country = "маленькая";
     birthplace.Region = "БОЛЬШОЙ";
     patient.BirthPlace = birthplace;
     ContactDto contact = new ContactDto();
     contact.IdContactType = 1;
     contact.ContactValue = "89626959434";
     ContactDto contact2 = new ContactDto();
     contact2.IdContactType = 1;
     contact2.ContactValue = "89525959544";
     patient.Contacts = new ContactDto[] { contact, contact2 };
     PixServise.JobDto job = new PixServise.JobDto();
     job.OgrnCode = "0100000000000"; // некорректный код
     job.CompanyName = "OOO 'МИГ'";
     job.Sphere = "Я";
     job.Position = "Я";
     job.DateStart = new DateTime(2003, 1, 1);
     job.DateEnd = new DateTime(2004, 1, 1);
     patient.Job = job;
     PrivilegeDto privilege = new PrivilegeDto();
     privilege.DateStart = new DateTime(1993, 01, 02);
     privilege.DateEnd = new DateTime(2020, 01, 02);
     privilege.IdPrivilegeType = 10;
     patient.Privilege = privilege;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#41
0
 public void Test_NoSex()
 {
     PatientDto patient = new PatientDto();
     Random random = new Random();
     patient.FamilyName = PatientData.Patient.FamilyName;
     patient.GivenName = PatientData.Patient.GivenName;
     patient.IdPatientMIS = PatientData.Patient.IdPatientMIS + random.Next(1500);
     patient.BirthDate = PatientData.Patient.BirthDate;
     // удаляем из БД, во избежание ошибки повторного добавления
     (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
     try
     {
         pixs.AddPatient(Data.guid, Data.idLPU, patient);
         (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
         Assert.Fail("Отсутствие ошибки \"Параметр Sex контейнера Patient заполнен некорректно\"");
     }
     //catch (System.ServiceModel.FaultException<TestPixService.ServiceReference1.RequestFault> ex)
     catch (Exception ex)
     {
         (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
         Assert.AreEqual("Параметр Sex контейнера Patient заполнен некорректно", ex.Message.ToString());
     }
 }
示例#42
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddMinPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PixServiceClient c = new PixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     patient.Documents = new PixServise.DocumentDto[]
     {
         new PixServise.DocumentDto()
         {
             DocN = "123-123-123-12",
             ProviderName = "ПФР",
             IdDocumentType = 223
         }
     };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     client.UpdatePatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#43
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void UpdateMinPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     patient.Documents = (new SetData()).PatientSet().Documents;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     //patient.FamilyName = "Сидоров";
     client.UpdatePatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#44
0
 public void FindMultidocumentPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.Addresses = new PixServise.AddressDto[]
      {
          new PixServise.AddressDto
          {
              IdAddressType = 1,
              StringAddress = "Россия, г.Санкт-Петербург, р-н.Центральный, пер.Дегтярный, д.1/8, кв.82"
          }
      };
     patient.BirthDate = new DateTime(1976, 07, 19);
     patient.BirthPlace = new BirthPlaceDto
     {
         City = "г. СПБ",
         Country = "г. СПБ",
         Region = "г. СПБ"
     };
     patient.Contacts = new ContactDto[]
      {
          new ContactDto
          {
              ContactValue = "274-26-75",
              IdContactType = 1
          }
      };
     patient.Documents = new PixServise.DocumentDto[]
      {
          new PixServise.DocumentDto
          {
              DocN = "993820",
              DocS = "40 02",
              IdDocumentType = 14,
              IssuedDate = new DateTime(2002, 09, 06),
              ProviderName = "76 о/м СПб"
          },
          new PixServise.DocumentDto
          {
              DocN = "7852320830001562",
              DocS = "ЕП",
              IdDocumentType = 228,
              IdProvider = "78008",
              IssuedDate = new DateTime(2014, 05, 03),
              ProviderName = "САНКТ-ПЕТЕРБУРГСКИЙ ФИЛИАЛ ОАО 'РОСНО-МС'"
          },
          new PixServise.DocumentDto
          {
              DocN = "148-841-391 96",
              IdDocumentType = 223,
              ProviderName = "ПФР"
          }
      };
     patient.FamilyName = "Трескунов";
     patient.GivenName = "Роман";
     patient.IdLivingAreaType = 1;
     patient.Job = new PixServise.JobDto
     {
         CompanyName = "Не работает",
     };
     patient.SocialStatus = "2.4";
     patient.IdPatientMIS = "2312312312399";
     patient.Sex = 1;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.230", patient);
     client.UpdatePatient(Global.GUID, "1.2.643.5.1.13.3.25.78.230", patient);
     PatientDto patient2 = new PatientDto();
     patient2.Documents = new PixServise.DocumentDto[]
      {
          new PixServise.DocumentDto
          {
              DocN = "7852320830001562",
              DocS = "ЕП",
              IdDocumentType = 228
          }
      };
     patient2.FamilyName = "Трескунов";
     patient2.GivenName = "Роман";
     patient2.BirthDate = new DateTime(1976, 07, 19);
     client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.230", patient2, SourceType.Reg);
 }
示例#45
0
 public void SearchPatientByMinParametrAndDocument()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 14;
     document.DocS = "1234";
     document.DocN = "123456";
     document.ProviderName = "УФМС";
     patient.Documents = new PixServise.DocumentDto[] { document };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     PatientDto forSearch = new PatientDto();
     forSearch.FamilyName = "Жукин";
     forSearch.GivenName = "Дмитрий";
     forSearch.BirthDate = new DateTime(1983, 01, 07);
     forSearch.Sex = 1;
     PixServise.DocumentDto forSearchD = new PixServise.DocumentDto();
     forSearchD.IdDocumentType = 14;
     forSearchD.DocS = "1234";
     forSearchD.DocN = "123456";
     forSearch.Documents = new PixServise.DocumentDto[] { document };
     client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", forSearch, SourceType.Reg);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#46
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void FindByFamilyAndName()
 {
     //System.Collections.ArrayList exeptions;
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Павел";
     patient.GivenName = "Петров";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PatientDto forSearch = new PatientDto();
     forSearch.FamilyName = "Павел";
     forSearch.GivenName = "Петров";
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     var patents = client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", forSearch, SourceType.Fed);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#47
0
        public void Test_SearchVersion4()
        {
            var error = new List<string>();
            PatientDto patient = new PatientDto();
            patient = (new FuncForAdd()).ConstParamCorrect("IdentGet");
            // Задаём паспорт
            patient.Documents = new DocumentDto[] { (new FuncForAdd()).Set_MinDocument(PatientData.Passport) };

            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);

            pixs.AddPatient(Data.guid, Data.idLPU, patient);

            error = (new CommonFun()).CheckDB(patient);

            // задаём необходимые данные для поиска добавленного пациента
            PatientDto searchPatient = new PatientDto();
            (new FuncForGet()).Set_MainData(searchPatient);
            searchPatient.Sex = 1;
            // Задаём паспорт
            searchPatient.Documents = new DocumentDto[] { (new FuncForGet()).Set_DocumentForSearch(PatientData.Passport) };

            PatientDto[] getPatient = pixs.GetPatient(Data.guid, Data.idLPU, searchPatient, SourceType.Reg);
            // Проверяем найденных пациентов
            foreach (PatientDto pat in getPatient)
            {
                //сравниваем заданного для поиска пациента и найденого
                error.AddRange((new FuncForGet()).ComparePatient(searchPatient, pat));
                //проверяем наличие найденного пациента в БД
                error.AddRange((new FuncForGet()).CheckDB_AfterGet(pat));
            }

            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));
        }
示例#48
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddPatientWithPassport()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Легенда";
     patient.GivenName = "Легенда";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "1123123123";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 14;
     document.DocS = "1311";
     document.DocN = "113131";
     document.ProviderName = "УФМС";
     patient.Documents = new PixServise.DocumentDto[] { document };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#49
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddPatientWithPrivilege()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PrivilegeDto privilege = new PrivilegeDto();
     privilege.DateStart = new DateTime(1993, 01, 02);
     privilege.DateEnd = new DateTime(2020, 01, 02);
     privilege.IdPrivilegeType = 10;
     patient.Privilege = privilege;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#50
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddPatientWithJob()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PixServise.JobDto job = new PixServise.JobDto();
     job.CompanyName = "OOO 'МИГ'";
     patient.Job = job;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#51
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddPatientWithContacts()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     ContactDto contact = new ContactDto();
     contact.IdContactType = 1;
     contact.ContactValue = "89626959434";
     ContactDto contact2 = new ContactDto();
     contact2.IdContactType = 1;
     contact2.ContactValue = "89525959544";
     patient.Contacts = new ContactDto[] { contact, contact2 };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#52
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void AddPatientWithAddress()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PixServise.AddressDto address = new PixServise.AddressDto();
     address.StringAddress = "Улица Ленина 47";
     address.IdAddressType = 1;
     PixServise.AddressDto address2 = new PixServise.AddressDto();
     address2.StringAddress = "Улица Партизанская 47";
     address2.IdAddressType = 2;
     patient.Addresses = new PixServise.AddressDto[] { address, address2 };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#53
0
文件: SetData.cs 项目: nbIxMaN/EMKT
        public PatientDto PatientSet()
        {
            PatientDto patient = new PatientDto();
            patient.IdPatientMIS = PatientData.Patient.IdPatientMIS;
            patient.FamilyName = PatientData.Patient.FamilyName;
            patient.GivenName = PatientData.Patient.GivenName;
            patient.Sex = PatientData.Patient.Sex;
            patient.BirthDate = new DateTime(1990, 10, 10);
            patient.IdBloodType = 1;
            //PixServise.DocumentDto d = new PixServise.DocumentDto();
            //d.DocN = DocumentData.PatientPassport.DocN;
            //d.IdDocumentType = DocumentData.PatientPassport.IdDocumentType;
            //d.ProviderName = DocumentData.PatientPassport.ProviderName;
            //d.DocS = DocumentData.PatientPassport.DocS;
            PixServise.DocumentDto s = new PixServise.DocumentDto();
            s.DocN = DocumentData.PatientSNILS.DocN;
            s.IdDocumentType = DocumentData.PatientSNILS.IdDocumentType;
            s.ProviderName = DocumentData.PatientSNILS.ProviderName;
            patient.Documents = new PixServise.DocumentDto[] { s };

            return patient;
        }
示例#54
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void FindPatientBySnilsInReg()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Легенда";
     patient.GivenName = "Легенда";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "1123123123";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 223;
     document.DocN = "123-456-789 45";
     document.ProviderName = "Снилс";
     patient.Documents = new PixServise.DocumentDto[] { document };
     PatientDto find = new PatientDto();
     find.FamilyName = "Легенда";
     find.GivenName = "Легенда";
     find.BirthDate = new DateTime(1983, 01, 07);
     find.Documents = new PixServise.DocumentDto[] { document };
     client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", find, SourceType.Reg);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#55
0
 public void FindByFamilyAndName()
 {
     //System.Collections.ArrayList exeptions;
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = (new SetData()).PatientSet();
     PatientDto forSearch = new PatientDto();
     forSearch.FamilyName = PatientData.Patient.GivenName;
     forSearch.GivenName = PatientData.Patient.FamilyName;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     var patents = client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", forSearch, SourceType.Fed);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#56
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void PatientWithRealationship()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "Дмитрий";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "123456789010";
     PatientDto patient2 = new PatientDto();
     patient2.FamilyName = "Петров";
     patient2.GivenName = "Денис";
     patient2.BirthDate = new DateTime(1999, 02, 03);
     patient2.Sex = 1;
     patient2.IdPatientMIS = "098765432111";
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient2);
     ContactPersonDto pers = new ContactPersonDto();
     pers.ContactList = patient2.Contacts;
     pers.FamilyName = patient2.FamilyName;
     pers.GivenName = patient2.GivenName;
     pers.IdPersonMis = patient2.IdPatientMIS;
     pers.IdRelationType = 2;
     pers.MiddleName = patient2.MiddleName;
     patient.ContactPerson = pers;
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#57
0
 public void FindPatientByIdMIS()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = (new SetData()).PatientSet();
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     PatientDto find = new PatientDto();
     find.IdPatientMIS = patient.IdPatientMIS;
     client.GetPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", find, SourceType.Reg);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#58
0
文件: UnitTest1.cs 项目: nbIxMaN/EMKT
 public void SearchEmptyPatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     var test = client.GetPatient("8CDE415D-FAB7-4809-AA37-8CDD70B1B46C", "1.2.643.5.1.13.3.25.78.118", patient, SourceType.Fed);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#59
0
 public void UpdatePatient()
 {
     TestPixServiceClient client = new TestPixServiceClient();
     PatientDto patient = new PatientDto();
     patient.FamilyName = "Жукин";
     patient.GivenName = "АЛЕКСЕЙ";
     patient.BirthDate = new DateTime(1983, 01, 07);
     patient.Sex = 1;
     patient.IdPatientMIS = "12345678900029";
     PixServise.DocumentDto document = new PixServise.DocumentDto();
     document.IdDocumentType = 14;
     document.DocS = "1311";
     document.DocN = "113131";
     document.ProviderName = "УФМС";
     patient.Documents = new PixServise.DocumentDto[] { document };
     PixServise.AddressDto address = new PixServise.AddressDto();
     address.IdAddressType = 1;
     address.StringAddress = "ТУТ";
     patient.Addresses = new PixServise.AddressDto[] { address };
     ContactDto cont = new ContactDto();
     cont.IdContactType = 1;
     cont.ContactValue = "89519435454";
     ContactDto cont2 = new ContactDto();
     cont2.IdContactType = 1;
     cont2.ContactValue = "89519435455";
     patient.Contacts = new ContactDto[] { cont, cont2 };
     client.AddPatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     client.UpdatePatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient);
     PatientDto patient2 = new PatientDto();
     PixServise.DocumentDto document2 = new PixServise.DocumentDto();
     document2.IdDocumentType = 14;
     document2.DocS = "1311";
     document2.DocN = "113131";
     document2.ProviderName = "УФМС";
     patient2.Documents = new PixServise.DocumentDto[] { document2 };
     PixServise.AddressDto address2 = new PixServise.AddressDto();
     address2.IdAddressType = 1;
     address2.StringAddress = "ТУТ";
     patient2.FamilyName = "Сидоров";
     patient2.Addresses = new PixServise.AddressDto[] { address2 };
     ContactDto cont3 = new ContactDto();
     cont3.IdContactType = 1;
     cont3.ContactValue = "89519435456";
     patient2.Contacts = new ContactDto[] { cont3 };
     patient2.IdPatientMIS = patient.IdPatientMIS;
     client.UpdatePatient(Global.GUID, "1.2.643.5.1.13.3.25.78.118", patient2);
     if (Global.errors == "")
         Assert.Pass();
     else
         Assert.Fail(Global.errors);
 }
示例#60
0
        public void Test_SearchТNoExistPatient()
        {
            var error = new List<string>();
            PatientDto patient = new PatientDto();
            patient = (new FuncForAdd()).ConstParamCorrect("IdentGet");

            // удаляем пациента
            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);

            // задаём необходимые данные для поиска добавленного пациента
            PatientDto searchPatient = new PatientDto();
            searchPatient.IdPatientMIS = patient.IdPatientMIS;

            PatientDto[] getPatient = pixs.GetPatient(Data.guid, Data.idLPU, searchPatient, SourceType.Reg);
            // Проверяем найденных пациентов
            foreach (PatientDto pat in getPatient)
            {
                //проверяем наличие найденного пациента в БД
                error.AddRange((new FuncForGet()).CheckDB_AfterGet(pat));
            }

            (new CommonFun()).DeletePatientFromDB(guid, idLPU, patient.IdPatientMIS);
            Assert.AreEqual(string.Empty, base.ErrorsListToStr(error));
        }