Software Development: OpenMRS Information

The Project
  [[media:project-description.pdf |The preliminary project description]]  

OpenMRS Information
  OpenMRS.org: The main OpenMRS website.   dev.openmrs.org: The main OpenMRS developer website. You should explore much of this site, but in particular:

  OpenMRS Technical Overview.   Developer How-To Guide   OpenMRS Data Model  

</li>  Exploring OpenMRS: a document I have started writing on figuring out what OpenMRS does and how it works. These notes are preliminary! </li> </ul>

Installing OpenMRS
We will get our copy of OpenMRS from the OpenMRS subversion repository. This will not be a problem, as we will be developing a module, so we will never need to change the core code. I strongly recommend doing this over a wired network connection, as the OpenMRS trunk is rather large download. These instructions are modifications of the official Step-by-Step Installation for Developers on the OpenMRS website. <ol>  Download the OpenMRS source code.

<ol>  Start EasyEclipse. </li>  Select File-&gt;New...-&gt;Project. Untie the SVN twistie, select "Checkout Projects from SVN," and press Next. </li>  Select "Create a new repository location" and press Next. </li>  Enter  for the URL and press Next.

</li>  Untie the  twistie, then the   twistie, and select, and press Next. </li>  You should only be able to select "Check out as a project in the workspace;" I recommend leaving the Project Name alone, and be sure that "Head Revision" is selected for "Revision to check out." Press Next. </li>  Select "Use default workspace location." Press Finish. Take a rest---this is not a fast process.

</li> </ol> </li>  Install the OpenMRS database. <ol>  Change directory to. </li>  Start MySQL and then start the MySQL command-line interface as root: $ mysql -u root -p </li>

 Run the provided scripts in the following order: mysql&gt; source 1.3.0-createdb-from-scratch-with-demo-data.sql ; mysql&gt; source update-to-latest-db.mysqldiff.sql ; Note that if you have a MySql user named, this user will be deleted. Regardless, the user  will be created with password. This is not very secure...

</li> </ol> </li>  Follow the instructions in Step 4 (Set up your local configuration) of the Step-by-Step Installation for Developers. In the  file, be sure to specify your Tomcat installation directory as well as the Tomcat manager username and password. I do not think you need to modify  or. </li>  Follow the instructions in Step 5 (Deploy OpenMRS) in the Step-by-Step Installation for Developers. </li>

</ol>

You should routinely make sure that you have the latest revision of OpenMRS, which is easy to do using Subversion. <ol>  Right-click on the OpenMRS project that you created above. </li> <li> In the context menu that appears, select Team-&gt;Update. </li> </ol> That's it!

Initial module setup under Eclipse and Subversion The Visit Register project will be built as an OpenMRS module. An OpenMRS module is basically a small application that can be loaded into OpenMRS at run-time. As such, it has a specific file-system structure that must be followed (just like for a web application). To make this a little easier, OpenMRS provides a module called Basic Module that is properly organized; the intent is that a new module developer download the Basic Module, makes the appropriate changes (primarily, changing "Basic Module" to a new name everywhere), and then starts working on the new functionality. However, this process is not as automated as one might hope. Instead, I have done almost all the manual work for you; you just need to get a copy of the Visit Register module from our Subversion repository, copy it into your team's repository, and change just a few things where my name appears (and, of course, adding all your new files as you develop the module). Here are the steps, assuming you have Eclipse started: <ol>

<li> Check out the Visit Register module. <ol> <li> Select File-&gt;New-&gt;Project. Untie the SVN twistie, select "Checkout Projects from SVN," and press Next. </li> <li> Select "Create a new repository location" and press Next. </li> <li> Enter  for the URL and press Next. </li>

<li> Select  and press Next. </li> <li> You should only be able to select "Check out as a project in the workspace." Set the project name to   or  (no spaces). Select revision 4 as the revision to check out. Press Next. </li> <li> Select "Use default workspace location" and press Finish.

</li> </ol> </li>

<li> Disconnect your copy of the visit register module from the subversion server and make it the trunk of your team's subversion directory. <ol> <li> Right-click on the Visit Register project you just created and select Team-&gt;Disconnect.... </li> <li> Select "Also delete the SVN meta information..." and press Yes. You will be warned about not being able to reconnect your project to the repository; press Yes. </li> <li> Right-click on the Visit Register project and select Team-&gt;Share Project....

</li> <li> Select SVN as the repository type and press Next. </li> <li> Select "Use existing repository location" and and press Next. </li> <li> Select "Use specified folder name" and press Browse. In the Repository Browser window, untie the  twistie, select the folder corresponding to your team, and press OK. Replace

with, so that the folder name is .  Press Next. </li> <li> Edit the initial commit comment to be and press Finish. </li> </ol> </li>

<li> Now play just a bit with making changes and committing them.

<ol> <li> Look through all the files in your Visit Register project and replace every occurrence of my name with your names. Each file that you change should get a little snowflake icon in the Eclipse navigator, indicating that your working copy of this file is different than the version that was most recently downloaded from the repository. Notice also that if you consider the navigator as a tree in the obvious way, then every node above any file you change also has the snowflake icon. </li> <li> Once you have made your changes, you can get a quick view of what those changes are by right-clicking on your project and selecting Compare with-&gt;Latest from repository. This will open a tab where you usually edit files. The upper part of the tab is a list of files that are different (deleted, added, or modified). Double-clicking on any such file displays your version of the file side-by-side with the version in the repository, and indications of where the differences are. </li> <li> You can commit your changes by right-clicking on your project and selecting Team-&gt;Commit.... Add an appropriate comment to indicate what changes you have made. Check the resources that will be committed; make sure that you are not committing anything in the or  folders, as these are all files that are generated from source code or copied from elsewhere in the project.

</li> </ol> </li>

</ol>