diff --git a/Business/Etiqueta.cs b/Business/Etiqueta.cs
index d5807b19..fef72d63 100644
--- a/Business/Etiqueta.cs
+++ b/Business/Etiqueta.cs
@@ -22,13 +22,13 @@ public class Etiqueta
private Image headerImage = null;
int count = 1;
-
+ private float margenDerecho = 0;
int maxChar = 35;
int maxCharDescription = 20;
int imageHeight = 0;
- float leftMargin = 2;//2;///estaba en 20--Cambio para plottier
+ float leftMargin = 2;//2;///estaba en 20--Cambio para centenario=20, para los demas es 2
float leftMarginSdaEtiqueta = 61;
float topMargin = 1; //estaba en 2
@@ -129,11 +129,11 @@ public void AddCodigoBarras(string line, string fuenteBarCode)
// items.Add(newItem.GenerateItem(cantidad, item, price));
//}
- public void AddTotal(string name, string price)
- {
- OrderTotal newTotal = new OrderTotal('?');
- totales.Add(newTotal.GenerateTotal(name, price));
- }
+ //public void AddTotal(string name, string price)
+ //{
+ // OrderTotal newTotal = new OrderTotal('?');
+ // totales.Add(newTotal.GenerateTotal(name, price));
+ //}
public void AddFooterLine(string line)
{
@@ -202,8 +202,8 @@ private void pr_PrintPage(object sender, System.Drawing.Printing.PrintPageEventA
{
e.Graphics.PageUnit = GraphicsUnit.Millimeter;
gfx = e.Graphics;
-
- // DrawImage();
+ gfx.TranslateTransform(margenDerecho, 0);
+ // DrawImage();
DrawHeader();
DrawSubHeader();
DrawSubHeaderNegrita();
@@ -219,8 +219,9 @@ private void pr_PrintPage(object sender, System.Drawing.Printing.PrintPageEventA
//}
}
- public void PrintTicket2(string equipo, string fuente, string tipoEtiqueta )
+ public void PrintTicket2(string equipo, string fuente, string tipoEtiqueta ,float margen)
{
+ margenDerecho = margen;
printFont = new Font(fontName, fontSize, FontStyle.Bold);
printFontPequeño = new Font(fontName, 5, FontStyle.Bold);
//fuenteBarCode ="Code39";
@@ -238,8 +239,11 @@ public void PrintTicket2(string equipo, string fuente, string tipoEtiqueta )
}
+
+
private void DrawSubHeaderNegrita()
{
+
foreach (string header in subHeaderLinesNegrita)
{
Font printFont_Area= new Font(fontName, 6, FontStyle.Bold);
@@ -261,6 +265,7 @@ private float YPosition(float topMargin)
private void DrawImage()
{
+
if (headerImage != null)
{
try
@@ -277,6 +282,7 @@ private void DrawImage()
private void DrawHeader()
{
+
foreach (string header in headerLines)
{
@@ -309,6 +315,7 @@ private void DrawHeader()
private void DrawSubHeader()
{
+
foreach (string header in subHeaderLines)
{
@@ -329,6 +336,7 @@ private void DrawSubHeader()
private void DrawCodigoBarras()
{
+
foreach (string subHeader in subCodigoBarras)
{
@@ -354,6 +362,7 @@ private void DrawCodigoBarras()
private void DrawFooter()
{
+
foreach (string footer in footerLines)
{
@@ -409,6 +418,7 @@ private void DrawFooter()
private void DrawEspacio()
{
+
line = "";
Font printFontLineaEspacio = new Font(fontName, 1, FontStyle.Regular);
gfx.DrawString(line, printFontLineaEspacio, myBrush, leftMargin, YPosition(1), new StringFormat());
@@ -420,30 +430,5 @@ private void DrawEspacio()
}
- public class OrderTotal
- {
- char[] delimitador = new char[] { '?' };
-
- public OrderTotal(char delimit)
- {
- delimitador = new char[] { delimit };
- }
-
- public string GetTotalName(string totalItem)
- {
- string[] delimitado = totalItem.Split(delimitador);
- return delimitado[0];
- }
-
- public string GetTotalCantidad(string totalItem)
- {
- string[] delimitado = totalItem.Split(delimitador);
- return delimitado[1];
- }
-
- public string GenerateTotal(string totalName, string price)
- {
- return totalName + delimitador[0] + price;
- }
- }
+
}
\ No newline at end of file
diff --git a/Business/Reporte.cs b/Business/Reporte.cs
index 5b4c8a43..c569db98 100644
--- a/Business/Reporte.cs
+++ b/Business/Reporte.cs
@@ -119,11 +119,11 @@ public void AddCodigoBarras(string line, string fuenteBarCode)
// items.Add(newItem.GenerateItem(cantidad, item, price));
//}
- public void AddTotal(string name, string price)
- {
- OrderTotal newTotal = new OrderTotal('?');
- totales.Add(newTotal.GenerateTotal(name, price));
- }
+ //public void AddTotal(string name, string price)
+ //{
+ // OrderTotal newTotal = new OrderTotal('?');
+ // totales.Add(newTotal.GenerateTotal(name, price));
+ //}
public void AddFooterLine(string line)
{
diff --git a/ImprimeLocal/App.config b/ImprimeLocal/App.config
index 60ff3ed0..fc9a7c58 100644
--- a/ImprimeLocal/App.config
+++ b/ImprimeLocal/App.config
@@ -4,38 +4,19 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
-
-
+
-
-
-
-
diff --git a/ImprimeLocal/Form1MultiEfector.Designer.cs b/ImprimeLocal/Form1MultiEfector.Designer.cs
index 94b85b14..5849bb3f 100644
--- a/ImprimeLocal/Form1MultiEfector.Designer.cs
+++ b/ImprimeLocal/Form1MultiEfector.Designer.cs
@@ -78,6 +78,8 @@ private void InitializeComponent()
this.lblIdEfector = new System.Windows.Forms.Label();
this.txtmensajes = new System.Windows.Forms.TextBox();
this.label21 = new System.Windows.Forms.Label();
+ this.nmMargenDerecho = new System.Windows.Forms.NumericUpDown();
+ this.label22 = new System.Windows.Forms.Label();
this.tabControl1.SuspendLayout();
this.Protocolos.SuspendLayout();
this.tabPage2.SuspendLayout();
@@ -88,6 +90,7 @@ private void InitializeComponent()
((System.ComponentModel.ISupportInitialize)(this.nupMicrobiologia)).BeginInit();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
+ ((System.ComponentModel.ISupportInitialize)(this.nmMargenDerecho)).BeginInit();
this.SuspendLayout();
//
// timer1
@@ -108,28 +111,25 @@ private void InitializeComponent()
// comboBoximp
//
this.comboBoximp.FormattingEnabled = true;
- this.comboBoximp.Location = new System.Drawing.Point(120, 27);
- this.comboBoximp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.comboBoximp.Location = new System.Drawing.Point(80, 18);
this.comboBoximp.Name = "comboBoximp";
- this.comboBoximp.Size = new System.Drawing.Size(298, 28);
+ this.comboBoximp.Size = new System.Drawing.Size(200, 21);
this.comboBoximp.TabIndex = 10;
//
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("Microsoft Sans Serif", 28.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.textBox1.Location = new System.Drawing.Point(36, 129);
- this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.textBox1.Location = new System.Drawing.Point(24, 84);
this.textBox1.Name = "textBox1";
- this.textBox1.Size = new System.Drawing.Size(388, 71);
+ this.textBox1.Size = new System.Drawing.Size(260, 50);
this.textBox1.TabIndex = 0;
//
// btnImprimir
//
this.btnImprimir.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnImprimir.Location = new System.Drawing.Point(36, 243);
- this.btnImprimir.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.btnImprimir.Location = new System.Drawing.Point(24, 158);
this.btnImprimir.Name = "btnImprimir";
- this.btnImprimir.Size = new System.Drawing.Size(388, 60);
+ this.btnImprimir.Size = new System.Drawing.Size(259, 39);
this.btnImprimir.TabIndex = 2;
this.btnImprimir.Text = "Imprimir";
this.btnImprimir.UseVisualStyleBackColor = true;
@@ -138,10 +138,9 @@ private void InitializeComponent()
// label1
//
this.label1.AutoSize = true;
- this.label1.Location = new System.Drawing.Point(18, 27);
- this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label1.Location = new System.Drawing.Point(12, 18);
this.label1.Name = "label1";
- this.label1.Size = new System.Drawing.Size(85, 20);
+ this.label1.Size = new System.Drawing.Size(56, 13);
this.label1.TabIndex = 3;
this.label1.Text = "Impresora:";
//
@@ -150,10 +149,9 @@ private void InitializeComponent()
this.label2.AutoSize = true;
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label2.ForeColor = System.Drawing.Color.Blue;
- this.label2.Location = new System.Drawing.Point(40, 64);
- this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label2.Location = new System.Drawing.Point(27, 42);
this.label2.Name = "label2";
- this.label2.Size = new System.Drawing.Size(406, 33);
+ this.label2.Size = new System.Drawing.Size(269, 24);
this.label2.TabIndex = 11;
this.label2.Text = "NUMERO DE PROTOCOLO";
//
@@ -161,10 +159,9 @@ private void InitializeComponent()
//
this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button2.ForeColor = System.Drawing.Color.Maroon;
- this.button2.Location = new System.Drawing.Point(36, 302);
- this.button2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.button2.Location = new System.Drawing.Point(24, 196);
this.button2.Name = "button2";
- this.button2.Size = new System.Drawing.Size(388, 60);
+ this.button2.Size = new System.Drawing.Size(259, 39);
this.button2.TabIndex = 14;
this.button2.Text = "Imprimir";
this.button2.UseVisualStyleBackColor = true;
@@ -173,29 +170,26 @@ private void InitializeComponent()
// txtDesde
//
this.txtDesde.Font = new System.Drawing.Font("Microsoft Sans Serif", 28.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.txtDesde.Location = new System.Drawing.Point(36, 69);
- this.txtDesde.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.txtDesde.Location = new System.Drawing.Point(24, 45);
this.txtDesde.Name = "txtDesde";
- this.txtDesde.Size = new System.Drawing.Size(253, 71);
+ this.txtDesde.Size = new System.Drawing.Size(170, 50);
this.txtDesde.TabIndex = 15;
//
// txtHasta
//
this.txtHasta.Font = new System.Drawing.Font("Microsoft Sans Serif", 28.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.txtHasta.Location = new System.Drawing.Point(36, 197);
- this.txtHasta.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.txtHasta.Location = new System.Drawing.Point(24, 128);
this.txtHasta.Name = "txtHasta";
- this.txtHasta.Size = new System.Drawing.Size(253, 71);
+ this.txtHasta.Size = new System.Drawing.Size(170, 50);
this.txtHasta.TabIndex = 16;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 16.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label4.Location = new System.Drawing.Point(28, 151);
- this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label4.Location = new System.Drawing.Point(19, 98);
this.label4.Name = "label4";
- this.label4.Size = new System.Drawing.Size(103, 38);
+ this.label4.Size = new System.Drawing.Size(69, 26);
this.label4.TabIndex = 18;
this.label4.Text = "Hasta";
//
@@ -203,10 +197,9 @@ private void InitializeComponent()
//
this.label5.AutoSize = true;
this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label5.Location = new System.Drawing.Point(28, 5);
- this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label5.Location = new System.Drawing.Point(19, 3);
this.label5.Name = "label5";
- this.label5.Size = new System.Drawing.Size(127, 42);
+ this.label5.Size = new System.Drawing.Size(86, 29);
this.label5.TabIndex = 20;
this.label5.Text = "Desde";
//
@@ -217,11 +210,10 @@ private void InitializeComponent()
this.tabControl1.Controls.Add(this.tabPage1);
this.tabControl1.Controls.Add(this.tabPage3);
this.tabControl1.Controls.Add(this.tabPage4);
- this.tabControl1.Location = new System.Drawing.Point(481, 148);
- this.tabControl1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.tabControl1.Location = new System.Drawing.Point(321, 96);
this.tabControl1.Name = "tabControl1";
this.tabControl1.SelectedIndex = 0;
- this.tabControl1.Size = new System.Drawing.Size(462, 426);
+ this.tabControl1.Size = new System.Drawing.Size(308, 277);
this.tabControl1.TabIndex = 21;
this.tabControl1.Visible = false;
//
@@ -230,11 +222,10 @@ private void InitializeComponent()
this.Protocolos.Controls.Add(this.label2);
this.Protocolos.Controls.Add(this.textBox1);
this.Protocolos.Controls.Add(this.btnImprimir);
- this.Protocolos.Location = new System.Drawing.Point(4, 29);
- this.Protocolos.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.Protocolos.Location = new System.Drawing.Point(4, 22);
this.Protocolos.Name = "Protocolos";
- this.Protocolos.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.Protocolos.Size = new System.Drawing.Size(454, 393);
+ this.Protocolos.Padding = new System.Windows.Forms.Padding(3);
+ this.Protocolos.Size = new System.Drawing.Size(300, 251);
this.Protocolos.TabIndex = 0;
this.Protocolos.Text = "Protocolos";
this.Protocolos.UseVisualStyleBackColor = true;
@@ -246,11 +237,10 @@ private void InitializeComponent()
this.tabPage2.Controls.Add(this.label4);
this.tabPage2.Controls.Add(this.txtDesde);
this.tabPage2.Controls.Add(this.txtHasta);
- this.tabPage2.Location = new System.Drawing.Point(4, 29);
- this.tabPage2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.tabPage2.Location = new System.Drawing.Point(4, 22);
this.tabPage2.Name = "tabPage2";
- this.tabPage2.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.tabPage2.Size = new System.Drawing.Size(454, 393);
+ this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage2.Size = new System.Drawing.Size(300, 251);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "Seroteca";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -267,19 +257,17 @@ private void InitializeComponent()
this.tabPage1.Controls.Add(this.label6);
this.tabPage1.Controls.Add(this.nupMicrobiologia);
this.tabPage1.Controls.Add(this.label3);
- this.tabPage1.Location = new System.Drawing.Point(4, 29);
- this.tabPage1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.tabPage1.Location = new System.Drawing.Point(4, 22);
this.tabPage1.Name = "tabPage1";
- this.tabPage1.Padding = new System.Windows.Forms.Padding(4, 5, 4, 5);
- this.tabPage1.Size = new System.Drawing.Size(454, 393);
+ this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
+ this.tabPage1.Size = new System.Drawing.Size(300, 251);
this.tabPage1.TabIndex = 2;
this.tabPage1.Text = "Parametros";
this.tabPage1.UseVisualStyleBackColor = true;
//
// nupLaboratorio
//
- this.nupLaboratorio.Location = new System.Drawing.Point(159, 68);
- this.nupLaboratorio.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.nupLaboratorio.Location = new System.Drawing.Point(106, 44);
this.nupLaboratorio.Maximum = new decimal(new int[] {
10,
0,
@@ -291,7 +279,7 @@ private void InitializeComponent()
0,
0});
this.nupLaboratorio.Name = "nupLaboratorio";
- this.nupLaboratorio.Size = new System.Drawing.Size(111, 26);
+ this.nupLaboratorio.Size = new System.Drawing.Size(74, 20);
this.nupLaboratorio.TabIndex = 9;
this.nupLaboratorio.Value = new decimal(new int[] {
1,
@@ -303,10 +291,9 @@ private void InitializeComponent()
//
this.label12.AutoSize = true;
this.label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label12.Location = new System.Drawing.Point(30, 71);
- this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label12.Location = new System.Drawing.Point(20, 46);
this.label12.Name = "label12";
- this.label12.Size = new System.Drawing.Size(105, 20);
+ this.label12.Size = new System.Drawing.Size(71, 13);
this.label12.TabIndex = 8;
this.label12.Text = "Laboratorio";
//
@@ -314,20 +301,18 @@ private void InitializeComponent()
//
this.label8.AutoSize = true;
this.label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label8.Location = new System.Drawing.Point(9, 23);
- this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label8.Location = new System.Drawing.Point(6, 15);
this.label8.Name = "label8";
- this.label8.Size = new System.Drawing.Size(313, 20);
+ this.label8.Size = new System.Drawing.Size(212, 13);
this.label8.TabIndex = 7;
this.label8.Text = "Cantidad de Etiquetas por Protocolo";
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Gainsboro;
- this.button3.Location = new System.Drawing.Point(152, 237);
- this.button3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.button3.Location = new System.Drawing.Point(101, 154);
this.button3.Name = "button3";
- this.button3.Size = new System.Drawing.Size(118, 45);
+ this.button3.Size = new System.Drawing.Size(79, 29);
this.button3.TabIndex = 6;
this.button3.Text = "Guardar";
this.button3.UseVisualStyleBackColor = false;
@@ -335,8 +320,7 @@ private void InitializeComponent()
//
// nupForense
//
- this.nupForense.Location = new System.Drawing.Point(158, 182);
- this.nupForense.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.nupForense.Location = new System.Drawing.Point(105, 118);
this.nupForense.Maximum = new decimal(new int[] {
10,
0,
@@ -348,7 +332,7 @@ private void InitializeComponent()
0,
0});
this.nupForense.Name = "nupForense";
- this.nupForense.Size = new System.Drawing.Size(112, 26);
+ this.nupForense.Size = new System.Drawing.Size(75, 20);
this.nupForense.TabIndex = 5;
this.nupForense.Value = new decimal(new int[] {
1,
@@ -360,17 +344,15 @@ private void InitializeComponent()
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label7.Location = new System.Drawing.Point(66, 186);
- this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label7.Location = new System.Drawing.Point(44, 121);
this.label7.Name = "label7";
- this.label7.Size = new System.Drawing.Size(77, 20);
+ this.label7.Size = new System.Drawing.Size(52, 13);
this.label7.TabIndex = 4;
this.label7.Text = "Forense";
//
// nupNoPaciente
//
- this.nupNoPaciente.Location = new System.Drawing.Point(159, 145);
- this.nupNoPaciente.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.nupNoPaciente.Location = new System.Drawing.Point(106, 94);
this.nupNoPaciente.Maximum = new decimal(new int[] {
10,
0,
@@ -382,7 +364,7 @@ private void InitializeComponent()
0,
0});
this.nupNoPaciente.Name = "nupNoPaciente";
- this.nupNoPaciente.Size = new System.Drawing.Size(111, 26);
+ this.nupNoPaciente.Size = new System.Drawing.Size(74, 20);
this.nupNoPaciente.TabIndex = 3;
this.nupNoPaciente.Value = new decimal(new int[] {
1,
@@ -394,17 +376,15 @@ private void InitializeComponent()
//
this.label6.AutoSize = true;
this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label6.Location = new System.Drawing.Point(28, 146);
- this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label6.Location = new System.Drawing.Point(19, 95);
this.label6.Name = "label6";
- this.label6.Size = new System.Drawing.Size(121, 20);
+ this.label6.Size = new System.Drawing.Size(83, 13);
this.label6.TabIndex = 2;
this.label6.Text = "No Pacientes";
//
// nupMicrobiologia
//
- this.nupMicrobiologia.Location = new System.Drawing.Point(159, 108);
- this.nupMicrobiologia.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.nupMicrobiologia.Location = new System.Drawing.Point(106, 70);
this.nupMicrobiologia.Maximum = new decimal(new int[] {
10,
0,
@@ -416,7 +396,7 @@ private void InitializeComponent()
0,
0});
this.nupMicrobiologia.Name = "nupMicrobiologia";
- this.nupMicrobiologia.Size = new System.Drawing.Size(111, 26);
+ this.nupMicrobiologia.Size = new System.Drawing.Size(74, 20);
this.nupMicrobiologia.TabIndex = 1;
this.nupMicrobiologia.Value = new decimal(new int[] {
1,
@@ -428,10 +408,9 @@ private void InitializeComponent()
//
this.label3.AutoSize = true;
this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label3.Location = new System.Drawing.Point(30, 111);
- this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label3.Location = new System.Drawing.Point(20, 72);
this.label3.Name = "label3";
- this.label3.Size = new System.Drawing.Size(121, 20);
+ this.label3.Size = new System.Drawing.Size(82, 13);
this.label3.TabIndex = 0;
this.label3.Text = "Microbiologia";
//
@@ -443,10 +422,11 @@ private void InitializeComponent()
this.tabPage3.Controls.Add(this.btnImprimirEfector);
this.tabPage3.Controls.Add(this.label13);
this.tabPage3.Controls.Add(this.ddlEfector);
- this.tabPage3.Location = new System.Drawing.Point(4, 29);
+ this.tabPage3.Location = new System.Drawing.Point(4, 22);
+ this.tabPage3.Margin = new System.Windows.Forms.Padding(2);
this.tabPage3.Name = "tabPage3";
- this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage3.Size = new System.Drawing.Size(454, 393);
+ this.tabPage3.Padding = new System.Windows.Forms.Padding(2);
+ this.tabPage3.Size = new System.Drawing.Size(300, 251);
this.tabPage3.TabIndex = 3;
this.tabPage3.Text = "Lote por Efector";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -455,29 +435,26 @@ private void InitializeComponent()
//
this.label16.AutoSize = true;
this.label16.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label16.Location = new System.Drawing.Point(143, 134);
- this.label16.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label16.Location = new System.Drawing.Point(95, 87);
this.label16.Name = "label16";
- this.label16.Size = new System.Drawing.Size(127, 42);
+ this.label16.Size = new System.Drawing.Size(86, 29);
this.label16.TabIndex = 29;
this.label16.Text = "Desde";
//
// txtDesdeEfector
//
this.txtDesdeEfector.Font = new System.Drawing.Font("Microsoft Sans Serif", 28.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.txtDesdeEfector.Location = new System.Drawing.Point(21, 181);
- this.txtDesdeEfector.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.txtDesdeEfector.Location = new System.Drawing.Point(14, 118);
this.txtDesdeEfector.Name = "txtDesdeEfector";
- this.txtDesdeEfector.Size = new System.Drawing.Size(388, 71);
+ this.txtDesdeEfector.Size = new System.Drawing.Size(260, 50);
this.txtDesdeEfector.TabIndex = 28;
//
// label15
//
this.label15.AutoSize = true;
- this.label15.Location = new System.Drawing.Point(26, 167);
- this.label15.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label15.Location = new System.Drawing.Point(17, 109);
this.label15.Name = "label15";
- this.label15.Size = new System.Drawing.Size(0, 20);
+ this.label15.Size = new System.Drawing.Size(0, 13);
this.label15.TabIndex = 27;
this.label15.Visible = false;
//
@@ -485,10 +462,9 @@ private void InitializeComponent()
//
this.btnImprimirEfector.BackColor = System.Drawing.Color.WhiteSmoke;
this.btnImprimirEfector.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.btnImprimirEfector.Location = new System.Drawing.Point(21, 274);
- this.btnImprimirEfector.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.btnImprimirEfector.Location = new System.Drawing.Point(14, 178);
this.btnImprimirEfector.Name = "btnImprimirEfector";
- this.btnImprimirEfector.Size = new System.Drawing.Size(388, 60);
+ this.btnImprimirEfector.Size = new System.Drawing.Size(259, 39);
this.btnImprimirEfector.TabIndex = 22;
this.btnImprimirEfector.Text = "Imprimir";
this.btnImprimirEfector.UseVisualStyleBackColor = false;
@@ -498,19 +474,19 @@ private void InitializeComponent()
//
this.label13.AutoSize = true;
this.label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 18.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
- this.label13.Location = new System.Drawing.Point(40, 27);
- this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label13.Location = new System.Drawing.Point(27, 18);
this.label13.Name = "label13";
- this.label13.Size = new System.Drawing.Size(318, 42);
+ this.label13.Size = new System.Drawing.Size(218, 29);
this.label13.TabIndex = 21;
this.label13.Text = "Efector Solicitante";
//
// ddlEfector
//
this.ddlEfector.FormattingEnabled = true;
- this.ddlEfector.Location = new System.Drawing.Point(21, 86);
+ this.ddlEfector.Location = new System.Drawing.Point(14, 56);
+ this.ddlEfector.Margin = new System.Windows.Forms.Padding(2);
this.ddlEfector.Name = "ddlEfector";
- this.ddlEfector.Size = new System.Drawing.Size(385, 28);
+ this.ddlEfector.Size = new System.Drawing.Size(258, 21);
this.ddlEfector.TabIndex = 0;
//
// tabPage4
@@ -520,58 +496,54 @@ private void InitializeComponent()
this.tabPage4.Controls.Add(this.label17);
this.tabPage4.Controls.Add(this.label14);
this.tabPage4.Controls.Add(this.label9);
- this.tabPage4.Location = new System.Drawing.Point(4, 29);
+ this.tabPage4.Location = new System.Drawing.Point(4, 22);
+ this.tabPage4.Margin = new System.Windows.Forms.Padding(2);
this.tabPage4.Name = "tabPage4";
- this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
- this.tabPage4.Size = new System.Drawing.Size(454, 393);
+ this.tabPage4.Padding = new System.Windows.Forms.Padding(2);
+ this.tabPage4.Size = new System.Drawing.Size(300, 251);
this.tabPage4.TabIndex = 4;
this.tabPage4.Text = "Versiones";
this.tabPage4.UseVisualStyleBackColor = true;
//
// label20
//
- this.label20.Location = new System.Drawing.Point(29, 257);
- this.label20.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label20.Location = new System.Drawing.Point(19, 167);
this.label20.Name = "label20";
- this.label20.Size = new System.Drawing.Size(389, 74);
+ this.label20.Size = new System.Drawing.Size(259, 48);
this.label20.TabIndex = 34;
this.label20.Text = "Version 04-02-2022 Impresion por Areas desde el SIL";
//
// label19
//
- this.label19.Location = new System.Drawing.Point(29, 196);
- this.label19.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label19.Location = new System.Drawing.Point(19, 127);
this.label19.Name = "label19";
- this.label19.Size = new System.Drawing.Size(389, 74);
+ this.label19.Size = new System.Drawing.Size(259, 48);
this.label19.TabIndex = 33;
this.label19.Text = "Version 02-11-2021 numero de protocolo arriba del codigo de barras para etiqueta " +
"pequeña";
//
// label17
//
- this.label17.Location = new System.Drawing.Point(29, 137);
- this.label17.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label17.Location = new System.Drawing.Point(19, 89);
this.label17.Name = "label17";
- this.label17.Size = new System.Drawing.Size(421, 59);
+ this.label17.Size = new System.Drawing.Size(281, 38);
this.label17.TabIndex = 31;
this.label17.Text = "Version 28-10-2021 numero de protocolo de lado izquierdo vertical para etiqueta p" +
"equeña";
//
// label14
//
- this.label14.Location = new System.Drawing.Point(29, 78);
- this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label14.Location = new System.Drawing.Point(19, 51);
this.label14.Name = "label14";
- this.label14.Size = new System.Drawing.Size(421, 59);
+ this.label14.Size = new System.Drawing.Size(281, 38);
this.label14.TabIndex = 30;
this.label14.Text = "Version 18-10-2021 numero de protocolo de lado izquierdo vertical";
//
// label9
//
- this.label9.Location = new System.Drawing.Point(27, 16);
- this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label9.Location = new System.Drawing.Point(18, 10);
this.label9.Name = "label9";
- this.label9.Size = new System.Drawing.Size(391, 62);
+ this.label9.Size = new System.Drawing.Size(261, 40);
this.label9.TabIndex = 29;
this.label9.Text = "Version 20-09-2021 habilitacion de Impresion por Lote de Efector";
//
@@ -580,10 +552,9 @@ private void InitializeComponent()
this.lblError.AutoSize = true;
this.lblError.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblError.ForeColor = System.Drawing.Color.Red;
- this.lblError.Location = new System.Drawing.Point(22, 443);
- this.lblError.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.lblError.Location = new System.Drawing.Point(15, 288);
this.lblError.Name = "lblError";
- this.lblError.Size = new System.Drawing.Size(76, 25);
+ this.lblError.Size = new System.Drawing.Size(52, 17);
this.lblError.TabIndex = 22;
this.lblError.Text = "label3";
this.lblError.TextAlign = System.Drawing.ContentAlignment.TopCenter;
@@ -592,10 +563,9 @@ private void InitializeComponent()
// chkImpresora
//
this.chkImpresora.AutoSize = true;
- this.chkImpresora.Location = new System.Drawing.Point(120, 66);
- this.chkImpresora.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.chkImpresora.Location = new System.Drawing.Point(80, 43);
this.chkImpresora.Name = "chkImpresora";
- this.chkImpresora.Size = new System.Drawing.Size(177, 24);
+ this.chkImpresora.Size = new System.Drawing.Size(119, 17);
this.chkImpresora.TabIndex = 23;
this.chkImpresora.Text = "Recordar Impresora";
this.chkImpresora.UseVisualStyleBackColor = true;
@@ -608,10 +578,9 @@ private void InitializeComponent()
this.chkModoAutomatico.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkModoAutomatico.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.chkModoAutomatico.ForeColor = System.Drawing.Color.Red;
- this.chkModoAutomatico.Location = new System.Drawing.Point(120, 100);
- this.chkModoAutomatico.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+ this.chkModoAutomatico.Location = new System.Drawing.Point(210, 62);
this.chkModoAutomatico.Name = "chkModoAutomatico";
- this.chkModoAutomatico.Size = new System.Drawing.Size(212, 33);
+ this.chkModoAutomatico.Size = new System.Drawing.Size(148, 24);
this.chkModoAutomatico.TabIndex = 26;
this.chkModoAutomatico.Text = "Iniciar-Detener";
this.chkModoAutomatico.UseVisualStyleBackColor = true;
@@ -620,10 +589,9 @@ private void InitializeComponent()
// label10
//
this.label10.AutoSize = true;
- this.label10.Location = new System.Drawing.Point(429, 598);
- this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label10.Location = new System.Drawing.Point(286, 389);
this.label10.Name = "label10";
- this.label10.Size = new System.Drawing.Size(87, 20);
+ this.label10.Size = new System.Drawing.Size(61, 13);
this.label10.TabIndex = 25;
this.label10.Text = "iniciando....";
this.label10.Visible = false;
@@ -632,55 +600,77 @@ private void InitializeComponent()
// label11
//
this.label11.AutoSize = true;
- this.label11.Location = new System.Drawing.Point(420, 578);
- this.label11.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label11.Location = new System.Drawing.Point(280, 376);
this.label11.Name = "label11";
- this.label11.Size = new System.Drawing.Size(199, 20);
+ this.label11.Size = new System.Drawing.Size(135, 13);
this.label11.TabIndex = 26;
this.label11.Text = "Activado Modo Automatico";
this.label11.Visible = false;
//
// label18
//
- this.label18.Location = new System.Drawing.Point(18, 485);
- this.label18.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+ this.label18.Location = new System.Drawing.Point(12, 315);
this.label18.Name = "label18";
- this.label18.Size = new System.Drawing.Size(263, 28);
+ this.label18.Size = new System.Drawing.Size(175, 18);
this.label18.TabIndex = 32;
- this.label18.Text = "Version Marzo-2024 MultiEfector";
+ this.label18.Text = "Version Mayo-2026 MultiEfector";
//
// lblIdEfector
//
this.lblIdEfector.AutoSize = true;
- this.lblIdEfector.Location = new System.Drawing.Point(376, 485);
+ this.lblIdEfector.Location = new System.Drawing.Point(251, 315);
+ this.lblIdEfector.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.lblIdEfector.Name = "lblIdEfector";
- this.lblIdEfector.Size = new System.Drawing.Size(60, 20);
+ this.lblIdEfector.Size = new System.Drawing.Size(41, 13);
this.lblIdEfector.TabIndex = 33;
this.lblIdEfector.Text = "label21";
//
// txtmensajes
//
- this.txtmensajes.Location = new System.Drawing.Point(22, 148);
+ this.txtmensajes.Location = new System.Drawing.Point(7, 96);
+ this.txtmensajes.Margin = new System.Windows.Forms.Padding(2);
this.txtmensajes.Multiline = true;
this.txtmensajes.Name = "txtmensajes";
- this.txtmensajes.Size = new System.Drawing.Size(525, 276);
+ this.txtmensajes.Size = new System.Drawing.Size(351, 190);
this.txtmensajes.TabIndex = 34;
//
// label21
//
this.label21.AutoSize = true;
- this.label21.Location = new System.Drawing.Point(345, 485);
+ this.label21.Location = new System.Drawing.Point(230, 315);
+ this.label21.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
this.label21.Name = "label21";
- this.label21.Size = new System.Drawing.Size(25, 20);
+ this.label21.Size = new System.Drawing.Size(18, 13);
this.label21.TabIndex = 35;
this.label21.Text = "id:";
this.label21.Click += new System.EventHandler(this.label21_Click);
//
+ // nmMargenDerecho
+ //
+ this.nmMargenDerecho.Location = new System.Drawing.Point(137, 63);
+ this.nmMargenDerecho.Name = "nmMargenDerecho";
+ this.nmMargenDerecho.Size = new System.Drawing.Size(62, 20);
+ this.nmMargenDerecho.TabIndex = 36;
+ this.nmMargenDerecho.ValueChanged += new System.EventHandler(this.nmMargenDerecho_ValueChanged);
+ //
+ // label22
+ //
+ this.label22.AutoSize = true;
+ this.label22.Location = new System.Drawing.Point(14, 66);
+ this.label22.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0);
+ this.label22.Name = "label22";
+ this.label22.Size = new System.Drawing.Size(118, 13);
+ this.label22.TabIndex = 37;
+ this.label22.Text = "Margen Derecho (mm): ";
+ //
// Form1MultiEfector
//
- this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(555, 524);
+ this.BackColor = System.Drawing.Color.SkyBlue;
+ this.ClientSize = new System.Drawing.Size(370, 341);
+ this.Controls.Add(this.label22);
+ this.Controls.Add(this.nmMargenDerecho);
this.Controls.Add(this.label21);
this.Controls.Add(this.txtmensajes);
this.Controls.Add(this.lblIdEfector);
@@ -693,9 +683,8 @@ private void InitializeComponent()
this.Controls.Add(this.tabControl1);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBoximp);
- this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.Name = "Form1MultiEfector";
- this.Text = "Impresión de Etiquetas - SIL";
+ this.Text = "Impresión de Etiquetas - SIL2";
this.tabControl1.ResumeLayout(false);
this.Protocolos.ResumeLayout(false);
this.Protocolos.PerformLayout();
@@ -710,6 +699,7 @@ private void InitializeComponent()
this.tabPage3.ResumeLayout(false);
this.tabPage3.PerformLayout();
this.tabPage4.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.nmMargenDerecho)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -765,6 +755,8 @@ private void InitializeComponent()
private System.Windows.Forms.Label lblIdEfector;
private System.Windows.Forms.TextBox txtmensajes;
private System.Windows.Forms.Label label21;
+ private System.Windows.Forms.NumericUpDown nmMargenDerecho;
+ private System.Windows.Forms.Label label22;
}
}
diff --git a/ImprimeLocal/Form1MultiEfector.cs b/ImprimeLocal/Form1MultiEfector.cs
index cdad825c..b5e035f4 100644
--- a/ImprimeLocal/Form1MultiEfector.cs
+++ b/ImprimeLocal/Form1MultiEfector.cs
@@ -25,13 +25,13 @@ namespace ImprimeLocal
{
public partial class Form1MultiEfector : Form
{
+ private bool _procesandoEtiquetas = false;
delegate void SetTextCallback(string text);
public Form1MultiEfector()
{
InitializeComponent();
foreach (String strPrinter in System.Drawing.Printing.PrinterSettings.InstalledPrinters)
-
{
comboBoximp.Items.Add(strPrinter);
@@ -43,7 +43,7 @@ public Form1MultiEfector()
string cantidadForense = ConfigurationManager.AppSettings["cantidadForense"];
lblIdEfector.Text = ConfigurationManager.AppSettings["idEfector"].ToString();
-
+ string margenDerecho = ConfigurationManager.AppSettings["margenDerecho"];
comboBoximp.Text = miValor;
nupLaboratorio.Value = decimal.Parse(cantidadLaboratorio);
nupMicrobiologia.Value = decimal.Parse(cantidadMicrobiologia);
@@ -60,7 +60,7 @@ public Form1MultiEfector()
textBox1.Enabled = false;
btnImprimir.Enabled = false;
timer1.Enabled = true;
- timer1.Interval = 5000; // 5 segundos
+ timer1.Interval = 3000; // 3 segundos
timer1.Start();
}
// chkModoAutomatico.Checked = true;
@@ -113,20 +113,335 @@ private void SetText(string text)
SetTextCallback d = new SetTextCallback(SetText);
this.Invoke(d, new object[] { text });
}
- else txtmensajes.Text = DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToShortTimeString() + " " + text; ;
+ else txtmensajes.Text = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")+ " " + text; ;
}
private void timer1_Tick(object sender, EventArgs e)
{
- label10.Text = DateTime.Now.ToLongTimeString();
+ /// label10.Text = DateTime.Now.ToLongTimeString();
// BuscarProtocolo2();
// BuscarProtocoloADemanda();
- BuscarProtocoloconAPI(); //CARO
+ // BuscarProtocoloconAPI(); //llamada para efector con una sola impresora, version anterior
+ if (_procesandoEtiquetas)
+ return;
+
+ try
+ {
+ _procesandoEtiquetas = true;
+ timer1.Enabled = false;
+
+ label10.Text = DateTime.Now.ToLongTimeString();
+
+ BuscarProtocoloconAPI_V2();
+ }
+ finally
+ {
+ _procesandoEtiquetas = false;
+ timer1.Enabled = true;
+ }
}
+ private void BuscarProtocoloconAPI_V2()
+ {
+ try
+ {
+ System.Net.ServicePointManager.SecurityProtocol =
+ System.Net.SecurityProtocolType.Tls12;
+
+ string s_impre = comboBoximp.Text.Trim();
+
+ if (string.IsNullOrEmpty(s_impre))
+ return;
+
+ string URL = ConfigurationManager.AppSettings["urlAPILaboratorio"].ToString();
+ URL += "executeSP?nombre=LAB_GetGeneraEtiquetaV2¶metros="
+ + lblIdEfector.Text + "|" + s_impre;
+
+ string s_token = ConfigurationManager.AppSettings["tokenAPI"].ToString();
+
+ HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
+
+ request.Timeout = 30000;
+ request.Method = "GET";
+ request.ContentType = "application/json";
+ request.Headers.Add("Authorization", "Bearer " + s_token);
+
+ using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
+ using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+ {
+ string json = reader.ReadToEnd();
+
+ if (string.IsNullOrWhiteSpace(json))
+ return;
+
+ JavaScriptSerializer js = new JavaScriptSerializer();
+
+ object obj = js.DeserializeObject(json);
+
+ if (obj == null)
+ return;
+
+ object[] resultado = obj as object[];
+
+ if (resultado == null || resultado.Length == 0)
+ return;
+
+ Dictionary bloque =
+ resultado[0] as Dictionary;
+
+ if (bloque == null)
+ return;
+
+ if (!bloque.ContainsKey("Data"))
+ return;
+
+ object[] data =
+ bloque["Data"] as object[];
+
+ if (data == null || data.Length == 0)
+ {
+ SetText("No hay etiquetas pendientes para imprimir en la impresora: " + s_impre);
+ return;
+ }
+
+ //Convertir Data a JSON
+ string jsonData = js.Serialize(data);
+
+ DataTable t = GetJSONToDataTableUsingMethod(jsonData);
+
+ if (t == null || t.Rows.Count == 0)
+ return;
+
+ SetText("Encontró " + t.Rows.Count.ToString() + " etiquetas pendientes");
+
+ foreach (DataRow item in t.Rows)
+ {
+ try
+ {
+ Business.Etiqueta ticket = new Business.Etiqueta();
+
+ string reg_area = Convert.ToString(item["area"]);
+ string reg_numero = Convert.ToString(item["numeroP"]);
+ string reg_Fecha = Convert.ToString(item["fecha"]);
+ string reg_Origen = Convert.ToString(item["origen"]);
+ string reg_Sector = Convert.ToString(item["sector"]);
+ string reg_NumeroOrigen = Convert.ToString(item["numeroOrigen"]);
+ string reg_NumeroDocumento = Convert.ToString(item["numeroDocumento"]);
+ string reg_apellido = Convert.ToString(item["apellido"]);
+ string reg_sexo = Convert.ToString(item["sexo"]);
+ string reg_edad = Convert.ToString(item["edad"]);
+ string reg_FIS = Convert.ToString(item["NumeroOrigen2"]);
+ string sTipoEtiqueta = Convert.ToString(item["tipoEtiqueta"]);
+ string sFuenteBarCode = Convert.ToString(item["FuenteBarCode"]);
+
+ ticket.TipoEtiqueta = sTipoEtiqueta;
+
+ if (!string.IsNullOrEmpty(reg_Origen) &&
+ reg_Origen.Length > 11)
+ {
+ reg_Origen = reg_Origen.Substring(0, 10);
+ }
+
+ ticket.AddHeaderLine(reg_apellido.ToUpper());
+
+ ticket.AddSubHeaderLine(
+ reg_sexo + " " +
+ reg_edad + " " +
+ reg_NumeroDocumento + " " +
+ reg_Fecha + " " +
+ reg_FIS
+ );
+
+ if (!string.IsNullOrEmpty(reg_area))
+ {
+ if (string.IsNullOrEmpty(reg_FIS))
+ {
+ ticket.AddSubHeaderLineNegrita(
+ reg_area + " - " + reg_NumeroOrigen
+ );
+ }
+ else
+ {
+ ticket.AddSubHeaderLineNegrita(
+ reg_area + " - " +
+ reg_NumeroOrigen +
+ "/HIS:" + reg_FIS
+ );
+ }
+ }
+
+ ticket.AddCodigoBarras(reg_numero, sFuenteBarCode);
+
+ ticket.AddFooterLine(reg_numero);
+ float margen = (float)nmMargenDerecho.Value;
+ ticket.PrintTicket2(
+ s_impre,
+ sFuenteBarCode,
+ sTipoEtiqueta, margen
+ );
+
+ SetText("Etiqueta " + reg_numero + " enviada a impresora");
+ }
+ catch (Exception exEtiqueta)
+ {
+ SetText("Error imprimiendo etiqueta: " + exEtiqueta.Message);
+ }
+ }
+ }
+ }
+ catch (WebException ex)
+ {
+ SetText(
+ "Error al conectarse a " +
+ ConfigurationManager.AppSettings["urlAPILaboratorio"].ToString() +
+ " - " + ex.Message
+ );
+ }
+ catch (Exception ex)
+ {
+ SetText("Error: " + ex.Message);
+ }
+ }
+
+ //private void BuscarProtocoloconAPI_V2_old()
+ //{
+ // try
+ // {
+ // SetText("Buscando etiquetas pendientes de imprimir...");
+
+ // System.Net.ServicePointManager.SecurityProtocol =
+ // System.Net.SecurityProtocolType.Tls12;
+
+ // string s_impre = comboBoximp.Text.Trim();
+
+ // string URL = ConfigurationManager.AppSettings["urlAPILaboratorio"].ToString();
+ // URL += "executeSP?nombre=LAB_GetGeneraEtiquetaV2¶metros="
+ // + lblIdEfector.Text + "|" + s_impre;
+
+ // string s_token = ConfigurationManager.AppSettings["tokenAPI"].ToString();
+
+ // HttpWebRequest request = (HttpWebRequest)WebRequest.Create(URL);
+
+ // request.Timeout = -1;
+ // request.Method = "GET";
+ // request.ContentType = "application/json";
+ // request.Headers.Add("Authorization", "Bearer " + s_token);
+
+ // using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
+ // using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+ // {
+ // string json = reader.ReadToEnd();
+
+ // if (string.IsNullOrWhiteSpace(json) || json == "0" || json == "[]" || json.Trim() == "{}")
+ // {
+ // SetText("NO encontró etiquetas pendientes de imprimir");
+ // return;
+ // }
+
+ // DataTable t = GetJSONToDataTableUsingMethod(json);
+
+ // if (t == null || t.Rows.Count == 0)
+ // {
+ // SetText("NO encontró etiquetas pendientes de imprimir");
+ // return;
+ // }
+
+ // SetText("Encontró " + t.Rows.Count.ToString() + " etiquetas pendientes de imprimir");
+
+
+
+
+ // foreach (DataRow item in t.Rows)
+ // {
+ // try
+ // {
+ // /// Business.Etiqueta ticket = new Business.Etiqueta();
+ // Business.Etiqueta ticket;
+
+
+ // ticket = new Business.Etiqueta();
+
+
+
+ // string reg_area = item["area"].ToString();
+ // string reg_numero = item["numeroP"].ToString();
+ // string reg_Fecha = item["fecha"].ToString();
+ // string reg_Origen = item["origen"].ToString();
+ // string reg_Sector = item["sector"].ToString();
+ // string reg_NumeroOrigen = item["numeroOrigen"].ToString();
+ // string reg_NumeroDocumento = item["numeroDocumento"].ToString();
+ // string reg_apellido = item["apellido"].ToString();
+ // string reg_sexo = item["sexo"].ToString();
+ // string reg_edad = item["edad"].ToString();
+ // string reg_FIS = item["NumeroOrigen2"].ToString();
+ // string sTipoEtiqueta = item["tipoEtiqueta"].ToString();
+ // string sFuenteBarCode = item["FuenteBarCode"].ToString();
+
+ // ticket.TipoEtiqueta = sTipoEtiqueta;
+
+ // if (reg_Origen.Length > 11)
+ // reg_Origen = reg_Origen.Substring(0, 10);
+
+ // ticket.AddHeaderLine(reg_apellido.ToUpper());
+
+ // ticket.AddSubHeaderLine(
+ // reg_sexo + " " +
+ // reg_edad + " " +
+ // reg_NumeroDocumento + " " +
+ // reg_Fecha + " " +
+ // reg_FIS
+ // );
+
+ // if (!string.IsNullOrEmpty(reg_area))
+ // {
+ // if (string.IsNullOrEmpty(reg_FIS))
+ // ticket.AddSubHeaderLineNegrita(
+ // reg_area + " - " + reg_NumeroOrigen
+ // );
+ // else
+ // ticket.AddSubHeaderLineNegrita(
+ // reg_area + " - " +
+ // reg_NumeroOrigen +
+ // "/HIS:" + reg_FIS
+ // );
+ // }
+
+ // ticket.AddCodigoBarras(reg_numero, sFuenteBarCode);
+
+ // ticket.AddFooterLine(reg_numero);
+
+ // ticket.PrintTicket2(
+ // s_impre,
+ // sFuenteBarCode,
+ // sTipoEtiqueta
+ // );
+
+ // SetText("Etiqueta " + reg_numero + " enviada a impresora");
+ // }
+ // catch (Exception exEtiqueta)
+ // {
+ // SetText("Error imprimiendo etiqueta: " + exEtiqueta.Message);
+ // }
+ // }
+ // }
+ // }
+ // catch (WebException ex)
+ // {
+ // SetText(
+ // "Error al conectarse a " +
+ // ConfigurationManager.AppSettings["urlAPILaboratorio"].ToString() +
+ // " - " + ex.Message
+ // );
+ // }
+ // catch (Exception ex)
+ // {
+ // SetText("Error: " + ex.Message);
+ // }
+ //}
+
private void BuscarProtocoloconAPI()
{
try
@@ -170,7 +485,7 @@ private void BuscarProtocoloconAPI()
if (body != "")
{
SetText("encontró etiquetas pendientes de imprimir");
- TraerEtiquetasAPI();
+ TraerEtiquetasAPI(s_impre);
}
else
SetText("NO encontró etiquetas pendientes de imprimir");
@@ -185,7 +500,7 @@ private void BuscarProtocoloconAPI()
}
}
- private void TraerEtiquetasAPI()
+ private void TraerEtiquetasAPI(string s_impre)
{
try
{
@@ -193,7 +508,7 @@ private void TraerEtiquetasAPI()
System.Net.SecurityProtocolType.Tls12;
string URL = ConfigurationManager.AppSettings["urlAPILaboratorio"].ToString();
- URL = URL + "GetDBdata?nombre=GetEtiquetaImpresa¶metros=idEfector:" + lblIdEfector.Text;
+ URL = URL + "GetDBdata?nombre=GetEtiquetaImpresa¶metros=idEfector:" + lblIdEfector.Text + " and impresora:" + s_impre;
string s_token = ConfigurationManager.AppSettings["tokenAPI"].ToString();
// string s_token = ConfigurationManager.AppSettings["tokenffeeandes"].ToString();
@@ -223,7 +538,6 @@ private void TraerEtiquetasAPI()
foreach (DataRow item in t.Rows)
{
-
Business.Etiqueta ticket = new Business.Etiqueta();
///Desde acá impresion de archivos
@@ -283,7 +597,9 @@ private void TraerEtiquetasAPI()
string equipo = comboBoximp.Text; //config.AppSettings.Settings["impresora"].Value;
- ticket.PrintTicket2(equipo, sFuenteBarCode, sTipoEtiqueta);
+ //ticket.PrintTicket2(equipo, sFuenteBarCode, sTipoEtiqueta);
+
+ ticket.PrintTicket2(equipo, sFuenteBarCode, sTipoEtiqueta, 0);
SetText("Etiqueta " + reg_numero + " enviada a impresora");
}
}
@@ -741,7 +1057,7 @@ private void ImprimirCodigoBarras(Protocolo oProt, int idAreaImprimir)
string equipo = comboBoximp.Text; //config.AppSettings.Settings["impresora"].Value;
- ticket.PrintTicket2(equipo, sFuenteBarCode, oC.TipoEtiqueta);
+ ticket.PrintTicket2(equipo, sFuenteBarCode, oC.TipoEtiqueta,0);
/////fin de impresion de archivos
}
@@ -1050,7 +1366,7 @@ private void ImprimirCodigoBarrasNoPaciente(Protocolo oProt)
System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
string equipo = comboBoximp.Text; //config.AppSettings.Settings["impresora"].Value;
- ticket.PrintTicket2(equipo, sFuenteBarCode, oC.TipoEtiqueta);
+ ticket.PrintTicket2(equipo, sFuenteBarCode, oC.TipoEtiqueta,0);
/////fin de impresion de archivos
}
@@ -1254,6 +1570,22 @@ private void label21_Click(object sender, EventArgs e)
}
+ private void nmMargenDerecho_ValueChanged(object sender, EventArgs e)
+ {
+
+ Configuration config =
+ ConfigurationManager.OpenExeConfiguration(
+ ConfigurationUserLevel.None);
+
+ config.AppSettings.Settings["margenDerecho"].Value =
+ nmMargenDerecho.Value.ToString();
+
+ config.Save(ConfigurationSaveMode.Modified);
+
+ ConfigurationManager.RefreshSection("appSettings");
+
+ }
+
//private void timer2_Tick(object sender, EventArgs e)
//{
// BuscarProtocoloADemanda();
diff --git a/WebLab/AutoAnalizador/CobasB221/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/CobasB221/ConfiguracionEdit.aspx.cs
index abb609cf..94646f44 100644
--- a/WebLab/AutoAnalizador/CobasB221/ConfiguracionEdit.aspx.cs
+++ b/WebLab/AutoAnalizador/CobasB221/ConfiguracionEdit.aspx.cs
@@ -15,11 +15,23 @@
using Business.Data.AutoAnalizador;
using NHibernate;
using NHibernate.Expression;
+using Business.Data;
namespace WebLab.AutoAnalizador.CobasB221
{
public partial class ConfiguracionEdit : System.Web.UI.Page
{
+ Usuario oUser = new Usuario();
+
+ protected void Page_PreInit(object sender, EventArgs e)
+ {
+ if (Session["idUsuario"] != null)
+ oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+ // oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1, "IdEfector", oEfector);
+ else
+ Response.Redirect("../FinSesion.aspx", false);
+
+ }
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
@@ -151,6 +163,18 @@ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
CmdEliminar.ToolTip = "Eliminar";
+ CheckBox chkStatus = (CheckBox)e.Row.Cells[3].Controls[1];
+ if (oUser.IdEfector.IdEfector == 227)
+ {
+ CmdEliminar.Visible = true;
+ chkStatus.Visible = true;
+
+ }
+ else
+ {
+ CmdEliminar.Visible = false;
+ chkStatus.Enabled = false;
+ }
@@ -199,7 +223,7 @@ private void CargarItem()
Utility oUtil = new Utility();
///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item
- where baja=0 AND idEfector=idEfectorDerivacion and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
+ where baja=0 and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
" order by nombre";
oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre");
diff --git a/WebLab/AutoAnalizador/EnvioMensaje.aspx.cs b/WebLab/AutoAnalizador/EnvioMensaje.aspx.cs
index b8715560..f9ba7f6c 100644
--- a/WebLab/AutoAnalizador/EnvioMensaje.aspx.cs
+++ b/WebLab/AutoAnalizador/EnvioMensaje.aspx.cs
@@ -78,7 +78,7 @@ private void GenerarArchivoFormatoMetrolabExportar()
ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloEnvio));
crit.Add(Expression.Eq("Equipo", "Metrolab"));
crit.Add(Expression.Eq("IdEfector", oUser.IdEfector.IdEfector));
-
+ crit.AddOrder(Order.Asc("NumeroProtocolo")); //se agrega ordenamiento
IList detalle = crit.List();
if (detalle.Count > 0)
{
diff --git a/WebLab/AutoAnalizador/SysmexKX21N/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/SysmexKX21N/ConfiguracionEdit.aspx.cs
index 02b63e45..2ac300f7 100644
--- a/WebLab/AutoAnalizador/SysmexKX21N/ConfiguracionEdit.aspx.cs
+++ b/WebLab/AutoAnalizador/SysmexKX21N/ConfiguracionEdit.aspx.cs
@@ -88,7 +88,7 @@ private void CargarItem()
///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item (nolock)
- where baja=0 AND idEfector=idEfectorDerivacion and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
+ where baja=0 and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
" order by nombre";
oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre", connReady);
diff --git a/WebLab/AutoAnalizador/SysmexXN1000/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/SysmexXN1000/ConfiguracionEdit.aspx.cs
index 82581fcb..ff070a4d 100644
--- a/WebLab/AutoAnalizador/SysmexXN1000/ConfiguracionEdit.aspx.cs
+++ b/WebLab/AutoAnalizador/SysmexXN1000/ConfiguracionEdit.aspx.cs
@@ -15,11 +15,23 @@
using Business.Data.AutoAnalizador;
using NHibernate;
using NHibernate.Expression;
+using Business.Data;
namespace WebLab.AutoAnalizador.SysmexXN1000
{
public partial class ConfiguracionEdit : System.Web.UI.Page
{
+ Usuario oUser = new Usuario();
+
+ protected void Page_PreInit(object sender, EventArgs e)
+ {
+ if (Session["idUsuario"] != null)
+ oUser = (Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+ // oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1, "IdEfector", oEfector);
+ else
+ Response.Redirect("../FinSesion.aspx", false);
+
+ }
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
@@ -71,9 +83,10 @@ FROM LAB_SysmexItemXN1000 AS M
private void CargarCombos()
{
Utility oUtil = new Utility();
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
string m_ssql = "select idArea, nombre from Lab_Area where baja=0 and idtiposervicio=1 order by nombre";
- oUtil.CargarCombo(ddlArea, m_ssql, "idArea", "nombre");
+ oUtil.CargarCombo(ddlArea, m_ssql, "idArea", "nombre", connReady);
CargarItem();
@@ -85,12 +98,14 @@ private void CargarCombos()
private void CargarItem()
{
Utility oUtil = new Utility();
+ string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item
- where baja=0 AND idEfector=idEfectorDerivacion and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
+ where baja=0 and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
" order by nombre";
- oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre");
+ oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre", connReady);
ddlItem.Items.Insert(0, new ListItem("Seleccione Item", "0"));
ddlItem.UpdateAfterCallBack = true;
}
@@ -171,6 +186,18 @@ protected void gvLista_RowDataBound(object sender, GridViewRowEventArgs e)
CmdEliminar.ToolTip = "Eliminar";
+ CheckBox chkStatus = (CheckBox)e.Row.Cells[3].Controls[1];
+ if (oUser.IdEfector.IdEfector == 227)
+ {
+ CmdEliminar.Visible = true;
+ chkStatus.Visible = true;
+
+ }
+ else
+ {
+ CmdEliminar.Visible = false;
+ chkStatus.Enabled = false;
+ }
diff --git a/WebLab/AutoAnalizador/SysmexXP300/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/SysmexXP300/ConfiguracionEdit.aspx.cs
index e2762e7f..42786268 100644
--- a/WebLab/AutoAnalizador/SysmexXP300/ConfiguracionEdit.aspx.cs
+++ b/WebLab/AutoAnalizador/SysmexXP300/ConfiguracionEdit.aspx.cs
@@ -106,7 +106,7 @@ private void CargarItem()
Utility oUtil = new Utility();
///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item
- where baja=0 AND idEfector=idEfectorDerivacion and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
+ where baja=0 and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
" order by nombre";
string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
diff --git a/WebLab/AutoAnalizador/SysmexXT1800/ConfiguracionEdit.aspx.cs b/WebLab/AutoAnalizador/SysmexXT1800/ConfiguracionEdit.aspx.cs
index 21c25ecc..12f5b747 100644
--- a/WebLab/AutoAnalizador/SysmexXT1800/ConfiguracionEdit.aspx.cs
+++ b/WebLab/AutoAnalizador/SysmexXT1800/ConfiguracionEdit.aspx.cs
@@ -87,7 +87,7 @@ private void CargarItem()
Utility oUtil = new Utility();
///Carga de combos de Item sin el item que se está configurando y solo las determinaciones simples
string m_ssql = @"select idItem, nombre + ' - ' + codigo as nombre from Lab_Item
- where baja=0 AND idEfector=idEfectorDerivacion and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
+ where baja=0 and idCategoria=0 and idArea=" + ddlArea.SelectedValue +
" order by nombre";
oUtil.CargarCombo(ddlItem, m_ssql, "idItem", "nombre");
diff --git a/WebLab/Protocolos/Default2.aspx b/WebLab/Protocolos/Default2.aspx
index b1796bdb..da0a808c 100644
--- a/WebLab/Protocolos/Default2.aspx
+++ b/WebLab/Protocolos/Default2.aspx
@@ -207,7 +207,9 @@
-
+
<%----%>
diff --git a/WebLab/Protocolos/DefaultFFEE2.aspx b/WebLab/Protocolos/DefaultFFEE2.aspx
index dc474e52..967bbae1 100644
--- a/WebLab/Protocolos/DefaultFFEE2.aspx
+++ b/WebLab/Protocolos/DefaultFFEE2.aspx
@@ -139,7 +139,7 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebLab/Protocolos/DefaultFFEE2.aspx.cs b/WebLab/Protocolos/DefaultFFEE2.aspx.cs
index c30422c5..b2884ac4 100644
--- a/WebLab/Protocolos/DefaultFFEE2.aspx.cs
+++ b/WebLab/Protocolos/DefaultFFEE2.aspx.cs
@@ -25,9 +25,10 @@
using System.Text.RegularExpressions;
using System.Collections.Generic;
+
namespace WebLab.Protocolos
{
- public partial class DefaultFFEE2 : System.Web.UI.Page
+ public partial class DefaultFFEE2 : System.Web.UI.Page
{
public Configuracion oC = new Configuracion();
@@ -96,48 +97,24 @@ protected void Page_Load(object sender, EventArgs e)
break;
- }
-
-
-
- lblTitulo.Text = "NUEVO PROTOCOLO";
-
-
-
- //if ((Request["idServicio"].ToString() == "6") && (Session["idCaso"] != null))
- ProtocoloList1.CargarGrillaProtocolo(Request["idServicio"].ToString());
- //else
- //{
- // ProtocoloList1.Visible = false;
- // btnFinalizarCaso.Visible = false;
- //}
-
-
-
-
-
-
-
-
+ }
+ lblTitulo.Text = "NUEVO PROTOCOLO";
+ ProtocoloList1.CargarGrillaProtocolo(Request["idServicio"].ToString());
CargarEfectores();
CargarTipoMuestra();
CargarCaracteres();
- CargarTipoFichas();
- CargarImpresoras();
+ CargarTipoFichas();
+ CargarImpresoras();
if (Session["Etiquetadora"] != null) ddlImpresora.SelectedValue = Session["Etiquetadora"].ToString();
}
}
private void CargarImpresoras()
- {
-
+ {
string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
-
Utility oUtil = new Utility();
string m_ssql = "SELECT idImpresora, nombre FROM LAB_Impresora with (nolock) where idEfector=" + oUser.IdEfector.IdEfector.ToString() + " order by nombre"; //MultiEfector
-
oUtil.CargarCombo(ddlImpresora, m_ssql, "nombre", "nombre", connReady);
-
ddlImpresora.Items.Insert(0, new ListItem("Seleccione impresora", "0"));
}
@@ -175,15 +152,14 @@ private void ConectarWebService()
{
string s_codigo = "";
- try
+ try
{
-
-
- System.Net.ServicePointManager.SecurityProtocol =
+
+ System.Net.ServicePointManager.SecurityProtocol =
System.Net.SecurityProtocolType.Tls12;
string URL = ConfigurationManager.AppSettings["urlffeeandes"].ToString();
URL = URL + "&desde=2000-01-01T23:18:08.382Z&hasta=2050-01-01T23:18:11.407Z&totalOrganizaciones=true";
- if ((ddlTipoFicha.SelectedValue == "600ceaf8220da69a4bbe7223") || (ddlTipoFicha.SelectedValue == "6257096489e70952a20eadc3"))//covid o uma
+ if ((ddlTipoFicha.SelectedValue == "600ceaf8220da69a4bbe7223") || (ddlTipoFicha.SelectedValue == "6257096489e70952a20eadc3") || (ddlTipoFicha.SelectedValue == "69a084acf1b15d16a778a706"))//covid o uma o virossis_respiratoria
{
s_codigo = ControlCodigo();
@@ -217,10 +193,12 @@ private void ConectarWebService()
HttpWebResponse response = request.GetResponse() as HttpWebResponse;
StreamReader reader = new StreamReader(response.GetResponseStream());
string body = reader.ReadToEnd();
- body = body.Replace("[", "").Replace("]", "");
+ // body = body.Replace("[", "").Replace("]", "");
+
if (body != "")
{
String bodyLimpio = body.Replace("'", "''");
+
/*LAB_FichaElectronica: Log de que se recibio la ficha*/
SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
string query = @" INSERT INTO [dbo].[LAB_FichaElectronica]
@@ -231,48 +209,73 @@ private void ConectarWebService()
int idres = Convert.ToInt32(cmd.ExecuteScalar());
try
{
- FFEE respuesta_d = jsonSerializer.Deserialize(body);
+ body = Regex.Replace(body, @"T\d{2}:\d{2}:\d{2}\.\d+Z", "");
+
+ List lista = jsonSerializer.Deserialize>(body);
+
+ ///FFEE respuesta_d = jsonSerializer.Deserialize(body);
+ if (lista != null && lista.Count > 0)
+ {
+ // guardar JSON en hiddenfield
+ hfListaFFEE.Value = body;
+
+ if (lista.Count == 1)
+ {
+ FFEE respuesta_d = lista[0];
+
+ string errores =
+ Validacion(respuesta_d);
- //if (respuesta_d.identificadorpcr == s_codigo)
- //{
- string errores = Validacion(respuesta_d);
if (errores == "")
{
+ bool ok =
+ GuardaFicha(respuesta_d);
- bool ok= GuardaFicha(respuesta_d);
- if (ok)
- {
- ProcesaFicha(respuesta_d);
- Session["Etiquetadora"] = ddlImpresora.SelectedValue;
- }
- else
- {
- //lblMensaje.Text ="No se han configurado determinaciones para el tipo de ficha y servicio. Consulte con el Administrador";
- lblMensaje.Text = "Hubo un error no esperado en la recepcion de la ficha. Consulte con el Administrador";
- lblMensaje.Visible = true;
- }
+ if (ok)
+ {
+ ProcesaFicha(respuesta_d);
- }
+ Session["Etiquetadora"] =
+ ddlImpresora.SelectedValue;
+ }
+ }
else
{
lblMensaje.Text = errores;
lblMensaje.Visible = true;
}
+ }
+ else
+ {
+ gvFichas.DataSource = lista;
+ gvFichas.DataBind();
+
+ gvFichas.Visible = true;
- //}
+ lblMensaje.Text =
+ "Se encontraron varias fichas";
+ lblMensaje.Visible = true;
+ }
}
- catch (Exception ex1)
- {
- if (ex1.InnerException != null)
- lblMensaje.Text = "Error al procesar la ficha " + ex1.Message.ToString();
else
- lblMensaje.Text = "Error al procesar la ficha .Consulte con Administrador";
- lblMensaje.Visible = true;
+ {
+ lblMensaje.Text =
+ "No se encontraron fichas";
+
+ lblMensaje.Visible = true;
}
+ }
+ catch (Exception ex1)
+ {
+ lblMensaje.Text =
+ "Error al procesar la ficha: " +
+ ex1.Message;
+ lblMensaje.Visible = true;
}
+ }
else
{
lblMensaje.Text = "Ficha no encontrada ";
@@ -292,6 +295,80 @@ private void ConectarWebService()
}
}
+
+ protected void gvFichas_RowCommand(object sender, GridViewCommandEventArgs e)
+ {
+ if (e.CommandName == "recibir")
+ {
+ try
+ {
+ int index = Convert.ToInt32(e.CommandArgument);
+
+ if (hfListaFFEE.Value != "")
+ {
+ JavaScriptSerializer jsonSerializer =
+ new JavaScriptSerializer();
+
+ List lista =
+ jsonSerializer.Deserialize>(
+ hfListaFFEE.Value
+ );
+
+ if (lista != null && lista.Count > index)
+ {
+ FFEE ficha = lista[index];
+
+ string errores = Validacion(ficha);
+
+ if (errores == "")
+ {
+ bool ok = GuardaFicha(ficha);
+
+ if (ok)
+ {
+ ProcesaFicha(ficha);
+
+ Session["Etiquetadora"] =
+ ddlImpresora.SelectedValue;
+
+ lblMensaje.Text =
+ "Ficha recibida correctamente";
+ }
+ else
+ {
+ lblMensaje.Text =
+ "Error al guardar la ficha";
+ }
+ }
+ else
+ {
+ lblMensaje.Text = errores;
+ }
+ }
+ else
+ {
+ lblMensaje.Text =
+ "No se encontró la ficha seleccionada";
+ }
+ }
+ else
+ {
+ lblMensaje.Text =
+ "La lista de fichas está vacÃa";
+ }
+ }
+ catch (Exception ex)
+ {
+ lblMensaje.Text =
+ "Error al procesar la ficha: " +
+ ex.Message;
+ }
+
+ lblMensaje.Visible = true;
+ }
+ }
+
+
private string ControlCodigo()
{
string s_codigo = txtCodigo.Text;
@@ -299,10 +376,7 @@ private string ControlCodigo()
string result = string.Concat(s_codigo.Where(c => Char.IsDigit(c)));
if (result == "")
- {
- s_codigo = "";
-
- }
+ s_codigo = "";
else
s_codigo = int.Parse(result).ToString();
}
@@ -331,22 +405,23 @@ private string Validacion(FFEE respuesta_d)
else
errores += " No es posible grabar sin datos de organizacion";
- /* if (Session["idServicio"].ToString() == "3")
- {
- if (respuesta_d.tipomuestra != null)
- {
- idTipoMuestra = BuscarMuestra(respuesta_d.tipomuestra);
- if (idTipoMuestra == "0")
- {
-
- errores += " No existe vinculacion entre la muestra informada " + respuesta_d.tipomuestra + " y las muestras del sistema";
- }
- }
- }
- */
+ /* if (Session["idServicio"].ToString() == "3")
+ {
+ if (respuesta_d.tipomuestra != null)
+ {
+ idTipoMuestra = BuscarMuestra(respuesta_d.tipomuestra);
+ if (idTipoMuestra == "0")
+ {
+
+ errores += " No existe vinculacion entre la muestra informada " + respuesta_d.tipomuestra + " y las muestras del sistema";
+ }
+ }
+ }
+ */
//if tipoform='UMA' entonces clasificacionmonitorio
- string idcarac="";
+ ////Caro: 12.05.2026. No vendrá el dato clasificacion
+ /*string idcarac="";
if (respuesta_d.Tipo_ficha=="UMA") idcarac = "26";
if ((respuesta_d.clasificacion != null) && (respuesta_d.Tipo_ficha != "UMA"))
@@ -367,6 +442,7 @@ private string Validacion(FFEE respuesta_d)
if (idcarac=="")
errores += " No es posible grabar sin datos de clasificacion";
+ */
//if (BuscarEfector(respuesta_d.Paciente_documento.isn) == "0")
//{
// valida = false;
@@ -613,7 +689,22 @@ private bool GuardaFicha(FFEE respuesta_d)
{
///guarda ficha para recuperar en protocoloedit2
int ID_ORIGEN = 0;
- string det = BuscarDeterminaciones(respuesta_d.Tipo_ficha);
+
+ if (respuesta_d.requerimientocuidado != null)
+ {
+ if (respuesta_d.requerimientocuidado.ToUpper() == "AMBULATORIO")
+ ID_ORIGEN = 1;
+
+ if (respuesta_d.requerimientocuidado.ToUpper().Contains("INTERNA"))
+ ID_ORIGEN = 2;
+ }
+ else
+ ID_ORIGEN = 1;
+ if (respuesta_d.Tipo_ficha == "UMA") ID_ORIGEN = 1; //AMBULATORIO
+
+
+
+ string det = BuscarDeterminaciones(respuesta_d.Tipo_ficha, ID_ORIGEN);
/* if (det == "")
return false;
else
@@ -622,8 +713,10 @@ private bool GuardaFicha(FFEE respuesta_d)
VerificarSiExisteFFE(respuesta_d._id);
Ficha oRegistro = new Ficha();
- oRegistro.Clasificacion = respuesta_d.clasificacion;
-
+ if (respuesta_d.clasificacion != null)// con viruses_repiratorios no viene la clasificacion
+ oRegistro.Clasificacion = respuesta_d.clasificacion;
+ else
+ oRegistro.Clasificacion = "";
string efectorsol = BuscarEfector(respuesta_d.organizacion);
Efector oEfectorSol = new Efector();
oEfectorSol = (Efector)oEfectorSol.Get(typeof(Efector), int.Parse(efectorsol));
@@ -636,8 +729,16 @@ private bool GuardaFicha(FFEE respuesta_d)
if (respuesta_d.identificadorpcr!=null)
oRegistro.Identificadorlabo = respuesta_d.identificadorpcr;
- if (respuesta_d.fechasintomas!= null)
- oRegistro.FechaSintoma=DateTime.Parse(respuesta_d.fechasintomas);
+ /* if (respuesta_d.fechasintomas!= null)
+ oRegistro.FechaSintoma=DateTime.Parse(respuesta_d.fechasintomas);
+ */
+ System.DateTime fechaSintoma;
+
+ if (!string.IsNullOrWhiteSpace(respuesta_d.fechasintomas) &&
+ System.DateTime.TryParse(respuesta_d.fechasintomas, out fechaSintoma))
+ {
+ oRegistro.FechaSintoma = fechaSintoma;
+ }
oRegistro.IdFicha = respuesta_d._id;
oRegistro.TipoFicha = respuesta_d.Tipo_ficha;
oRegistro.Solicitante = respuesta_d.usuario;
@@ -645,7 +746,7 @@ private bool GuardaFicha(FFEE respuesta_d)
if (respuesta_d.idCasoSnvs != null)
oRegistro.IdCasoSnvs = respuesta_d.idCasoSnvs;
- if (respuesta_d.tipomuestra != null)
+ if ((respuesta_d.tipomuestra != null) || (respuesta_d.tipomuestra != ""))
{
string idTipoMuestra = BuscarMuestra(respuesta_d.tipomuestra);
if (idTipoMuestra != "0")
@@ -654,23 +755,23 @@ private bool GuardaFicha(FFEE respuesta_d)
}
}
- if (respuesta_d.requerimientocuidado != null)
- {
- if (respuesta_d.requerimientocuidado.ToUpper() == "AMBULATORIO")
- ID_ORIGEN = 1;
+
- if (respuesta_d.requerimientocuidado.ToUpper().Contains("INTERNA"))
- ID_ORIGEN = 2;
+ oRegistro.IdOrigen = ID_ORIGEN;
+ System.DateTime fechamuestra;
+
+ if (!string.IsNullOrWhiteSpace(respuesta_d.fechamuestra) &&
+ System.DateTime.TryParse(respuesta_d.fechamuestra, out fechamuestra))
+ {
+ oRegistro.FechaToma = fechamuestra;
}
- else
- ID_ORIGEN = 1;
- if (respuesta_d.Tipo_ficha == "UMA") ID_ORIGEN = 1; //AMBULATORIO
+ else oRegistro.FechaToma = DateTime.Parse(respuesta_d.Fecha);
- oRegistro.IdOrigen = ID_ORIGEN;
- if (respuesta_d.fechamuestra == null)
+ /* if (respuesta_d.fechamuestra == null)
oRegistro.FechaToma = DateTime.Parse(respuesta_d.Fecha);
else
oRegistro.FechaToma = DateTime.Parse(respuesta_d.fechamuestra);
+ */
oRegistro.Analisis = det;// BuscarDeterminaciones(respuesta_d.Tipo_ficha);
oRegistro.Save();
@@ -712,232 +813,232 @@ private void VerificarSiExisteFFE(string _id)
//}
- private int GuardarProtocolo(Paciente oPaciente, FFEE respuesta_d)
- {
- Efector oEfector = new Efector();
- // Usuario oUser = new Usuario();
-
- Protocolo oRegistro = new Protocolo();
- ObraSocial oObra = new ObraSocial();
- Origen oOrigen = new Origen();
- Prioridad oPri = new Prioridad();
- DateTime fecha = DateTime.Parse(respuesta_d.Fecha);
-
- //Configuracion oC = new Configuracion();
- //oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
-
- oRegistro.IdEfector = oC.IdEfector;
- if (oC.IdSectorDefecto > 0)
- {
- SectorServicio oSector = new SectorServicio();
- oSector = (SectorServicio)oSector.Get(typeof(SectorServicio), oC.IdSectorDefecto);
-
- oRegistro.IdSector = oSector;
- }
- else
- oRegistro.IdSector = BuscarSectorDefecto();
-
-
- TipoServicio oServicio = new TipoServicio();
- oServicio = (TipoServicio)oServicio.Get(typeof(TipoServicio), int.Parse(Session["idServicio"].ToString()));
- oRegistro.IdTipoServicio = oServicio;
-
-
-
- oRegistro.Numero = 0; // oRegistro.GenerarNumero();
- /* oRegistro.NumeroDiario = oRegistro.GenerarNumeroDiario(fecha.ToString("yyyyMMdd"));
- oRegistro.PrefijoSector = oSector.Prefijo.Trim();
- oRegistro.NumeroSector = oRegistro.GenerarNumeroGrupo(oSector);
- oRegistro.NumeroTipoServicio = oRegistro.GenerarNumeroTipoServicio(oServicio);*/
-
- bool grabarincidenciafis = false;
- bool grabarincidenciafuc = false;
-
- oRegistro.FechaInicioSintomas = DateTime.Parse("01/01/1900");
- oRegistro.FechaUltimoContacto = DateTime.Parse("01/01/1900");
-
- //string idCar = BuscarCaracter(respuesta_d.clasificacion);
- //if (respuesta_d.Tipo_ficha == "UMA") idCar = "26";
-
- string idCar = "0";
- if (respuesta_d.Tipo_ficha == "UMA") idCar = "26";
- else
- { if (respuesta_d.clasificacion!= null)
- idCar = BuscarCaracter(respuesta_d.clasificacion);
- }
-
-
- oRegistro.IdCaracter = int.Parse(idCar);
-
- if (idCar == "4") // contacto se guarda en fuc
- {
- if ((respuesta_d.fechasintomas == "") || (respuesta_d.fechasintomas == null)) grabarincidenciafuc = true;
- else oRegistro.FechaUltimoContacto = DateTime.Parse(respuesta_d.fechasintomas);
- }
- else
- { if ((respuesta_d.fechasintomas == "") || (respuesta_d.fechasintomas == null)) grabarincidenciafis = true;
- else oRegistro.FechaInicioSintomas = DateTime.Parse(respuesta_d.fechasintomas);
- }
-
-
-
- //if (ddlCaracter.SelectedValue == "4") //CONTACTO
- //{
- // if (chkSinFUC.Checked) grabarincidenciafuc = true;
- // else oRegistro.FechaUltimoContacto = DateTime.Parse(txtFechaFUC.Value);
- // //GRABAR fUC
- //}
- oRegistro.Fecha =DateTime.Parse( DateTime.Now.ToShortDateString());
- oRegistro.FechaOrden = DateTime.Parse(respuesta_d.Fecha);
- if (respuesta_d.fechamuestra== null)
- oRegistro.FechaTomaMuestra = DateTime.Parse(respuesta_d.Fecha);
- else
- oRegistro.FechaTomaMuestra = DateTime.Parse(respuesta_d.fechamuestra);
- oRegistro.FechaRetiro = DateTime.Parse("01/01/1900"); //DateTime.Parse(txtFechaEntrega.Value);
-
- string idefectororganizacion = BuscarEfector(respuesta_d.organizacion);
- oRegistro.IdEfectorSolicitante = (Efector)oEfector.Get(typeof(Efector), int.Parse(idefectororganizacion));
- oRegistro.IdEspecialistaSolicitante = 0;
-
-
- if (respuesta_d.usuario != null)
- {
- oRegistro.MatriculaEspecialista = "9999";
- oRegistro.Especialista = respuesta_d.usuario;
- }
- else
- {
- oRegistro.MatriculaEspecialista = "0";
- oRegistro.Especialista = "No identificado";
- }
+ // private int GuardarProtocolo(Paciente oPaciente, FFEE respuesta_d)
+ // {
+ // Efector oEfector = new Efector();
+ //// Usuario oUser = new Usuario();
+
+ // Protocolo oRegistro = new Protocolo();
+ // ObraSocial oObra = new ObraSocial();
+ // Origen oOrigen = new Origen();
+ // Prioridad oPri = new Prioridad();
+ // DateTime fecha = DateTime.Parse(respuesta_d.Fecha);
+
+ // //Configuracion oC = new Configuracion();
+ // //oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
+
+ // oRegistro.IdEfector = oC.IdEfector;
+ // if (oC.IdSectorDefecto > 0)
+ // {
+ // SectorServicio oSector = new SectorServicio();
+ // oSector = (SectorServicio)oSector.Get(typeof(SectorServicio), oC.IdSectorDefecto);
+
+ // oRegistro.IdSector = oSector;
+ // }
+ // else
+ // oRegistro.IdSector = BuscarSectorDefecto();
+
+
+ // TipoServicio oServicio = new TipoServicio();
+ // oServicio = (TipoServicio)oServicio.Get(typeof(TipoServicio), int.Parse(Session["idServicio"].ToString()));
+ // oRegistro.IdTipoServicio = oServicio;
+
+
+
+ // oRegistro.Numero = 0; // oRegistro.GenerarNumero();
+ // /* oRegistro.NumeroDiario = oRegistro.GenerarNumeroDiario(fecha.ToString("yyyyMMdd"));
+ // oRegistro.PrefijoSector = oSector.Prefijo.Trim();
+ // oRegistro.NumeroSector = oRegistro.GenerarNumeroGrupo(oSector);
+ // oRegistro.NumeroTipoServicio = oRegistro.GenerarNumeroTipoServicio(oServicio);*/
+
+ // bool grabarincidenciafis = false;
+ // bool grabarincidenciafuc = false;
+
+ // oRegistro.FechaInicioSintomas = DateTime.Parse("01/01/1900");
+ // oRegistro.FechaUltimoContacto = DateTime.Parse("01/01/1900");
+
+ // //string idCar = BuscarCaracter(respuesta_d.clasificacion);
+ // //if (respuesta_d.Tipo_ficha == "UMA") idCar = "26";
+
+ // string idCar = "0";
+ // if (respuesta_d.Tipo_ficha == "UMA") idCar = "26";
+ // else
+ // { if (respuesta_d.clasificacion!= null)
+ // idCar = BuscarCaracter(respuesta_d.clasificacion);
+ // }
+
+
+ // oRegistro.IdCaracter = int.Parse(idCar);
+
+ // if (idCar == "4") // contacto se guarda en fuc
+ // {
+ // if ((respuesta_d.fechasintomas == "") || (respuesta_d.fechasintomas == null)) grabarincidenciafuc = true;
+ // else oRegistro.FechaUltimoContacto = DateTime.Parse(respuesta_d.fechasintomas);
+ // }
+ // else
+ // { if ((respuesta_d.fechasintomas == "") || (respuesta_d.fechasintomas == null)) grabarincidenciafis = true;
+ // else oRegistro.FechaInicioSintomas = DateTime.Parse(respuesta_d.fechasintomas);
+ // }
+
+
+
+ // //if (ddlCaracter.SelectedValue == "4") //CONTACTO
+ // //{
+ // // if (chkSinFUC.Checked) grabarincidenciafuc = true;
+ // // else oRegistro.FechaUltimoContacto = DateTime.Parse(txtFechaFUC.Value);
+ // // //GRABAR fUC
+ // //}
+ // oRegistro.Fecha =DateTime.Parse( DateTime.Now.ToShortDateString());
+ // oRegistro.FechaOrden = DateTime.Parse(respuesta_d.Fecha);
+ // if (respuesta_d.fechamuestra== null)
+ // oRegistro.FechaTomaMuestra = DateTime.Parse(respuesta_d.Fecha);
+ // else
+ // oRegistro.FechaTomaMuestra = DateTime.Parse(respuesta_d.fechamuestra);
+ // oRegistro.FechaRetiro = DateTime.Parse("01/01/1900"); //DateTime.Parse(txtFechaEntrega.Value);
+
+ // string idefectororganizacion = BuscarEfector(respuesta_d.organizacion);
+ // oRegistro.IdEfectorSolicitante = (Efector)oEfector.Get(typeof(Efector), int.Parse(idefectororganizacion));
+ // oRegistro.IdEspecialistaSolicitante = 0;
+
+
+ // if (respuesta_d.usuario != null)
+ // {
+ // oRegistro.MatriculaEspecialista = "9999";
+ // oRegistro.Especialista = respuesta_d.usuario;
+ // }
+ // else
+ // {
+ // oRegistro.MatriculaEspecialista = "0";
+ // oRegistro.Especialista = "No identificado";
+ // }
- ///Desde aca guarda los datos del paciente en Protocolo
- oRegistro.IdPaciente = oPaciente;
+ // ///Desde aca guarda los datos del paciente en Protocolo
+ // oRegistro.IdPaciente = oPaciente;
- oRegistro.Edad = 0; // oRegistro. int.Parse(lblEdad.Text);
+ // oRegistro.Edad = 0; // oRegistro. int.Parse(lblEdad.Text);
- oRegistro.NumeroOrigen = "";
- string origen2 = "";
- if (respuesta_d.identificadorpcr!= null)
- origen2= respuesta_d.identificadorpcr.Replace("HISOP00", "").Replace("HISOP0", "").Replace("HISOP", "");
- if (respuesta_d.identificadorlabo != null)
- origen2 = respuesta_d.identificadorlabo;
+ // oRegistro.NumeroOrigen = "";
+ // string origen2 = "";
+ // if (respuesta_d.identificadorpcr!= null)
+ // origen2= respuesta_d.identificadorpcr.Replace("HISOP00", "").Replace("HISOP0", "").Replace("HISOP", "");
+ // if (respuesta_d.identificadorlabo != null)
+ // origen2 = respuesta_d.identificadorlabo;
- oRegistro.NumeroOrigen2 = origen2;
- oRegistro.UnidadEdad = 0;
+ // oRegistro.NumeroOrigen2 = origen2;
+ // oRegistro.UnidadEdad = 0;
- //oRegistro.Sexo = lblSexo.Text;
+ // //oRegistro.Sexo = lblSexo.Text;
- switch (oPaciente.IdSexo)
- {
- case 1: oRegistro.Sexo = "I"; break;
- case 2: oRegistro.Sexo = "F"; break;
- case 3: oRegistro.Sexo = "M"; break;
- }
+ // switch (oPaciente.IdSexo)
+ // {
+ // case 1: oRegistro.Sexo = "I"; break;
+ // case 2: oRegistro.Sexo = "F"; break;
+ // case 3: oRegistro.Sexo = "M"; break;
+ // }
- oRegistro.Embarazada = "N";
- oRegistro.Sala = ""; // txtSala.Text;
- oRegistro.Cama = ""; // txtCama.Text;
+ // oRegistro.Embarazada = "N";
+ // oRegistro.Sala = ""; // txtSala.Text;
+ // oRegistro.Cama = ""; // txtCama.Text;
- ObraSocial oObraSocial = new ObraSocial();
- oRegistro.IdObraSocial = (ObraSocial)oObraSocial.Get(typeof(ObraSocial), -1);
+ // ObraSocial oObraSocial = new ObraSocial();
+ // oRegistro.IdObraSocial = (ObraSocial)oObraSocial.Get(typeof(ObraSocial), -1);
- string nombreOS = "";
- string codigoOS = "0";
- string[] os = GetPuco(oPaciente.NumeroDocumento).Split('&');
- if (os.Length > 1)
- {
- nombreOS = os[0].ToString();
- codigoOS = os[1].ToUpper();
- // CodOS.Value = codigoOS;
- }
+ // string nombreOS = "";
+ // string codigoOS = "0";
+ // string[] os = GetPuco(oPaciente.NumeroDocumento).Split('&');
+ // if (os.Length > 1)
+ // {
+ // nombreOS = os[0].ToString();
+ // codigoOS = os[1].ToUpper();
+ // // CodOS.Value = codigoOS;
+ // }
- //lblObraSocial.Text = nombreOS; // oObraSocial.Nombre;
+ // //lblObraSocial.Text = nombreOS; // oObraSocial.Nombre;
- oRegistro.NombreObraSocial = nombreOS;
- oRegistro.CodOs = int.Parse(codigoOS);
- int ID_ORIGEN = 12; // no informado
+ // oRegistro.NombreObraSocial = nombreOS;
+ // oRegistro.CodOs = int.Parse(codigoOS);
+ // int ID_ORIGEN = 12; // no informado
- if (respuesta_d.requerimientocuidado != null)
- {
- if (respuesta_d.requerimientocuidado.ToUpper() == "AMBULATORIO")
- ID_ORIGEN = 1;
+ // if (respuesta_d.requerimientocuidado != null)
+ // {
+ // if (respuesta_d.requerimientocuidado.ToUpper() == "AMBULATORIO")
+ // ID_ORIGEN = 1;
- if (respuesta_d.requerimientocuidado.ToUpper().Contains("INTERNA") )
- ID_ORIGEN = 2;
- }
- else
- ID_ORIGEN = 1;
- if (respuesta_d.Tipo_ficha == "UMA") ID_ORIGEN = 1; //AMBULATORIO
+ // if (respuesta_d.requerimientocuidado.ToUpper().Contains("INTERNA") )
+ // ID_ORIGEN = 2;
+ // }
+ // else
+ // ID_ORIGEN = 1;
+ // if (respuesta_d.Tipo_ficha == "UMA") ID_ORIGEN = 1; //AMBULATORIO
- oRegistro.Notificarresultado = true;
- oRegistro.IdOrigen = (Origen)oOrigen.Get(typeof(Origen), ID_ORIGEN);
- oRegistro.IdPrioridad = (Prioridad)oPri.Get(typeof(Prioridad), 1);
- if (respuesta_d.antigeno != null)
- {
- oRegistro.Observacion = "Antigeno:" + respuesta_d.antigeno;
- if (respuesta_d.antigeno == "Reactivo")
- { oRegistro.Notificarresultado = false; }
- }
- else
- {
- oRegistro.Notificarresultado = true;
- }
- oRegistro.ObservacionResultado = "";
+ // oRegistro.Notificarresultado = true;
+ // oRegistro.IdOrigen = (Origen)oOrigen.Get(typeof(Origen), ID_ORIGEN);
+ // oRegistro.IdPrioridad = (Prioridad)oPri.Get(typeof(Prioridad), 1);
+ // if (respuesta_d.antigeno != null)
+ // {
+ // oRegistro.Observacion = "Antigeno:" + respuesta_d.antigeno;
+ // if (respuesta_d.antigeno == "Reactivo")
+ // { oRegistro.Notificarresultado = false; }
+ // }
+ // else
+ // {
+ // oRegistro.Notificarresultado = true;
+ // }
+ // oRegistro.ObservacionResultado = "";
- string ID_MUESTRA = "18"; // por defecto hisopado: CARO: Ver como hacer con el tipo de muestra por ficha
- if (respuesta_d.tipomuestra != null)
- { ID_MUESTRA = BuscarMuestra(respuesta_d.tipomuestra); }
- oRegistro.IdMuestra = int.Parse(ID_MUESTRA);
+ // string ID_MUESTRA = "18"; // por defecto hisopado: CARO: Ver como hacer con el tipo de muestra por ficha
+ // if (respuesta_d.tipomuestra != null)
+ // { ID_MUESTRA = BuscarMuestra(respuesta_d.tipomuestra); }
+ // oRegistro.IdMuestra = int.Parse(ID_MUESTRA);
- oRegistro.IdUsuarioRegistro = oUser; ///(Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
- oRegistro.FechaRegistro = DateTime.Now;
- oRegistro.IpCarga = "";
- oRegistro.Impres = ddlImpresora.SelectedValue;
+ // oRegistro.IdUsuarioRegistro = oUser; ///(Usuario)oUser.Get(typeof(Usuario), int.Parse(Session["idUsuario"].ToString()));
+ // oRegistro.FechaRegistro = DateTime.Now;
+ // oRegistro.IpCarga = "";
+ // oRegistro.Impres = ddlImpresora.SelectedValue;
- oRegistro.Estado = 0;
- oRegistro.Save();
+ // oRegistro.Estado = 0;
+ // oRegistro.Save();
- oRegistro.ActualizarNumeroDesdeID();
+ // oRegistro.ActualizarNumeroDesdeID();
- string tabla = BuscarDeterminaciones(respuesta_d.Tipo_ficha);
- GuardarDetalle(oRegistro, tabla );
+ // string tabla = BuscarDeterminaciones(respuesta_d.Tipo_ficha, ID_ORIGEN);
+ // GuardarDetalle(oRegistro, tabla );
- oRegistro.IdPaciente.ActualizarEdadProtocolo();
+ // oRegistro.IdPaciente.ActualizarEdadProtocolo();
- // no grabo incidencias por que va a estar controlado el ingreso de fechas
- //if (grabarincidenciafis)
- // oRegistro.GeneraIncidenciaAutomatica(46, int.Parse(Session["idUsuario"].ToString()));
- //if (grabarincidenciafuc)
- // oRegistro.GeneraIncidenciaAutomatica(47, int.Parse(Session["idUsuario"].ToString()));
- //else
- // GuardarDiagnosticos(oRegistro);
+ // // no grabo incidencias por que va a estar controlado el ingreso de fechas
+ // //if (grabarincidenciafis)
+ // // oRegistro.GeneraIncidenciaAutomatica(46, int.Parse(Session["idUsuario"].ToString()));
+ // //if (grabarincidenciafuc)
+ // // oRegistro.GeneraIncidenciaAutomatica(47, int.Parse(Session["idUsuario"].ToString()));
+ // //else
+ // // GuardarDiagnosticos(oRegistro);
- //if ((!grabarincidenciafis) && (!grabarincidenciafuc))
- // oRegistro.BorrarIncidenciasFISyFUC(int.Parse(Session["idUsuario"].ToString()));
+ // //if ((!grabarincidenciafis) && (!grabarincidenciafuc))
+ // // oRegistro.BorrarIncidenciasFISyFUC(int.Parse(Session["idUsuario"].ToString()));
- oRegistro.GrabarAuditoriaDetalleProtocolo("Graba desde FFEE", oUser.IdUsuario, respuesta_d.identificadorpcr, "");
+ // oRegistro.GrabarAuditoriaDetalleProtocolo("Graba desde FFEE", oUser.IdUsuario, respuesta_d.identificadorpcr, "");
- ///Caro, ver de imprimir todas general y area
- oRegistro.ImprimirCodigoBarras(ddlImpresora.SelectedItem.Text, oUser.IdUsuario);
+ // ///Caro, ver de imprimir todas general y area
+ // oRegistro.ImprimirCodigoBarras(ddlImpresora.SelectedItem.Text, oUser.IdUsuario);
- return oRegistro.Numero;
- }
+ // return oRegistro.Numero;
+ // }
private SectorServicio BuscarSectorDefecto()
{
@@ -968,93 +1069,14 @@ private SectorServicio BuscarSectorDefecto()
private void CargarTipoFichas()
{
-
- Utility oUtil = new Utility();
- //Configuracion oC = new Configuracion(); oC = (Configuracion)oC.Get(typeof(Configuracion), "IdConfiguracion", 1);
-
+ Utility oUtil = new Utility();
string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
///Carga de grupos de numeración solo si el tipo de numeración es 2: por Grupos
string m_ssql = "SELECT nombre as nombre, codigo FROM LAB_TipoFicha with (nolock) WHERE (baja = 0) order by nombre";
oUtil.CargarCombo(ddlTipoFicha, m_ssql, "codigo", "nombre", connReady);
ddlTipoFicha.Items.Insert(0, new ListItem("Seleccione", "0"));
-
-
- // Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);
- /* System.Net.ServicePointManager.SecurityProtocol =
- System.Net.SecurityProtocolType.Tls12;
- string URL = "";// ConfigurationManager.AppSettings["urlffeeandes"].ToString();
- URL = URL + "https://app.andes.gob.ar/api/bi/queries/listado-tiposFichas/json";
-
- string s_token = ConfigurationManager.AppSettings["tokenffeeandes"].ToString();
-
-
- JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
-
- HttpWebRequest request;
- request = WebRequest.Create(URL) as HttpWebRequest;
- request.Timeout = 10 * 1000;
- request.Method = "GET";
-
- request.ContentType = "application/json";
- request.Headers.Add("Authorization", s_token);
-
-
- HttpWebResponse response = request.GetResponse() as HttpWebResponse;
- StreamReader reader = new StreamReader(response.GetResponseStream());
- string body = reader.ReadToEnd();
- body = body.Replace("[", "").Replace("]", "");
- if (body != "")
- {
- //string fileName = "WeatherForecast.json";
- //string jsonString = jsonSerializer.Serialize(body);
- //File.WriteAllText(fileName, jsonString);
-
-
- //string json = JsonConvert.SerializeObject(body);
- //List respuesta_d = jsonSerializer.Deserialize(body); ;
- //foreach (var f in respuesta_d.ficha)
- //{
- // ddlTipoFicha.Items.Add(f.ficha.nombre);
- //}
- // // Recorremos el array de datos del JSON
-
-
- [
- {
- "id": "600ceaf8220da69a4bbe7223",
- "nombre": "covid19"
- },
- {
- "id": "6257096489e70952a20eadc3",
- "nombre": "UMA"
- },
- {
- "id": "648ca796698f662a8932649e",
- "nombre": "Intento de Suicidio"
- },
- {
- "id": "6643a1abb428bb3f28064b30",
- "nombre": "Hantavirus"
- },
- {
- "id": "66eebc26eea39c3da812ba4e",
- "nombre": "Dengue"
- },
- {
- "id": "66df637dd1a25e5b8d7eb8b8",
- "nombre": "Sifilis"
- }
- ]
-
- ddlTipoFicha.Items.Insert(0, new ListItem("Seleccione", "0"));
- ddlTipoFicha.Items.Insert(1, new ListItem("covid19", "600ceaf8220da69a4bbe7223"));// es micro y para labo central y genera automaticamente ficha
- ddlTipoFicha.Items.Insert(2, new ListItem("UMA", "6257096489e70952a20eadc3"));// es micro y para labo central y genera automaticamente ficha
- ddlTipoFicha.Items.Insert(3, new ListItem("Intento de Suicidio", "648ca796698f662a8932649e"));
- ddlTipoFicha.Items.Insert(4, new ListItem("Hantavirus", "6643a1abb428bb3f28064b30"));// es micro y para labo central y genera automaticamente ficha
- ddlTipoFicha.Items.Insert(5, new ListItem("Dengue", "66eebc26eea39c3da812ba4e"));// es Labo y micro y para todos y NO genera automaticamente ficha
- ddlTipoFicha.Items.Insert(6, new ListItem("Sifilis", "66df637dd1a25e5b8d7eb8b8"));// es Labo y micro y para todos y NO genera automaticamente ficha
- //} */
+
}
private void CargarEfectores()
@@ -1147,14 +1169,8 @@ private string BuscarEfector(string organizacion)
s_idEfector = efe;
break;
}
- }
-
-
-
-
-
+ }
return s_idEfector;
-
}
private string BuscarMuestra(string muestra)
{
@@ -1182,237 +1198,214 @@ private string BuscarMuestra(string muestra)
}
- private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro, string Det)
- {
- ISession m_session = NHibernateHttpModule.CurrentSession;
+ //private void GuardarDetalle(Business.Data.Laboratorio.Protocolo oRegistro, string Det)
+ //{
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
- //int dias_espera = 0;
- // string[] tabla = "1#9122#Si#False".Split('@'); // TxtDatosCargados.Value.Split('@');
+ // //int dias_espera = 0;
+ // // string[] tabla = "1#9122#Si#False".Split('@'); // TxtDatosCargados.Value.Split('@');
- string[] tabla = Det.Split('@');
- string recordar_practicas = "";
+ // string[] tabla = Det.Split('@');
+ // string recordar_practicas = "";
- for (int i = 0; i < tabla.Length; i++)
- {
- string[] fila = tabla[i].Split('#');
+ // for (int i = 0; i < tabla.Length; i++)
+ // {
+ // string[] fila = tabla[i].Split('#');
- string codigo = fila[1].ToString();
+ // string codigo = fila[1].ToString();
- if (recordar_practicas == "")
- recordar_practicas = codigo + "#Si#False";
- else
- recordar_practicas += ";" + codigo + "#Si#False";
+ // if (recordar_practicas == "")
+ // recordar_practicas = codigo + "#Si#False";
+ // else
+ // recordar_practicas += ";" + codigo + "#Si#False";
- if (codigo != "")
- {
- Item oItem = new Item();
- oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
- ///Caro verificar si está disponible para el efector la determinacion sino no cargar
- //string trajomuestra = fila[3].ToString();
+ // if (codigo != "")
+ // {
+ // Item oItem = new Item();
+ // oItem = (Item)oItem.Get(typeof(Item), "Codigo", codigo, "Baja", false);
+ // ///Caro verificar si está disponible para el efector la determinacion sino no cargar
+ // //string trajomuestra = fila[3].ToString();
- ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
- crit.Add(Expression.Eq("IdProtocolo", oRegistro));
- crit.Add(Expression.Eq("IdItem", oItem));
- IList listadetalle = crit.List();
- if (listadetalle.Count == 0)
- { //// si no está lo agrego --- si ya está no hago nada
+ // ICriteria crit = m_session.CreateCriteria(typeof(DetalleProtocolo));
+ // crit.Add(Expression.Eq("IdProtocolo", oRegistro));
+ // crit.Add(Expression.Eq("IdItem", oItem));
+ // IList listadetalle = crit.List();
+ // if (listadetalle.Count == 0)
+ // { //// si no está lo agrego --- si ya está no hago nada
- DetalleProtocolo oDetalle = new DetalleProtocolo();
- //Item oItem = new Item();
- oDetalle.IdProtocolo = oRegistro;
- oDetalle.IdEfector = oRegistro.IdEfector;
+ // DetalleProtocolo oDetalle = new DetalleProtocolo();
+ // //Item oItem = new Item();
+ // oDetalle.IdProtocolo = oRegistro;
+ // oDetalle.IdEfector = oRegistro.IdEfector;
- oDetalle.IdItem = oItem; // (Item)oItem.Get(typeof(Item), "Codigo", codigo);
- oDetalle.IdSubItem = oItem;
+ // oDetalle.IdItem = oItem; // (Item)oItem.Get(typeof(Item), "Codigo", codigo);
+ // oDetalle.IdSubItem = oItem;
- oDetalle.TrajoMuestra = "Si";
-
-
- oDetalle.FechaResultado = DateTime.Parse("01/01/1900");
- oDetalle.FechaValida = DateTime.Parse("01/01/1900");
- oDetalle.FechaControl = DateTime.Parse("01/01/1900");
- oDetalle.FechaImpresion = DateTime.Parse("01/01/1900");
- oDetalle.FechaEnvio = DateTime.Parse("01/01/1900");
- oDetalle.FechaObservacion = DateTime.Parse("01/01/1900");
- oDetalle.FechaValidaObservacion = DateTime.Parse("01/01/1900");
- oDetalle.FechaPreValida = DateTime.Parse("01/01/1900");
- oDetalle.Informable = oItem.GetInformableEfector(oUser.IdEfector); //oItem.Informable;
+ // oDetalle.TrajoMuestra = "Si";
+
+
+ // oDetalle.FechaResultado = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaValida = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaControl = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaImpresion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaEnvio = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaObservacion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaValidaObservacion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaPreValida = DateTime.Parse("01/01/1900");
+ // oDetalle.Informable = oItem.GetInformableEfector(oUser.IdEfector); //oItem.Informable;
- ///CARO poner sin insumo y calculo de valores de referencia
- oDetalle.Save();
+ // ///CARO poner sin insumo y calculo de valores de referencia
+ // oDetalle.Save();
- GuardarDetallePractica(oDetalle);
- oDetalle.GuardarDerivacion(oUser );
- //ardarDerivacion(oDetalle);
- }
- else //si ya esta actualizo si trajo muestra o no
- {
- foreach (DetalleProtocolo oDetalle in listadetalle)
- {
- //if (trajomuestra == "true")
- // oDetalle.TrajoMuestra = "No";
- //else
- oDetalle.TrajoMuestra = "Si";
-
- oDetalle.Save();
- }
-
- }
- }
- }
+ // GuardarDetallePractica(oDetalle);
+ // oDetalle.GuardarDerivacion(oUser );
+ // //ardarDerivacion(oDetalle);
+ // }
+ // else //si ya esta actualizo si trajo muestra o no
+ // {
+ // foreach (DetalleProtocolo oDetalle in listadetalle)
+ // {
+ // //if (trajomuestra == "true")
+ // // oDetalle.TrajoMuestra = "No";
+ // //else
+ // oDetalle.TrajoMuestra = "Si";
+
+ // oDetalle.Save();
+ // }
+
+ // }
+ // }
+ // }
- oRegistro.FechaRetiro = oRegistro.Fecha.AddDays(0);
- oRegistro.Estado = 0;
+ // oRegistro.FechaRetiro = oRegistro.Fecha.AddDays(0);
+ // oRegistro.Estado = 0;
- oRegistro.Save();
+ // oRegistro.Save();
- }
- //private void GuardarDerivacion(DetalleProtocolo oDetalle)
+ //}
+
+ //private void GuardarDetallePractica(DetalleProtocolo oDet)
//{
- // if (oDetalle.IdItem.esDerivado(oC.IdEfector))
+ // //if (oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
+ // //{
+ // // oDet.IdSubItem = oDet.IdItem;
+ // // oDet.Save();
+ // //}
+ // if (oDet.VerificarSiEsDerivable(oUser.IdEfector))//(VerificarSiEsDerivable(oDet)) //oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
// {
- // Business.Data.Laboratorio.Derivacion oRegistro = new Business.Data.Laboratorio.Derivacion();
- // oRegistro.IdDetalleProtocolo = oDetalle;
- // oRegistro.Estado = 0;
- // oRegistro.Observacion = "";// txtObservacion.Text;
- // oRegistro.IdUsuarioRegistro = oUser.IdUsuario;//int.Parse(Session["idUsuario"].ToString());
- // oRegistro.FechaRegistro = DateTime.Now;
- // oRegistro.FechaResultado = DateTime.Parse("01/01/1900");
-
- // oRegistro.IdEfectorDerivacion = oDetalle.IdItem.GetIDEfectorDerivacion(oC.IdEfector); // se graba el efector configurado en ese momento.
-
- // oRegistro.Save();
-
- // // graba el resultado en ResultadCar "Derivado: " + oItem.GetEfectorDerivacion(oCon.IdEfector);
- // //oDetalle.ResultadoCar = "Pendiente de Derivacion";//"se podria poner a que efector....
- // //oDetalle.Save();
- // oDetalle.GrabarAuditoriaDetalleProtocolo("Graba Derivado", oUser.IdUsuario);
- // }
+ // oDet.IdSubItem = oDet.IdItem;
+ // oDet.Save();
+ // oDet.GuardarValorReferencia();
- //}
-
- private void GuardarDetallePractica(DetalleProtocolo oDet)
- {
- //if (oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
- //{
- // oDet.IdSubItem = oDet.IdItem;
- // oDet.Save();
- //}
- if (oDet.VerificarSiEsDerivable(oUser.IdEfector))//(VerificarSiEsDerivable(oDet)) //oDet.IdItem.IdEfector.IdEfector != oDet.IdItem.IdEfectorDerivacion.IdEfector) //Si es un item derivable no busca hijos y guarda directamente.
- {
- oDet.IdSubItem = oDet.IdItem;
- oDet.Save();
- oDet.GuardarValorReferencia();
-
- // GuardarValorReferencia(oDet);
- }
- else
+ // // GuardarValorReferencia(oDet);
+ // }
+ // else
- {
- ISession m_session = NHibernateHttpModule.CurrentSession;
- ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
- crit.Add(Expression.Eq("IdItemPractica", oDet.IdItem));
- crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
- IList detalle = crit.List();
- if (detalle.Count > 0)
- {
- int i = 1;
- foreach (PracticaDeterminacion oSubitem in detalle)
- {
- if (oSubitem.IdItemDeterminacion != 0)
- {
- Item oSItem = new Item();
- oSItem = (Item)oSItem.Get(typeof(Item), oSubitem.IdItemDeterminacion);
- if (i == 1)
- {
- oDet.IdSubItem = oSItem;
- oDet.Save();
- oDet.GuardarSinInsumo();
- oDet.GuardarValorReferencia();
- }
- else
- {
- DetalleProtocolo oDetalle = new DetalleProtocolo();
- oDetalle.IdProtocolo = oDet.IdProtocolo;
- oDetalle.IdEfector = oDet.IdEfector;
- oDetalle.IdItem = oDet.IdItem;
- oDetalle.IdSubItem = oSItem;
- oDetalle.TrajoMuestra = oDet.TrajoMuestra;
- oDetalle.Informable = oSItem.Informable;
-
-
- oDetalle.FechaResultado = DateTime.Parse("01/01/1900");
- oDetalle.FechaValida = DateTime.Parse("01/01/1900");
- oDetalle.FechaControl = DateTime.Parse("01/01/1900");
- oDetalle.FechaImpresion = DateTime.Parse("01/01/1900");
- oDetalle.FechaEnvio = DateTime.Parse("01/01/1900");
- oDetalle.FechaObservacion = DateTime.Parse("01/01/1900");
- oDetalle.FechaValidaObservacion = DateTime.Parse("01/01/1900");
- oDetalle.FechaPreValida = DateTime.Parse("01/01/1900");
-
-
- oDetalle.Save();
- oDetalle.GuardarSinInsumo();
- oDetalle.GuardarValorReferencia();
- }
- i = i + 1;
- }//fin if
- }//fin foreach
- }
- else
- {
- oDet.IdSubItem = oDet.IdItem;
- oDet.Informable = oDet.IdSubItem.GetInformableEfector(oUser.IdEfector);
-
-
- oDet.Save();
- oDet.GuardarSinInsumo();
- oDet.GuardarValorReferencia();
- }//fin if (detalle.Count > 0)
- }
+ // {
+ // ISession m_session = NHibernateHttpModule.CurrentSession;
+ // ICriteria crit = m_session.CreateCriteria(typeof(PracticaDeterminacion));
+ // crit.Add(Expression.Eq("IdItemPractica", oDet.IdItem));
+ // crit.Add(Expression.Eq("IdEfector", oUser.IdEfector));
+ // IList detalle = crit.List();
+ // if (detalle.Count > 0)
+ // {
+ // int i = 1;
+ // foreach (PracticaDeterminacion oSubitem in detalle)
+ // {
+ // if (oSubitem.IdItemDeterminacion != 0)
+ // {
+ // Item oSItem = new Item();
+ // oSItem = (Item)oSItem.Get(typeof(Item), oSubitem.IdItemDeterminacion);
+ // if (i == 1)
+ // {
+ // oDet.IdSubItem = oSItem;
+ // oDet.Save();
+ // oDet.GuardarSinInsumo();
+ // oDet.GuardarValorReferencia();
+ // }
+ // else
+ // {
+ // DetalleProtocolo oDetalle = new DetalleProtocolo();
+ // oDetalle.IdProtocolo = oDet.IdProtocolo;
+ // oDetalle.IdEfector = oDet.IdEfector;
+ // oDetalle.IdItem = oDet.IdItem;
+ // oDetalle.IdSubItem = oSItem;
+ // oDetalle.TrajoMuestra = oDet.TrajoMuestra;
+ // oDetalle.Informable = oSItem.Informable;
+
+
+ // oDetalle.FechaResultado = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaValida = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaControl = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaImpresion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaEnvio = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaObservacion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaValidaObservacion = DateTime.Parse("01/01/1900");
+ // oDetalle.FechaPreValida = DateTime.Parse("01/01/1900");
+
+
+ // oDetalle.Save();
+ // oDetalle.GuardarSinInsumo();
+ // oDetalle.GuardarValorReferencia();
+ // }
+ // i = i + 1;
+ // }//fin if
+ // }//fin foreach
+ // }
+ // else
+ // {
+ // oDet.IdSubItem = oDet.IdItem;
+ // oDet.Informable = oDet.IdSubItem.GetInformableEfector(oUser.IdEfector);
+
+
+ // oDet.Save();
+ // oDet.GuardarSinInsumo();
+ // oDet.GuardarValorReferencia();
+ // }//fin if (detalle.Count > 0)
+ // }
- }
+ //}
- private string BuscarDeterminaciones(string Tipo_ficha)
+ private string BuscarDeterminaciones(string Tipo_ficha, int ID_ORIGEN)
{///CARO poner en la tabla las determinaciones por ficha dengue /sifilis
Utility oUtil = new Utility();
///Carga del combo de determinaciones
+ ///
+ string s_tipo = "Determinacion";
+
+ if (Tipo_ficha == "virosis_respiratoria")
+ {
+ if (ID_ORIGEN == 1) ///ambulatorio
+ s_tipo += "Ambulatorio";
+ if (ID_ORIGEN == 2) ///ambulatorio
+ s_tipo += "Internacion";
+ }
+
string m_ssql = @"select idsil from Rel_andes A with (nolock)
inner join LAB_ItemEfector I with (nolock) on A.idSIL = i.idItem
inner join lab_item I2 with (nolock) on I2.iditem = I.iditem
inner join lab_Area A2 with (nolock) on A2.idarea=I2.idarea
- where A.tipo ='Determinacion' ";
+ where A.tipo ='"+s_tipo+"' ";
if (Tipo_ficha == "UMA")
- m_ssql += @" and [nombreAndes]='DerivacionOVR'"; //UMA
- /*if (Tipo_ficha == "covid19")
- m_ssql += @" and [nombreAndes]='covid19'";
- */
-
+ m_ssql += @" and [nombreAndes]='DerivacionOVR'"; //UMA
else
- m_ssql += @" and [nombreAndes]='"+ddlTipoFicha.SelectedItem.Text+"'";
- // if ((Tipo_ficha != "UMA") && (Tipo_ficha != "covid19")) ///el resto de las fichas: dengue , sifilis
- // m_ssql = @"select idsil from Rel_andes A with (nolock)
- // inner join LAB_ItemEfector I with (nolock) on A.idSIL = i.idItem
- // inner join lab_item I2 on I2.iditem = I.iditem
- // inner join lab_Area A2 on A2.idarea=I2.idarea
- // where A.tipo='Determinacion' and [nombreAndes]='Dengue'";
- ////
+ m_ssql += @" and [nombreAndes]='"+ddlTipoFicha.SelectedItem.Text+"'";
m_ssql += " and I.idEfector="+ oUser.IdEfector.IdEfector.ToString()+" and i.disponible=1 ";
@@ -1428,67 +1421,54 @@ inner join lab_Area A2 with (nolock) on A2.idarea=I2.idarea
string sTareas = "";
for (int i = 0; i < ds.Tables["T"].Rows.Count; i++)
{
- //if ((Tipo_ficha == "UMA") || (Tipo_ficha == "covid19"))
- //{ //string[] tabla = "1#9122#Si#False".Split
- // if (sTareas == "")
- // sTareas = "1#" + ds.Tables["T"].Rows[i][0].ToString() + "#Si#False";
- // else
- // sTareas += "@" + (i + 1).ToString() + "#" + ds.Tables["T"].Rows[i][0].ToString() + "#Si#False";
- //}
- //else //el resto de las fichas
- //{
- if (sTareas == "")
- sTareas = ds.Tables["T"].Rows[i][0].ToString();
- else
- sTareas += "|" + ds.Tables["T"].Rows[i][0].ToString();
- //}
-
+ if (sTareas == "")
+ sTareas = ds.Tables["T"].Rows[i][0].ToString();
+ else
+ sTareas += "|" + ds.Tables["T"].Rows[i][0].ToString();
}
- return sTareas;
-
-
+ return sTareas;
}
- public string GetPuco(int numeroDocumento)
- {
- string connetionString = null;
- SqlConnection connection;
- SqlCommand command;
- string sql = null;
- string codigo = "";
- string nombre = "";
- connetionString = ConfigurationManager.ConnectionStrings["Puco"].ConnectionString;
-
- ; // "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password";
- sql = @"select S.nombre, S.cod_os as os from pd_puco P with (nolock)
- inner join obras_sociales S with (nolock) on S.cod_os=P.codigoOS where P.dni = " + numeroDocumento.ToString();
-
- connection = new SqlConnection(connetionString);
- try
- {
- SqlDataReader rdr = null;
- connection.Open();
- command = new SqlCommand(sql, connection);
- rdr = command.ExecuteReader();
-
- while (rdr.Read())
- {
- nombre = rdr[0].ToString();
- codigo = rdr[1].ToString();
- }
- if (nombre == "") nombre = "Sin obra social"; // sin obra social
- else nombre = nombre + "&" + codigo;
- command.Dispose();
- connection.Close();
- }
- catch (Exception ex)
- {
- nombre = "Sin obra social&0";
- }
+ //public string GetPuco(int numeroDocumento)
+ //{
+ // string connetionString = null;
+ // SqlConnection connection;
+ // SqlCommand command;
+ // string sql = null;
+ // string codigo = "";
+ // string nombre = "";
+ // connetionString = ConfigurationManager.ConnectionStrings["Puco"].ConnectionString;
+
+ // ; // "Data Source=ServerName;Initial Catalog=DatabaseName;User ID=UserName;Password=Password";
+ // sql = @"select S.nombre, S.cod_os as os from pd_puco P with (nolock)
+ // inner join obras_sociales S with (nolock) on S.cod_os=P.codigoOS where P.dni = " + numeroDocumento.ToString();
+
+ // connection = new SqlConnection(connetionString);
+ // try
+ // {
+ // SqlDataReader rdr = null;
+ // connection.Open();
+ // command = new SqlCommand(sql, connection);
+ // rdr = command.ExecuteReader();
+
+ // while (rdr.Read())
+ // {
+ // nombre = rdr[0].ToString();
+ // codigo = rdr[1].ToString();
+ // }
+ // if (nombre == "") nombre = "Sin obra social"; // sin obra social
+ // else nombre = nombre + "&" + codigo;
+ // command.Dispose();
+ // connection.Close();
+ // }
+ // catch (Exception ex)
+ // {
+ // nombre = "Sin obra social&0";
+ // }
- return nombre;
- }
+ // return nombre;
+ //}
public class TipoFFEEs
{
@@ -1501,7 +1481,8 @@ public class TipoFFEE
public string id { get; set; }
public string nombre { get; set; }
}
- public class FFEE
+
+ public class FFEE
{
public string _id { get; set; }
public string identificadorpcr { get; set; }
@@ -1585,28 +1566,28 @@ protected void lnkAmpliarFiltros_Click(object sender, EventArgs e)
- protected void btnFinalizarCaso_Click(object sender, EventArgs e)
- {
- CrystalReportSource oCr = new CrystalReportSource();
- Business.Data.Laboratorio.CasoFiliacion oRegistro = new Business.Data.Laboratorio.CasoFiliacion();
- oRegistro = (Business.Data.Laboratorio.CasoFiliacion)oRegistro.Get(typeof(Business.Data.Laboratorio.CasoFiliacion), int.Parse(Session["idCaso"].ToString()));
+ //protected void btnFinalizarCaso_Click(object sender, EventArgs e)
+ //{
+ // CrystalReportSource oCr = new CrystalReportSource();
+ // Business.Data.Laboratorio.CasoFiliacion oRegistro = new Business.Data.Laboratorio.CasoFiliacion();
+ // oRegistro = (Business.Data.Laboratorio.CasoFiliacion)oRegistro.Get(typeof(Business.Data.Laboratorio.CasoFiliacion), int.Parse(Session["idCaso"].ToString()));
- ParameterDiscreteValue nrocaso = new ParameterDiscreteValue();
- nrocaso.Value = oRegistro.IdCasoFiliacion.ToString();
+ // ParameterDiscreteValue nrocaso = new ParameterDiscreteValue();
+ // nrocaso.Value = oRegistro.IdCasoFiliacion.ToString();
- ParameterDiscreteValue nombre = new ParameterDiscreteValue();
- nombre.Value = oRegistro.IdCasoFiliacion.ToString() + " " + oRegistro.Nombre;
+ // ParameterDiscreteValue nombre = new ParameterDiscreteValue();
+ // nombre.Value = oRegistro.IdCasoFiliacion.ToString() + " " + oRegistro.Nombre;
- oCr.Report.FileName = "..\\CasoFiliacion\\CaratulaFiliacion.rpt";
+ // oCr.Report.FileName = "..\\CasoFiliacion\\CaratulaFiliacion.rpt";
- oCr.ReportDocument.ParameterFields[0].CurrentValues.Add(nrocaso);
- oCr.ReportDocument.ParameterFields[1].CurrentValues.Add(nombre);
+ // oCr.ReportDocument.ParameterFields[0].CurrentValues.Add(nrocaso);
+ // oCr.ReportDocument.ParameterFields[1].CurrentValues.Add(nombre);
- oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Caratula");
- }
+ // oCr.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, Response, true, "Caratula");
+ //}
protected void cvValidacionInput_ServerValidate(object source, ServerValidateEventArgs args)
{
@@ -1622,10 +1603,7 @@ protected void cvValidacionInput_ServerValidate(object source, ServerValidateEve
args.IsValid = false;
cvValidacionInput.ErrorMessage = "Para el tipo de ficha seleccionada debe ingresar un codigo";
return;
- }
-
-
-
+ }
}
else
{
diff --git a/WebLab/Protocolos/DefaultFFEE2.aspx.designer.cs b/WebLab/Protocolos/DefaultFFEE2.aspx.designer.cs
index 95b0ff72..b5b4b945 100644
--- a/WebLab/Protocolos/DefaultFFEE2.aspx.designer.cs
+++ b/WebLab/Protocolos/DefaultFFEE2.aspx.designer.cs
@@ -129,6 +129,15 @@ public partial class DefaultFFEE2 {
///
protected global::System.Web.UI.WebControls.Button btnBuscar;
+ ///
+ /// hfListaFFEE control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.HiddenField hfListaFFEE;
+
///
/// cvValidacionInput control.
///
@@ -182,5 +191,14 @@ public partial class DefaultFFEE2 {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Label lblMensaje;
+
+ ///
+ /// gvFichas control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvFichas;
}
}
diff --git a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
index cc2c6513..ac11e6ca 100644
--- a/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
+++ b/WebLab/Protocolos/ProtocoloEdit2.aspx.cs
@@ -342,18 +342,15 @@ private void CargarFFEE( string idFicha)
Business.Data.Laboratorio.Ficha oRegistro = new Business.Data.Laboratorio.Ficha();
oRegistro = (Business.Data.Laboratorio.Ficha)oRegistro.Get(typeof(Business.Data.Laboratorio.Ficha), "IdFicha", idFicha);
- //oRegistro.GrabarAuditoriaProtocolo("Consulta", int.Parse(Session["idUsuario"].ToString()));
+
if (oRegistro != null)
{
hplActualizarPaciente.Visible = false;
hplModificarPaciente.Visible = false;
-
- // oRegistro.IdEfector = oC.IdEfector;
+
SectorServicio oSector = new SectorServicio();
oSector = BuscarSectorDefecto();
-
-
lblTitulo.Visible = false;
txtFecha.Value = DateTime.Now.ToShortDateString();
txtFechaOrden.Value = oRegistro.Fecha.ToShortDateString();///fecha en la ficha
@@ -367,16 +364,13 @@ private void CargarFFEE( string idFicha)
ddlEfector.SelectedValue = oRegistro.IdEfectorSolicitante.IdEfector.ToString(); SelectedEfector();
ddlOrigen.SelectedValue = oRegistro.IdOrigen.ToString();
ddlSectorServicio.SelectedValue = oSector.IdSectorServicio.ToString();// oRegistro.IdSector.IdSectorServicio.ToString(); //ver el servicio
- ddlPrioridad.SelectedValue = "1";// oRegistro.IdPrioridad.IdPrioridad.ToString();
- //if (oRegistro.IdTipoServicio.IdTipoServicio == 3) ddlMuestra.SelectedValue = oRegistro.IdMuestra.ToString();
-
+ ddlPrioridad.SelectedValue = "1";// oRegistro.IdPrioridad.IdPrioridad.ToString();
txtEspecialista.Text = "9999";//oRegistro.MatriculaEspecialista;
string espe = oRegistro.Solicitante;
string matricula = "9999" + '#' + oRegistro.Solicitante; //oRegistro.MatriculaEspecialista + '#' + oRegistro.Especialista;
// MostrarMedico();
- ddlEspecialista.Items.Insert(0, new ListItem(espe, matricula + '#' + espe));
- //if ((matricula == oRegistro.MatriculaEspecialista) && (oRegistro.Especialista== apellidoynombre))
+ ddlEspecialista.Items.Insert(0, new ListItem(espe, matricula + '#' + espe));
ddlEspecialista.SelectedValue = "9999" + '#' + oRegistro.Solicitante;
ddlEspecialista.UpdateAfterCallBack = true;
@@ -392,11 +386,19 @@ private void CargarFFEE( string idFicha)
CargarDiagnosticoFicha(oRegistro.TipoFicha);
////caracteres segun laborotorio central
- string idCar = BuscarCaracter(oRegistro.Clasificacion);
- if (oRegistro.TipoFicha == "UMA") idCar = "26";
- ddlCaracter.SelectedValue = idCar;
+ if (oRegistro.TipoFicha == "virosis_respiratoria")
+ ddlCaracter.Enabled = false;
+ else
+ {
+ string idCar = BuscarCaracter(oRegistro.Clasificacion);
+ if (oRegistro.TipoFicha == "UMA") idCar = "26";
+
+ ddlCaracter.SelectedValue = idCar;
+ }
+
+
}
@@ -1853,6 +1855,18 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
}
+ if (Request["Operacion"].ToString() == "AltaFFEE")
+ {
+
+ string idFicha = Request["idFicha"].ToString();
+ GuardarProtocoloFicha(oRegistro, idFicha);
+
+
+
+ }
+
+
+
}
//////////////////////////
@@ -1907,15 +1921,15 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
else
{
- if (Request["Operacion"].ToString() == "AltaTurno")
- Response.Redirect("../turnos/Turnolist.aspx?ultimoProtocolo=" + oRegistro.IdProtocolo.ToString(), false);
+ if (Request["Operacion"].ToString() == "AltaFFEE")
+ Response.Redirect("DefaultFFEE2.aspx?idServicio=" + Session["idServicio"].ToString() + "&idUrgencia=0", false);
else
{
- // if (Request["Operacion"].ToString() == "AltaPeticion")
- // Response.Redirect("../PeticionElectronica/PeticionList.aspx", false);
- // else
- // {
- if (Session["idServicio"].ToString() == "3") { Session["idUrgencia"] = "0"; }
+ if (Request["Operacion"].ToString() == "AltaPeticion")
+ Response.Redirect("../PeticionElectronica/PeticionList.aspx", false);
+ else
+ {
+ if (Session["idServicio"].ToString() == "3") { Session["idUrgencia"] = "0"; }
if (Session["idUrgencia"] != null)
{
switch (Session["idUrgencia"].ToString())
@@ -1934,7 +1948,7 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
else
Response.Redirect("Default2.aspx?idServicio=" + Session["idServicio"].ToString() + "&idUrgencia=0", false);
- // }
+ }
}
}
}
@@ -1949,43 +1963,142 @@ protected void btnGuardar_Click(object sender, EventArgs e)
}
+ private void GuardarProtocoloFicha(
+ Protocolo oRegistro,
+ string idFicha)
+ {
+ Business.Data.Laboratorio.Ficha oRegistroFFEE =
+ new Business.Data.Laboratorio.Ficha();
+
+ oRegistroFFEE =
+ (Business.Data.Laboratorio.Ficha)
+ oRegistroFFEE.Get(
+ typeof(Business.Data.Laboratorio.Ficha),
+ "IdFicha",
+ idFicha
+ );
+
+ SqlConnection conn =
+ (SqlConnection)
+ NHibernateHttpModule.CurrentSession.Connection;
+
+ if (conn.State != ConnectionState.Open)
+ conn.Open();
+
+ string query = @"
+ INSERT INTO LAB_ProtocoloFicha
+ (
+ idProtocolo,
+ idEfector,
+ idTipoFicha,
+ idFicha
+ )
+ VALUES
+ (
+ @idProtocolo,
+ @idEfector,
+ @idTipoFicha,
+ @idFicha
+ )";
+
+ SqlCommand cmd = new SqlCommand(query, conn);
+
+ cmd.Parameters.AddWithValue(
+ "@idProtocolo",
+ oRegistro.IdProtocolo);
+
+ cmd.Parameters.AddWithValue(
+ "@idEfector",
+ oUser.IdEfector.IdEfector);
+
+ cmd.Parameters.AddWithValue(
+ "@idTipoFicha",
+ oRegistroFFEE.TipoFicha);
+
+ cmd.Parameters.AddWithValue(
+ "@idFicha",
+ idFicha);
+
+ cmd.ExecuteNonQuery();
+ }
private void EnviarEquipo(Protocolo oRegistro)
{
- /*
- Caro: Primer version para enviar de forma automatica (sin intervencion del usuario) muestras el equipo.
- En este caso para el equipo REAL: Si el servicio es micro solo para los efectores 205 y 221 (HPN y HEller)
- Se debe mejorar para algo mas generico
- Se agrega try/cath para que ante cualquier problema no haya inconvenientes con el ingreso de la muestra
- */
-
try
{
if ((oRegistro.IdTipoServicio.IdTipoServicio == 3) &&
- (oRegistro.IdEfector.IdEfector == 205 || oRegistro.IdEfector.IdEfector == 221))
+ (oRegistro.IdEfector.IdEfector == 205 ||
+ oRegistro.IdEfector.IdEfector == 221))
{
- using (SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection)
+ SqlConnection conn =
+ (SqlConnection)
+ NHibernateHttpModule
+ .CurrentSession.Connection;
+
+ if (conn.State != ConnectionState.Open)
+ conn.Open();
+
+ using (SqlCommand cmd =
+ new SqlCommand(
+ "dbo.LAB_GeneraProtocoloEnvioAutomaticoREAL",
+ conn))
{
+ cmd.CommandType =
+ CommandType.StoredProcedure;
- using (SqlCommand cmd = new SqlCommand("dbo.LAB_GeneraProtocoloEnvioAutomaticoREAL", conn))
- {
- cmd.CommandType = CommandType.StoredProcedure;
+ cmd.Parameters.AddWithValue(
+ "@idEfector",
+ oRegistro.IdEfector.IdEfector);
- // Parámetros del SP
- cmd.Parameters.AddWithValue("@idEfector", oRegistro.IdEfector.IdEfector);
- cmd.Parameters.AddWithValue("@idProtocolo", oRegistro.IdProtocolo);
+ cmd.Parameters.AddWithValue(
+ "@idProtocolo",
+ oRegistro.IdProtocolo);
- // Ejecuta sin devolver resultados
- cmd.ExecuteNonQuery();
- }
+ cmd.ExecuteNonQuery();
}
}
}
catch (Exception ex)
{
- string exception = "";
- exception = ex.Message + "
";
+ string exception = ex.Message;
}
}
+ //private void EnviarEquipo(Protocolo oRegistro)
+ //{
+ // /*
+ // Caro: Primer version para enviar de forma automatica (sin intervencion del usuario) muestras el equipo.
+ // En este caso para el equipo REAL: Si el servicio es micro solo para los efectores 205 y 221 (HPN y HEller)
+ // Se debe mejorar para algo mas generico
+ // Se agrega try/cath para que ante cualquier problema no haya inconvenientes con el ingreso de la muestra
+ // */
+
+ // try
+ // {
+ // if ((oRegistro.IdTipoServicio.IdTipoServicio == 3) &&
+ // (oRegistro.IdEfector.IdEfector == 205 || oRegistro.IdEfector.IdEfector == 221))
+ // {
+ // using (SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection)
+ // {
+
+ // using (SqlCommand cmd = new SqlCommand("dbo.LAB_GeneraProtocoloEnvioAutomaticoREAL", conn))
+ // {
+ // cmd.CommandType = CommandType.StoredProcedure;
+
+ // // Parámetros del SP
+ // cmd.Parameters.AddWithValue("@idEfector", oRegistro.IdEfector.IdEfector);
+ // cmd.Parameters.AddWithValue("@idProtocolo", oRegistro.IdProtocolo);
+
+ // // Ejecuta sin devolver resultados
+ // cmd.ExecuteNonQuery();
+ // }
+ // }
+ // }
+ // }
+ // catch (Exception ex)
+ // {
+ // string exception = "";
+ // exception = ex.Message + "
";
+ // }
+ //}
private void ActualizarEstadoDerivacion(Protocolo oRegistro, Protocolo oRegistroAnterior)
{
@@ -2409,7 +2522,7 @@ private bool Guardar(Business.Data.Laboratorio.Protocolo oRegistro)
oRegistroFFEE = (Business.Data.Laboratorio.Ficha)oRegistroFFEE.Get(typeof(Business.Data.Laboratorio.Ficha), "IdFicha", idFicha);
if (oRegistroFFEE != null)
if (oRegistroFFEE.IdCasoSnvs!="")
- if (oUtil.EsNumerico(oRegistroFFEE.IdCasoSnvs))
+ if (oUtil.EsNumerico(oRegistroFFEE.IdCasoSnvs.Trim()))
oRegistro.IdCasoSISA =int.Parse(oRegistroFFEE.IdCasoSnvs);
}
@@ -3454,11 +3567,6 @@ protected void btnCancelar_Click(object sender, EventArgs e)
case "Derivacion": Response.Redirect("Derivacion.aspx?idServicio="+Session["idServicio"].ToString(), false); break;
}
-
- //if (Request["Control"] != null)
- // Response.Redirect("ProtocoloList.aspx?idServicio=" + Session["idServicio"].ToString() + "&Tipo=Control");
- //else
- // Response.Redirect("ProtocoloList.aspx?idServicio="+ Session["idServicio"].ToString()+"&Tipo=Lista");
}
}
else
@@ -3480,12 +3588,19 @@ protected void btnCancelar_Click(object sender, EventArgs e)
else
{
if (Request["Operacion"].ToString() == "AltaDerivacionMultiEfectorLote") //Se piso en un merge..
- Response.Redirect("DerivacionMultiEfectorLote.aspx?idServicio=" + Session["idServicio"].ToString() + "&idLote=" + Request["idLote"]);
-
- if (Session["idUrgencia"].ToString() != "0")
- Response.Redirect("Default2.aspx?idServicio=1&idUrgencia=" + Session["idUrgencia"].ToString(), false);
+ Response.Redirect("DerivacionMultiEfectorLote.aspx?idServicio=" + Session["idServicio"].ToString() + "&idLote=" + Request["idLote"]);
else
- Response.Redirect("Default2.aspx?idServicio=" + Session["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString(), false);
+ {
+ if (Request["Operacion"].ToString() == "AltaFFEE") //Se piso en un merge..
+ Response.Redirect("DefaultFFEE2.aspx?idServicio=" + Session["idServicio"].ToString() + "&idUrgencia=0", false);
+ else
+ {
+ if (Session["idUrgencia"].ToString() != "0")
+ Response.Redirect("Default2.aspx?idServicio=1&idUrgencia=" + Session["idUrgencia"].ToString(), false);
+ else
+ Response.Redirect("Default2.aspx?idServicio=" + Session["idServicio"].ToString() + "&idUrgencia=" + Session["idUrgencia"].ToString(), false);
+ }
+ }
}
}
}
@@ -3521,14 +3636,7 @@ private void AgregarRutina()
if (codigos == "")
codigos = oDetalle.IdItem.Codigo;
else
- codigos += ";" + oDetalle.IdItem.Codigo;
-
-
-
- //ddlRutina.SelectedValue = "0";
- //ddlRutina.UpdateAfterCallBack = true;
-
-
+ codigos += ";" + oDetalle.IdItem.Codigo;
}
txtCodigosRutina.Text = codigos;
txtCodigosRutina.UpdateAfterCallBack = true;
diff --git a/WebLab/Resultados/ResultadosaSisa2.aspx b/WebLab/Resultados/ResultadosaSisa2.aspx
index 1c4afdf7..cb7bcda5 100644
--- a/WebLab/Resultados/ResultadosaSisa2.aspx
+++ b/WebLab/Resultados/ResultadosaSisa2.aspx
@@ -73,16 +73,23 @@ Efector:
+ Tipo FFEE:
+
+
+
+
+
Evento SISA:
- Resultado:
-
- Debe seleccionar un evento
+ Debe seleccionar un evento
+
+ Resultado:
+
Pendientes de Enviar
@@ -139,6 +146,7 @@ Efector:
+
@@ -241,6 +249,93 @@ Efector:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebLab/Resultados/ResultadosaSisa2.aspx.cs b/WebLab/Resultados/ResultadosaSisa2.aspx.cs
index 7b2c0fcf..a2ca66ff 100644
--- a/WebLab/Resultados/ResultadosaSisa2.aspx.cs
+++ b/WebLab/Resultados/ResultadosaSisa2.aspx.cs
@@ -1,4 +1,4 @@
- using System;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
@@ -20,6 +20,7 @@
using System.Configuration;
using Business.Data;
using System.Web.UI.HtmlControls;
+using System.Text.RegularExpressions;
namespace WebLab.Resultados
{
@@ -76,34 +77,188 @@ private void VerificaPermisos(string sObjeto)
else Response.Redirect("../FinSesion.aspx", false);
}
+
+ private void RegistrarHistoricoSISA( DetalleProtocolo oDetalle, string estadoEnvio, string mensaje, string tipoInteroperabilidad)
+ {
+ /*CARO: este registro es para poder generar una estadistica de envios a sisa, sin acceder a las tablas madres ya que los querys se hacen muy poco perfomante.*/
+ try
+ {
+ if (oDetalle == null)
+ return;
+
+ SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+
+ string sql = @"
+ INSERT INTO LAB_HistoricoEnvioSISA
+ (
+ fechaEnvio,
+ idProtocolo,
+ idDetalleProtocolo,
+ numeroProtocolo,
+ idPaciente,
+ documento,
+ idEfector,
+ nombreEfector,
+ idEventoSISA,
+ nombreEvento,
+ idResultadoSISA,
+ resultado,
+ idCasoSISA,
+ idEventoMuestraSISA,
+ estadoEnvio,
+ mensaje,
+ usuarioEnvio,
+ fechaResultado
+ )
+ VALUES
+ (
+ GETDATE(),
+ @idProtocolo,
+ @idDetalleProtocolo,
+ @numeroProtocolo,
+ @idPaciente,
+ @documento,
+ @idEfector,
+ @nombreEfector,
+ @idEventoSISA,
+ @nombreEvento,
+ @idResultadoSISA,
+ @resultado,
+ @idCasoSISA,
+ @idEventoMuestraSISA,
+ @estadoEnvio,
+ @mensaje,
+ @usuarioEnvio,
+ @fechaResultado
+ )";
+
+ SqlCommand cmd = new SqlCommand(sql, conn);
+
+
+ cmd.Parameters.AddWithValue( "@idProtocolo", oDetalle.IdProtocolo.IdProtocolo);
+
+ cmd.Parameters.AddWithValue( "@idDetalleProtocolo", oDetalle.IdDetalleProtocolo);
+
+ cmd.Parameters.AddWithValue( "@numeroProtocolo", oDetalle.IdProtocolo.Numero);
+ cmd.Parameters.AddWithValue( "@idPaciente", oDetalle.IdProtocolo.IdPaciente.IdPaciente);
+ cmd.Parameters.AddWithValue( "@documento", oDetalle.IdProtocolo.IdPaciente.NumeroDocumento);
+ cmd.Parameters.AddWithValue( "@idEfector", oDetalle.IdProtocolo.IdEfector.IdEfector);
+ cmd.Parameters.AddWithValue( "@nombreEfector", oDetalle.IdProtocolo.IdEfector.Nombre);
+
+
+ // Evento SISA
+ int idEvento = 0;
+
+ if (HdidEventoSISA.Value != "") idEvento = int.Parse(HdidEventoSISA.Value);
+
+ cmd.Parameters.AddWithValue( "@idEventoSISA", idEvento);
+ cmd.Parameters.AddWithValue( "@nombreEvento", ddlItem.SelectedItem.Text);//ver si es ficha
+
+
+ // Resultado
+
+ int idResultado = 0;
+ if (HdidResultadoSISA.Value != "") idResultado = int.Parse(HdidResultadoSISA.Value);
+
+ cmd.Parameters.AddWithValue( "@idResultadoSISA", idResultado);
+ cmd.Parameters.AddWithValue( "@resultado", oDetalle.ResultadoCar);
+
+ // IDs SISA
+
+
+ cmd.Parameters.AddWithValue( "@idCasoSISA", oDetalle.IdProtocolo.IdCasoSISA);
+ cmd.Parameters.AddWithValue( "@idEventoMuestraSISA", oDetalle.IdeventomuestraSISA);
+
+
+ // Estado
+
+ cmd.Parameters.AddWithValue( "@estadoEnvio", estadoEnvio);
+
+
+ // Mensaje
+
+ if (mensaje == null)
+ mensaje = "";
+
+ if (mensaje.Length > 4000)
+ mensaje = mensaje.Substring(0, 4000);
+
+ cmd.Parameters.AddWithValue(
+ "@mensaje",
+ mensaje);
+
+
+ // Usuario
+ cmd.Parameters.AddWithValue( "@usuarioEnvio", oUser.IdUsuario);
+ // Fecha resultado
+ cmd.Parameters.AddWithValue( "@fechaResultado", oDetalle.FechaValida);
+ cmd.Parameters.AddWithValue( "@tipoInteroperabilidad", tipoInteroperabilidad);
+ cmd.ExecuteNonQuery();
+ }
+ catch (Exception ex)
+ {
+ grabarLogMensaje("Error RegistrarHistoricoSISA: " + ex.Message);
+ }
+ }
+
private void CargarGrilla()
{
- DataSet Ds = new DataSet();
- // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+ gvListaFicha.Visible = false;
+ gvLista.Visible = false;
+ DataSet Ds = new DataSet();
SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
SqlCommand cmd = new SqlCommand();
cmd.CommandType = CommandType.StoredProcedure;
+
- string str_condicion = " and C.idEfector=" + ddlEfector.SelectedValue;
- //Item oDet = new Item();
- //oDet = (Item)oDet.Get(typeof(Item), int.Parse(ddlItem.SelectedValue));
- //if (oDet != null)
- //{
+ string str_condicion = "";
+ if (ddlResultado.SelectedValue != "0")
+ str_condicion += " AND d.resultadocar= '" + ddlResultado.SelectedValue + "'";
+ if (ddlTipoFicha.SelectedValue != "0")
+ {
+ str_condicion += " and p.idEfector=" + ddlEfector.SelectedValue;
if (txtFechaDesde.Value != "")
{
- DateTime fecha1 = DateTime.Parse(txtFechaDesde.Value);
- // if (oDet.Informable)
- str_condicion += " AND d.fechaValida>= '" + fecha1.ToString("yyyyMMdd") + "'";
- /* else
- str_condicion += " AND c.fecha >= '" + fecha1.ToString("yyyyMMdd") + "'";
- */
+ DateTime fecha1 = DateTime.Parse(txtFechaDesde.Value);
+ str_condicion += " AND d.fechaValida>= '" + fecha1.ToString("yyyyMMdd") + "'";
}
- if (ddlResultado.SelectedValue != "0")
- str_condicion += " AND d.resultadocar= '" + ddlResultado.SelectedValue + "'";
+ cmd.CommandText = "[LAB_ResultadosASisaFicha]";
-
+ cmd.Parameters.Add("@FiltroBusqueda", SqlDbType.NVarChar);
+ cmd.Parameters["@FiltroBusqueda"].Value = str_condicion;
+
+ cmd.Parameters.Add("@idficha", SqlDbType.NVarChar);
+ cmd.Parameters["@idficha"].Value = ddlTipoFicha.SelectedValue;
+ cmd.Parameters.Add("@Estado", SqlDbType.Int);
+ cmd.Parameters["@Estado"].Value = rdbEstado.SelectedValue;
+
+ cmd.Parameters.Add("@agrupado", SqlDbType.Bit);
+ cmd.Parameters["@agrupado"].Value = 0;//a no grupado: lista de procotocolos
+
+
+ cmd.Connection = conn;
+
+
+ SqlDataAdapter da = new SqlDataAdapter(cmd);
+
+ da.Fill(Ds);
+
+ gvListaFicha.Visible = true;
+ gvListaFicha.DataSource = Ds.Tables[0];
+ gvListaFicha.DataBind();
+ }
+ else
+ {
+ str_condicion += " and C.idEfector=" + ddlEfector.SelectedValue;
+
+ if (txtFechaDesde.Value != "")
+ {
+ DateTime fecha1 = DateTime.Parse(txtFechaDesde.Value);
+ str_condicion += " AND d.fechaValida>= '" + fecha1.ToString("yyyyMMdd") + "'";
+ }
+
cmd.CommandText = "[LAB_ResultadosASisa]";
cmd.Parameters.Add("@FiltroBusqueda", SqlDbType.NVarChar);
@@ -115,11 +270,11 @@ private void CargarGrilla()
cmd.Parameters.Add("@Estado", SqlDbType.Int);
cmd.Parameters["@Estado"].Value = rdbEstado.SelectedValue;
- cmd.Parameters.Add("@agrupado", SqlDbType.Bit);
- cmd.Parameters["@agrupado"].Value = 0;//a no grupado: lista de procotocolos
+ cmd.Parameters.Add("@agrupado", SqlDbType.Bit);
+ cmd.Parameters["@agrupado"].Value = 0;//a no grupado: lista de procotocolos
- cmd.Connection = conn;
+ cmd.Connection = conn;
SqlDataAdapter da = new SqlDataAdapter(cmd);
@@ -127,9 +282,10 @@ private void CargarGrilla()
da.Fill(Ds);
-
+ gvLista.Visible = true;
gvLista.DataSource = Ds.Tables[0];
gvLista.DataBind();
+ }
lblCantidadRegistros.Text = Ds.Tables[0].Rows.Count.ToString() + " registros encontrados";
conn.Close();
//}
@@ -138,24 +294,34 @@ private void CargarGrilla()
protected void lnkMarcar_Click(object sender, EventArgs e)
{
- MarcarSeleccionados(true);
- //PintarReferencias();
+ MarcarSeleccionados(true);
}
protected void lnkDesmarcar_Click(object sender, EventArgs e)
{
- MarcarSeleccionados(false);
- //PintarReferencias();
+ MarcarSeleccionados(false);
}
private void MarcarSeleccionados(bool p)
{
- foreach (GridViewRow row in gvLista.Rows)
+ if (ddlTipoFicha.SelectedValue != "0")
{
- CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1")));
- if (a.Checked == !p)
- ((CheckBox)(row.Cells[0].FindControl("CheckBox1"))).Checked = p;
+ foreach (GridViewRow row in gvListaFicha.Rows)
+ {
+ CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox2")));
+ if (a.Checked == !p)
+ ((CheckBox)(row.Cells[0].FindControl("CheckBox2"))).Checked = p;
+ }
+ }
+ else
+ {
+ foreach (GridViewRow row in gvLista.Rows)
+ {
+ CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1")));
+ if (a.Checked == !p)
+ ((CheckBox)(row.Cells[0].FindControl("CheckBox1"))).Checked = p;
+ }
}
}
@@ -175,43 +341,133 @@ private void BorrarResultadosTemporales()
private void BorrarLineaTemporales(string idderivacion, string ideventomuestra)
{
SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
-
string query = @"DELETE FROM [dbo].[LAB_Temp_ResultadoSISA] where [idDerivacion]=" + idderivacion+" and [idEventoMuestra]=" + ideventomuestra;
- SqlCommand cmd = new SqlCommand(query, conn);
-
-
-
-
-
+ SqlCommand cmd = new SqlCommand(query, conn);
int idres = Convert.ToInt32(cmd.ExecuteScalar());
}
private void BorrarLineaTemporalesdesdeAPI(string ideventocaso)
{
SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
-
string query = @"DELETE FROM [dbo].[LAB_Temp_ResultadoSISA] where [idEvento]=" + ideventocaso;
SqlCommand cmd = new SqlCommand(query, conn);
+ int idres = Convert.ToInt32(cmd.ExecuteScalar());
+ }
+ protected void btnGuardar_Click(object sender, EventArgs e)
+ {
+ if (ddlTipoFicha.SelectedValue == "")
+ SubirSISAdesdeAPI();
+ else
+ SubirSISAdesdeAPI_Ficha();
+ }
+ private bool ProcesaSISAFicha(DetalleProtocolo oDetalle)
+ {
+ bool generacaso = false;
+ try
+ {
+ /* Caro: Se busca el idcasosisa invocando la api de andes que devuelve datos por ficha*/
+ if (oDetalle.IdProtocolo.IdCasoSISA == 0)
+ BuscarCasoSISA_Ficha(oDetalle.IdProtocolo);
+
+ if ((oDetalle.IdProtocolo.IdCasoSISA > 0) && (oDetalle.IdeventomuestraSISA == 0))
+ {
+ bool existe = ExisteTipoMuestraFicha (oDetalle, HdIdMuestra.Value, HdIdTipoMuestra.Value);
+ if (!existe)
+ GenerarMuestraSISA(oDetalle.IdProtocolo, oDetalle.IdProtocolo.IdCasoSISA);
+ if (oDetalle.IdeventomuestraSISA > 0)
+ GenerarResultadoSISA(oDetalle);
+ }
+ BorrarDescartado(oDetalle);
- int idres = Convert.ToInt32(cmd.ExecuteScalar());
+ }
+ catch (Exception e)
+ {
+ generacaso = false;
+ }
+ return generacaso;
}
+ private void BuscarCasoSISA_Ficha(Protocolo oRegistro)
+ {
+ try
+ {
+ System.Net.ServicePointManager.SecurityProtocol =
+ System.Net.SecurityProtocolType.Tls12;
+ string URL = ConfigurationManager.AppSettings["urlffeeandes"].ToString();
+ URL = URL + "&desde=2000-01-01T23:18:08.382Z&hasta=2050-01-01T23:18:11.407Z&totalOrganizaciones=true";
+ if (ddlTipoFicha.SelectedValue != "0")
+ URL = URL + "&tipoForm=" + ddlTipoFicha.SelectedValue;
+ //if (txtDni.Value != "")
+ /// URL = URL + "&documento=" + oRegistro.IdPaciente.NumeroDocumento.ToString();///busca por dni en algun momento deberá buscar por id de ficha.
+
+ URL = URL + "&idFicha=" + HidFicha.Value.Trim();//forma univoca de traer un solo registro
+
+ string s_token = ConfigurationManager.AppSettings["tokenffeeandes"].ToString();
-
+ JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
+ HttpWebRequest request;
+ request = WebRequest.Create(URL) as HttpWebRequest;
+ request.Timeout = 10 * 1000;
+ request.Method = "GET";
- protected void btnGuardar_Click(object sender, EventArgs e)
- {
-
- SubirSISAdesdeAPI();
+ request.ContentType = "application/json";
+ request.Headers.Add("Authorization", s_token);
+
+
+ HttpWebResponse response = request.GetResponse() as HttpWebResponse;
+ StreamReader reader = new StreamReader(response.GetResponseStream());
+ string body = reader.ReadToEnd();
+ if (!string.IsNullOrEmpty(body))
+ {
+ body = body.Trim();
+
+ Protocolos.DefaultFFEE2.FFEE respuesta_d = null;
+
+ // devuelve array
+ if (body.StartsWith("["))
+ {
+ List lista =
+ jsonSerializer.Deserialize
+ >(body);
+
+ // actualizar solo si hay un único objeto
+ if (lista != null && lista.Count == 1)
+ {
+ respuesta_d = lista[0];
+ }
+ }
+ else
+ {
+ // devuelve objeto único
+ respuesta_d =
+ jsonSerializer.Deserialize
+ (body);
+ }
+
+ if (respuesta_d != null &&
+ !string.IsNullOrEmpty(respuesta_d.idCasoSnvs))
+ {
+ oRegistro.IdCasoSISA =
+ int.Parse(respuesta_d.idCasoSnvs.Trim());
+
+ oRegistro.Save();
+ }
+ }
+ }
+ catch (WebException ex)
+ {
+ estatus.Text = "Error al conectarse a Andes para recuperar evento SNVS: " + ex.Message.ToString();
+ estatus.Visible = true;
+ }
}
private bool ProcesaSISA(DetalleProtocolo oDetalle )
@@ -271,6 +527,8 @@ private void BorrarDescartado(DetalleProtocolo oDetalleProtocolo)
}
}
+
+
private void CargarListas()
{
Utility oUtil = new Utility(); string m_ssql = ""; string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
@@ -290,7 +548,10 @@ private void CargarListas()
oUtil.CargarCombo(ddlEfector, m_ssql, "idEfector", "nombre", connReady);
}
-
+ ///carga de tipo de ficha
+ m_ssql = "SELECT nombre as nombre, codigo FROM LAB_TipoFicha with (nolock) WHERE (baja = 0) order by nombre";
+ oUtil.CargarCombo(ddlTipoFicha, m_ssql, "codigo", "nombre", connReady);
+ ddlTipoFicha.Items.Insert(0, new ListItem("Seleccione", "0"));
///Carga de grupos de numeración solo si el tipo de numeración es 2: por Grupos
// m_ssql = @"SELECT distinct i.idItem, i.nombre FROM LAB_item i (nolock)
@@ -309,285 +570,29 @@ FROM LAB_ConfiguracionSISA c with (nolock)
m_ssql = null;
oUtil = null;
}
- private bool GenerarCasoSISA(DetalleProtocolo oDetalle, string res)
- {
- /*Version 1*/
- System.Net.ServicePointManager.SecurityProtocol =
- System.Net.SecurityProtocolType.Tls12;
-
- bool generacaso = false;
- string caracter = "";
- string idevento = "";
- string nombreevento = "";
- string idclasificacionmanual = "";
- string nombreclasificacionmanual = "";
- string idgrupoevento = "";
- string nombregrupoevento = "";
- bool seguir = false;
- string m_strSQL = "";
-
- try
- {
- // query levanta todos los que se generan segun el caracter
- m_strSQL = " select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=" + oDetalle.IdProtocolo.IdCaracter.ToString() + " and idItem= " + oDetalle.IdSubItem.IdItem.ToString();
- // si es contacto se sube==>si es negativo como contacto y si es positivo como sospechoso.
- if ((res == "SE DETECTA") && (oDetalle.IdProtocolo.IdCaracter == 4) && (oC.CodigoCovid == oDetalle.IdSubItem.Codigo))
- {
- m_strSQL = " select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=1 and idItem= " + oDetalle.IdSubItem.IdItem.ToString();
- }
-
-
-
-
-
- DataSet Ds = new DataSet();
- //SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
- SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
- SqlDataAdapter adapter = new SqlDataAdapter();
- adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
- adapter.Fill(Ds);
-
- DataTable dt = Ds.Tables[0];
-
- for (int i = 0; i < dt.Rows.Count; i++)
- {
- caracter = dt.Rows[i][1].ToString();
- idevento = dt.Rows[i][2].ToString();
- HdidEventoSISA.Value = idevento;
- nombreevento = dt.Rows[i][3].ToString();
- idclasificacionmanual = dt.Rows[i][4].ToString();
- nombreclasificacionmanual = dt.Rows[i][5].ToString();
- idgrupoevento = dt.Rows[i][6].ToString();
- nombregrupoevento = dt.Rows[i][7].ToString();
- seguir = true;
- break;
- }
-
- if (seguir)
- {
-
- string URL = oC.UrlServicioSISA;
- string s_idestablecimiento = oC.CodigoEstablecimientoSISA; // "14580562167000"
- string usersisa = ConfigurationManager.AppSettings["usuarioSisa"].ToString();
- string[] a = usersisa.Split(':');
- string s_user = a[0].ToString();
- string s_userpass = a[1].ToString();
-
- string s_sexo = "";
- switch (oDetalle.IdProtocolo.IdPaciente.IdSexo)
- {
- case 1: s_sexo = "I"; break;
- case 2: s_sexo = "F"; break;
- case 3: s_sexo = "M"; break;
- }
- string fn = oDetalle.IdProtocolo.IdPaciente.FechaNacimiento.ToShortDateString().Replace("/", "-");
- string fnpapel = oDetalle.IdProtocolo.FechaOrden.ToShortDateString().Replace("/", "-");
- string numerodocumento = oDetalle.IdProtocolo.IdPaciente.NumeroDocumento.ToString();
- string error = "";
- //bool hayerror = false;
-
- evento newevento = new evento
- {
- idTipodoc = "1",
- nrodoc = numerodocumento,
- sexo = s_sexo,
- fechaNacimiento = fn, //"05-06-1989",
- idGrupoEvento = idgrupoevento,
- idEvento = idevento, // "77",
- idEstablecimientoCarga = s_idestablecimiento, //prod: "51580352167442",
- fechaPapel = fnpapel, // "10-12-2019",
- idClasificacionManualCaso = idclasificacionmanual, // "22"
- };
-
- AltaCaso caso = new AltaCaso
- {
- usuario = s_user,
- clave = s_userpass,
- altaEventoCasoNominal = newevento
- };
-
- JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
-
- string DATA = jsonSerializer.Serialize(caso);
-
-
-
- System.Net.Http.HttpClient client = new System.Net.Http.HttpClient();
- client.BaseAddress = new System.Uri(URL);
-
- System.Net.Http.HttpContent content = new StringContent(DATA, UTF8Encoding.UTF8, "application/json");
- HttpResponseMessage messge = client.PostAsync(URL, content).Result;
- string description = string.Empty;
- if (messge.IsSuccessStatusCode)
- {
- string result = messge.Content.ReadAsStringAsync().Result;
- description = result;
- RespuestaCaso respuesta_d = jsonSerializer.Deserialize(description);
-
- if (respuesta_d.id_caso != "")
- { // devolver el idcaso para guardar en la base de datos
- string s_idcaso = respuesta_d.id_caso;
- ///grabar a protocolo idCaso
- //Protocolo protocolo = new Protocolo();
- //protocolo = (Protocolo)protocolo.Get(typeof(Protocolo), int.Parse(Request["idP"].ToString()));
-
- oDetalle.IdProtocolo.IdCasoSISA = int.Parse(s_idcaso);
- oDetalle.IdProtocolo.Save();
- if (respuesta_d.resultado == "OK")
- oDetalle.IdProtocolo.GrabarAuditoriaProtocolo("Genera Caso SISA " + s_idcaso, int.Parse(Session["idUsuario"].ToString()));
- else // ERROR_DATOS
- oDetalle.IdProtocolo.GrabarAuditoriaProtocolo("Actualiza Caso SISA " + s_idcaso, int.Parse(Session["idUsuario"].ToString()));
-
-
- }
- else
- {
- generacaso = false;
- //hayerror = true;
- error = respuesta_d.resultado;
-
- }
- }
-
- }
-
- }
- //catch
- //{
- // generacaso = false;
- // //lblError.Text = "Hubo algun problema al conectar al servicio SISA: " + e.InnerException.InnerException.Message.ToString() + ". Intente de nuevo o haga clic en Salir";
- // //lblError.Visible = true;
- // //btnSalir.Visible = true;
- //}
- catch (WebException ex)
- {
- string mensaje = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd();
- generacaso = false;
- }
- return generacaso;
-
- }
-
+
private void GenerarCasoSISA_V2(DetalleProtocolo oDetalle)
{
/*Version 2*/
/*Cambio para que vuelva a buscar los datos en la base y tome los datos desde la grilla*/
- System.Net.ServicePointManager.SecurityProtocol =
- System.Net.SecurityProtocolType.Tls12;
-
- // bool generacaso = false;
- //string caracter = "";
- //string idevento = "";
- //string nombreevento = "";
- //string idclasificacionmanual = "";
- //string nombreclasificacionmanual = "";
- //string idgrupoevento = "";
- //string nombregrupoevento = "";
- bool seguir = false;
- //string m_strSQL = "";
+ System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
+ bool seguir = false;
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
try
- {
- // // query levanta todos los que se generan segun el caracter
- // m_strSQL = @" select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=" + oDetalle.IdProtocolo.IdCaracter.ToString() + " and idItem= " + oDetalle.IdSubItem.IdItem.ToString() + " and idEvento=" + ddlItem.SelectedValue;
- // // si es contacto se sube==>si es negativo como contacto y si es positivo como sospechoso.
- // if ((res == "SE DETECTA") && (oDetalle.IdProtocolo.IdCaracter == 4) && (oC.CodigoCovid == oDetalle.IdSubItem.Codigo))
- // {
- // m_strSQL = " select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=1 and idItem= " + oDetalle.IdSubItem.IdItem.ToString()+ " and idEvento=" + ddlItem.SelectedValue;
- // }
-
-
- // m_strSQL += @" and fechavigenciadesde<=convert(date,convert(varchar,getdate(),112))
- //and ( fechavigenciahasta >convert(date,convert(varchar,getdate(),112)) or convert(varchar, fechavigenciahasta, 103) = '01/01/1900')
- // and (idorigen=0 or idOrigen=" +oDetalle.IdProtocolo.IdOrigen.IdOrigen.ToString() +")";
-
- // //Control de efector solicitante
- // //Monitoreo de SARS COV - 2 y OVR en ambulatorios ==> solo aplica para Hospital Heller
- // //Demas eventos para todos los efectores solicitantes.
- // m_strSQL += @" and (idefectorsolicitante=0 or
- // idefectorsolicitante in (" + oDetalle.IdProtocolo.IdEfectorSolicitante.IdEfector.ToString() + "))";
-
- // //control de embarzada=s /N
- // m_strSQL += @" and soloEmbarazada='" + oDetalle.IdProtocolo.Embarazada.ToString()+"'";
- // ///control de edades
- // m_strSQL += @" and ("+oDetalle.IdProtocolo.Edad+" between edadDesde and edadHasta and "+oDetalle.IdProtocolo.UnidadEdad +" = 0) ";
-
-
- // DataSet Ds = new DataSet();
- // // SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
- // SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
- // SqlDataAdapter adapter = new SqlDataAdapter();
- // adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
- // adapter.Fill(Ds);
-
- // DataTable dt = Ds.Tables[0];
-
- // for (int i = 0; i < dt.Rows.Count; i++)
- // {
- // caracter = dt.Rows[i][1].ToString();
- // idevento = dt.Rows[i][2].ToString();
- // HdidEventoSISA.Value = idevento;
- // nombreevento = dt.Rows[i][3].ToString();
- // idclasificacionmanual = dt.Rows[i][4].ToString();
- // nombreclasificacionmanual = dt.Rows[i][5].ToString();
- // idgrupoevento = dt.Rows[i][6].ToString();
- // nombregrupoevento = dt.Rows[i][7].ToString();
- // seguir = true;
- // break;
- // }
-
-
-
- //caracter = dt.Rows[i][1].ToString();
- // idevento = dt.Rows[i][2].ToString();
- // HdidEventoSISA.Value = idevento;
- // nombreevento = dt.Rows[i][3].ToString();
- // idclasificacionmanual = dt.Rows[i][4].ToString();
- // nombreclasificacionmanual = dt.Rows[i][5].ToString();
- // idgrupoevento = dt.Rows[i][6].ToString();
- // nombregrupoevento = dt.Rows[i][7].ToString();
-
- // string idmuestra = gvLista.Rows[row.RowIndex].Cells[8].Text;
- // string idtipomuestra = gvLista.Rows[row.RowIndex].Cells[9].Text;
- // HdIdMuestra.Value = idmuestra;
- // HdIdTipoMuestra.Value = idtipomuestra;
-
- // HdIdPrueba.Value = gvLista.Rows[row.RowIndex].Cells[10].Text;
- // HdIdTipoPrueba.Value = gvLista.Rows[row.RowIndex].Cells[11].Text;
-
- // HdidResultadoSISA.Value = gvLista.Rows[row.RowIndex].Cells[12].Text;
- // HidItemSIL.Value = gvLista.Rows[row.RowIndex].Cells[15].Text;
-
-
- // /*nuevos campos recuperados desde la grilla*/
- // HidCaracter.Value = gvLista.Rows[row.RowIndex].Cells[16].Text;
- // //idevento = dt.Rows[i][2].ToString();
- // HdidEventoSISA.Value = gvLista.Rows[row.RowIndex].Cells[13].Text;
-
-
- seguir = true;
- //break;
+ {
+ seguir = true;
if (seguir)
{
string conexionServicio = oC.UrlServicioSISA;
string[] arr = conexionServicio.Split((";").ToCharArray());
-
if (arr.Length >= 1)
{
string URL = arr[0].ToString();
string s_user = arr[1].ToString();
- string s_userpass = arr[2].ToString();
-
-
-
-
- //string URL = oC.UrlServicioSISA;// "https://ws400-qa.sisa.msal.gov.ar/snvsCasoNominal/v2/snvsCasoNominal"; //oC.UrlServicioSISA;
- string s_idestablecimiento = oC.CodigoEstablecimientoSISA; // "14580562167000"
- //string s_user ="e56f25eb"; // "PruebasWSQA_SNVS_ID"; //
- //string s_userpass = "64a16ba3bedbae19e9010e3184fa9926"; //"PruebasWSQA_SNVS_KEY"; //
-
+ string s_userpass = arr[2].ToString();
+ string s_idestablecimiento = oC.CodigoEstablecimientoSISA;
string s_sexo = "";
switch (oDetalle.IdProtocolo.IdPaciente.IdSexo)
{
@@ -712,17 +717,12 @@ private void GenerarCasoSISA_V2(DetalleProtocolo oDetalle)
if (body != "")
{
- //string result = messge.Content.ReadAsStringAsync().Result;
- //description = result;
RespuestaCaso respuesta_d = jsonSerializer.Deserialize(body);
if (respuesta_d.id_caso != "")
{ // devolver el idcaso para guardar en la base de datos
string s_idcaso = respuesta_d.id_caso;
- ///grabar a protocolo idCaso
- //Protocolo protocolo = new Protocolo();
- //protocolo = (Protocolo)protocolo.Get(typeof(Protocolo), int.Parse(Request["idP"].ToString()));
-
+
oDetalle.IdProtocolo.IdCasoSISA = int.Parse(s_idcaso);
oDetalle.IdProtocolo.Save();
if (respuesta_d.resultado == "OK")
@@ -732,8 +732,7 @@ private void GenerarCasoSISA_V2(DetalleProtocolo oDetalle)
}
else
{
- // generacaso = false;
- //hayerror = true;
+
error = respuesta_d.resultado;
}
}
@@ -751,10 +750,7 @@ private void GenerarCasoSISA_V2(DetalleProtocolo oDetalle)
if (respuesta_error.id_caso != "")
{ // devolver el idcaso para guardar en la base de datos
string s_idcaso = respuesta_error.id_caso;
- ///grabar a protocolo idCaso
- //Protocolo protocolo = new Protocolo();
- //protocolo = (Protocolo)protocolo.Get(typeof(Protocolo), int.Parse(Request["idP"].ToString()));
-
+
oDetalle.IdProtocolo.IdCasoSISA = int.Parse(s_idcaso);
oDetalle.IdProtocolo.Save();
if (respuesta_error.resultado == "OK")
@@ -799,9 +795,7 @@ private void GenerarMuestraSISA(Protocolo protocolo, int idCasoSISA)
string ftoma = protocolo.FechaTomaMuestra.ToString("yyyy-MM-dd");//.ToShortDateString("yyyy/MM/dd").Replace("/", "-");
- //if (protocolo.FechaTomaMuestra< protocolo.FechaOrden)
- // ftoma = protocolo.FechaOrden.ToString("yyyy-MM-dd");//.ToShortDateString("yyyy/MM/dd").Replace("/", "-");
-
+
string idestablecimientotoma = protocolo.IdEfectorSolicitante.CodigoSISA;
if ((idestablecimientotoma == "") || (idestablecimientotoma == "0"))
//pongo por defecto laboratorio central
@@ -866,7 +860,8 @@ private void GenerarMuestraSISA(Protocolo protocolo, int idCasoSISA)
oDetalle.IdeventomuestraSISA = respuesta_d.id;
oDetalle.Save();
oDetalle.GrabarAuditoriaDetalleProtocolo("Genera Muestra SISA " + respuesta_d.id.ToString(), oUser.IdUsuario);
- } //for each
+
+ } //for each
} //respuesta_o
}// body
}
@@ -880,6 +875,60 @@ private void GenerarMuestraSISA(Protocolo protocolo, int idCasoSISA)
}
}
+
+
+ private bool ExisteTipoMuestraFicha(DetalleProtocolo oDetalle,string idmuestra,string idtipomuestra)
+ {
+ /// Verifica si para la misma muestra SISA ya existe creada
+ /// y replica el ideventomuestraSISA en el detalle actual
+
+ if (oDetalle == null || oDetalle.IdProtocolo == null || oDetalle.IdProtocolo.IdCasoSISA <= 0)
+ return false;
+
+ bool existe = false;
+
+ string sql = @" SELECT TOP 1 dp.ideventomuestraSISA
+ FROM Lab_detalleprotocolo dp WITH (NOLOCK)
+ INNER JOIN LAB_Protocolo p WITH (NOLOCK)
+ ON p.idProtocolo = dp.idProtocolo
+ INNER JOIN lab_configuracionsisaFicha cf WITH (NOLOCK)
+ ON cf.iditem = dp.idsubitem
+ WHERE p.idcasosisa = @idcasosisa
+ AND dp.ideventomuestraSISA > 0
+ AND cf.idFicha = @idficha
+ AND cf.idmuestra = @idmuestra
+ AND cf.idTipoMuestra = @idtipomuestra
+ ORDER BY dp.ideventomuestraSISA DESC";
+
+ SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
+
+ using (SqlCommand cmd = new SqlCommand(sql, conn))
+ {
+ cmd.Parameters.AddWithValue("@idcasosisa",oDetalle.IdProtocolo.IdCasoSISA);
+ cmd.Parameters.AddWithValue("@idficha",ddlTipoFicha.SelectedValue);
+ cmd.Parameters.AddWithValue("@idmuestra",int.Parse(idmuestra));
+ cmd.Parameters.AddWithValue("@idtipomuestra",int.Parse(idtipomuestra));
+
+ object result = cmd.ExecuteScalar();
+
+ if (result != null && result != DBNull.Value && oDetalle.IdeventomuestraSISA == 0)
+ {
+ int ideventomuestraSISA = Convert.ToInt32(result);
+
+ if (ideventomuestraSISA > 0)
+ {
+ existe = true;
+ oDetalle.IdeventomuestraSISA = ideventomuestraSISA;
+ oDetalle.Save();
+
+ oDetalle.GrabarAuditoriaDetalleProtocolo( "Replica Muestra SISA " + ideventomuestraSISA, oUser.IdUsuario);
+ }
+ }
+ }
+
+ return existe;
+ }
+
private bool ExisteTipoMuestra(DetalleProtocolo oDetalle, string idmuestra, string idtipomuestra)
{
///Verifica si para la misma muestra sisa ya existe creada se replica el ideventomuestraSISA en todos los detalles del mismo protocolo
@@ -937,74 +986,18 @@ private void GenerarResultadoSISA(DetalleProtocolo oDetalle )
string URL = arr[0].ToString();
string s_user = arr[1].ToString();
string s_userpass = arr[2].ToString();
-
-
try
- {
-
-
-// // query levanta todos los que se generan segun el caracter
-// string m_strSQL = " select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=" + oDetalle.IdProtocolo.IdCaracter.ToString() + " and idItem= " + oDetalle.IdSubItem.IdItem.ToString();
-
-
-// // si es contacto se sube==>si es negativo como contacto y si es positivo como sospechoso.
-// if ((resul == "SE DETECTA") && (oDetalle.IdProtocolo.IdCaracter == 4) && (oC.CodigoCovid == oDetalle.IdSubItem.Codigo))
-// {
-// m_strSQL = " select * from LAB_ConfiguracionSISA with (nolock) where idCaracter=1 and idItem= " + oDetalle.IdSubItem.IdItem.ToString();
-// }
-// m_strSQL += @" and fechavigenciadesde<=convert(date,convert(varchar,getdate(),112))
-//and ( fechavigenciahasta >convert(date,convert(varchar,getdate(),112)) or convert(varchar, fechavigenciahasta, 103) = '01/01/1900')
-// and (idorigen=0 or idOrigen=" + oDetalle.IdProtocolo.IdOrigen.IdOrigen.ToString() + ")";
-
-// //Control de efector solicitante
-// //Monitoreo de SARS COV - 2 y OVR en ambulatorios ==> solo aplica para Hospital Heller
-// //Demas eventos para todos los efectores solicitantes.
-// m_strSQL += @" and (idefectorsolicitante=0 or idefectorsolicitante in (" + oDetalle.IdProtocolo.IdEfectorSolicitante.IdEfector.ToString() + "))";
-// //control de embarzada=s /N
-// m_strSQL += @" and soloEmbarazada='" + oDetalle.IdProtocolo.Embarazada.ToString() + "'";
-// ///control de edades
-// m_strSQL += @" and (" + oDetalle.IdProtocolo.Edad + " between edadDesde and edadHasta and " + oDetalle.IdProtocolo.UnidadEdad + " = 0) ";
-
-
- string idestablecimientodiagnostico = oDetalle.IdProtocolo.IdEfector.CodigoSISA;///.IdEfectorSolicitante.CodigoSISA;
- //if ((idestablecimientodiagnostico == "") || (idestablecimientodiagnostico == "0"))
- //idestablecimientodiagnostico = oDetalle.IdProtocolo.IdEfector.CodigoSISA;
- ////idestablecimientodiagnostico = "107093";
-
-
- //DataSet Ds = new DataSet();
- //// SqlConnection conn = (SqlConnection)NHibernateHttpModule.CurrentSession.Connection;
- //SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString); ///Performance: conexion de solo lectura
- //SqlDataAdapter adapter = new SqlDataAdapter();
- //adapter.SelectCommand = new SqlCommand(m_strSQL, conn);
- //adapter.Fill(Ds);
-
- //DataTable dt = Ds.Tables[0];
-
- //for (int i = 0; i < dt.Rows.Count; i++)
- //{
-
-
- // HdidEventoSISA.Value = dt.Rows[i][2].ToString();
-
- // break;
- //}
-
+ {
+ string idestablecimientodiagnostico = oDetalle.IdProtocolo.IdEfector.CodigoSISA;///.IdEfectorSolicitante.CodigoSISA;
int id_resultado_a_informar = int.Parse(HdidResultadoSISA.Value);
int idevento = int.Parse(HdidEventoSISA.Value);
int id_Prueba = int.Parse(HdIdPrueba.Value);
int id_TipoPrueba = int.Parse(HdIdTipoPrueba.Value);
-
-
-
string res = oDetalle.ResultadoCar;
-
-
if (id_resultado_a_informar != 0)
{
-
string femision = oDetalle.FechaValida.ToString("yyyy-MM-dd");//.ToShortDateString("yyyy/MM/dd").Replace("/", "-");
if (femision == "1900-01-01")
femision = DateTime.Now.ToString("yyyy-MM-dd");
@@ -1027,14 +1020,8 @@ private void GenerarResultadoSISA(DetalleProtocolo oDetalle )
valor = ""
};
-
-
-
JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
-
string DATA = jsonSerializer.Serialize(newresultado);
-
-
byte[] data = UTF8Encoding.UTF8.GetBytes(DATA);
HttpWebRequest request;
@@ -1045,9 +1032,7 @@ private void GenerarResultadoSISA(DetalleProtocolo oDetalle )
request.ContentType = "application/json";
request.Headers.Add("app_key", s_userpass);/// "8482d41353ecd747c271f2ec869345e4");
request.Headers.Add("app_id", s_user);// "0e4fcbbf");
-
-
-
+
Stream postStream = request.GetRequestStream();
postStream.Write(data, 0, data.Length);
@@ -1055,11 +1040,12 @@ private void GenerarResultadoSISA(DetalleProtocolo oDetalle )
StreamReader reader = new StreamReader(response.GetResponseStream());
string body = reader.ReadToEnd();
if (body != "")
- {
- /* if (oDetalle.IdUsuarioValida>0)
- oDetalle.GrabarAuditoriaDetalleProtocolo("Genera Resultado en SISA", oUser.IdUsuario);
- else*/
+ {
oDetalle.GrabarAuditoriaDetalleProtocolo("Genera Resultado en SISA", oUser.IdUsuario);
+ if (gvLista.Visible)
+ RegistrarHistoricoSISA(oDetalle, "ENVIADO", body, "EVENTO");
+ else
+ RegistrarHistoricoSISA(oDetalle, "ENVIADO", body, "FICHA");
}
}
@@ -1070,14 +1056,53 @@ private void GenerarResultadoSISA(DetalleProtocolo oDetalle )
{
string mensaje = new StreamReader(ex.Response.GetResponseStream()).ReadToEnd();
- grabarLogMensaje(mensaje + " ideventomuestra:" + oDetalle.IdeventomuestraSISA.ToString());
-
+ grabarLogMensaje("Genera Resultado SISA:" + mensaje + " ideventomuestra:" + oDetalle.IdeventomuestraSISA.ToString());
+
}
}
}
+ private void SubirSISAdesdeAPI_Ficha()
+ {
+ int i = 0;
+ foreach (GridViewRow row in gvListaFicha.Rows)
+ {
+
+ string idmuestra = gvListaFicha.Rows[row.RowIndex].Cells[8].Text;
+ string idtipomuestra = gvListaFicha.Rows[row.RowIndex].Cells[9].Text;
+ HdIdMuestra.Value = idmuestra;
+ HdIdTipoMuestra.Value = idtipomuestra;
+
+ HdIdPrueba.Value = gvListaFicha.Rows[row.RowIndex].Cells[10].Text;
+ HdIdTipoPrueba.Value = gvListaFicha.Rows[row.RowIndex].Cells[11].Text;
+
+ HdidResultadoSISA.Value = gvListaFicha.Rows[row.RowIndex].Cells[12].Text;
+ HidItemSIL.Value = gvListaFicha.Rows[row.RowIndex].Cells[13].Text;
+ HidFicha.Value = gvListaFicha.Rows[row.RowIndex].Cells[15].Text;
+
+ CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox2")));
+ if (a.Checked == true)
+ {
+
+ DetalleProtocolo oDetalleProtocolo = new DetalleProtocolo();
+ oDetalleProtocolo = (DetalleProtocolo)oDetalleProtocolo.Get(typeof(DetalleProtocolo), int.Parse(gvListaFicha.DataKeys[row.RowIndex].Value.ToString()));
+ if (oDetalleProtocolo != null)
+ {
+ if (ProcesaSISAFicha(oDetalleProtocolo))
+ {
+ i = i + 1;
+ }
+ }
+ }//checked
+ }// grid
+
+ rdbEstado.SelectedValue = "1";
+ CargarGrilla();
+
+
+ }
private void SubirSISAdesdeAPI()
{
int i = 0;
@@ -1104,14 +1129,7 @@ private void SubirSISAdesdeAPI()
//idevento = dt.Rows[i][2].ToString();
HdidEventoSISA.Value = gvLista.Rows[row.RowIndex].Cells[13].Text;
HidGrupoEvento.Value = gvLista.Rows[row.RowIndex].Cells[17].Text;
- HidClasificacionManual.Value = gvLista.Rows[row.RowIndex].Cells[18].Text;
- //nombreevento = dt.Rows[i][3].ToString();
- //idclasificacionmanual = dt.Rows[i][4].ToString();
- //nombreclasificacionmanual = dt.Rows[i][5].ToString();
- //idgrupoevento = dt.Rows[i][6].ToString();
- //nombregrupoevento = dt.Rows[i][7].ToString();
-
-
+ HidClasificacionManual.Value = gvLista.Rows[row.RowIndex].Cells[18].Text;
string idcasosisa= gvLista.Rows[row.RowIndex].Cells[14].Text;
CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1")));
if (a.Checked == true)
@@ -1121,220 +1139,24 @@ private void SubirSISAdesdeAPI()
oDetalleProtocolo = (DetalleProtocolo)oDetalleProtocolo.Get(typeof(DetalleProtocolo), int.Parse(gvLista.DataKeys[row.RowIndex].Value.ToString()));
if (oDetalleProtocolo != null)
- {
- //string res = oDetalleProtocolo.ResultadoCar;
-
-
-
- //if (oDetalleProtocolo.IdSubItem.Codigo == oC.CodigoCovid)
- //{
- // if (res.Length > 10)
- // {
- // if (res.Substring(0, 10) == "SE DETECTA")
- // { if (ProcesaSISA(oDetalleProtocolo, "SE DETECTA", idcasosisa)) i = i + 1; }
-
- // if (res.Substring(0, 13) == "NO SE DETECTA")
- // { if (ProcesaSISA(oDetalleProtocolo, "NO SE DETECTA", idcasosisa)) i = i + 1; }
-
-
- // }
- //}
- //else
-
- //{
+ {
if (ProcesaSISA(oDetalleProtocolo))
{
i = i + 1;
-
- }
-
- //}
-
- // BorrarLineaTemporalesdesdeAPI(ideventomuestra);
+ }
}
-
-
}//checked
}// grid
rdbEstado.SelectedValue = "1";
CargarGrilla();
- // estatus.Text = "se han informado " + i.ToString() + " resultados";
- // btnDescargarExcelControl.Visible = true;
- //GenerarResultadoSISA( );
+
}
- //private void SubirSISA()
- //{
- // int i = 0;
- // foreach (GridViewRow row in gvLista.Rows)
- // {
-
- // // string res = gvLista.Rows[row.RowIndex].Cells[6].Text;
- // string idderivacion = gvLista.Rows[row.RowIndex].Cells[4].Text;
- // string ideventomuestra = gvLista.Rows[row.RowIndex].Cells[5].Text;
- // CheckBox a = ((CheckBox)(row.Cells[0].FindControl("CheckBox1")));
- // if (a.Checked == true)
- // {
-
- // DetalleProtocolo oDetalleProtocolo = new DetalleProtocolo();
- // oDetalleProtocolo = (DetalleProtocolo)oDetalleProtocolo.Get(typeof(DetalleProtocolo), int.Parse(gvLista.DataKeys[row.RowIndex].Value.ToString()));
- // if (GenerarResultadoSISA(oDetalleProtocolo, idderivacion, ideventomuestra))
- // {
- // i = i + 1;
- // // oDetalleProtocolo.IdProtocolo.GrabarAuditoriaDetalleProtocolo(" Resultado a SISA", int.Parse(Session["idUsuario"].ToString()), "", oDetalleProtocolo.ResultadoCar);
- // BorrarLineaTemporales(idderivacion, ideventomuestra);
- // }
-
-
- // }//checked
- // }// grid
-
-
- // CargarGrilla();
- // estatus.Text = "se han informado " + i.ToString() + " resultados";
- // //GenerarResultadoSISA( );
-
- //}
-
- // private bool GenerarResultadoSISA(DetalleProtocolo oDetalle, string idderivacion, string ideventomuestra)
-
- //{
- // bool generacaso = false;
-
- // Configuracion oCon = new Configuracion(); oCon = (Configuracion)oCon.Get(typeof(Configuracion), 1);
- // string URL = oCon.URLResultadoSISA;
-
-
-
- // try
- // {
- // int id_resultado_a_informar = 0;
-
- // // nose notificò antes y es sospechoso o contacto
-
- // int idevento = 307; // sospechoso
-
- // if (oDetalle.IdProtocolo.IdCaracter == 4) idevento = 309; // contacto
- // // nose notificò antes y es sospechoso o contacto
-
-
- // string res = oDetalle.ResultadoCar;
-
-
- // if (res.Length > 10)
- // {
- // if (res.Substring(0, 10) == "SE DETECTA")
- // { id_resultado_a_informar = 3; }
-
- // if (res.Substring(0, 13) == "NO SE DETECTA")
- // { id_resultado_a_informar = 4; }
-
- // } // if res
-
- // if (id_resultado_a_informar != 0)
- // {
- // string femision = oDetalle.FechaValida.ToString("yyyy-MM-dd");//.ToShortDateString("yyyy/MM/dd").Replace("/", "-");
-
- // string frecepcion = oDetalle.IdProtocolo.Fecha.ToString("yyyy-MM-dd");//ToShortDateString("yyyy/MM/dd").Replace("/", "-");
-
-
-
-
-
-
- // resultado newresultado = new resultado
- // { // resultado de dni: 31935346
- // derivada = true,
- // fechaEmisionResultado = femision, //"2020-09-14", //
- // fechaRecepcion = frecepcion, // "2020-09-13"
- // idDerivacion = int.Parse(idderivacion), //1125675,//
- // idEstablecimiento = 107093, //int.Parse( s_idestablecimiento), //prod: "51580352167442",
- // idEvento = idevento, // sospechoso: 307 y 309 contacto.. idem a la tabla de configuracion sisa
- // idEventoMuestra = int.Parse(ideventomuestra), // 2131682, // sale del excel
- // idPrueba = 1076, // RT-PCR en tiempo real para agregar en la tabla de configuracion sisa
- // idResultado = id_resultado_a_informar,// 4, // 4: no detectable; 3: detectable
- // idTipoPrueba = 727, // Genoma viral SARS-CoV-2 para agregar en la tabla de configuracion sisa
- // noApta = true,
- // valor = ""
- // };
-
-
-
- // JavaScriptSerializer jsonSerializer = new JavaScriptSerializer();
-
- // string DATA = jsonSerializer.Serialize(newresultado);
-
-
- // byte[] data = UTF8Encoding.UTF8.GetBytes(DATA);
-
- // HttpWebRequest request;
- // request = WebRequest.Create(URL) as HttpWebRequest;
- // request.Timeout = 10 * 1000;
- // request.Method = "POST";
- // request.ContentLength = data.Length;
- // request.ContentType = "application/json";
- // string a_apiKey = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes("8482d41353ecd747c271f2ec869345e4"));
- // string a_apiId = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes("0e4fcbbf"));
- // request.Headers.Add("app_key", "8482d41353ecd747c271f2ec869345e4");
- // request.Headers.Add("app_id", "0e4fcbbf");
-
-
-
- // Stream postStream = request.GetRequestStream();
- // postStream.Write(data, 0, data.Length);
-
- // HttpWebResponse response = request.GetResponse() as HttpWebResponse;
- // StreamReader reader = new StreamReader(response.GetResponseStream());
- // string body = reader.ReadToEnd();
- // if (body != "")
- // {
- // oDetalle.IdeventomuestraSISA = int.Parse(ideventomuestra);
- // oDetalle.Save();
-
- // oDetalle.GrabarAuditoriaDetalleProtocolo("Genera Muestra SISA " + ideventomuestra,int.Parse( Session["idUsuario"].ToString()));
-
-
-
- // oDetalle.GrabarAuditoriaDetalleProtocolo("Genera Resultado en SISA", int.Parse(Session["idUsuario"].ToString()));
- // generacaso = true;
- // }
-
- // }
-
-
- // }
- // catch (Exception e)
- // {
- // generacaso = false;
-
-
-
- // //lblError.Visible = true;
- // //btnSalir.Visible = true;
- // }
- // return generacaso;
-
- //}
-
+
-
- //private void BorrarResultadosLuminex(int nroProtocolo)
- //{
- // ISession m_session = NHibernateHttpModule.CurrentSession;
- // ICriteria crit = m_session.CreateCriteria(typeof(ProtocoloLuminex));
- // crit.Add(Expression.Eq("IdProtocolo", nroProtocolo));
- // IList detalle = crit.List();
- // if (detalle.Count > 0)
- // {
- // foreach (ProtocoloLuminex oDetalle in detalle)
- // {
- // oDetalle.Delete();
- // }
- // }
-
- //}
+
public class resultado
{
@@ -1432,11 +1254,31 @@ protected void ddlItem_SelectedIndexChanged(object sender, EventArgs e)
CargarResultado();
Buscar();
}
+
+
}
+ private void CargarResultadoFicha()
+ {
+ Utility oUtil = new Utility(); string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
+
+
+ string m_ssql = @" select distinct ds.resultado
+ from LAB_ConfiguracionSISAFicha S with (nolock)
+ inner join LAB_ConfiguracionSISADetalle DS with (nolock) on DS.idItem=s.iditem
+ where s.idficha='" + ddlTipoFicha.SelectedValue+"'";
+ ///where s.iditem= " + ddlItem.SelectedValue;
+
+ oUtil.CargarCombo(ddlResultado, m_ssql, "resultado", "resultado", connReady);
+
+ ddlResultado.Items.Insert(0, new ListItem("--Todos--", "0"));
+
+
+
+ }
private void CargarResultado()
{
Utility oUtil = new Utility(); string connReady = ConfigurationManager.ConnectionStrings["SIL_ReadOnly"].ConnectionString; ///Performance: conexion de solo lectura
@@ -1523,5 +1365,14 @@ protected void ddlResultado_SelectedIndexChanged(object sender, EventArgs e)
{
Buscar();
}
+
+ protected void ddlTipoFicha_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (ddlTipoFicha.SelectedValue != "0")
+ {
+ CargarResultadoFicha();
+ Buscar();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/WebLab/Resultados/ResultadosaSisa2.aspx.designer.cs b/WebLab/Resultados/ResultadosaSisa2.aspx.designer.cs
index a7ebc7be..b1ae82b7 100644
--- a/WebLab/Resultados/ResultadosaSisa2.aspx.designer.cs
+++ b/WebLab/Resultados/ResultadosaSisa2.aspx.designer.cs
@@ -31,22 +31,22 @@ public partial class ResultadosaSisa2 {
protected global::System.Web.UI.HtmlControls.HtmlInputText txtFechaDesde;
///
- /// ddlItem control.
+ /// ddlTipoFicha control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.DropDownList ddlItem;
+ protected global::System.Web.UI.WebControls.DropDownList ddlTipoFicha;
///
- /// ddlResultado control.
+ /// ddlItem control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.DropDownList ddlResultado;
+ protected global::System.Web.UI.WebControls.DropDownList ddlItem;
///
/// rvItem control.
@@ -57,6 +57,15 @@ public partial class ResultadosaSisa2 {
///
protected global::System.Web.UI.WebControls.RangeValidator rvItem;
+ ///
+ /// ddlResultado control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlResultado;
+
///
/// rdbEstado control.
///
@@ -210,6 +219,15 @@ public partial class ResultadosaSisa2 {
///
protected global::System.Web.UI.HtmlControls.HtmlInputHidden HidClasificacionManual;
+ ///
+ /// HidFicha control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlInputHidden HidFicha;
+
///
/// btnSISA control.
///
@@ -228,6 +246,15 @@ public partial class ResultadosaSisa2 {
///
protected global::System.Web.UI.WebControls.GridView gvLista;
+ ///
+ /// gvListaFicha control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvListaFicha;
+
///
/// btnNoInformarSISA control.
///
diff --git a/WebLab/Site1.Master b/WebLab/Site1.Master
index 8ab1782a..c8d245b0 100644
--- a/WebLab/Site1.Master
+++ b/WebLab/Site1.Master
@@ -222,7 +222,7 @@ document.onkeydown=checkKeyCode;
font-weight: normal;
font-size: 14px;
font-family: Arial;
- text-align:center;">Versión MultiEfector Mayo 2026-11." target="_blank" >Ver Cambios Version
+ text-align:center;">Versión MultiEfector Mayo 2026-21." target="_blank" >Ver Cambios Version
diff --git a/WebLab/SiteTurnos.Master b/WebLab/SiteTurnos.Master
index 3a4ee6a7..be1ad179 100644
--- a/WebLab/SiteTurnos.Master
+++ b/WebLab/SiteTurnos.Master
@@ -222,7 +222,7 @@ document.onkeydown=checkKeyCode;
font-weight: normal;
font-size: 14px;
font-family: Arial;
- text-align:center;">Versión MultiEfector Mayo 2026-11." target="_blank" >Ver Cambios Version
diff --git a/WebLab/controldecambios.html b/WebLab/controldecambios.html
index acb9cc3a..c6b58447 100644
--- a/WebLab/controldecambios.html
+++ b/WebLab/controldecambios.html
@@ -1,4 +1,4 @@
-
+