This version is outdated. Please use latest SDK version: OpenMRS SDK
OpenMRS SDK allows for rapid development of modules and the OpenMRS core code. It is an ever expanding project with a rich feature-set, outlined below. Operating System compatibility was also taken into account, allowing users to install the SDK and be up and running within a few minutes on Windows, Linux and Mac OS X.
To be added.
Please help us improve SDK. We kindly ask you to report any problems in JIRA or in notes. Please include the output of omrs-version in your problem description. In order to test SDK on your computer please go through the Step By Step instructions that you find below.
Step By Step
Describe the basics here. Download and install instructions, module creation and running openmrs with an embedded h2 (for OpenMRS 1.9.4+) and an external mysql db.
Step 1. Development Environment Check
Before we get started with the installation of the OpenMRS SDK you have to make sure that if you are planning on working in conjunction with GitHub, that you have
Git installed. For a howto on how to do that see here.
Once Git is installed, you have to make sure that you have the Java Development Kit(JDK) installed. To see if you do, open up a console/terminal and enter
You should see output like this:
SDK requires Java 1.7+. You must have the JAVA_HOME environment variable set. See here.
Step 2. Installing OpenMRS SDK
Now go ahead and download your operating system's compatible version of the OpenMRS SDK installer.
The installation is fairly straightforward.
On Windows and Mac OS X you just need to double click on the downloaded installer. On Linux you need to do:
Once it is finished, you can make sure the SDK works. To do so, open up a terminal/console and issue the following:
The output it gives, should be similar of that below:
If that is the case, you have successfully installed the SDK.
How to create a Basic Module
The SDK allow you, the user to create a basic module, with little effort! All that you have to do is, make sure you have a console/terminal window open and make sure you are
in a directory that you have write access to. If that is the case, you just issue the following:
This will now prompt you for various inputs, the default value/name is already assigned, which you can change if you input your own.
Once the creation process is finished, you can now start working on your module. Be sure that you initialize a git project and push it to
your Github account for easy development access.
Running OpenMRS with an embedded Database
Notice: This only works with OpenMRS version 1.9.4+
Within the module that you just created, you can choose to run OpenMRS with an Embedded Database to test the module you are working on.
To do so, be sure you are in the module directory. Once there you can either issue in the console:
Once you followed either of those two methods, you can now access a fully running OpenMRS instance by going to http://localhost/openmrs
If a previous install of OpenMRS did not happen, an automatic installation will be done. When the wizard is finished, the page will refresh and
you can login using:
The module you were working on, providing it was built without any error, should be visible on the administration page.
Running OpenMRS with an external database
You follow the same steps needed to create a module, however the steps are a bit different post module creation. In order for you, the developer to run
OpenMRS with an external server you need to modify the omrs-run command that is issued. Please issue:
This modification will cause OpenMRS, when accessed via the browser to prompt the you, the developer for all info required to connect to a SQL Database.
You use the exact same credentials as above to access the web-interface.
These commands are mainly used for working with an OpenMRS Module, however certain ones can come in handy if you are doing development on OpenMRS-Core. The latter will be discussed further down.
|Displays version and runtime information for the OpenMRS-SDK
|Displays all available commands and their information.
|Runs an OpenMRS instance of the latest version unless specified otherwise
|Creates an OpenMRS Project.
|Creates an OpenMRS Module.
|Cleans an OpenMRS-SDK Project or Module Project of temporary files.
|Cleans OpenMRS-SDK Temp files, and compiles module.
|Compiles all files to create a runnable module.
Working on OpenMRS Core
OpenMRS SDK uses the following features of OpenMRS core 1.9.4+. We provide them here for the reference. Examples listed below refer to Jetty, however they can be used when running OpenMRS on any application server.
|Installation-script command line property
Once you have cloned an OpenMRS-core github repository you are able to specify an
to set the path to the custom installation script.
|Automatic installation feat. H2 Database
If you want to install OpenMRS after you have compiled the project with the alterations,
to automatically install OpenMRS with the default installation script located in the classpath.
|AppData directory command line property
If you wish to set the Application Data directory to a custom location for easy configuration access
to adjust the Application Data directory.