コード例 #1
0
 @Test
 public void getAutoExpireDate_shouldInferAutoExpireDateForAKnownSNOMEDCTDurationUnit()
     throws Exception {
   DrugOrder drugOrder = new DrugOrder();
   drugOrder.setDateActivated(createDateTime("2014-07-01 10:00:00"));
   drugOrder.setDuration(30);
   drugOrder.setDurationUnits(createUnits(Duration.SNOMED_CT_SECONDS_CODE));
   Date autoExpireDate = new SimpleDosingInstructions().getAutoExpireDate(drugOrder);
   assertEquals(createDateTime("2014-07-01 10:00:29"), autoExpireDate);
 }
コード例 #2
0
 @Test
 public void getAutoExpireDate_shouldInferAutoExpireDateForScheduledDrugOrder() throws Exception {
   DrugOrder drugOrder = new DrugOrder();
   drugOrder.setDateActivated(createDateTime("2014-07-01 00:00:00"));
   drugOrder.setScheduledDate(createDateTime("2014-07-05 00:00:00"));
   drugOrder.setUrgency(Order.Urgency.ON_SCHEDULED_DATE);
   drugOrder.setDuration(10);
   drugOrder.setDurationUnits(createUnits(Duration.SNOMED_CT_DAYS_CODE));
   Date autoExpireDate = new SimpleDosingInstructions().getAutoExpireDate(drugOrder);
   assertEquals(createDateTime("2014-07-14 23:59:59"), autoExpireDate);
 }
コード例 #3
0
  @Test
  public void getAutoExpireDate_shouldNotInferAutoExpireDateWhenDurationUnitsDoesNotExist()
      throws Exception {
    DrugOrder drugOrder = new DrugOrder();
    drugOrder.setDateActivated(createDateTime("2014-07-01 10:00:00"));
    drugOrder.setDuration(1);
    drugOrder.setDurationUnits(null);

    Date autoExpireDate = new SimpleDosingInstructions().getAutoExpireDate(drugOrder);

    assertEquals(null, autoExpireDate);
  }
コード例 #4
0
  @Test
  public void
      getAutoExpireDate_shouldNotInferAutoExpireDateWhenConceptMappingOfSourceSNOMEDCTDurationDoesNotExist()
          throws Exception {
    DrugOrder drugOrder = new DrugOrder();
    drugOrder.setDateActivated(createDateTime("2014-07-01 10:00:00"));
    drugOrder.setDuration(30);
    drugOrder.setDurationUnits(createUnits("Other.Source", Duration.SNOMED_CT_HOURS_CODE, null));

    Date autoExpireDate = new SimpleDosingInstructions().getAutoExpireDate(drugOrder);

    assertEquals(null, autoExpireDate);
  }
コード例 #5
0
  @Test
  public void getAutoExpireDate_shouldNotInferAutoExpireDateWhenDrugOrderHasOneOrMoreRefill()
      throws Exception {
    DrugOrder drugOrder = new DrugOrder();
    drugOrder.setDateActivated(createDateTime("2014-07-01 10:00:00"));
    drugOrder.setDuration(30);
    drugOrder.setDurationUnits(createUnits(Duration.SNOMED_CT_SECONDS_CODE));
    drugOrder.setNumRefills(1);

    Date autoExpireDate = new SimpleDosingInstructions().getAutoExpireDate(drugOrder);

    assertEquals(null, autoExpireDate);
  }