// Path: src/main/java/com/ellixo/healthcare/domain/util/DateESDeserializer.java
// public class DateESDeserializer extends JsonDeserializer<Date> {
// 
//     @Override
//     public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
//         String string = jsonParser.getText();
//         if (Strings.isNullOrEmpty(string)) {
//             return null;
//         }
// 
//         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//         LocalDate localDate = LocalDate.parse(string, dtf);
//         return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
//     }
// }
// 
// Path: src/main/java/com/ellixo/healthcare/domain/util/DateSerializer.java
// public class DateSerializer extends JsonSerializer<Date> {
// 
//     @Override
//     public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
//         if (date == null) {
//             return;
//         }
// 
//         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//         jsonGenerator.writeString(dtf.format(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));
//     }
// }


import com.ellixo.healthcare.domain.util.DateESDeserializer;
import com.ellixo.healthcare.domain.util.DateSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;
import java.util.*;
import java.util.stream.Collectors;
import static org.springframework.data.elasticsearch.annotations.FieldType.Date;

                return codeCIS.equals(that.codeCIS);

            }

            @Override
            public int hashCode() {
                return codeCIS.hashCode();
            }

            @Override
            public String toString() {
                return "MedicamentGenerique{" +
                        "codeCIS='" + codeCIS + '\'' +
                        ", denomination='" + denomination + '\'' +
                        ", type=" + type +
                        ", prix=" + prix +
                        '}';
            }
        }
    }

    public static class InfoImportante {

        @Field(
                type = FieldType.Date,
                index = FieldIndex.not_analyzed,
                store = true,
                format = DateFormat.custom, pattern = "yyyy-MM-dd"
        )
// Path: src/main/java/com/ellixo/healthcare/domain/util/DateESDeserializer.java
// public class DateESDeserializer extends JsonDeserializer<Date> {
// 
//     @Override
//     public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JsonProcessingException {
//         String string = jsonParser.getText();
//         if (Strings.isNullOrEmpty(string)) {
//             return null;
//         }
// 
//         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//         LocalDate localDate = LocalDate.parse(string, dtf);
//         return Date.from(localDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
//     }
// }
// 
// Path: src/main/java/com/ellixo/healthcare/domain/util/DateSerializer.java
// public class DateSerializer extends JsonSerializer<Date> {
// 
//     @Override
//     public void serialize(Date date, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException, JsonProcessingException {
//         if (date == null) {
//             return;
//         }
// 
//         DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
//         jsonGenerator.writeString(dtf.format(date.toInstant().atZone(ZoneId.systemDefault()).toLocalDate()));
//     }
// }


// Path: src/main/java/com/ellixo/healthcare/domain/Medicament.java
import com.ellixo.healthcare.domain.util.DateESDeserializer;
import com.ellixo.healthcare.domain.util.DateSerializer;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;
import java.util.*;
import java.util.stream.Collectors;
import static org.springframework.data.elasticsearch.annotations.FieldType.Date;


                return codeCIS.equals(that.codeCIS);

            }

            @Override
            public int hashCode() {
                return codeCIS.hashCode();
            }

            @Override
            public String toString() {
                return "MedicamentGenerique{" +
                        "codeCIS='" + codeCIS + '\'' +
                        ", denomination='" + denomination + '\'' +
                        ", type=" + type +
                        ", prix=" + prix +
                        '}';
            }
        }
    }

    public static class InfoImportante {

        @Field(
                type = FieldType.Date,
                index = FieldIndex.not_analyzed,
                store = true,
                format = DateFormat.custom, pattern = "yyyy-MM-dd"
        )
        @JsonSerialize(using = DateSerializer.class)