Hi everyone!
I’m trying to implement a simple report inside the referenceapplication module. I have created a new class called VisitCountRegisterand
. I have added the following line to the module activator class.
ReportManagerUtil.setupAllReports(ReportManager.class);
@Component
public class VisitCountRegister extends BaseReportManager {
public VisitCountRegister() {
}
@Override
public String getUuid() {
return "eb6c9c1f-62f7-49fc-a8fd-748e77b9f906";
}
@Override
public String getName() {
return "JUDE DEMO DEMO DEMO";
}
@Override
public String getDescription() {
return "First reporting trying to implement through the reference module";
}
@Override
public List<Parameter> getParameters() {
List<Parameter> parameterArrayList = new ArrayList<Parameter>();
parameterArrayList.add(ReportingConstants.START_DATE_PARAMETER);
parameterArrayList.add(ReportingConstants.END_DATE_PARAMETER);
return parameterArrayList;
}
@Override
public ReportDefinition constructReportDefinition() {
ReportDefinition numberOfVisits_ReportDefinition = new ReportDefinition();
numberOfVisits_ReportDefinition.setUuid(getUuid());
numberOfVisits_ReportDefinition.setName(getName());
numberOfVisits_ReportDefinition.setDescription(getDescription());
numberOfVisits_ReportDefinition.setParameters(getParameters());
return numberOfVisits_ReportDefinition;
}
@Override
public List<ReportDesign> constructReportDesigns(ReportDefinition reportDefinition) {
List<ReportDesign> l = new ArrayList<ReportDesign>();
l.add(ReportManagerUtil.createExcelDesign("ae928860-4a4e-48d4-bbc2-50902babcfc0", reportDefinition));
return l;
}
@Override
public String getVersion() {
return "1.0";
}
}
Note that I am only trying to configure the report. I haven’t connected a dataset to that report yet. When I try to build the referenceApplication module, it will gives me the following error.
java.lang.RuntimeException: failed to setup the required modules at org.openmrs.module.referenceapplication.ReferenceApplicationActivator.started(ReferenceApplicationActivator.java:116) at org.openmrs.module.referenceapplication.ReferenceApplicationActivatorComponentTest.testSetupOfProcessHL7Task(ReferenceApplicationActivatorComponentTest.java:124) ... 39 more`
Caused by: org.hibernate.MappingException: Unknown entity: org.openmrs.module.reporting.report.ReportDesign
BTW; I added the following to the moduleApplicationContext.xml file.
< context:component-scan base-package="org.openmrs.module.referenceapplication" / >
Thanks.