CSC/ECE 517 Spring 2013/OSS M604: Difference between revisions
Line 19: | Line 19: | ||
==Writing Exercise 2== | ==Writing Exercise 2== | ||
===Design Overview of the Module=== | ===Design Overview of the Module=== | ||
OpenMRS modules utilize | OpenMRS modules utilize a modified Spring MVC framework [http://en.wikipedia.org/wiki/Spring_Framework]. The skeleton for the module is first generated using convenient maven[http://maven.apache.org/] artifacts provided here [https://wiki.openmrs.org/display/docs/Creating+Your+First+Module]. | ||
The 'change patient relationships' module utilizes 5 basic files. | The 'change patient relationships' module utilizes 5 basic files. |
Revision as of 02:05, 21 March 2013
OpenMRS Change Patient Relationships
README
The design document for the project can be found at [1]
The project is currently hosted at a long term VCL image found at [2]
The code for our module is hosted on github at [3]
To Use:
- Login with user:Admin password:Admin123.
- Click the 'Administration' button in the top-right corner.
- In the bottom-right corner, under 'patients' there should be a link for "change patient relationships".
- Click on the 'change patient relationships' link
- The content of the change patient relationships module should be displayed.
To see a list of possible patients, it may be useful to open a separate tab with the 'Find/Create Patient" menu from the main menu bar.
Writing Exercise 2
Design Overview of the Module
OpenMRS modules utilize a modified Spring MVC framework [4]. The skeleton for the module is first generated using convenient maven[5] artifacts provided here [6].
The 'change patient relationships' module utilizes 5 basic files.
- The main page is a .jsp [7] page, the code can be found at [8].
- This .jsp page is linked to a spring annotated controller [9], the code can be found at [10]. The annotated controller maps the manage.jsp form actions using the '@RequestMapping' annotations. This pattern can be observed by viewing the manage.jsp code and comparing the <form> tags to the @RequestMapping annotations in teh java code.
- The controller along with the spring framework link the form actions from the 'manage.jsp' page to java objects defined in the following .java files. [11] and [12]
- The module utilizes OpenMRS's services infrastructure to create services with the following code [13]. The services found within this class are retrieved from the OpenMRS context object inside of the above controller code (#2). The ChangePatientRelationshipsServiceImpl.java class utilizes OpenMRS database APIs [14] to actually change the patient data in the OpenMRS database.
The entire module is packaged in an OpenMRS .omod file using maven and pre-created packaging scripts. The .omod file can be found here [15] and installed into any OpenMRS server using the 'Administration'>Manage modules page.