private void SaveValueControlForInterfacingESO(string name, string value) { #region Capturar Valor del campo _listEspirometria.RemoveAll(p => p.v_ComponentFieldId == name); _espirometria = new ServiceComponentFieldValuesList(); _espirometria.v_ComponentFieldId = name; _espirometria.v_Value1 = value; _listEspirometria.Add(_espirometria); DataSource = _listEspirometria; #endregion }
private void SaveValueControlForInterfacingESO(string name, string value) { #region Capturar Valor del campo _listOfAtencionAdulto1.RemoveAll(p => p.v_ComponentFieldId == name); _UserControlValores = new ServiceComponentFieldValuesList(); _UserControlValores.v_ComponentFieldId = name; _UserControlValores.v_Value1 = value; _UserControlValores.v_ComponentId = Constants.SINTOMATICO_ID; _listOfAtencionAdulto1.Add(_UserControlValores); DataSource = _listOfAtencionAdulto1; #endregion }
private void btnGrabar_Click(object sender, EventArgs e) { if (uvValidador.Validate(true, false).IsValid) { if (double.Parse(txtTalla.Text) < 0.5 || double.Parse(txtTalla.Text) > 2.5) { MessageBox.Show("Talla: valor entre 0.5 y 2.5 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (double.Parse(txtPeso.Text) < 1 || double.Parse(txtPeso.Text) > 200) { MessageBox.Show("Peso: valor entre 1 y 200 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txtPerAbd.Text != "") { if (double.Parse(txtPerAbd.Text) < 1 || double.Parse(txtPerAbd.Text) > 300) { MessageBox.Show("Perímetro Abdominal: valor entre 1 y 300 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (txtPerCad.Text != "") { if (double.Parse(txtPerCad.Text) < 1 || double.Parse(txtPerCad.Text) > 300) { MessageBox.Show("Perímetro Cadera: valor entre 1 y 300 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (txtTemperatura.Text != "") { if (double.Parse(txtTemperatura.Text) < 15 || double.Parse(txtTemperatura.Text) > 50) { MessageBox.Show("Temperatura: valor entre 15 y 50 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (int.Parse(txtPAS.Text) < 40 || int.Parse(txtPAS.Text) > 350) { MessageBox.Show("PAS: valor entre 40 y 350 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (int.Parse(txtPAD.Text) < 40 || int.Parse(txtPAD.Text) > 350) { MessageBox.Show("PAD: valor entre 40 y 350 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } if (txtFrecResp.Text != "") { if (int.Parse(txtFrecResp.Text) < 0 || int.Parse(txtFrecResp.Text) > 60) { MessageBox.Show("Frecuencia Respiratoria: valor entre 0 y 60 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } if (txtFrecCard.Text != "") { if (int.Parse(txtFrecCard.Text) < 0 || int.Parse(txtFrecCard.Text) > 250) { MessageBox.Show("Frecuencia Cardiaca: valor entre 0 y 250 ", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); return; } } OperationResult objOperationResult = new OperationResult(); ServiceBL _serviceBL = new ServiceBL(); ServiceComponentFieldValuesList serviceComponentFieldValues = null; ServiceComponentFieldsList serviceComponentFields = null; List <ServiceComponentFieldValuesList> _serviceComponentFieldValuesList = null; List <ServiceComponentFieldsList> _serviceComponentFieldsList = null; if (_serviceComponentFieldsList == null) { _serviceComponentFieldsList = new List <ServiceComponentFieldsList>(); } //Talla**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_TALLA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtTalla.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Temperatura**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_TEMPERATURA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtTemperatura.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Peso**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_PESO_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtPeso.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //PAS**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_PAS_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtPAS.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //IMC**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_IMC_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtImc.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //PAD**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_PAD_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtPAD.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Perímetro Abdomen**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_PERIMETRO_ABDOMINAL_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtPerAbd.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Frecuencia Cardiaca**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_FREC_CARDIACA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtFrecCard.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Perímetro Cadera**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_PERIMETRO_CADERA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtPerCad.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Frecuencia Respiratoria**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_FREC_RESPIRATORIA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtFrecResp.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //ICC**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.ANTROPOMETRIA_INDICE_CINTURA_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtICC.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); //Saturación Oxígeno**-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*-*-*--*-*-*-*-*-*-*-*-*-*-*-*-*- serviceComponentFields = new ServiceComponentFieldsList(); serviceComponentFields.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_SAT_O2_ID; serviceComponentFields.v_ServiceComponentId = _ServiceComponentId; _serviceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); serviceComponentFieldValues = new ServiceComponentFieldValuesList(); serviceComponentFieldValues.v_ComponentFieldValuesId = null; serviceComponentFieldValues.v_Value1 = txtSatOx.Text; _serviceComponentFieldValuesList.Add(serviceComponentFieldValues); serviceComponentFields.ServiceComponentFieldValues = _serviceComponentFieldValuesList; // Agregar a mi lista _serviceComponentFieldsList.Add(serviceComponentFields); var result = _serviceBL.AddServiceComponentValues(ref objOperationResult, _serviceComponentFieldsList, Globals.ClientSession.GetAsList(), _PersonId, _ServiceComponentId); //lIMPIAR LA LISTA DE DXS List <DiagnosticRepositoryList> ListaDxByComponent = new List <DiagnosticRepositoryList>(); MedicalExamFieldValuesBL oMedicalExamFieldValuesBL = new MedicalExamFieldValuesBL(); //Elminar los Dx antiguos _serviceBL.EliminarDxAniguosPorComponente(_ServiceId, Constants.FUNCIONES_VITALES_ID, Globals.ClientSession.GetAsList()); _serviceBL.EliminarDxAniguosPorComponente(_ServiceId, Constants.ANTROPOMETRIA_ID, Globals.ClientSession.GetAsList()); ListaDxByComponent = new List <DiagnosticRepositoryList>(); if (txtImc.Text != "") { double IMC = double.Parse(txtImc.Text.ToString()); DiagnosticRepositoryList DxByComponent = new DiagnosticRepositoryList(); List <RecomendationList> Recomendations = new List <RecomendationList>(); List <RestrictionList> Restrictions = new List <RestrictionList>(); DxByComponent.i_AutoManualId = 1; DxByComponent.i_FinalQualificationId = (int)FinalQualification.Definitivo; DxByComponent.i_PreQualificationId = 1; DxByComponent.v_ComponentFieldsId = Constants.ANTROPOMETRIA_IMC_ID; //Obtener el Componente que está amarrado al DX string ComponentDx = oMedicalExamFieldValuesBL.ObtenerComponentDx(Constants.ANTROPOMETRIA_IMC_ID); string DiseasesId = ""; if (IMC <= 18.49) { DiseasesId = "N009-DD000000300"; } else if (IMC >= 18.5 && IMC <= 24.99) { DiseasesId = "N009-DD000000788"; } else if (IMC >= 25 && IMC <= 29.99) { DiseasesId = "N009-DD000000601"; } else if (IMC >= 30 && IMC <= 34.99) { DiseasesId = "N009-DD000000602"; } else if (IMC >= 35 && IMC <= 39.99) { DiseasesId = "N009-DD000000603"; } else if (IMC >= 40) { DiseasesId = "N009-DD000000604"; } string ComponentFieldId = Constants.ANTROPOMETRIA_IMC_ID; DiagnosticRepositoryList oDiagnosticRepositoryListOld = _serviceBL.VerificarDxExistente(_ServiceId, DiseasesId, ComponentDx, ComponentFieldId); if (oDiagnosticRepositoryListOld != null) { oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId = oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId; oDiagnosticRepositoryListOld.i_RecordType = (int)RecordType.NoTemporal; oDiagnosticRepositoryListOld.i_RecordStatus = (int)RecordStatus.EliminadoLogico; oDiagnosticRepositoryListOld.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; ListaDxByComponent.Add(oDiagnosticRepositoryListOld); } DxByComponent.v_DiagnosticRepositoryId = Guid.NewGuid().ToString(); DxByComponent.i_RecordType = (int)RecordType.Temporal; DxByComponent.i_RecordStatus = (int)RecordStatus.Agregado; DxByComponent.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; DxByComponent.d_ExpirationDateDiagnostic = DateTime.Now; string ComponentFieldValuesId = oMedicalExamFieldValuesBL.ObtenerIdComponentFieldValues(ComponentFieldId, DiseasesId); DxByComponent.v_ComponentFieldValuesId = ComponentFieldValuesId; DxByComponent.v_ComponentId = ComponentDx; DxByComponent.v_DiseasesId = DiseasesId; DxByComponent.v_ServiceId = _ServiceId; //Obtener las recomendaciones DxByComponent.Recomendations = oMedicalExamFieldValuesBL.ObtenerListaRecomendaciones(ComponentFieldValuesId, _ServiceId, Constants.FUNCIONES_VITALES_ID); ListaDxByComponent.Add(DxByComponent); //Llenar entidad ServiceComponent servicecomponentDto serviceComponentDto = new servicecomponentDto(); serviceComponentDto.v_ServiceComponentId = _ServiceComponentId; serviceComponentDto.v_Comment = ""; serviceComponentDto.i_ServiceComponentStatusId = (int)ServiceComponentStatus.Evaluado; serviceComponentDto.i_ExternalInternalId = (int)ComponenteProcedencia.Interno; serviceComponentDto.i_IsApprovedId = (int)SiNo.NO; serviceComponentDto.v_ComponentId = Constants.FUNCIONES_VITALES_ID; serviceComponentDto.v_ServiceId = _ServiceId; _serviceBL.AddDiagnosticRepository(ref objOperationResult, ListaDxByComponent, serviceComponentDto, Globals.ClientSession.GetAsList(), true); } ListaDxByComponent = new List <DiagnosticRepositoryList>(); if (txtPAS.Text != "") { DiagnosticRepositoryList DxByComponent = new DiagnosticRepositoryList(); List <RecomendationList> Recomendations = new List <RecomendationList>(); List <RestrictionList> Restrictions = new List <RestrictionList>(); int PAS = int.Parse(txtPAS.Text.ToString()); DxByComponent.i_AutoManualId = 1; DxByComponent.i_FinalQualificationId = (int)FinalQualification.Definitivo; DxByComponent.i_PreQualificationId = 1; DxByComponent.v_ComponentFieldsId = Constants.FUNCIONES_VITALES_PAS_ID; //Obtener el Componente que está amarrado al DX string ComponentDx = oMedicalExamFieldValuesBL.ObtenerComponentDx(Constants.FUNCIONES_VITALES_PAS_ID); string DiseasesId = ""; if (PAS > 140) { DiseasesId = "N009-DD000000606"; string ComponentFieldId = Constants.FUNCIONES_VITALES_PAS_ID; DiagnosticRepositoryList oDiagnosticRepositoryListOld = _serviceBL.VerificarDxExistente(_ServiceId, DiseasesId, ComponentDx, ComponentFieldId); if (oDiagnosticRepositoryListOld != null) { oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId = oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId; oDiagnosticRepositoryListOld.i_RecordType = (int)RecordType.NoTemporal; oDiagnosticRepositoryListOld.i_RecordStatus = (int)RecordStatus.EliminadoLogico; oDiagnosticRepositoryListOld.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; ListaDxByComponent.Add(oDiagnosticRepositoryListOld); } DxByComponent.v_DiagnosticRepositoryId = Guid.NewGuid().ToString(); DxByComponent.i_RecordType = (int)RecordType.Temporal; DxByComponent.i_RecordStatus = (int)RecordStatus.Agregado; DxByComponent.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; DxByComponent.d_ExpirationDateDiagnostic = DateTime.Now; string ComponentFieldValuesId = oMedicalExamFieldValuesBL.ObtenerIdComponentFieldValues(ComponentFieldId, DiseasesId); DxByComponent.v_ComponentFieldValuesId = ComponentFieldValuesId; DxByComponent.v_ComponentId = ComponentDx; DxByComponent.v_DiseasesId = DiseasesId; DxByComponent.v_ServiceId = _ServiceId; //Obtener las recomendaciones DxByComponent.Recomendations = oMedicalExamFieldValuesBL.ObtenerListaRecomendaciones(ComponentFieldValuesId, _ServiceId, Constants.FUNCIONES_VITALES_ID); ListaDxByComponent.Add(DxByComponent); //Llenar entidad ServiceComponent servicecomponentDto serviceComponentDto = new servicecomponentDto(); serviceComponentDto.v_ServiceComponentId = _ServiceComponentId; serviceComponentDto.v_Comment = ""; serviceComponentDto.i_ServiceComponentStatusId = (int)ServiceComponentStatus.Evaluado; serviceComponentDto.i_ExternalInternalId = (int)ComponenteProcedencia.Interno; serviceComponentDto.i_IsApprovedId = (int)SiNo.NO; serviceComponentDto.v_ComponentId = Constants.FUNCIONES_VITALES_ID; serviceComponentDto.v_ServiceId = _ServiceId; _serviceBL.AddDiagnosticRepository(ref objOperationResult, ListaDxByComponent, serviceComponentDto, Globals.ClientSession.GetAsList(), true); } } ListaDxByComponent = new List <DiagnosticRepositoryList>(); if (txtICC.Text != "") { DiagnosticRepositoryList DxByComponent = new DiagnosticRepositoryList(); List <RecomendationList> Recomendations = new List <RecomendationList>(); List <RestrictionList> Restrictions = new List <RestrictionList>(); double ICC = double.Parse(txtICC.Text.ToString()); DxByComponent.i_AutoManualId = 1; DxByComponent.i_FinalQualificationId = (int)FinalQualification.Definitivo; DxByComponent.i_PreQualificationId = 1; DxByComponent.v_ComponentFieldsId = Constants.ANTROPOMETRIA_INDICE_CINTURA_ID; //Obtener el Componente que está amarrado al DX string ComponentDx = oMedicalExamFieldValuesBL.ObtenerComponentDx(Constants.ANTROPOMETRIA_INDICE_CINTURA_ID); string DiseasesId = ""; if (ICC > 1) { DiseasesId = "N009-DD000000605"; string ComponentFieldId = Constants.ANTROPOMETRIA_INDICE_CINTURA_ID; DiagnosticRepositoryList oDiagnosticRepositoryListOld = _serviceBL.VerificarDxExistente(_ServiceId, DiseasesId, ComponentDx, ComponentFieldId); if (oDiagnosticRepositoryListOld != null) { oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId = oDiagnosticRepositoryListOld.v_DiagnosticRepositoryId; oDiagnosticRepositoryListOld.i_RecordType = (int)RecordType.NoTemporal; oDiagnosticRepositoryListOld.i_RecordStatus = (int)RecordStatus.EliminadoLogico; oDiagnosticRepositoryListOld.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; ListaDxByComponent.Add(oDiagnosticRepositoryListOld); } DxByComponent.v_DiagnosticRepositoryId = Guid.NewGuid().ToString(); DxByComponent.i_RecordType = (int)RecordType.Temporal; DxByComponent.i_RecordStatus = (int)RecordStatus.Agregado; DxByComponent.i_DiagnosticTypeId = (int)TipoDx.Enfermedad_Comun; DxByComponent.d_ExpirationDateDiagnostic = DateTime.Now; string ComponentFieldValuesId = oMedicalExamFieldValuesBL.ObtenerIdComponentFieldValues(ComponentFieldId, DiseasesId); DxByComponent.v_ComponentFieldValuesId = ComponentFieldValuesId; DxByComponent.v_ComponentId = ComponentDx; DxByComponent.v_DiseasesId = DiseasesId; DxByComponent.v_ServiceId = _ServiceId; //Obtener las recomendaciones DxByComponent.Recomendations = oMedicalExamFieldValuesBL.ObtenerListaRecomendaciones(ComponentFieldValuesId, _ServiceId, Constants.FUNCIONES_VITALES_ID); ListaDxByComponent.Add(DxByComponent); //Llenar entidad ServiceComponent servicecomponentDto serviceComponentDto = new servicecomponentDto(); serviceComponentDto.v_ServiceComponentId = _ServiceComponentId; serviceComponentDto.v_Comment = ""; serviceComponentDto.i_ServiceComponentStatusId = (int)ServiceComponentStatus.Evaluado; serviceComponentDto.i_ExternalInternalId = (int)ComponenteProcedencia.Interno; serviceComponentDto.i_IsApprovedId = (int)SiNo.NO; serviceComponentDto.v_ComponentId = Constants.FUNCIONES_VITALES_ID; serviceComponentDto.v_ServiceId = _ServiceId; _serviceBL.AddDiagnosticRepository(ref objOperationResult, ListaDxByComponent, serviceComponentDto, Globals.ClientSession.GetAsList(), true); } } _serviceBL.ActualizarEstadoComponentesPorCategoria(ref objOperationResult, 10, _ServiceId, (int)ServiceComponentStatus.Evaluado, Globals.ClientSession.GetAsList()); MessageBox.Show("Los datos se grabaron correctamente", "VALIDACIÓN!", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Por favor corrija la información ingresada. Vea los indicadores de error.", "Error de validación", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
private void btnOK_Click(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_RITMO; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtRitmo.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_EJE; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtEje.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_FC; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtFC.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_PR; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtPR.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_QRS; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtQrs.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_QT; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtQT.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_Q; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaQ.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_P; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaP.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_R; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaR.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_S; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaS.Text; oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_T; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaT.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.EVA_CARDIOLOGICA_ONDA_U; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; oServiceComponentFieldValuesList.v_Value1 = txtOndaU.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); var result = _serviceBL.AddServiceComponentValues(ref objOperationResult, _serviceComponentFieldsList, Globals.ClientSession.GetAsList(), _personId, _serviceComponentId); if (result) { MessageBox.Show("Se grabó correctamente", "SISTEMAS", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }
private void btnOK_Click(object sender, EventArgs e) { OperationResult objOperationResult = new OperationResult(); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_VERTICES_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtVertices.Text; oServiceComponentFieldValuesList.v_Value1 = txtVertices.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_HILOS_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtHilios.Text; oServiceComponentFieldValuesList.v_Value1 = txtHilios.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_SENOS_CARDIOFRENICOS_DESCRIPCION_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtSenosCardio.Text; oServiceComponentFieldValuesList.v_Value1 = txtSenosCardio.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_SILUETA_CARDIACA_DESCRIPCION_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtSiluetaCardia.Text; oServiceComponentFieldValuesList.v_Value1 = txtSiluetaCardia.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_PARTES_BLANDAS_OSEAS_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtPartesBlandas.Text; oServiceComponentFieldValuesList.v_Value1 = txtPartesBlandas.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_CAMPOS_PULMONARES_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtCamposPulmonares.Text; oServiceComponentFieldValuesList.v_Value1 = txtCamposPulmonares.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_COSTO_ODIAFRAGMATICO_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtSenosDiag.Text; oServiceComponentFieldValuesList.v_Value1 = txtSenosDiag.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_MEDIASTINOS_DESCRIPCION_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtMediastinos.Text; oServiceComponentFieldValuesList.v_Value1 = txtMediastinos.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_INDICE_CARDIACO_DESCRIPCION_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtIndice.Text; oServiceComponentFieldValuesList.v_Value1 = txtIndice.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); oServiceComponentFieldsList = new ServiceComponentFieldsList(); ListServiceComponentFieldValuesList = new List <ServiceComponentFieldValuesList>(); oServiceComponentFieldValuesList = new ServiceComponentFieldValuesList(); oServiceComponentFieldsList.v_ComponentFieldsId = Constants.RX_CONCLUSIONES_RADIOGRAFICAS_DESCRIPCION_ID; oServiceComponentFieldsList.v_ServiceComponentId = _serviceComponentId; //oServiceComponentFieldsList.ServiceComponentFieldValues[0].v_Value1 = txtConclusiones.Text; oServiceComponentFieldValuesList.v_Value1 = txtConclusiones.Text; ListServiceComponentFieldValuesList.Add(oServiceComponentFieldValuesList); oServiceComponentFieldsList.ServiceComponentFieldValues = ListServiceComponentFieldValuesList; _serviceComponentFieldsList.Add(oServiceComponentFieldsList); var result = _serviceBL.AddServiceComponentValues(ref objOperationResult, _serviceComponentFieldsList, Globals.ClientSession.GetAsList(), _personId, _serviceComponentId); if (result) { MessageBox.Show("Se grabó correctamente", "SISTEMAS", MessageBoxButtons.OK, MessageBoxIcon.Information); this.Close(); } }