diff --git a/app/src/main/java/net/foucry/pilldroid/UtilDate.java b/app/src/main/java/net/foucry/pilldroid/UtilDate.java index fe7075a..9a67307 100644 --- a/app/src/main/java/net/foucry/pilldroid/UtilDate.java +++ b/app/src/main/java/net/foucry/pilldroid/UtilDate.java @@ -82,7 +82,7 @@ public class UtilDate { * @return int numbers of days between date and today * Number of days between date (older than today) and today */ - static int nbOfDaysBetweenDateAndToday(Date date) { + public static int nbOfDaysBetweenDateAndToday(Date date) { Date oldDate = dateAtNoon(date); // Be sure that the old date is at Noon Date todayDate = dateAtNoon(new Date()); // Be sure that we use today at Noon diff --git a/app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java b/app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java index 97d8ff9..6016836 100644 --- a/app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java +++ b/app/src/main/java/net/foucry/pilldroid/dao/MedicinesDAO.java @@ -12,7 +12,7 @@ public interface MedicinesDAO { @Query("SELECT * FROM drugs") List getAllMedicines(); - @Query("SELECT * FROM drugs WHERE cip13 = :cip13") + @Query("SELECT COALESCE(label_group,name), * FROM drugs WHERE cip13 = :cip13") Medicine getMedicineByCIP13(String cip13); @Query("SELECT count(*) FROM drugs") diff --git a/app/src/main/java/net/foucry/pilldroid/dao/PrescriptionsDAO.java b/app/src/main/java/net/foucry/pilldroid/dao/PrescriptionsDAO.java index 969ac4a..cad750d 100644 --- a/app/src/main/java/net/foucry/pilldroid/dao/PrescriptionsDAO.java +++ b/app/src/main/java/net/foucry/pilldroid/dao/PrescriptionsDAO.java @@ -21,10 +21,10 @@ public interface PrescriptionsDAO { @Delete void delete(Prescription prescription); - @Query("SELECT * FROM prescriptions") + @Query("SELECT COALESCE(label_group,name), * FROM prescriptions") List getAllMedics(); - @Query("SELECT * FROM prescriptions WHERE cip13 = :cip13") + @Query("SELECT COALESCE(label_group,name), * FROM prescriptions WHERE cip13 = :cip13") Prescription getMedicByCIP13(String cip13); @Query("SELECT count(*) FROM prescriptions")