Esempio n. 1
0
        public DischargeEpicrisisReportBuilder(ConnectionFactory factory, Config config, Patient patient)
            : base(ReportBuilderId.DischargeEpicrisis)
        {
            using (GmConnection conn = factory.CreateConnection())
            {
                AddParameter("Age", patient.GetAgeStr(conn));
                AddParameter("PatientName", patient.GetPatientName(conn));
                AddParameter("DoctorName", patient.GetDoctorName(conn));
                AddParameter("ChiefName", patient.GetChiefName(conn));
                GenderId genderId = patient.GetGender(conn);
                AddParameter("EndingOi", GenderUtils.GetEndingOi(genderId));
                AddParameter("EndingA", GenderUtils.GetEndingA(genderId));
                AddParameter("Treatment", patient.GetTreatment(conn));
                AddParameter("PatientExamination", patient.GetExamination(conn));
                AddParameter("PatientStateDynamics", patient.GetPatientStateDynamics(conn));
            }

            AddParameter("Department", config.DepartmentFullName);
            AddParameter("AdmissionDiagnosis", patient.patientDiagnoses.admissionDiagnosis);
            AddParameter("FinalDiagnosis", patient.patientDiagnoses.clinicalDiagnosis);
            AddParameter("Complication", patient.patientDiagnoses.complicationDiagnosis);
            AddParameter("GeneralCondition", patient.patientDescription);
            AddParameter("Coverlet", patient.patientDescription);
            AddParameter("SystolicBloodPressure", patient.patientDescription);
            AddParameter("DiastolicBloodPressure", patient.patientDescription);
            AddParameter("HeartRate", patient.patientDescription);
            AddParameter("RespiratoryRate", patient.patientDescription);
        }
Esempio n. 2
0
 public PatientDescriptionReportBuilder(ConnectionFactory factory, Config config, Patient patient)
     : base(ReportBuilderId.PatientDescription)
 {
     AddDataSource("ReportsDataSet_Prescriptions", PrescriptionsReportBuilder.GetPrescriptionsTable(factory, patient.Id));
     AddHandbooksInfo(patient.patientDescription, config[HandbookGroupId.PatientDescription]);
     AddHandbooksInfo(patient.patientData, config[HandbookGroupId.PatientData]);
     using (GmConnection conn = factory.CreateConnection())
     {
         AddParameter("Age", patient.GetAgeStr(conn));
         AddParameter("DoctorName", patient.GetDoctorName(conn));
         AddParameter("ChiefName", patient.GetChiefName(conn));
         AddParameter("PatientName", patient.GetPatientName(conn));
         GenderId genderId = patient.GetGender(conn);
         AddParameter("EndingOi", GenderUtils.GetEndingOi(genderId));                //2	Больн(ой) (-ая)
         AddParameter("EndingA", GenderUtils.GetEndingA(genderId));
         AddParameter("EndingGo", GenderUtils.GetEndingGo(genderId));
         AddParameter("PatientSex", GenderUtils.GetGender(genderId));
         AddParameter("Analyses", patient.GetAnalysesList(conn));
         AddParameter("Examinations", patient.GetExamination(conn));                         //80 Обследования
     }
     AddParameter("DescriptionTime", patient.patientData.descriptionTime, "dd.MM.yy HH:mm"); //1 Дата и время жалоб
     AddParameter("AdmissionDiagnosis", patient.patientDiagnoses.admissionDiagnosis);        //3	Предварительный диагноз
     AddParameter("SickListStartDate", patient.patientData.sickListStartDate);               //15 Дата начала больничного
     AddParameter("DepartmentName", config.departmentConfig.departmentName);
     AddParameter("HospitalName", config.departmentConfig.hospitalName);
     AddParameter("PulseShortage", GetPulseShortage(patient.patientDescription));
     AddParameter("ECGData", patient.patientData["ECG"]);
 }
