Example #1
0
        public void AddPatient_With_Document()
        {
            testPatient.FamilyName   = "Иванов";
            testPatient.GivenName    = "Петр";
            testPatient.MiddleName   = "Федорович";
            testPatient.BirthDate    = new DateTime(1992, 05, 05);
            testPatient.IdPatientMIS = "1234567";
            testPatient.Sex          = 1;

            PixService.DocumentDto doc = new PixService.DocumentDto();
            doc.IdDocumentType = 1;
            doc.DocS           = "4445";
            doc.DocN           = "444444";
            doc.ExpiredDate    = new DateTime(2020, 05, 01);
            doc.IssuedDate     = new DateTime(2010, 05, 01);
            doc.ProviderName   = "ОМ45";
            doc.RegionCode     = "78";

            testPatient.Documents    = new PixService.DocumentDto[1];
            testPatient.Documents[0] = doc;

            client.AddPatient(guid, idLPU, testPatient);
            PixService.PatientDto[] testPatients = client.GetPatient(guid, idLPU, testPatient, PixService.SourceType.Reg);

            Assert.AreEqual(1, testPatients[0].Documents[0].IdDocumentType);
            Assert.AreEqual("4445", testPatients[0].Documents[0].DocS);
            Assert.AreEqual("444444", testPatients[0].Documents[0].DocN);
            Assert.AreEqual(new DateTime(2020, 05, 01), testPatients[0].Documents[0].ExpiredDate);
            Assert.AreEqual(new DateTime(2010, 05, 01), testPatients[0].Documents[0].IssuedDate);
            Assert.AreEqual("ОМ45", testPatients[0].Documents[0].ProviderName);
            Assert.AreEqual("78", testPatients[0].Documents[0].RegionCode);
        }
Example #2
0
        public void AddPatient_With_Document_MissParameter_DocN()
        {
            testPatient.FamilyName   = "Иванов";
            testPatient.GivenName    = "Петр";
            testPatient.MiddleName   = "Федорович";
            testPatient.BirthDate    = new DateTime(1992, 05, 05);
            testPatient.IdPatientMIS = "1234567";
            testPatient.Sex          = 1;

            PixService.DocumentDto doc = new PixService.DocumentDto();
            doc.IdDocumentType       = 1;
            testPatient.Documents    = new PixService.DocumentDto[1];
            testPatient.Documents[0] = doc;

            Assert.That(() => client.AddPatient(guid, idLPU, testPatient), Throws.ArgumentException);
        }
Example #3
0
        public void AddPatient_With_Document_ExpiredDate_LessThan_IssuedDate()
        {
            testPatient.FamilyName   = "Иванов";
            testPatient.GivenName    = "Петр";
            testPatient.MiddleName   = "Федорович";
            testPatient.BirthDate    = new DateTime(1992, 05, 05);
            testPatient.IdPatientMIS = "1234567";
            testPatient.Sex          = 1;

            PixService.DocumentDto doc = new PixService.DocumentDto();
            doc.IdDocumentType       = 1;
            doc.DocS                 = "4445";   // Не должны использоваться разделители (пробелы, тире и т.д.)
            doc.DocN                 = "545455"; // Не должны использоваться разделители (пробелы, тире и т.д.)
            doc.ExpiredDate          = new DateTime(2010, 01, 01);
            doc.IssuedDate           = new DateTime(2020, 01, 01);
            testPatient.Documents    = new PixService.DocumentDto[1];
            testPatient.Documents[0] = doc;

            Assert.That(() => client.AddPatient(guid, idLPU, testPatient), Throws.ArgumentException);
        }
Example #4
0
        public void AddPatient_With_2_Documents()
        {
            testPatient.FamilyName   = "Иванов";
            testPatient.GivenName    = "Петр";
            testPatient.MiddleName   = "Федорович";
            testPatient.BirthDate    = new DateTime(1992, 05, 05);
            testPatient.IdPatientMIS = "1234567";
            testPatient.Sex          = 1;

            PixService.DocumentDto doc = new PixService.DocumentDto();
            doc.IdDocumentType = 1;
            doc.DocS           = "4445";
            doc.DocN           = "444444";


            PixService.DocumentDto doc2 = new PixService.DocumentDto();
            doc2.IdDocumentType = 230;
            doc.DocS            = "4445";
            doc2.DocN           = "44444355344";

            testPatient.Documents = new PixService.DocumentDto[2];

            testPatient.Documents[0] = doc;
            testPatient.Documents[1] = doc2;

            client.AddPatient(guid, idLPU, testPatient);

            PixService.PatientDto[] testPatients = client.GetPatient(guid, idLPU, testPatient, PixService.SourceType.Reg);

            Assert.AreEqual(1, testPatients[0].Documents[0].IdDocumentType);
            Assert.AreEqual("4445", testPatients[0].Documents[0].DocS);
            Assert.AreEqual("444444", testPatients[0].Documents[0].DocN);
            Assert.AreEqual(230, testPatients[0].Documents[1].IdDocumentType);
            Assert.AreEqual("4445", testPatients[0].Documents[1].DocS);
            Assert.AreEqual("44444355344", testPatients[0].Documents[1].DocN);
        }