Example #1
0
File: Data.cs Project: nbIxMaN/EMKT
        static public void SetMedRecord()
        {
            MedRecordData.service = new Service
            {
                DateStart     = new DateTime(2012, 11, 1),
                DateEnd       = new DateTime(2012, 11, 10),
                IdServiceType = "A01.01.001.001",
                ServiceName   = "Название услуги",
                Performer     = new Participant
                {
                    IdRole = 3,
                    Doctor = SetDoctor(),
                },
                PaymentInfo = new PaymentInfo
                {
                    HealthCareUnit = 1,
                    IdPaymentType  = 1,
                    PaymentState   = 1,
                    Quantity       = 1,
                    Tariff         = new Decimal(1000),
                },
            };

            MedRecordData.tfomsInfo = new TfomsInfo
            {
                IdTfomsType = 211010,
                Count       = 1,
                Tariff      = 100,
            };

            MedRecordData.appointedMedication = new AppointedMedication
            {
                AnatomicTherapeuticChemicalClassification = "A",
                DaysCount         = 5,
                IssuedDate        = new DateTime(2012, 03, 06),
                MedicineIssueType = "PRE",
                MedicineName      = "Валерьянка",
                MedicineType      = 136,
                MedicineUseWay    = 1,
                Number            = "324465",
                Seria             = "3242309",
                //CourseDose = new Quantity
                //{
                //    IdUnit = 1,
                //    Value = 20,
                //},
                DayDose = new Quantity
                {
                    IdUnit = 16,
                    Value  = 20
                },
                OneTimeDose = new Quantity
                {
                    IdUnit = 16,
                    Value  = 2,
                },
                Doctor = SetDoctor(),
            };

            MedRecordData.deathInfo = new DeathInfo
            {
                MkbCode = "M00",
            };

            MedRecordData.diagnosis = new Diagnosis
            {
                DiagnosisInfo = new DiagnosisInfo
                {
                    IdDiseaseType            = 1,
                    DiagnosedDate            = new DateTime(2012, 02, 02),
                    IdDiagnosisType          = 2,
                    Comment                  = "Комментарий",
                    DiagnosisChangeReason    = 2,
                    DiagnosisStage           = 1,
                    IdDispensaryState        = 8,
                    IdTraumaType             = 1,
                    MESImplementationFeature = 10,
                    MedicalStandard          = 211010,
                    MkbCode                  = "F00",
                },
                Doctor = SetDoctor(),
            };

            MedRecordData.clinicMainDiagnosis = new ClinicMainDiagnosis
            {
                DiagnosisInfo = new DiagnosisInfo
                {
                    IdDiseaseType            = 1,
                    DiagnosedDate            = new DateTime(2012, 02, 02),
                    IdDiagnosisType          = 1,
                    Comment                  = "Комментарий",
                    DiagnosisChangeReason    = 2,
                    DiagnosisStage           = 3,
                    IdDispensaryState        = 8,
                    IdTraumaType             = 1,
                    MESImplementationFeature = 10,
                    MedicalStandard          = 211010,
                    MkbCode                  = "D00",
                },
                Doctor        = SetDoctor(),
                Complications = new List <Diagnosis>
                {
                    new  Diagnosis
                    {
                        DiagnosisInfo = new DiagnosisInfo
                        {
                            IdDiseaseType            = 2,
                            DiagnosedDate            = new DateTime(2012, 02, 02),
                            IdDiagnosisType          = 2,
                            Comment                  = "Комментарий",
                            DiagnosisChangeReason    = 2,
                            DiagnosisStage           = 3,
                            IdDispensaryState        = 8,
                            IdTraumaType             = 1,
                            MESImplementationFeature = 10,
                            MedicalStandard          = 211010,
                            MkbCode                  = "C00",
                        },
                        Doctor = SetDoctor(),
                    }
                }
            };

            MedRecordData.clinicMainDiagnosisWithSnils = new ClinicMainDiagnosis
            {
                DiagnosisInfo = new DiagnosisInfo
                {
                    IdDiseaseType            = 1,
                    DiagnosedDate            = new DateTime(2010, 02, 02),
                    IdDiagnosisType          = 1,
                    Comment                  = "Комментарий",
                    DiagnosisChangeReason    = 2,
                    DiagnosisStage           = 1,
                    IdDispensaryState        = 8,
                    IdTraumaType             = 1,
                    MESImplementationFeature = 10,
                    MedicalStandard          = 211010,
                    MkbCode                  = "A00",
                },
                Doctor        = SetDoctorWithSNILS(),
                Complications = new List <Diagnosis>
                {
                    new  Diagnosis
                    {
                        DiagnosisInfo = new DiagnosisInfo
                        {
                            IdDiseaseType            = 2,
                            DiagnosedDate            = new DateTime(2010, 02, 02),
                            IdDiagnosisType          = 2,
                            Comment                  = "Комментарий",
                            DiagnosisChangeReason    = 2,
                            DiagnosisStage           = 1,
                            IdDispensaryState        = 8,
                            IdTraumaType             = 1,
                            MESImplementationFeature = 10,
                            MedicalStandard          = 211010,
                            MkbCode                  = "A00",
                        },
                        Doctor = SetDoctorWithSNILS(),
                    }
                }
            };
            MedRecordData.clinicMainDiagnosisWithOutSnils = new ClinicMainDiagnosis
            {
                DiagnosisInfo = new DiagnosisInfo
                {
                    IdDiseaseType            = 1,
                    DiagnosedDate            = new DateTime(2010, 02, 02),
                    IdDiagnosisType          = 1,
                    Comment                  = "Комментарий",
                    DiagnosisChangeReason    = 2,
                    DiagnosisStage           = 1,
                    IdDispensaryState        = 8,
                    IdTraumaType             = 1,
                    MESImplementationFeature = 10,
                    MedicalStandard          = 211010,
                    MkbCode                  = "A00",
                },
                Doctor        = SetDoctorWithoutSNILS(),
                Complications = new List <Diagnosis>
                {
                    new  Diagnosis
                    {
                        DiagnosisInfo = new DiagnosisInfo
                        {
                            IdDiseaseType            = 2,
                            DiagnosedDate            = new DateTime(2010, 02, 02),
                            IdDiagnosisType          = 2,
                            Comment                  = "Комментарий",
                            DiagnosisChangeReason    = 2,
                            DiagnosisStage           = 1,
                            IdDispensaryState        = 8,
                            IdTraumaType             = 1,
                            MESImplementationFeature = 10,
                            MedicalStandard          = 211010,
                            MkbCode                  = "A00",
                        },
                        Doctor = SetDoctorWithoutSNILS(),
                    }
                }
            };

            MedRecordData.anatomopathologicalClinicMainDiagnosis = new AnatomopathologicalClinicMainDiagnosis
            {
                DiagnosisInfo = new DiagnosisInfo
                {
                    IdDiseaseType            = 1,
                    DiagnosedDate            = new DateTime(2012, 02, 02),
                    IdDiagnosisType          = 1,
                    Comment                  = "Комментарий",
                    DiagnosisChangeReason    = 2,
                    DiagnosisStage           = 4,
                    IdDispensaryState        = 8,
                    IdTraumaType             = 1,
                    MESImplementationFeature = 10,
                    MedicalStandard          = 211010,
                    MkbCode                  = "A00",
                },
                Doctor        = SetDoctor(),
                Complications = new List <Diagnosis>
                {
                    new  Diagnosis
                    {
                        DiagnosisInfo = new DiagnosisInfo
                        {
                            IdDiseaseType            = 2,
                            DiagnosedDate            = new DateTime(2012, 02, 02),
                            IdDiagnosisType          = 2,
                            Comment                  = "Комментарий",
                            DiagnosisChangeReason    = 2,
                            DiagnosisStage           = 4,
                            IdDispensaryState        = 8,
                            IdTraumaType             = 1,
                            MESImplementationFeature = 10,
                            MedicalStandard          = 211010,
                            MkbCode                  = "B00",
                        },
                        Doctor = SetDoctor(),
                    }
                }
            };

            var data      = (new N3.EMK.Infrastructure.Helpers.SignatureHelper()).SignN3Gost(Convert.ToBase64String(File.ReadAllBytes("empty.pdf")), "application/pdf");
            var wrongdata = data.Remove(data.IndexOf("<Sign>") + 6, 1);

            MedRecordData.TrueMedRecordDataWithKey = new LaboratoryReport
            {
                Attachment = new MedDocument.DocumentAttachment
                {
                    Data     = Encoding.UTF8.GetBytes(data),
                    Hash     = N3.EMK.Infrastructure.Helpers.Md5Helper.GetGost3411Hash(data),
                    MimeType = "text/xml",
                    IsSigned = true
                },
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Author       = SetDoctor(),
            };

            MedRecordData.WrongMedRecordDataWithKey = new LaboratoryReport
            {
                Attachment = new MedDocument.DocumentAttachment
                {
                    Data     = Encoding.UTF8.GetBytes(wrongdata),
                    Hash     = Md5Helper.GetGost3411Hash(wrongdata),
                    Url      = new Uri("https://www.google.ru"),
                    MimeType = "text/xml",
                    IsSigned = true
                },
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Author       = SetDoctor(),
            };

            var dataForm027u = (new N3.EMK.Infrastructure.Helpers.SignatureHelper()).SignN3Gost(Convert.ToBase64String(File.ReadAllBytes("F027.xml")), "application/xml");

            MedRecordData.form027U = new Form027U
            {
                Attachment = new MedDocument.DocumentAttachment
                {
                    Data     = Encoding.UTF8.GetBytes(dataForm027u),
                    Hash     = N3.EMK.Infrastructure.Helpers.Md5Helper.GetGost3411Hash(dataForm027u),
                    MimeType = "text/xml"
                },
                CreationDate = new DateTime(2013, 02, 02),
                Header       = "Header 027U",
                Author       = SetDoctor(),
            };

            MedRecordData.dispensaryOne = new DispensaryOne
            {
                CreationDate             = new DateTime(2012, 02, 02),
                Header                   = "Header",
                IsGuested                = true,
                HasExpertCareRefferal    = true,
                IsUnderObservation       = true,
                HasExtraResearchRefferal = false,
                HasPrescribeCure         = true,
                HasHealthResortRefferal  = false,
                HasSecondStageRefferal   = false,
                Attachment               = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author                   = SetDoctor(),
                HealthGroup              = new HealthGroup
                {
                    Doctor          = SetDoctor(),
                    HealthGroupInfo = new HealthGroupInfo
                    {
                        Date          = new DateTime(2010, 02, 03),
                        IdHealthGroup = 1,
                    }
                },
                Recommendations = new List <Recommendation>
                {
                    new Recommendation
                    {
                        Doctor = SetDoctor(),
                        Date   = new DateTime(2012, 02, 04),
                        Text   = "Текст рекомендации",
                    }
                }
            };

            MedRecordData.dispensaryOneWithSnils = new DispensaryOne
            {
                CreationDate             = new DateTime(2010, 02, 02),
                Header                   = "Header",
                IsGuested                = true,
                HasExpertCareRefferal    = true,
                IsUnderObservation       = true,
                HasExtraResearchRefferal = false,
                HasPrescribeCure         = true,
                HasHealthResortRefferal  = false,
                HasSecondStageRefferal   = false,
                Attachment               = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author                   = SetDoctorWithSNILS(),
                HealthGroup              = new HealthGroup
                {
                    Doctor          = SetDoctorWithSNILS(),
                    HealthGroupInfo = new HealthGroupInfo
                    {
                        Date          = new DateTime(2010, 02, 03),
                        IdHealthGroup = 1,
                    }
                },
                Recommendations = new List <Recommendation>
                {
                    new Recommendation
                    {
                        Doctor = SetDoctorWithSNILS(),
                        Date   = new DateTime(2010, 02, 04),
                        Text   = "Текст рекомендации",
                    }
                }
            };
            MedRecordData.dispensaryOneWithoutSnils = new DispensaryOne
            {
                CreationDate             = new DateTime(2010, 02, 02),
                Header                   = "Header",
                IsGuested                = true,
                HasExpertCareRefferal    = true,
                IsUnderObservation       = true,
                HasExtraResearchRefferal = false,
                HasPrescribeCure         = true,
                HasHealthResortRefferal  = false,
                HasSecondStageRefferal   = false,
                Attachment               = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author                   = SetDoctorWithoutSNILS(),
                HealthGroup              = new HealthGroup
                {
                    Doctor          = SetDoctorWithoutSNILS(),
                    HealthGroupInfo = new HealthGroupInfo
                    {
                        Date          = new DateTime(2010, 02, 03),
                        IdHealthGroup = 1,
                    }
                },
                Recommendations = new List <Recommendation>
                {
                    new Recommendation
                    {
                        Doctor = SetDoctorWithoutSNILS(),
                        Date   = new DateTime(2010, 02, 04),
                        Text   = "Текст рекомендации",
                    }
                }
            };

            MedRecordData.referral = new Referral
            {
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                IdSourceLpu  = idlpu,
                IdTargetLpu  = idlpu,
                ReferralID   = "referralId2890",
                RelatedID    = "relatedId02890",
                Attachment   = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author       = SetDoctor(),
                ReferralInfo = new ReferralInfo
                {
                    Reason               = "Потому что",
                    IdReferralMis        = "idReferralMis2983",
                    IdReferralType       = 1,
                    IssuedDateTime       = new DateTime(2012, 02, 05),
                    HospitalizationOrder = 2,
                    MkbCode              = "A00.0",
                },
                DepartmentHead = SetDoctor(),
            };

            MedRecordData.sickList = new SickList
            {
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Attachment   = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author       = SetDoctor(),
                SickListInfo = new SickListInfo
                {
                    Number              = "341234567890",
                    DateStart           = new DateTime(2012, 02, 02),
                    DateEnd             = new DateTime(2012, 02, 22),
                    DisabilityDocState  = 1,
                    DisabilityDocReason = 1,
                    IsPatientTaker      = false,
                    Caregiver           = SetGuardian()
                }
            };

            MedRecordData.dischargeSummary = new DischargeSummary
            {
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Attachment   = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author       = SetDoctor(),
            };

            MedRecordData.LaboratoryReport = new LaboratoryReport
            {
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Attachment   = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author       = SetDoctor(),
            };

            MedRecordData.consultNote = new ConsultNote
            {
                CreationDate = new DateTime(2012, 02, 02),
                Header       = "Header",
                Attachment   = SetAttachment("empty.pdf", "https://www.google.ru", "application/pdf"),
                Author       = SetDoctor(),
            };
        }