Esempio n. 3
0
        public void Load()
        {
            var parser  = new InputFileParser(logger);
            var results = parser.parse(fileName, MandatoryFields);

            //Add participants
            foreach (var line in results)
            {
                var name   = line.items.FirstOrDefault(i => i.Key == ColNames.Name).Value;
                var gender = GenderUtils.Parse(line.items.FirstOrDefault(i => i.Key == ColNames.Gender).Value);
                if (gender == null)
                {
                    throw new ParsingException($"No gender found for participant {name}");
                }

                this.addParticipantCB(new Participant(name, (Gender)gender));
                logger.Log($"Adding participant {name}");
            }

            //Add constraints
            foreach (var line in results)
            {
                var name = line.items.FirstOrDefault(i => i.Key == ColNames.Name).Value;

                //Add Gender constraints
                if (BlockPhrases.Contains(line.items.FirstOrDefault(i => i.Key == ColNames.DatingMales).Value))
                {
                    addConstraintToParticipantCB(name, new GenderBlockConstraint(Gender.Male));
                }
                if (BlockPhrases.Contains(line.items.FirstOrDefault(i => i.Key == ColNames.DatingFemales).Value))
                {
                    addConstraintToParticipantCB(name, new GenderBlockConstraint(Gender.Female));
                }

                //Add participant constraints
                foreach (var i in line.items.Where(i2 => !MandatoryFields.Contains(i2.Key)))
                {
                    if (BlockPhrases.Contains(i.Value))
                    {
                        //this means we have a column with participant name and its value is some block phrase (eg - block)
                        //so we take the column name (key) and add it as a constraint
                        addConstraintToParticipantCB(name, new ParticipantBlockConstraint(i.Key));
                    }
                }
            }
            logger.Log("Loading complete");
            LoadCompleteCB();
        }
        public DischargeReportBuilder(ConnectionFactory factory, Config config, Patient patient)
            : base(ReportBuilderId.Discharge)
        {
            using (GmConnection conn = factory.CreateConnection())
            {
                AddParameter("Age", patient.GetAgeStr(conn));
                AddParameter("PatientName", patient.GetPatientName(conn));
                AddParameter("DoctorName", patient.GetDoctorName(conn));
                AddParameter("ChiefName", patient.GetChiefName(conn));
                AddParameter("Address", patient.GetAddress(conn));
                GenderId genderId = patient.GetGender(conn);
                AddParameter("EndingOi", GenderUtils.GetEndingOi(genderId));
                AddParameter("EndingA", GenderUtils.GetEndingA(genderId));
                AddParameter("Treatment", patient.GetTreatment(conn));
                AddParameter("PatientInvestigation", patient.GetAnalysesReport(conn, config));
                AddParameter("PatientExamination", patient.GetExamination(conn));
                AddParameter("PatientStateDynamics", patient.GetPatientStateDynamics(conn));
            }

            AddHandbooksInfo(patient.patientData, config[HandbookGroupId.PatientData]);

            AddParameter("Department", config.DepartmentFullName);
            AddParameter("AdmissionDiagnosis", patient.patientDiagnoses.admissionDiagnosis);
            AddParameter("FinalDiagnosis", patient.patientDiagnoses.finalDiagnosis);
            AddParameter("GeneralCondition", patient.patientDescription);
            AddParameter("Coverlet", patient.patientDescription);
            AddParameter("SystolicBloodPressure", patient.patientDescription);
            AddParameter("DiastolicBloodPressure", patient.patientDescription);
            AddParameter("HeartRate", patient.patientDescription);
            AddParameter("RespiratoryRate", patient.patientDescription);
            AddParameter("AdmissionDate", patient.admissionDate);
            AddParameter("DischargeDate", patient.dischargeDate);
            AddParameter("Breath", patient.patientDescription);
            AddParameter("HeartSounds", patient.patientDescription);
            AddParameter("AbdomenPalpation", patient.patientDescription);
            AddParameter("Liver", patient.patientDescription);
            AddParameter("Spleen", patient.patientDescription);
            AddParameter("LumbarKnocking", patient.patientDescription);
            AddParameter("Hypostases", patient.patientDescription);
            AddParameter("Complaints", patient.patientDescription);
            AddParameter("Pulse", patient.patientDescription);
            AddParameter("Complication", patient.patientDiagnoses.complicationDiagnosis);
            AddParameter("ÑoncomitantDiagnosis", patient.patientDiagnoses.concomitantDiagnosis);
            AddParameter("RecommendationsToCardiologist", patient.dischargeData);
        }
        public ReacardReportBuilder(ConnectionFactory factory, Config config, Patient patient, Reacard reacard)
            : base(ReportBuilderId.Prescriptions)
        {
            this.patient = patient;
            this.reacard = reacard;
            AddDataSource("ReportsDataSet_ReacardDescriptions", GetReacardDescriptionsTable(factory));
            AddDataSource("ReportsDataSet_ReacardPrescriptions", GetReacardPrescriptionsTable(factory));
            Analysis analysis = null;

            using (GmConnection conn = factory.CreateConnection())
            {
                AddParameter("Age", patient.GetAgeStr(conn));
                AddParameter("PatientName", patient.GetPatientName(conn));
                GenderId gid = patient.GetGender(conn);
                AddParameter("Gender", GenderUtils.GetGender(gid));
                analysis = Analysis.GetLastAnalysis(conn, patient.Id, "BloodGroupAndRhesusFactor");
            }
            AddHandbooksInfo(patient.patientData, config[HandbookGroupId.PatientData]);
            AddHandbooksInfo(reacard.reacardData, config[HandbookGroupId.ReacardData]);
            AddParameter("Diet", patient.dietNumber);
            try
            {
                int output  = GetReacardDataInt("Diuresis") + GetReacardDataInt("Stool");
                int balance = GetReacardDataInt("Input") + GetReacardDataInt("DrankWater") - output;
                AddParameter("Output", output.ToString());
                AddParameter("Balance", balance.ToString());
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }

            if (analysis != null)
            {
                AddParameter("BloodGroup", analysis.analysisData);
                AddParameter("RhesusFactor", analysis.analysisData);
            }
            else
            {
                AddParameter("BloodGroup", "");
                AddParameter("RhesusFactor", "");
            }
        }
