@Handler(supports={Patient.class,Encounter.class}) public class RequireVoidReasonSaveHandler extends Object implements SaveHandler<Voidable>
RequiredDataAdvice
,
SaveHandler
,
RequiredDataAdvice
Constructor and Description |
---|
RequireVoidReasonSaveHandler() |
Modifier and Type | Method and Description |
---|---|
void |
handle(Voidable voidableObject,
User currentUser,
Date currentDate,
String notUsed)
Validates that the voidReason is non-null and non-empty for supported objects
Should throw APIException if Patient voidReason is null
Should throw APIException if Encounter voidReason is empty
Should throw APIException if Encounter voidReason is blank
Should not throw Exception if voidReason is not blank
Should not throw Exception if voidReason is null for unsupported types
|
public void handle(Voidable voidableObject, User currentUser, Date currentDate, String notUsed)
handle
in interface RequiredDataHandler<Voidable>
handle
in interface SaveHandler<Voidable>
voidableObject
- an OpenmrsObject that needs to have some required data setcurrentUser
- the user who is saving this objectcurrentDate
- the datetime this object is being savednotUsed
- (optional) would be the second argument in the save method, if existsRequiredDataHandler.handle(org.openmrs.OpenmrsObject,
org.openmrs.User, java.util.Date, java.lang.String)
Copyright © 2024 OpenMRS Inc.. All rights reserved.