I realy need you help on auto-calculate from two date time.
i want to auto-calculate total surgical time spend from surgical time in and surgical time out and these fields are datetime.
I tried to follow the same auto-calculate done in bahmni for BMI but i don’t know why it doesn’t show the auto-calculated value. i also tried to use this approach for debugging Debug groovy file but it doesn’t debug.
Do you have the Concept ‘Surgical Total Time’ created under the same parent of Surgical Time In/Out?
Looking at the groovy, i see that you are just setting value, but when you are saving Surgical Time In/Out observations for the first time, there won’t be any Surgical Total Time obs right. Hence you need to create an observation using ‘createObs’ method for it and set the value and set it as one of the children of your parent concept.
I have followed your advice but it seems there is something i’m messing up, i have created the obs using
createObs as you suggested and set a static value to the surgical total time fields. But that static value is not showing up when i save the form data, even the debug code don’t write in the file. it seems this file is not executing my code.
Thanks for the information but for me it 's inevitably to have this kind of
auto-calculated fields, can you guide me how i can display this
auto-calculated field on patient dashboard, or my be share your
configurations if you don’t mind.