Beispiel #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);
        }
Beispiel #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"]);
 }
 public void LoadSelectedConversionData(GenderId gender, ConversionId conversion, string region, BrandId brand)
 {
     this.SelectedConversionData = this.conversiondsDB.ConversionData.Where(c => c.Gender == gender &&
                                                                            c.Conversion == conversion &&
                                                                            c.Region == region &&
                                                                            c.Brand == brand).FirstOrDefault();
 }
        public static string GetString(GenderId genderId, string maleString, string femaleString)
        {
            switch (genderId)
            {
            case GenderId.Male: return(maleString);

            case GenderId.Female: return(femaleString);
            }
            return("");
        }
        public PatientIdentification(DbDataReader dr)
        {
            GmDataReader gr = new GmDataReader(dr);

            id                 = gr.GetInt32();
            surname            = gr.GetString();
            name               = gr.GetString();
            middleName         = gr.GetString();
            gender             = (GenderId)gr.GetInt();
            birthday           = gr.GetDateTime();
            identificationData = IdentificationData.Create(gr.GetString());
        }
        public Passport(DbDataReader dr)
        {
            int i = 0;

            id              = dr.GetInt32(i++);
            serialNumber    = dr.GetString(i++);
            issueDepartment = dr.GetString(i++);
            issueDate       = dr.GetDateTime(i++);
            departmentCode  = dr.GetString(i++);
            surname         = dr.GetString(i++);
            name            = dr.GetString(i++);
            middleName      = dr.GetString(i++);
            gender          = (GenderId)dr.GetInt32(i++);
            birthday        = dr.GetDateTime(i++);
            birthPlace      = dr.GetString(i++);
            registration    = dr.GetString(i++);
        }
        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", "");
            }
        }
Beispiel #9
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 static string GetEndingA(GenderId genderId)
 {
     return(GetString(genderId, "", "а"));
 }
 public static FeedbackAdjustment GetAdjustmentOrNull(ConversionId cId, string rId, GenderId gender, BrandId bId)
 {
     throw new NotImplementedException();
 }
Beispiel #12
0
 public Gender(GenderId id)
 {
     this.Id   = id;
     this.Name = id.ToString();
 }
 public string GetHelpText(MeasurementId measurementId, GenderId gender)
 {
     return(App.VM.HelpData.HelpText[measurementId]);
 }
Beispiel #14
0
        public async Task LoadConversionsPageDataAsyncTask(int profileId, ConversionId conversionId)
        {
            // Fire the event off
            this.IsConversionDataLoading = true;
            if (this.ConversionDataLoading != null)
            {
                this.ConversionDataLoading(this);
            }

            // Load up the data in case of tombstone situation
            await TaskEx.Run(() =>
            {
                // Modify the vars directly to avoid raising NotifyPropertyChanged
                if (App.VM.SelectedProfile == null || App.VM.SelectedProfile.Id != profileId)
                {
                    App.VM._selectedProfile = (from Profile p in App.VM.appDB.Profiles where p.Id == profileId select p).FirstOrDefault();
                }
                if (App.VM.SelectedConversionType != conversionId)
                {
                    App.VM._selectedConversionType = conversionId;
                }
            });

            // TODO: If gender not specified, then return Female measurements. Note only perform gener query on tables that have
            // Gender fields (even after casting) because it still generate SQL to query gender
            GenderId qGender = (this.SelectedProfile.Gender == GenderId.Unspecified) ? GenderId.Female : this.SelectedProfile.Gender;

            this.LoadRequiredMeasurements(qGender, this.SelectedConversionType);

            Dictionary <MeasurementId, double> measuredVals = this.ConversionMeasurements.ToDictionary(k => k.MeasurementId, v => Double.Parse(v.Value));

            // Check we have all the necessary measurements
            if (measuredVals == null)
            {
                return;
            }
            // Build up by regions
            string selectedRegion = this.SelectedRegion;

            // Await the resolution of BlacklistedBrands
            BrandId[]    blacklistedBrands = App.VM.BlacklistedBrands.ToArray();
            ConversionId conversion        = App.VM.SelectedConversionType;

            this.GroupedConversions = await TaskEx.Run(() =>
            {
                string r = selectedRegion;
                List <ConversionData> conversions     = new List <ConversionData>();
                IEnumerable <BrandId> collectedBrands = new List <BrandId>();
                while (true) // I know ...
                {
                    // Do database (Linq-to-sql) stuff first, so this should translate to SQL and run SQL with AsList
                    conversions.AddRange(from d in this.conversiondsDB.ConversionData
                                         where d is ConversionData
                                         // Filter to specific region, gender, conversion
                                         && d.Region == r &&
                                         d.Gender == qGender &&
                                         d.Conversion == conversion &&
                                         !blacklistedBrands.Contains(d.Brand) &&
                                         !collectedBrands.Contains(d.Brand)
                                         select d);
                    collectedBrands = from d in conversions select d.Brand;
                    if (r == Globalisation.CustomRegions.GlobalRegion)
                    {
                        break;
                    }
                    r = Globalisation.CustomRegions.RegionParents[r];
                }
                conversions.Sort((a, b) => { return(a.BrandName.CompareTo(b.BrandName)); });
                // Group up the brand names
                string groupKeys = "#abcdefghijklmnopqrstuvwxyz";
                // Initially store in a dictionary
                Dictionary <string, List <ConversionData> > groupDict = new Dictionary <string, List <ConversionData> >();
                foreach (char c in groupKeys)
                {
                    groupDict.Add(c.ToString(), new List <ConversionData>());
                }
                foreach (ConversionData cd in conversions)
                {
                    // Find the best fit whilst at it
                    cd.FindBestFit(measuredVals);
                    // Add to the right group according to the first letter of the brand name
                    char key = char.ToLower(cd.BrandName[0]);
                    if (key < 'a' || key > 'z')
                    {
                        key = '#';
                    }
                    groupDict[key.ToString()].Add(cd);
                }
                // Buffer first to avoid triggering the NotifyPropertyChanged events on ObservableCollection hundreds of times
                List <LongListSelectorGroup <ConversionData> > buff = new List <LongListSelectorGroup <ConversionData> >();
                foreach (char key in groupKeys)
                {
                    string k = key.ToString();
                    buff.Add(new LongListSelectorGroup <ConversionData>(k, groupDict[k]));
                }
                return(new ObservableCollection <LongListSelectorGroup <ConversionData> >(buff));
            });

            // Fire the end event
            if (this.ConversionDataLoaded != null)
            {
                this.ConversionDataLoaded(this);
            }
            this.IsConversionDataLoading = false;
        }
