示例#1
0
        public NewPatientRes FindExistingPatient(NewExistingPatientReq req)
        {
            var pquery = Context.Registro
                         .Join(Context.Paciente,
                               reg => reg.idRegistro,
                               pac => pac.IdRegistro,
                               (reg, pac) => new { r = reg, p = pac })
                         .Where(x => x.r.Emeci == req.Emeci && x.r.Tipo == "P")
                         .FirstOrDefault();

            if (pquery != null)
            {
                var dtquery = Context.DatosTarjeta
                              .Where(x =>
                                     x.Coordenada == req.Coordinate &&
                                     x.Dato == req.Value &&
                                     x.noTarjeta == req.Emeci
                                     )
                              .FirstOrDefault();
                if (pquery != null)
                {
                    return new NewPatientRes
                           {
                               PatientId = pquery.p.idPaciente
                           }
                }
                ;
            }

            return(new NewPatientRes());
        }
示例#2
0
 //GET /api/patient/newpatient
 public NewPatientRes NewExistingPatient([FromUri] NewExistingPatientReq req)
 {
     return(service.FindExistingPatient(req));
 }