...
II. Getting started with OpenMRS
Install MySQL (Following steps are not needed if using latest code which automatically adds lab related data to db)
- Create database
- create database jsslab;
- use jsslab;
- After creating jsslab database, create username: openmrs with password: openmrs
- CREATE USER 'openmrs'@'localhost' identified by 'openmrs';
- GRANT ALL ON jsslab.* to 'openmrs'@'localhost';
- Download and unzip the latest jsslab mysqldump file: jsslab20120221.zip (in Dropbox /JSS EMR/Documentation/Lab Rats Only)
- Use the MySQL command interface to load it
source <path>\jsslab20120221.sql - Install MySQL workbench, get the model from dropbox/Documentation/LabRatsOnly/jsslab2.mwb (Not necessary step)
...
- Follow step-by-step installation instructions at https://wiki.openmrs.org/display/docs/Step+by+Step+Installation+for+Developers
- When you are setting up your OpenMRS environment, if you need help, don't hesitate to get in touch. Here are some tips:
- You will need to install the JDK (currently Glassfish3), Eclipse (currently Indigo), Eclipse add-ins from the marketplace (subclipse, maven, maven subclipse integration, run jetty run. NOTE: The maven sublipse integration is no longer supported and may not work with the newest version of subclipse. If so, try the Subversive plug-ins instead), maven. For now you don't need to install Tomcat.
- With Eclipse, you need to edit eclipse.ini to add the following 2 lines at the top:
- -vm
- c:/Program Files/glassfish3/jdk/jre/bin/javaw.exe
- If you have earlier versions of the JRE on the machine, you need to go to Preferences>>Java and change the JRE to the glassfish location.
- When you are first importing, use Import from SVN, but just go far enough to identify the OpenMRS SVN repository (http://svn.openmrs.org), then continue via Import Maven Project using Source Control. You will have to install a number of adapters when you download projects for the first time, just go with the flow.
- Make sure your standalone Maven and Eclipse maven are using the same repository. Install maven first and take the default (~/.m2/repository on xnix, c:\documents and settings\<username>\.m2\repository on Windows), then check the maven preferences to see what Eclipse is using
- Include the following 3 projects in your Eclipse workspace: JSSLab module trunk http://svn.openmrs.org/openmrs-modules/jsslab/, OpenMRS 1.8.x branch, webservices.rest module 0.8 branch.
- You will have to install the webservices.rest files into your local maven repository. See https://wiki.openmrs.org/display/docs/Requiring+another+module+in+your+module in the section Installing omod to a local repo. You do not need to do the other steps, they are already included in what you check out.
- You will need to run OpenMRS from your workspace via Jetty. This is because of a not-yet-released fix needed to map the LabTestResults table. If you have installed Tomcat, you will need to stop the service to be able to run Jetty.
...
- Make sure that you have installed the run-jetty-run plugin for Eclipse
- Make sure that you have the restws and openmrs 1.8 projects in your workspace and that you have done a maven clean install on all three projects with Debug output and Update snapshots selected
- Depending on your OS, you may find it useful to download and install the open source CURL utility in dropbox/Documentation/LabRatsOnly
- In Eclipse, right click on openmrs-webapp/target/jetty, choose debug as, run jetty
- From the menu, choose Window > Open Perspective > Debug. Wait until the console stops producing output and there is a process tree in the Debug pane.
- Open a new browser window, I like to use Firefox for testing.
- Go to http://localhost:8080/openmrs-webapp. The first time you do this, you will go through the installer.
Point it to the jsslab DB and the openmrs user, you don't want it to create a database or install test data.Latest .omod file of jsslab creates necessary tables & data by itself - You should see the openmrs login screen, use admin/test. Go to administration, module administration. Stop (red stop sign icon) and unload (trash can icon) all non-required modules (I think that will leave you only with logic). Get and start (green arrow icon) the webservices.rest omod from <workspace>/<webservices.rest project>/tags/0.8/omod/target (your path will be slightly different if you got only the 0.8 version and not the entire project). Get and start the jsslab omod from <workspace>/<jsslab project>/trunk/omod/target. As you debug, you will need to recompile jsslab (it will try to make changes dynamically, but I don't trust that). You will need to stop the jsslab module, unload it, compile, get the new version and start it. Sometime soon there will be some changes to the rest.webservices module. At that point you will have to stop the and unload the jsslab module, stop and unload the rest.webservices module, either get the new rest.webservices module or compile the changes, load and start the rest.webservices module, and load and start the jsslab module.
- Testing: Go to administration, rest.webservices module, test. In the URI line, change "/openmrs/ws/rest/v1/patient/495b10c4-56bd-11df-a35e-0027136865c4" to /openmrs-webapp/ws/rest/v1/module/jsslab/<resource><request info>. Choose a message type. If you are doing an update or create, you will need a body. If you are doing a get, you will may need a representation (if you are using ?v in the request, you shouldn't need to).
- You can also test the gets just by navigating to the URI. If you have logged out of openmrs, you should receive a login prompt.
...
(You can find the file in target folder of omod)
Another option is to change webservices to 1.0 and logic to 0.5.1 in the pom.xml
b. Test is failing
We know that jsslab is not passing test as of now and Roger is working on that.
...