Exemplo n.º 1
0
        private void DischargeEpicrisisForm_Load(object sender, EventArgs e)
        {
            if (_dbEngine.ConfigEngine.DischargeEpicrisisFormLocation.X >= 0 &&
                _dbEngine.ConfigEngine.DischargeEpicrisisFormLocation.Y >= 0)
            {
                Location = _dbEngine.ConfigEngine.DischargeEpicrisisFormLocation;
            }

            comboBoxRentgen.SelectedIndex       = comboBoxShowing.SelectedIndex =
                comboBoxGipsDay.SelectedIndex   = 2;
            dateTimePickerReasonStartDate.Value = _patientInfo.DeliveryDate;
            if (_patientInfo.ReleaseDate.HasValue)
            {
                dateTimePickerReasonEndDate.Value = _patientInfo.ReleaseDate.Value;
            }

            textBoxConservativeTherapy.Text = _patientInfo.GetDischargeEpicrisConservativeTherapy();
            textBoxAfterOperation.Text      = _patientInfo.DischargeEpicrisAfterOperation;
            if (_patientInfo.DischargeEpicrisAnalysisDate.HasValue)
            {
                dateTimePickerAnalysisDate.Value = _patientInfo.DischargeEpicrisAnalysisDate.Value;
            }

            textBoxEkg.Text               = _patientInfo.DischargeEpicrisEkg;
            textBoxOakErotrocits.Text     = _patientInfo.DischargeEpicrisOakEritrocits;
            textBoxOakHb.Text             = _patientInfo.DischargeEpicrisOakHb;
            textBoxOakLekocits.Text       = _patientInfo.DischargeEpicrisOakLekocits;
            textBoxOakSoe.Text            = _patientInfo.DischargeEpicrisOakSoe;
            textBoxOamDensity.Text        = _patientInfo.DischargeEpicrisOamDensity;
            comboBoxOamColor.Text         = _patientInfo.DischargeEpicrisOamColor;
            textBoxOamErotrocits.Text     = _patientInfo.DischargeEpicrisOamEritrocits;
            textBoxOamLekocits.Text       = _patientInfo.DischargeEpicrisOamLekocits;
            textBoxBakBillirubin.Text     = _patientInfo.DischargeEpicrisBakBillirubin;
            textBoxBakGeneralProtein.Text = _patientInfo.DischargeEpicrisBakGeneralProtein;
            textBoxBakPTI.Text            = _patientInfo.DischargeEpicrisBakPTI;
            textBoxBakSugar.Text          = _patientInfo.DischargeEpicrisBakSugar;
            comboBoxBloodGroup.Text       = _patientInfo.DischargeEpicrisBloodGroup;
            comboBoxRhesusFactor.Text     = _patientInfo.DischargeEpicrisRhesusFactor;

            textBoxAdditionalAnalises.Text = _patientInfo.DischargeEpicrisAdditionalAnalises;

            if (_patientInfo.DischargeEpicrisRecomendations.Count == 1 &&
                _patientInfo.DischargeEpicrisRecomendations[0] == "notdefined")
            {
                _patientInfo.DischargeEpicrisRecomendations.Clear();
                checkBox1.Checked = checkBox2.Checked = checkBox3.Checked = true;
            }
            else
            {
                foreach (string str in _patientInfo.DischargeEpicrisRecomendations)
                {
                    string[] words = str.Split(' ');
                    switch (str.Substring(0, 8))
                    {
                    case "листок н":
                    case "ученичес":
                        checkBox1.Checked   = true;
                        comboBoxReason.Text = words[0] + " " + words[1];
                        dateTimePickerReasonStartDate.Value = ConvertEngine.GetDateTimeFromString(words[5]);
                        dateTimePickerReasonEndDate.Value   = ConvertEngine.GetDateTimeFromString(words[7].TrimEnd('.'));
                        break;

                    case "явка к х":
                        checkBox2.Checked = true;
                        dateTimePickerSurgeryDate.Value = ConvertEngine.GetDateTimeFromString(words[5].TrimEnd('.'));
                        break;

                    case "наблюден":
                        checkBox3.Checked       = true;
                        textBoxSpetialists.Text = str.Substring(words[0].Length + words[1].Length + 2);
                        break;

                    case "рентген-":
                        checkBox4.Checked          = true;
                        numericUpDownRentgen.Value = Convert.ToInt32(words[2]);
                        comboBoxRentgen.Text       = words[3];
                        break;

                    case "явка в о":
                        checkBox5.Checked          = true;
                        numericUpDownShowing.Value = Convert.ToInt32(words[6]);
                        comboBoxShowing.Text       = words[7];
                        break;

                    case "гипс до ":
                    case "брейс до":
                        checkBox6.Checked             = true;
                        comboBoxGips.Text             = words[0];
                        numericUpDownGipsLength.Value = Convert.ToInt32(words[2]);
                        comboBoxGipsDay.Text          = words[3];
                        break;

                    case "косыночн":
                        checkBox6.Checked             = true;
                        comboBoxGips.Text             = "косынка";
                        numericUpDownGipsLength.Value = Convert.ToInt32(words[3]);
                        comboBoxShowing.Text          = words[4];
                        break;
                    }
                }
            }

            if (_patientInfo.DischargeEpicrisAdditionalRecomendations.Count == 1 &&
                _patientInfo.DischargeEpicrisAdditionalRecomendations[0] == "notdefined")
            {
                _patientInfo.DischargeEpicrisAdditionalRecomendations.Clear();

                if (_dbEngine.GlobalSettings.IsDepartmentNameStartWithNumber("7"))
                {
                    _patientInfo.DischargeEpicrisAdditionalRecomendations.Add("«Ходьба с костылями без нагрузки на ногу»");
                    _patientInfo.DischargeEpicrisAdditionalRecomendations.Add("«Дозированная нагрузка»");
                }
            }

            textBoxAdditionalRecomendations.Text = ListToString(_patientInfo.DischargeEpicrisAdditionalRecomendations);
            _stopSaveParameters = false;
        }