Esempio n. 6
0
        public PostmortalEpicrisisReportBuilder(ConnectionFactory factory, Config config, Patient patient)
			: base(ReportBuilderId.PostmortalEpicrisis)
		{
			using (GmConnection conn = factory.CreateConnection())
			{
				GenderId genderId = patient.GetGender(conn);
				AddParameter("Age", patient.GetAgeStr(conn));
				AddParameter("PatientName", patient.GetPatientName(conn));
				AddParameter("DoctorName", patient.GetDoctorName(conn));
				AddParameter("ChiefName", patient.GetChiefName(conn));
				AddParameter("EndingOi", GenderUtils.GetEndingOi(genderId));
				AddParameter("EndingA", GenderUtils.GetEndingA(genderId));
				AddParameter("Treatment", patient.GetTreatment(conn));
				AddParameter("PatientInvestigation", patient.GetAnalysesList(conn));
				AddParameter("PatientExamination", patient.GetExamination(conn));
				AddParameter("PatientStateDynamics", patient.GetPatientStateDynamics(conn));
			}
  			AddHandbooksInfo(patient.dischargeData, config[HandbookGroupId.Postmortal]);
			AddParameter("Department", config.DepartmentFullName);
			AddParameter("AdmissionDiagnosis", patient.patientDiagnoses.admissionDiagnosis);
			AddParameter("FinalDiagnosis", patient.patientDiagnoses.finalDiagnosis);
			AddParameter("Complication", patient.patientDiagnoses.complicationDiagnosis);
			AddParameter("GeneralCondition", patient.patientDescription);
			AddParameter("Coverlet", patient.patientDescription);
			AddParameter("SystolicBloodPressure", patient.patientDescription);
			AddParameter("DiastolicBloodPressure", patient.patientDescription);
			AddParameter("HeartRate", patient.patientDescription);
			AddParameter("RespiratoryRate", patient.patientDescription);

/*			ArrayList ar=new ArrayList(parameters);
			foreach (KeyValuePair<string,string> pair in ar)
			{
				if (pair.Value.Trim().Length == 0)
				{
					parameters[pair.Key]= "-";
				}
			}	*/		
		}
 public void Should_throw_ArgumentNullException_if_middle_name_is_not_provided(string middleName)
 {
     Assert.Throws <ArgumentNullException>(() => GenderUtils.Detect(middleName));
 }
 public void Should_not_throw_exception_if_gender_can_not_be_detected(string middleName)
 {
     Assert.DoesNotThrow(() => GenderUtils.Detect(middleName));
 }
        public void Should_detect_gender_using_extension_method(string middleName, Gender expectedGender)
        {
            var actualGender = GenderUtils.Detect(middleName);

            Assert.AreEqual(expectedGender, actualGender);
        }