Use of a different date variable in place of the visit date in EndTB

In the EndTB configuration 1.5 there are a number of observation templates for lab data (eg “Lab Result Biochemistry Template”, “Lab Results Hematology Template”). When using the “enter data” screen in the clinical app and entering data into these templates, they display on the left hand side with the “specimen collection date” in brackets. Similarly, in a display control of type “forms” the observation template is shown with the date of specimen collection.

If we add a completely new observation template in OpenMRS and include specimen collection date in that obs template, it instead shows the date of data/entry or the date of visit rather than the specimen collection date in the display control and in the enter data screen.

I was just wondering if we could get some advice on how and where this behaviour is controlled in the EndTB configuration. The outcome we would like is to be able to add new observation templates to the configuration that include a date field and then to use the date entered there as the date of data entry/visit in the same way that as currently happens for the existing lab result observation templates.


@gchan, if i understand this correctly, the behaviour needed here is that the all the Fields entered in new Observation Template are to be saved against the Sample Collection date on the Observation Template i.e another field on this form. Am i correct? Is it similar to what we have now for other Observation Forms in endtb config i.e when we save a form with data it is saved against the date field which is mandatory on the form? If yes then please look at this groovy script where the Date Concept is mentioned for the form name to specify that this form data needs to be saved against this date on the form. Please make changes accordingly i.e add new like for adding the new form.

Thanks @swathivarkala. Much appreciated - that is exactly what I was after. After adding a new template, I’ve specified the template and the date field in the BahmniObsValueCalculator.groovy file:

formNames.put(“Template name”, “Date concept in template”);

That seems to be working. Are there any other changes needed in the BahmniObsValueCalculator.groovy file that I might have missed?

Thanks for the help

No. For this scenario just this change should do.