Beispiel #15
0
        public void LoadRequiredMeasurements(GenderId gender, ConversionId conversion)
        {
            // Get the conversion specific data
            switch (conversion)
            {
            case ConversionId.TrouserSize:
                if (gender == GenderId.Male)
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.TrousersMens);
                }
                else
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.TrousersWomens);
                }
                break;

            case ConversionId.ShirtSize:
                if (gender == GenderId.Male)
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.ShirtMens);
                }
                else
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.ShirtWomens);
                }
                break;

            case ConversionId.HatSize:
                this.LoadConversionMeasurements(RequiredMeasurements.Hat);
                break;

            case ConversionId.SuitSize:
                if (gender == GenderId.Male)
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.SuitMens);
                }
                else
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.SuitWomens);
                }
                break;

            case ConversionId.DressSize:
                this.LoadConversionMeasurements(RequiredMeasurements.DressSize);
                break;

            case ConversionId.BraSize:
                this.LoadConversionMeasurements(RequiredMeasurements.Bra);
                break;

            case ConversionId.HosierySize:
                this.LoadConversionMeasurements(RequiredMeasurements.Hosiery);
                break;

            case ConversionId.ShoeSize:
                this.LoadConversionMeasurements(RequiredMeasurements.Shoes);
                break;

            case ConversionId.SkiBootSize:
                this.LoadConversionMeasurements(RequiredMeasurements.SkiBoots);
                break;

            case ConversionId.WetsuitSize:
                if (gender == GenderId.Male)
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.WetsuitMens);
                }
                else
                {
                    this.LoadConversionMeasurements(RequiredMeasurements.WetsuitWomens);
                }
                break;

            default:
                return;
            }
        }
 public static string GetGender(GenderId genderId)
 {
     return(GetString(genderId, "мужской", "женский"));
 }
 public static string GetEndingGo(GenderId genderId)
 {
     return(GetString(genderId, "го", "й"));
 }
        public BitmapImage GetHelpImg(MeasurementId measurementId, GenderId gender)
        {
            string fn = (gender == GenderId.Male) ? App.VM.HelpData.HelpImgMale[measurementId] : App.VM.HelpData.HelpImgFemale[measurementId];

            return(new BitmapImage(new Uri(AppConstants.HELP_IMAGE_DIRECTORY + fn, UriKind.Relative)));
        }
 public static string GetEndingOi(GenderId genderId)
 {
     return(GetString(genderId, "ой", "ая"));
 }
Beispiel #20
0
 //public virtual ISet<human> humans { get; set; }
 //public virtual void AddOrder(human human)
 //{
 //    humans.Add(human);
 //    human.gender = this;
 //}
 public override string ToString()
 {
     return(GenderId.ToString() + ". " + gendername + ", " + _human.ToString());
 }
Beispiel #21
0
                public override int GetHashCode()
                {
                    int num = 1;

                    if (EntityId != 0)
                    {
                        num ^= EntityId.GetHashCode();
                    }
                    if (EntityType != 0)
                    {
                        num ^= EntityType.GetHashCode();
                    }
                    if (name_ != null)
                    {
                        num ^= Name.GetHashCode();
                    }
                    if (defId_.HasValue)
                    {
                        num ^= DefId.GetHashCode();
                    }
                    if (weaponId_.HasValue)
                    {
                        num ^= WeaponId.GetHashCode();
                    }
                    if (genderId_.HasValue)
                    {
                        num ^= GenderId.GetHashCode();
                    }
                    if (playerIndexInFight_.HasValue)
                    {
                        num ^= PlayerIndexInFight.GetHashCode();
                    }
                    if (ownerId_.HasValue)
                    {
                        num ^= OwnerId.GetHashCode();
                    }
                    if (teamId_.HasValue)
                    {
                        num ^= TeamId.GetHashCode();
                    }
                    if (level_.HasValue)
                    {
                        num ^= Level.GetHashCode();
                    }
                    num ^= ((object)properties_).GetHashCode();
                    if (position_ != null)
                    {
                        num ^= Position.GetHashCode();
                    }
                    if (direction_.HasValue)
                    {
                        num ^= Direction.GetHashCode();
                    }
                    num ^= ((object)Caracs).GetHashCode();
                    if (customSkin_ != null)
                    {
                        num ^= CustomSkin.GetHashCode();
                    }
                    if (actionDoneThisTurn_.HasValue)
                    {
                        num ^= ActionDoneThisTurn.GetHashCode();
                    }
                    if (_unknownFields != null)
                    {
                        num ^= ((object)_unknownFields).GetHashCode();
                    }
                    return(num);
                }