I was exploring data integrity module and I used sample rule given in the github. I included it in the dataintegrity by inserting it into the dataintegrity_rules table but I’m not able to run it.
When I put it inside main directory (/api/src/main/java/org/openmrs/module/dataintegrity), I got groovy.lang.MissingMethodException: No signature of method .
My recommendation for moving forward is as follows:
Using SDK create a Reference Application 2.6-SNAPSHOT server and generate custom data using the reference demo data module - and add the latest version of the Data Integrity module
Create a custom module based on the Reference Application archetype which will be used to host the rules
This is also where the dashboard widget will be configured
Do let me know if you run into any problems doing this
I’m using SDK for the server and I used the sample rule given in the readme file of github repo of data integrity module. Also I have used the reference application demo data with the DINT omod which I complied from the fork of the module.
I’m getting this error when I’m running this command mvn clean install openmrs-sdk:run -DserverId=dint :
[INFO] Scanning for projects…
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO]
[INFO] Basicexample
[INFO] Basicexample API
[INFO] Basicexample OMOD
[WARNING] The POM for org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 is missing, no dependency information available
[WARNING] Failed to retrieve plugin descriptor for org.eclipse.m2e:lifecycle-mapping:1.0.0: Plugin org.eclipse.m2e:lifecycle-mapping:1.0.0 or one of its dependencies could not be resolved: Failure to find org.eclipse.m2e:lifecycle-mapping:jar:1.0.0 in http://mavenrepo.openmrs.org/nexus/content/repositories/public was cached in the local repository, resolution will not be reattempted until the update interval of openmrs-repo has elapsed or updates are forced
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Basicexample 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ basicexample —
[INFO]
[INFO] — buildnumber-maven-plugin:1.1:create (default) @ basicexample —
[INFO] Checking for local modifications: skipped.
[INFO] Updating project files from SCM: skipped.
[INFO] ShortRevision tag detected. The value is ‘6’.
[INFO] Executing: /bin/sh -c cd /home/shivang/basicexample && git rev-parse --verify --short=6 HEAD
[INFO] Working directory: /home/shivang/basicexample
[INFO] Storing buildNumber: 0 at timestamp: 1492709937788
[INFO] ShortRevision tag detected. The value is ‘6’.
[INFO] Executing: /bin/sh -c cd /home/shivang/basicexample && git rev-parse --verify --short=6 HEAD
[INFO] Working directory: /home/shivang/basicexample
[INFO] Storing buildScmBranch: UNKNOWN_BRANCH
[INFO]
[INFO] — maven-java-formatter-plugin:0.4:format (default) @ basicexample —
[INFO] Using ‘UTF-8’ encoding to format source files.
[INFO] Number of files to be formatted: 0
[INFO]
[INFO] — maven-install-plugin:2.4:install (default-install) @ basicexample —
[INFO] Installing /home/shivang/basicexample/pom.xml to /home/shivang/.m2/repository/org/openmrs/module/basicexample/1.0.0-SNAPSHOT/basicexample-1.0.0-SNAPSHOT.pom
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Basicexample API 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-clean-plugin:2.5:clean (default-clean) @ basicexample-api —
[INFO] Deleting /home/shivang/basicexample/api/target
[INFO]
[INFO] — buildnumber-maven-plugin:1.1:create (default) @ basicexample-api —
[INFO]
[INFO] — maven-java-formatter-plugin:0.4:format (default) @ basicexample-api —
[INFO] Using ‘UTF-8’ encoding to format source files.
[INFO] Number of files to be formatted: 12
[INFO] Successfully formatted: 0 file(s)
[INFO] Fail to format : 0 file(s)
[INFO] Skipped : 12 file(s)
[INFO] Approximate time taken: 0s
[INFO]
[INFO] — maven-resources-plugin:2.6:resources (default-resources) @ basicexample-api —
[INFO] Using ‘UTF-8’ encoding to copy filtered resources.
[INFO] Copying 5 resources
[INFO] Copying 0 resource
[INFO] skip non existing resourceDirectory /home/shivang/basicexample/api/src/main/webapp
[INFO] skip non existing resourceDirectory /home/shivang/basicexample/api/src/main/webapp
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ basicexample-api —
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 10 source files to /home/shivang/basicexample/api/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/IncompleteExposedInfantInformation.java:[33,71] diamond operator is not supported in -source 1.6
(use -source 7 or higher to enable diamond operator)
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/IncompleteARTInformation.java:[26,71] diamond operator is not supported in -source 1.6
(use -source 7 or higher to enable diamond operator)
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/InvalidARTEncounters.java:[27,71] diamond operator is not supported in -source 1.6
(use -source 7 or higher to enable diamond operator)
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Skipping Basicexample
[INFO] This project has been banned from the build due to previous failures.
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Basicexample … SUCCESS [ 1.069 s]
[INFO] Basicexample API … FAILURE [ 2.304 s]
[INFO] Basicexample OMOD … SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.474 s
[INFO] Finished at: 2017-04-20T23:09:00+05:30
[INFO] Final Memory: 30M/221M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project basicexample-api: Compilation failure: Compilation failure:
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/IncompleteExposedInfantInformation.java:[33,71] diamond operator is not supported in -source 1.6
[ERROR] (use -source 7 or higher to enable diamond operator)
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/IncompleteARTInformation.java:[26,71] diamond operator is not supported in -source 1.6
[ERROR] (use -source 7 or higher to enable diamond operator)
[ERROR] /home/shivang/basicexample/api/src/main/java/org/openmrs/module/basicexample/dataintegrity/InvalidARTEncounters.java:[27,71] diamond operator is not supported in -source 1.6
[ERROR] (use -source 7 or higher to enable diamond operator)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn -rf :basicexample-api
@ssmusoke, I’m using 1.7 . And the $JAVA_HOME is point to a symoblic link file whose link I change whenever necessary from jdk 1.7 to jdk 1.8 and vice-versa. I don’t even have 1.6 on my system.
The rules from the UgandaEMR module may not work for you as the missing data may not be there in you rmodule.
We can start with simple rules that can be built from the standard OpenMRS dataset for example making a patient below 5 years having a relationship parent.
Now I’m able to see the rules defined in 'data quality` section but I’m not able to run it due to some error. Here is the log .
I added dataintegrity dependency in root and api’s pom.xml . I’ve also added the rule in ‘dataintegrity_rule’ table.
@ssmusoke, @maany, @dkayiwa could you please help me here ? Everything is working fine except I’m not able to run validation rule. Is it possible to proceed with this error ?
@shivtej You should delete the rule from the data_integrity rule table. Once you create the rule in your API, the data integrity module will load it on module startup with the correct metadata to enable it to run.
Also it is always good practice to setup unit tests to test your rule with data before you attempt to run it which means that it will work as expected. As you keep adding more functionality
@ssmusoke, I did delete the rule from the table but the data integrity module isn’t loading the rule. I also added various module related to metadata (metadatadeploy, metadatamapping and metadatasharing) on the pom.xml of api submodule but I’m not able to see the rule.
Kindly excuse me if I’m getting stuck at very basic things. I don’t have much experience with Maven, but I assure you that I will have grip over it very quickly.
Please also let me know how can I test the rule, I really don’t have any clue about it.
Thanks a lot for your help.