Hi All! I am trying to design a form where the patient has to enter the date and time at which he took his medication. I have used a repeat group.
If the user enters the same date again at any point of time, the system should throw an error message stating 'This seems to be an additional dose for the same date ${date}'.
And if there is a gap between two dates, the system should throw a message that there is missed dose.
1. What is the issue? Please be detailed.
When I add a duplicate entry for date, it should show the note "This is an additional dosage".
If there is a missing date entry, it should show " Missed entry"
3. What have you tried to fix the issue?
I have used join() to join the dates and then when the date is entered within the repeat group, I have tried to check for duplicate dates using if (${position}=1,'', substr(${joindates},0, string-length(${joindates})-string-length(${date})))
I have used (selected(${checkduplicate},${date})) in the relevant field.
When there is a duplicate entry, it not only shows the note with respect to the current date entry but also for the previous entry which is not a duplicate.
I have used this looking at various websites using xlsform. However, they had used it with multiselect questions and I have a form where date is dynamically entered.
The logic for missed dose works only if the dates are entered in chronological order. I could not think of anything where in it would automatically check for the order of the dates and then fire a missed date message!
Can anyone help me here . Attaching the form for reference.
4. Upload any forms or screenshots you can share publicly below.
TestEnteko.xls (184 KB)
Below is the screenshot of how the form would look:
But if I enter the same date in the third row, I should get error message only for that entry. However, it shows error for the previous date as well!
Can someone help me solve this issue!
Regards,

