In EndTB 1.5 the TB drug tab in the clinical app allows the prescribing of drugs with an indefinite duration until a stop date is specified. The problem we are having is that we are unable to stop a drug on the current date: An example of the resulting error message is “20:40 PGT 2017 to null)’ failed to validate with reason: dateActivated: Date Activated cannot be in the future ‘DC DrugOrder(100.064 of Clofazimine (Cfz) from Sat Jun 24 11:20:40 PGT 2017 to null)’ failed to validate with reason: dateActivated: Date activated cannot be in the future”
Setting the system time on the client computer back an hour resolves the problem.
So is the failed validation a result of the validation checking the current system time on the client computer and comparing it to the server time as part of the validation? That is, if the client computer for any reason is running ahead of the server the validation will fail. If this is the case it might be good to make some allowance for discrepancies between system time on the client computer and on the server.
As a workaround, is it possible to configure the medications module to allow manual entry of time as well as date for stopping the drug (ie so that you can manually enter a time that is older than the current server time)?
Also, is the validation rule for stopping a drug with indefinite duration configurable at implementation (even if in groovy) or is it coded into an omod that would need to be recompiled?