Hi Mariam, At the point in time we're talking about, you are creating the *definitions* of cohorts and indicators, that go in a report definition. At this point the report is only being defined, it is not yet being run. So at this point, you can only access the definitions of parameters--their values are not available at that time. (Their values are only available when the report definition is being evaluated, and the cohort and indicator definitions are evaluated.)
If I'm understanding your use case correctly, you need to write a new class like DrugRegimenCohortDefinition and a matching class like DrugRegimenCohortDefinitionEvaluator. (Though maybe these are already written in one of the Rwanda reporting modules?) Then when the cohorts and indicators are being defined you would instantiate one of your cohort definitions, and a bunch of indicators that use it, mapping parameters so that the endDate parameter of the report eventually ties to the date parameter to your cohort definition. -Darius On Tue, Mar 6, 2012 at 11:52 PM, Mariam N. <[email protected]> wrote: > As shown in the table, in the first column they are regimens taken by > patients in a certain period and you know well that in openmrs there is no > table which holds patient *regimens *(I mean for > instance*Zidovudine+lamivudine+Nevirapine > *). > To come up, I have defined some method in *DAO *which takes all patients > having drug orders before some period and I loop through and try to keep > each patient's regimen.It's not really easy but it works elsewhere!!!! > When the method is invoked it needs the *enddate *as parameter (the > another purpose as Mike said). > > It is feasible in the controller as follows: > > EvaluationContext context = new EvaluationContext(); > Date endDate=(Date)context.getParameterValue("endDate"); > > OR > > Date endDate = (Date) dataSet.getContext().getParameterValue(" > endDate "); > > But when when I try to do so in the class where cohorts and indicators are > defined and added to the report, I just get the null value!!!!! > I tried to define also the endDate as static to make it accessible > and I've got the compiler error..... > > > ======================================================================================== > My method in *dao *looks like this:* public List<ArrayList<Integer>> > getRegimenComposition(Date date) {}* > and I want to call it from the class where I add indicators to the report > like this: > * List<ArrayList<Integer>> regimens = > Context.getService(QuarterReportingService.class).getRegimenComposition(endDate); > * > > > > ------------------------------ > Click here to > unsubscribe<[email protected]?body=SIGNOFF%20openmrs-devel-l>from > OpenMRS Developers' mailing list > _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

