OpenMRS SDK (current version: 2.0-beta) 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.
- Step By Step
- Project Resources
Please help us improve SDK. We kindly ask you to report any problems in JIRA or in notes. Please include the output of openmrs-sdk:help 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 Apache Maven installed. To see if you do, open up a console/terminal and enter
You should see output like this:
SDK requires Maven 3+ installed. You can download Maven from here and install.
Step 2. Setting up OpenMRS SDK
For setup the SDK you just need to open the terminal and execute:
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 for OpenMRS 1.x
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.
Creating module for OpenMRS 2.x
Similarly as creating OpenMRS 1.x module, you can create module for OpenMRS 2.x. For that, you can execute command:
Running OpenMRS 1.x with an embedded Database
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.
First, you need to create server:
Plugin will ask you for serverId, and if success, server will be created in $HOME/openmrs folder.
Than you need to install you module to server. For that, execute next:
Plugin will ask you for a serverId of server, you must put the id of just created server. After that, you can execute it:
If you run this command from the server folder, the server will start immediately. Otherwise plugin will ask you for a serverId.
If the server starts successfully, you can access a fully running OpenMRS instance by going to http://localhost:8080/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 2.z with an external database
Steps for creating OpenMRS 2.x server, and starting, are mostly the same as for 1.x. First, setup 2.x server:
Besides serverId, you must put database driver class, database URI, login and pass for database user.
And finally, install module to server, and run selected server (These steps are absolutely the same as for OpenMRS 1.x)
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.
Each command can be executed by:
|help||Displays all available commands and their information.||N/A|
|create-platform-module||Creates module for OpenMRS 1.x||N/A|
|create-module||Creates module for OpenMRS 2.x||N/A|
|run||Runs previously created OpenMRS server|
|setup-platform||Creates OpenMRS 1.x server|
|setup||Creates OpenMRS 2.x server|
|install-module||Installs module to selected server (you must install it to local repository before, using "mvn clean install")|
|uninstall-module||Removes module from selected server|
|upgrade-platform||Upgrades OpenMRS platform server to selected version.|
|upgrade||Upgrades OpenMRS 2.x server, or OpenMRS Platform server to 2.x. User modules will be saved|
|reset||Updates server to default state (database data, configuration, and optionally user modules)|
|delete||Remove selected server|
Note! All parameters, except "optional" are required, and will be prompted if user will no put them
|OpenMRS 2.x SDK||https://github.com/openmrs/openmrs-contrib-sdk-maven-plugin|