@Test public void testIsRecent() { for (Medication med : meds) { DrugTherapy dt = new DrugTherapy(MedType.typeOf(med), "FOO"); dt.addMed(med); assertEquals(med.isRecent(), dt.isRecent()); } }
public boolean isRecent() { int activeCnt = getStatusCount(MedStatus.ACTIVE); int pendingCnt = getStatusCount(MedStatus.PENDING); int holdCnt = getStatusCount(MedStatus.HOLD); int suspendCnt = getStatusCount(MedStatus.SUSPEND); int recent = getPrimary().isInPatient() ? Medication.RECENT_DAYS_IN : Medication.RECENT_DAYS_OUT; if (activeCnt > 0 || pendingCnt > 0 || holdCnt > 0 || suspendCnt > 0) { return true; } else if (therapyStop.before(PointInTime.now()) && therapyStop.after(PointInTime.now().subtractDays(recent))) { return true; } return false; }
DrugTherapy extends AbstractPatientObject implements FrameAction { public boolean isRecent() { int activeCnt = getStatusCount(MedStatus.ACTIVE); int pendingCnt = getStatusCount(MedStatus.PENDING); int holdCnt = getStatusCount(MedStatus.HOLD); int suspendCnt = getStatusCount(MedStatus.SUSPEND); int recent = getPrimary().isInPatient() ? Medication.RECENT_DAYS_IN : Medication.RECENT_DAYS_OUT; if (activeCnt > 0 || pendingCnt > 0 || holdCnt > 0 || suspendCnt > 0) { return true; } else if (therapyStop.before(PointInTime.now()) && therapyStop.after(PointInTime.now().subtractDays(recent))) { return true; } return false; } }
DrugTherapy extends AbstractPatientObject implements FrameAction { public boolean isRecent() { int activeCnt = getStatusCount(MedStatus.ACTIVE); int pendingCnt = getStatusCount(MedStatus.PENDING); int holdCnt = getStatusCount(MedStatus.HOLD); int suspendCnt = getStatusCount(MedStatus.SUSPEND); int recent = getPrimary().isInPatient() ? Medication.RECENT_DAYS_IN : Medication.RECENT_DAYS_OUT; if (activeCnt > 0 || pendingCnt > 0 || holdCnt > 0 || suspendCnt > 0) { return true; } else if (therapyStop.before(PointInTime.now()) && therapyStop.after(PointInTime.now().subtractDays(recent))) { return true; } return false; } @JsonCreator  DrugTherapy(Map<String,Object> data);  DrugTherapy(Medication med);  DrugTherapy(MedType type, String name); }
DrugTherapy extends AbstractPatientObject implements FrameAction { public boolean isRecent() { int activeCnt = getStatusCount(MedStatus.ACTIVE); int pendingCnt = getStatusCount(MedStatus.PENDING); int holdCnt = getStatusCount(MedStatus.HOLD); int suspendCnt = getStatusCount(MedStatus.SUSPEND); int recent = getPrimary().isInPatient() ? Medication.RECENT_DAYS_IN : Medication.RECENT_DAYS_OUT; if (activeCnt > 0 || pendingCnt > 0 || holdCnt > 0 || suspendCnt > 0) { return true; } else if (therapyStop.before(PointInTime.now()) && therapyStop.after(PointInTime.now().subtractDays(recent))) { return true; } return false; } @JsonCreator  DrugTherapy(Map<String,Object> data);  DrugTherapy(Medication med);  DrugTherapy(MedType type, String name); String getName(); MedType getType(); String getGroupName(); boolean isRecent(); int getStatusCount(MedStatus status); PointInTime getTherapyStart(); PointInTime getTherapyStop(); boolean hasMeds(); SortedSet<Medication> getMeds(); void addMed(Medication med); Float[] calcDoseRange(); PointInTime getLastAdmin(); PointInTime getLastFill(); @JsonIgnore List<MedicationAdministration> getAllAdmins(); @JsonIgnore List<MedicationFill> getAllFills(); @Deprecated Map<String, Object> buildRow(Map<String, Object> params, HealthTimePrinterSet dateTimePrinters); static String getDrugTherapyUID(Medication med); }
DrugTherapy extends AbstractPatientObject implements FrameAction { public boolean isRecent() { int activeCnt = getStatusCount(MedStatus.ACTIVE); int pendingCnt = getStatusCount(MedStatus.PENDING); int holdCnt = getStatusCount(MedStatus.HOLD); int suspendCnt = getStatusCount(MedStatus.SUSPEND); int recent = getPrimary().isInPatient() ? Medication.RECENT_DAYS_IN : Medication.RECENT_DAYS_OUT; if (activeCnt > 0 || pendingCnt > 0 || holdCnt > 0 || suspendCnt > 0) { return true; } else if (therapyStop.before(PointInTime.now()) && therapyStop.after(PointInTime.now().subtractDays(recent))) { return true; } return false; } @JsonCreator  DrugTherapy(Map<String,Object> data);  DrugTherapy(Medication med);  DrugTherapy(MedType type, String name); String getName(); MedType getType(); String getGroupName(); boolean isRecent(); int getStatusCount(MedStatus status); PointInTime getTherapyStart(); PointInTime getTherapyStop(); boolean hasMeds(); SortedSet<Medication> getMeds(); void addMed(Medication med); Float[] calcDoseRange(); PointInTime getLastAdmin(); PointInTime getLastFill(); @JsonIgnore List<MedicationAdministration> getAllAdmins(); @JsonIgnore List<MedicationFill> getAllFills(); @Deprecated Map<String, Object> buildRow(Map<String, Object> params, HealthTimePrinterSet dateTimePrinters); static String getDrugTherapyUID(Medication med); static final Comparator<DrugTherapy> AZ_SORTER; static final Comparator<DrugTherapy> CLASS_SORTER; }