Ejemplo n.º 1
0
        public bool ExistePacienteEnBUS(int pacienteId)
        {
            //BUSQUEDA BY MATCH: NO UTULIZADA, SE DEJA A MODO DE DOCUENTACION
            //var sexo = (model.Sexo == "M") ? Sexo.Masculino : Sexo.Femenido;
            //var fn = DateTime.Parse(model.FechaNacimiento);
            //var request = new Msn.InteropDemo.Fhir.Model.Request.ExistPatientRequest
            //{
            //    Dni = model.NroDocumento.Value,
            //    FechaNacimiento = fn,
            //    Sexo = sexo,
            //    OtrosNombres = model.OtrosNombres,
            //    PrimerApellido = model.PrimerApellido,
            //    PrimerNombre = model.PrimerNombre
            //};

            //var exists = _patientManager.ExistsPatient(request);

            var model = GetById(pacienteId);

            if (model == null)
            {
                throw new Exception("No se ha encontrado el Paciente en la Base de datos Local");
            }

            var exists = _patientManager.ExistsPatient(DomainName.LocalDomain, pacienteId.ToString());

            return(exists);
        }
Ejemplo n.º 2
0
        public bool ExistePacienteEnBUS(int pacienteId)
        {
            var model = GetById(pacienteId);

            if (model == null)
            {
                throw new Exception("No se ha encontrado el Paciente en la Base de datos Local");
            }

            var sexo = (model.Sexo == "M") ? Sexo.Masculino : Sexo.Femenido;
            var fn = DateTime.Parse(model.FechaNacimiento);

            var request = new Msn.InteropDemo.Fhir.Model.Request.ExistPatientRequest
            {
                Dni = model.NroDocumento.Value,
                FechaNacimiento = fn,
                Sexo = sexo,
                OtrosNombres = model.OtrosNombres,
                PrimerApellido = model.PrimerApellido,
                PrimerNombre = model.PrimerNombre
            };

            //Busqueda By Match
            //var exists = _patientManager.ExistsPatient(request);
            var exists = _patientManager.ExistsPatient(DomainName.LocalDomain, pacienteId.ToString());

            return exists;
        }