@@ -476,7 +476,7 @@ public void getActiveOrders_shouldDefaultToOrderClassIfNoOrderClassIsSpecified()
476
476
}
477
477
478
478
/**
479
- * @see {@link OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date)}
479
+ * @see {@link OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date, org.openmrs.Provider )}
480
480
*/
481
481
@ Test
482
482
@ Verifies (value = "populate correct attributes on the discontinue and discontinued orders" , method = "discontinueOrder(Order, String, Date)" )
@@ -486,7 +486,7 @@ public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOn
486
486
Date discontinueDate = new Date ();
487
487
String discontinueReasonNonCoded = "Test if I can discontinue this" ;
488
488
489
- Order discontinueOrder = orderService .discontinueOrder (order , discontinueReasonNonCoded , discontinueDate );
489
+ Order discontinueOrder = orderService .discontinueOrder (order , discontinueReasonNonCoded , discontinueDate , null );
490
490
491
491
Assert .assertEquals (order .getDateStopped (), discontinueDate );
492
492
Assert .assertNotNull (discontinueOrder );
@@ -497,7 +497,7 @@ public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOn
497
497
}
498
498
499
499
/**
500
- * @see {@link OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date)}
500
+ * @see {@link OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider )}
501
501
*/
502
502
@ Test
503
503
@ Verifies (value = "populate correct attributes on the discontinue and discontinued orders" , method = "discontinueOrder(Order, Concept, Date)" )
@@ -508,7 +508,7 @@ public void discontinueOrderWithConcept_shouldPopulateCorrectAttributesOnBothOrd
508
508
Date discontinueDate = new Date ();
509
509
Concept concept = Context .getConceptService ().getConcept (1 );
510
510
511
- Order discontinueOrder = orderService .discontinueOrder (order , concept , discontinueDate );
511
+ Order discontinueOrder = orderService .discontinueOrder (order , concept , discontinueDate , null );
512
512
513
513
Assert .assertEquals (order .getDateStopped (), discontinueDate );
514
514
Assert .assertNotNull (discontinueOrder );
@@ -519,7 +519,7 @@ public void discontinueOrderWithConcept_shouldPopulateCorrectAttributesOnBothOrd
519
519
}
520
520
521
521
/**
522
- * @see {@link OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date)}
522
+ * @see {@link OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date, org.openmrs.Provider )}
523
523
*/
524
524
@ Test (expected = APIException .class )
525
525
@ Verifies (value = "fail for a discontinue order" , method = "discontinueOrder(Order, String, Date)" )
@@ -528,11 +528,11 @@ public void discontinueOrderWithNonCodedReason_shouldFailForADiscontinueOrder()
528
528
OrderService orderService = Context .getOrderService ();
529
529
Order discontinueOrder = orderService .getOrder (26 );
530
530
531
- orderService .discontinueOrder (discontinueOrder , "Test if I can discontinue this" , null );
531
+ orderService .discontinueOrder (discontinueOrder , "Test if I can discontinue this" , null , null );
532
532
}
533
533
534
534
/**
535
- * @see {@link OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date)}
535
+ * @see {@link OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider )}
536
536
*/
537
537
@ Test (expected = APIException .class )
538
538
@ Verifies (value = "fail for a discontinue order" , method = "discontinueOrder(Order, Concept, Date)" )
@@ -542,7 +542,7 @@ public void discontinueOrderWithConcept_shouldFailForADiscontinueOrder() throws
542
542
OrderService orderService = Context .getOrderService ();
543
543
Order discontinueOrder = orderService .getOrder (26 );
544
544
545
- orderService .discontinueOrder (discontinueOrder , (Concept ) null , null );
545
+ orderService .discontinueOrder (discontinueOrder , (Concept ) null , null , null );
546
546
}
547
547
548
548
/**
@@ -617,7 +617,7 @@ public void saveOrder_shouldFailIfConceptInPreviousOrderDoesNotMatchThisConcept(
617
617
618
618
/**
619
619
* @verifies reject a future discontinueDate
620
- * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date)
620
+ * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider )
621
621
*/
622
622
@ Test (expected = IllegalArgumentException .class )
623
623
public void discontinueOrder_shouldRejectAFutureDiscontinueDate () throws Exception {
@@ -626,20 +626,20 @@ public void discontinueOrder_shouldRejectAFutureDiscontinueDate() throws Excepti
626
626
Patient patient = Context .getPatientService ().getPatient (2 );
627
627
CareSetting careSetting = orderService .getCareSetting (1 );
628
628
Order orderToDiscontinue = orderService .getActiveOrders (patient , Order .class , careSetting , null ).get (0 );
629
- orderService .discontinueOrder (orderToDiscontinue , new Concept (), cal .getTime ());
629
+ orderService .discontinueOrder (orderToDiscontinue , new Concept (), cal .getTime (), null );
630
630
}
631
631
632
632
/**
633
633
* @verifies fail if discontinueDate is in the future
634
- * @see OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date)
634
+ * @see OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date, org.openmrs.Provider )
635
635
*/
636
636
@ Test (expected = IllegalArgumentException .class )
637
637
public void discontinueOrder_shouldFailIfDiscontinueDateIsInTheFuture () throws Exception {
638
638
Calendar cal = Calendar .getInstance ();
639
639
cal .add (Calendar .HOUR_OF_DAY , 1 );
640
640
Order orderToDiscontinue = orderService .getActiveOrders (Context .getPatientService ().getPatient (2 ), Order .class ,
641
641
orderService .getCareSetting (1 ), null ).get (0 );
642
- orderService .discontinueOrder (orderToDiscontinue , "Testing" , cal .getTime ());
642
+ orderService .discontinueOrder (orderToDiscontinue , "Testing" , cal .getTime (), null );
643
643
}
644
644
645
645
/**
@@ -697,36 +697,36 @@ public void saveOrder_shouldFailIfTheExistingDrugOrderMatchesTheConceptAndNotDru
697
697
698
698
/**
699
699
* @verifies fail for a stopped order
700
- * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date)
700
+ * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider )
701
701
*/
702
702
@ Test (expected = APIException .class )
703
703
public void discontinueOrder_shouldFailForAStoppedOrder () throws Exception {
704
704
Order orderToDiscontinue = orderService .getOrder (1 );
705
705
assertNotNull (orderToDiscontinue .getDateStopped ());
706
- orderService .discontinueOrder (orderToDiscontinue , Context .getConceptService ().getConcept (1 ), null );
706
+ orderService .discontinueOrder (orderToDiscontinue , Context .getConceptService ().getConcept (1 ), null , null );
707
707
}
708
708
709
709
/**
710
710
* @verifies fail for a voided order
711
- * @see OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date)
711
+ * @see OrderService#discontinueOrder(org.openmrs.Order, String, java.util.Date, org.openmrs.Provider )
712
712
*/
713
713
@ Test (expected = APIException .class )
714
714
public void discontinueOrder_shouldFailForAVoidedOrder () throws Exception {
715
715
Order orderToDiscontinue = orderService .getOrder (8 );
716
716
assertTrue (orderToDiscontinue .isVoided ());
717
- orderService .discontinueOrder (orderToDiscontinue , "testing" , null );
717
+ orderService .discontinueOrder (orderToDiscontinue , "testing" , null , null );
718
718
}
719
719
720
720
/**
721
721
* @verifies fail for an expired order
722
- * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date)
722
+ * @see OrderService#discontinueOrder(org.openmrs.Order, org.openmrs.Concept, java.util.Date, org.openmrs.Provider )
723
723
*/
724
724
@ Test (expected = APIException .class )
725
725
public void discontinueOrder_shouldFailForAnExpiredOrder () throws Exception {
726
726
Order orderToDiscontinue = orderService .getOrder (6 );
727
727
assertNotNull (orderToDiscontinue .getAutoExpireDate ());
728
728
assertTrue (orderToDiscontinue .getAutoExpireDate ().before (new Date ()));
729
- orderService .discontinueOrder (orderToDiscontinue , Context .getConceptService ().getConcept (1 ), null );
729
+ orderService .discontinueOrder (orderToDiscontinue , Context .getConceptService ().getConcept (1 ), null , null );
730
730
}
731
731
732
732
/**
0 commit comments