Esempio n. 1
0
 public OrdemServico(int id, string descricao, string tipoOrdem, OsStatus status, DateTime dataRegistro, Funcionario funcionario)
 {
     Id        = id;
     Descricao = descricao;
     TipoOrdem = tipoOrdem;
     // Status = Enum.Parse<OsStatus>("Iniciado");
     // DataRegistro = DateTime.Now;
     Status       = status;
     DataRegistro = dataRegistro;
     Funcionario  = funcionario;
 }
Esempio n. 2
0
        public Afiliado Eligibilidad(string credencial)
        {
            string cadena;
            string plan;
            var    afiliado = new Afiliado();

            try
            {
                var output = "MSH|^~\\&|TRIA0100M|TRIA00007160|SWISSHL7|SWISS^800006^IIN|";
                output += DateTime.Now.ToString("yyyyMMddHHmmss") + "||ZQI^Z01^ZQI_Z01|08050522304540783782|P|2.4|||NE|AL|ARG";
                output += Environment.NewLine;
                output += "PRD|PS^Prestador Solicitante||^^^A||||30543364610^CU|";

                output += Environment.NewLine;
                output += "PID|||" + credencial + "^^^SWISS^HC||UNKNOWN";
                output += Environment.NewLine;

                //Call WebService
                var resultado = _traditum.Send(output);
                logResult(output.ToString(), resultado.ToString(), "E");

                var OSerror = false;
                if (resultado == "")
                {
                    return new Afiliado {
                               Name = Mensajes.Get("AfiIne")
                    }
                }
                ;

                if (resultado.Contains("Error ejecutando") || resultado.Contains("no se pueden procesar") || resultado.Contains("Unable to read data") || resultado.Contains("El cliente encontró el tipo de contenido de respuesta"))
                {
                    OSerror = OsStatus.checkSwiss(true);

                    afiliado.Name = Mensajes.Get("ServidorNoResponde");
                    afiliado.SetError(GetType().Name, 37, Mensajes.Get("ServidorNoResponde"), string.Empty, credencial, string.Empty, OSerror);
                    return(afiliado);
                }
                // convertimos respuesta en vector
                var msHL7 = HL7.DecifraHL7(resultado);
                var index = 0;
                if (msHL7.Length > 1)
                {
                    index = msHL7[1].IndexOf("En estos momentos, no se pueden procesar transacciones");
                }
                else
                {
                    index = 2;
                }
                if (index > 0)
                {
                    OSerror       = OsStatus.checkSwiss(true);
                    afiliado.Name = Mensajes.Get("ServidorNoResponde");
                    afiliado.SetError(GetType().Name, 37, Mensajes.Get("ServidorNoResponde"), string.Empty, credencial, string.Empty, OSerror);
                }
                else
                {
                    OSerror = OsStatus.checkSwiss(false);
                    if (HL7.CampoHL7(msHL7[2], 3, 1) == "B000")
                    {
                        cadena = HL7.CampoHL7(msHL7[4], 5, 1) + ", " + HL7.CampoHL7(msHL7[4], 5, 2);
                        plan   = HL7.CampoHL7(msHL7[5], 2, 0);
                    }
                    else
                    {
                        cadena = Mensajes.Get("AfiIne");
                        plan   = "";
                    }
                    afiliado.Name = cadena;
                    afiliado.Plan = plan;
                }
            }
            catch (Exception ex)
            {
                var afi = new Afiliado {
                    HasError = true
                };
                afi.SetError(GetType().Name, GetMethod.ErrorLine(ex), ex.Message, ex.InnerException?.ToString() ?? string.Empty, credencial, string.Empty);
                return(afi);
            }
            return(afiliado);
        }
Esempio n. 3
0
 /// <inheritdoc/>
 public void PublishStatus(OsStatus status)
 {
     this.Logger.Debug("Infra layer -> OsService -> PublishStatus");
     this.operatingSystemStatusSubject.OnNext(status);
 }