private void AddFields(IPatient patient, Document doc) { doc.Add(new Field("Id", patient.Id.ToString(CultureInfo.InvariantCulture), Field.Store.YES, Field.Index.ANALYZED)); doc.Add(new Field("Name", patient.Name, Field.Store.YES, Field.Index.ANALYZED)); doc.Add(new Field("Hospital", patient.Hospital.Key, Field.Store.YES, Field.Index.ANALYZED)); if (patient.CheckOutDate.HasValue) doc.Add(new Field("CheckOutDate", patient.CheckOutDate.Value.ToShortDateString(), Field.Store.YES, Field.Index.NOT_ANALYZED)); if (patient.EntryDate.HasValue) doc.Add(new Field("EntryDate", patient.EntryDate.Value.ToShortDateString(), Field.Store.YES, Field.Index.NOT_ANALYZED)); if (!string.IsNullOrEmpty(patient.CPF)) doc.Add(new Field("CPF", patient.GetCPF(), Field.Store.YES, Field.Index.ANALYZED)); if (!string.IsNullOrEmpty(patient.DateBirthday.ToString())) doc.Add(new Field("DateBirthday", patient.DateBirthday.ToString(), Field.Store.YES, Field.Index.ANALYZED)); }
private bool RemoveExistinPatient(IPatient patient) { return !PatientsLucene.Any(p => p.GetCPF() == patient.GetCPF()); }