Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: modified way how jsslab.omod is installed on openmrs 1.8

...

II.  Getting started with OpenMRS

Install MySQL (Following steps are not needed if using latest code which automatically adds lab related data to db)

  1. Create database 
    1. create database jsslab;
    2. use jsslab;
  2. After creating jsslab database, create username: openmrs with password: openmrs
    1. CREATE USER 'openmrs'@'localhost' identified by 'openmrs';
    2. GRANT ALL ON jsslab.* to 'openmrs'@'localhost';
  3. Download and unzip the latest jsslab mysqldump file: jsslab20120221.zip (in Dropbox /JSS EMR/Documentation/Lab Rats Only)
  4. Use the MySQL command interface to load it
            source <path>\jsslab20120221.sql
  5. Install MySQL workbench, get the model from dropbox/Documentation/LabRatsOnly/jsslab2.mwb (Not necessary step) 

...

  1. Make sure that you have installed the run-jetty-run plugin for Eclipse
  2. 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
  3. Depending on your OS, you may find it useful to download and install the open source CURL utility in dropbox/Documentation/LabRatsOnly
  4. In Eclipse, right click on openmrs-webapp/target/jetty, choose debug as, run jetty
  5. 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.
  6. Open a new browser window, I like to use Firefox for testing.
  7. 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
  8. 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.
  9. 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).
  10. 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.

...