Documentation for developers of OpenVPMS
The purpose of this document is to outline the requirements for getting the OpenVPMS webapp up and running from the source.
When configuring the MySQL server:
These have the corresponding settings my.ini:
max_allowed_packet=16M innodb_file_per_table character-set-server = utf8 innodb_buffer_pool_size = 512M
Create a database named openvpms_dev, with a single user openvpms:
mysql -u root -p mysql> create database openvpms_dev; mysql> grant all on openvpms_dev.* to openvpms identified by 'openvpms';
To get the most recent sources from git:
git clone https://bitbucket.org/OpenVPMS/openvpms.git openvpms
The easiest way to build the source is to simply run:
> cd openvpms > mvn -DskipTests install
To run the webapp from maven from the command line:
1. Create the database schema, load archetypes, and sample data
> cd openvpms-archetypes > mvn openvpms-db:create openvpms-db:update openvpms-data:load
2. Load report templates
> cd ../openvpms-release > mvn openvpms-report:load
3. Start Jetty
> cd ../openvpms-web/openvpms-web-app/ > mvn jetty:run
The app can be accessed at http://localhost:8080/openvpms/app
Login user name is admin password is admin
OpenVPMS will start without OpenOffice being present. However, it is required when:
The soffice binary must be in the PATH in order for OpenVPMS to locate it.
To log SQL queries, p6spy can be enabled as follows:
> mvn -Ddb.driver=com.p6spy.engine.spy.P6SpyDriver -Ddb.url=jdbc:p6spy:mysql://localhost:3306/openvpms_dev jetty:run
This will log all SQL to a file named spy.log, in the current directory.
The OpenVPMS source is hosted at bitbucket.org, at https://bitbucket.org/OpenVPMS/openvpms
To contribute a change to OpenVPMS:
For a tutorial on the Bitbucket workflow, see https://www.atlassian.com/git/tutorials/learn-about-code-review-in-bitbu...
For a general tutorial on Git, see https://www.atlassian.com/git/tutorials/learn-git-with-bitbucket-cloud
The OpenVPMS Booking API is a JSON API for making appointments in OpenVPMS.
This API first appears in OpenVPMS 2.0.
The current production version is the Online Booking API V2.
The OpenVPMS Booking API is a JSON API for making appointments in OpenVPMS. This API first appears in OpenVPMS 2.0.
The following assumes:
The openvpms-booking-api-v1.zip contains API documentation generated by Enunciate. Extract and browse from index.html.
You can also get an overview by browsing http://localhost:8080/openvpms/ws/booking/v1/application.wadl
To get the locations:
> curl -i -u sample:changeit http://localhost:8080/openvpms/ws/booking/v1/locations HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: application/json Content-Length: 126 Date: Tue, 25 Jul 2017 03:33:24 GMT [{"id":99,"name":"Branch Clinic","timeZone":"Australia/Sydney"}, {"id":113,"name":"Main Clinic","timeZone":"Australia/Sydney"}]
To get the schedules available at a location:
> curl -i -u sample:changeit http://localhost:8080/openvpms/ws/booking/v1/locations/113/schedules HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: application/json Content-Length: 117 Date: Tue, 25 Jul 2017 03:35:34 GMT [{"id":144,"name":"Main Appointment Schedule","slotSize":15}, {"id":130,"name":"Main Surgery Schedule","slotSize":30}]
For a schedule to be returned, its Online Booking flag must be ticked.
To get the appointment types applicable to a schedule:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v1/schedules/144/appointmentTypes [{"id":62,"name":"New Patient","slots":2}, {"id":52,"name":"Long Consult","slots":2}, {"id":50,"name":"Standard Consult","slots":1}, {"id":46,"name":"Short Consult","slots":1}]
A number of methods are provided to get free and busy times:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v1/schedules/144/free?from=2016-05-15T00:00:00%2B10:00&to=2016-05-16T00:00:00%2B10:00' [{"start":"2016-05-15T10:30:00.000+10:00","end":"2016-05-15T11:00:00.000+10:00"}, {"start":"2016-05-15T11:30:00.000+10:00","end":"2016-05-15T17:30:00.000+10:00"}]
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v1/schedules/144/busy?from=2016-05-15T00:00:00%2B10:00&to=2016-05-16T00:00:00%2B10:00' [{"start":"2016-05-15T09:00:00.000+10:00","end":"2016-05-15T10:30:00.000+10:00"}, {"start":"2016-05-15T11:00:00.000+10:00","end":"2016-05-15T11:30:00.000+10:00"}]
If you want both free and busy times, its more efficient to do a single call:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v1/schedules/144/freebusy?from=2016-05-15T00:00:00%2B10:00&to=2016-05-16T00:00:00%2B10:00' {"free":[{"start":"2016-05-15T10:30:00.000+10:00","end":"2016-05-15T11:00:00.000+10:00"}, {"start":"2016-05-15T11:30:00.000+10:00","end":"2016-05-15T17:30:00.000+10:00"}], "busy":[{"start":"2016-05-15T09:00:00.000+10:00","end":"2016-05-15T10:30:00.000+10:00"}, {"start":"2016-05-15T11:00:00.000+10:00","end":"2016-05-15T11:30:00.000+10:00"}]}
To return the free and busy times in slots, specify &slots=true e.g.:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v1/schedules/144/free?from=2016-05-15T00:00:00%2B10:00&to=2016-05-16T00:00:00%2B10:00&slots=true' [{"start":"2016-05-15T10:00:00.000+10:00","end":"2016-05-15T10:15:00.000+10:00"}, {"start":"2016-05-15T10:15:00.000+10:00","end":"2016-05-15T10:30:00.000+10:00"}, {"start":"2016-05-15T10:30:00.000+10:00","end":"2016-05-15T10:45:00.000+10:00"}, {"start":"2016-05-15T10:45:00.000+10:00","end":"2016-05-15T11:00:00.000+10:00"}, {"start":"2016-05-15T11:30:00.000+10:00","end":"2016-05-15T11:45:00.000+10:00"}, {"start":"2016-05-15T11:45:00.000+10:00","end":"2016-05-15T12:00:00.000+10:00"}, {"start":"2016-05-15T12:00:00.000+10:00","end":"2016-05-15T12:15:00.000+10:00"}, {"start":"2016-05-15T12:15:00.000+10:00","end":"2016-05-15T12:30:00.000+10:00"}, {"start":"2016-05-15T12:30:00.000+10:00","end":"2016-05-15T12:45:00.000+10:00"}, {"start":"2016-05-15T12:45:00.000+10:00","end":"2016-05-15T13:00:00.000+10:00"}, {"start":"2016-05-15T13:00:00.000+10:00","end":"2016-05-15T13:15:00.000+10:00"}, {"start":"2016-05-15T13:15:00.000+10:00","end":"2016-05-15T13:30:00.000+10:00"}, {"start":"2016-05-15T13:30:00.000+10:00","end":"2016-05-15T13:45:00.000+10:00"}, {"start":"2016-05-15T13:45:00.000+10:00","end":"2016-05-15T14:00:00.000+10:00"}, {"start":"2016-05-15T14:00:00.000+10:00","end":"2016-05-15T14:15:00.000+10:00"}, {"start":"2016-05-15T14:15:00.000+10:00","end":"2016-05-15T14:30:00.000+10:00"}, {"start":"2016-05-15T14:30:00.000+10:00","end":"2016-05-15T14:45:00.000+10:00"}, {"start":"2016-05-15T14:45:00.000+10:00","end":"2016-05-15T15:00:00.000+10:00"}, {"start":"2016-05-15T15:00:00.000+10:00","end":"2016-05-15T15:15:00.000+10:00"}, {"start":"2016-05-15T15:15:00.000+10:00","end":"2016-05-15T15:30:00.000+10:00"}, {"start":"2016-05-15T15:30:00.000+10:00","end":"2016-05-15T15:45:00.000+10:00"}, {"start":"2016-05-15T15:45:00.000+10:00","end":"2016-05-15T16:00:00.000+10:00"}, {"start":"2016-05-15T16:00:00.000+10:00","end":"2016-05-15T16:15:00.000+10:00"}, {"start":"2016-05-15T16:15:00.000+10:00","end":"2016-05-15T16:30:00.000+10:00"}, {"start":"2016-05-15T16:30:00.000+10:00","end":"2016-05-15T16:45:00.000+10:00"}, {"start":"2016-05-15T16:45:00.000+10:00","end":"2016-05-15T17:00:00.000+10:00"}, {"start":"2016-05-15T17:00:00.000+10:00","end":"2016-05-15T17:15:00.000+10:00"}, {"start":"2016-05-15T17:15:00.000+10:00","end":"2016-05-15T17:30:00.000+10:00"}]
> curl -u sample:changeit -H "Content-Type: application/json" --data @booking.json http://localhost:8080/openvpms/ws/booking/v1/bookings
Where booking.json is a file containing:
{ "location": 113, "schedule": 144, "appointmentType": 50, "start": "2016-05-15T10:30:00.000+10:00", "end": "2016-05-15T11:00:00.000+10:00", "title": "Ms", "firstName": "Judith", "lastName": "Bourke", "mobile": "0418976543", "patientName": "Muffett" }
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v1/bookings/603:3:be08f3c6-1afb-11e6-be41-3dbaef689d97
> curl -X DELETE -u sample:changeit http://localhost:8080/openvpms/ws/booking/v1/bookings/391:a98f02c9-1a4b-...
There are a number of security considerations to be aware of:
The OpenVPMS Booking API V2 is a JSON API for making appointments in OpenVPMS.
The following assumes:
The openvpms-booking-api-v2-draft.zip contains API documentation generated by Enunciate. Extract and browse from index.html.
You can also get an overview by browsing http://localhost:8080/openvpms/ws/booking/v2/application.wadl
To get the locations:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/locations [{"id":106,"name":"Branch Clinic","timeZone":"Australia/Sydney"}, {"id":98,"name":"Main Clinic","timeZone":"Australia/Sydney"}]
To get the schedules available at a location:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/locations/98/schedules [{"id":136,"name":"Main Appointment Schedule","slotSize":15}, {"id":211,"name":"Main Surgery Schedule","slotSize":30}]
To get the appointment types applicable to a schedule:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/schedules/136/appointmentTypes [{"id":79,"name":"Short Consult","slots":1}, {"id":66,"name":"Standard Consult","slots":1}, {"id":63,"name":"Long Consult","slots":2}, {"id":76,"name":"New Patient","slots":2}]
A number of methods are provided to get free and busy times:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v2/schedules/136/free?from=2019-02-15T00:00:00%2B11:00&to=2019-02-16T00:00:00%2B11:00' [{"start":"2019-02-15T09:00:00.000+11:00","end":"2019-02-15T10:45:00.000+11:00"}, {"start":"2019-02-15T11:30:00.000+11:00","end":"2019-02-15T17:30:00.000+11:00"}]
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v2/schedules/136/busy?from=2019-02-15T00:00:00%2B11:00&to=2019-02-16T00:00:00%2B11:00' [{"start":"2019-02-15T10:45:00.000+11:00","end":"2019-02-15T11:30:00.000+11:00"}]
If you want both free and busy times, its more efficient to do a single call:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v2/schedules/136/freebusy?from=2019-02-15T00:00:00%2B11:00&to=2019-02-16T00:00:00%2B11:00' {"free":[{"start":"2019-02-15T09:00:00.000+11:00","end":"2019-02-15T10:45:00.000+11:00"},{"start":"2019-02-15T11:30:00.000+11:00","end":"2019-02-15T17:30:00.000+11:00"}], "busy":[{"start":"2019-02-15T10:45:00.000+11:00","end":"2019-02-15T11:30:00.000+11:00"}]}
To return the free and busy times in slots, specify &slots=true e.g.:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v2/schedules/136/free?from=2019-02-15T00:00:00%2B11:00&to=2019-02-16T00:00:00%2B11:00&slots=true' [{"start":"2019-02-15T09:00:00.000+11:00","end":"2019-02-15T09:15:00.000+11:00"}, {"start":"2019-02-15T09:15:00.000+11:00","end":"2019-02-15T09:30:00.000+11:00"}, {"start":"2019-02-15T09:30:00.000+11:00","end":"2019-02-15T09:45:00.000+11:00"}, {"start":"2019-02-15T09:45:00.000+11:00","end":"2019-02-15T10:00:00.000+11:00"}, {"start":"2019-02-15T10:00:00.000+11:00","end":"2019-02-15T10:15:00.000+11:00"}, {"start":"2019-02-15T10:15:00.000+11:00","end":"2019-02-15T10:30:00.000+11:00"}, {"start":"2019-02-15T10:30:00.000+11:00","end":"2019-02-15T10:45:00.000+11:00"}, {"start":"2019-02-15T11:30:00.000+11:00","end":"2019-02-15T11:45:00.000+11:00"}, {"start":"2019-02-15T11:45:00.000+11:00","end":"2019-02-15T12:00:00.000+11:00"}, {"start":"2019-02-15T12:00:00.000+11:00","end":"2019-02-15T12:15:00.000+11:00"}, {"start":"2019-02-15T12:15:00.000+11:00","end":"2019-02-15T12:30:00.000+11:00"}, {"start":"2019-02-15T12:30:00.000+11:00","end":"2019-02-15T12:45:00.000+11:00"}, {"start":"2019-02-15T12:45:00.000+11:00","end":"2019-02-15T13:00:00.000+11:00"}, {"start":"2019-02-15T13:00:00.000+11:00","end":"2019-02-15T13:15:00.000+11:00"}, {"start":"2019-02-15T13:15:00.000+11:00","end":"2019-02-15T13:30:00.000+11:00"}, {"start":"2019-02-15T13:30:00.000+11:00","end":"2019-02-15T13:45:00.000+11:00"}, {"start":"2019-02-15T13:45:00.000+11:00","end":"2019-02-15T14:00:00.000+11:00"}, {"start":"2019-02-15T14:00:00.000+11:00","end":"2019-02-15T14:15:00.000+11:00"}, {"start":"2019-02-15T14:15:00.000+11:00","end":"2019-02-15T14:30:00.000+11:00"}, {"start":"2019-02-15T14:30:00.000+11:00","end":"2019-02-15T14:45:00.000+11:00"}, {"start":"2019-02-15T14:45:00.000+11:00","end":"2019-02-15T15:00:00.000+11:00"}, {"start":"2019-02-15T15:00:00.000+11:00","end":"2019-02-15T15:15:00.000+11:00"}, {"start":"2019-02-15T15:15:00.000+11:00","end":"2019-02-15T15:30:00.000+11:00"}, {"start":"2019-02-15T15:30:00.000+11:00","end":"2019-02-15T15:45:00.000+11:00"},{"start":"2019-02-15T15:45:00.000+11:00","end":"2019-02-15T16:00:00.000+11:00"},{"start":"2019-02-15T16:00:00.000+11:00","end":"2019-02-15T16:15:00.000+11:00"},{"start":"2019-02-15T16:15:00.000+11:00","end":"2019-02-15T16:30:00.000+11:00"},{"start":"2019-02-15T16:30:00.000+11:00","end":"2019-02-15T16:45:00.000+11:00"},{"start":"2019-02-15T16:45:00.000+11:00","end":"2019-02-15T17:00:00.000+11:00"},{"start":"2019-02-15T17:00:00.000+11:00","end":"2019-02-15T17:15:00.000+11:00"},{"start":"2019-02-15T17:15:00.000+11:00","end":"2019-02-15T17:30:00.000+11:00"}]
Clinician users can be be scheduled for appointments, subject to their availability at a Practice Location.
To determine the users available at a practice location:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/locations/98/users [{"id":1158,"name":"Andrew Turner"}, {"id":1159,"name":"Chris Barton"}]
To determine which locations a user may be available at:
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/users/1158/locations [{"id":106,"name":"Branch Clinic","timeZone":"Australia/Sydney"}, {"id":98,"name":"Main Clinic","timeZone":"Australia/Sydney"}]
To determine user availability at a Practice Location, and which schedules they may be assigned appointments to:
> curl -u sample:changeit 'http://localhost:8080/openvpms/ws/booking/v2/users/1158/locations/98/free?from=2019-02-15T00:00:00%2B11:00&to=2019-02-16T00:00:00%2B11:00' [{"start":"2019-02-15T11:00:00.000+11:00","end":"2019-02-15T17:00:00.000+11:00","schedule":136}, {"start":"2019-02-15T09:00:00.000+11:00","end":"2019-02-15T17:00:00.000+11:00","schedule":211}
To determine the times a user is available, the union of busy times needs to be removed from each schedule.
> curl -u sample:changeit -H "Content-Type: application/json" --data @booking.json http://localhost:8080/openvpms/ws/booking/v2/bookings
Where booking.json is a file containing:
{ "location": 98, "schedule": 136, "appointmentType": 66, "start": "2019-02-15T12:30:00.000+11:00", "end": "2019-02-15T12:45:00.000+11:00", "title": "Ms", "firstName": "Judith", "lastName": "Bourke", "mobile": "0418976543", "patientName": "Muffett" "user": 1158 }
> curl -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/bookings/603:3:be08f3c6-1afb-11e6-be41-3dbaef689d97
> curl -X DELETE -u sample:changeit http://localhost:8080/openvpms/ws/booking/v2/bookings/391:a98f02c9-1a4b-...
There are a number of security considerations to be aware of:
OpenVPMS ESCI (e-Supply Chain Interface) is a standards-based API to enable OpenVPMS to place orders and receive order responses and invoices to and from suppliers electronically.
It is based on the exchange of Universal Business Language (UBL) 2.0 documents via web services.
The 1.0 release of ESCI is available for download at:
This contains:
This release includes some minor improvements to the integration guide.
Please post any comments or queries to the Developers forum: http://www.openvpms.org/category/forums/developers/general-developers-di...
NOTE: This documentation applies to an earlier version of OpenVPMS, and needs to be updated.
OpenVPMS is now typically built with IntelliJ idea, you can still use any other IDE but IntelliJ is quite a full featured IDE specifically built for Java (it does do other languages)
Setting up IntelliJ for OpenVPMS is pretty straight forward.
1. You will an installation of MAVEN - currently OpenVPMS needs a prerequesite maven version of atleast 2.2.1 but you can use higher version successfully.
2. You will need a Java Development Kit installed - choose an appropriate version. Generally later versions are backward compatible but there may be specific compile time bugs that need working through.
3. Run through File - Settings in intellij to configure the environment properly.
The page
http://www.openvpms.org/documentation/getting-started-openvpms
details checking out OpenVPMS using maven and subversion - keep in mind you probably dont have permission to commit back to the OpenVPMS repo, so you are going to want to configure your own versioning system locally and or remotely.
Choose from GIT, SVN or Mecurial as IntelliJ supports these by default.
GIT may be a good choice because by default you can use it to checkout a SVN project with a complete history using
git svn --help
It checkouts the project and creates a GIT repo locally in one go.
IntelliJ supports running maven commands from within the IDE
You may wish to install a number of 3rd Party Plugins into Intellij
1. Atlassian Connector for IntelliJ idea
2. Maven Helper
3. Maven Test Helper.
4. .ignore
These are not required but they can provide extra information from within the IDE
Once you have imported all the projects into IntelliJ you can use the MAVEN PROJECTS window to run maven goals that are listed on other pages in this book.
NOTE: This applies to an earlier version of OpenVPMS, and needs to be updated.
This might be of some use to users wanting to create reports: a list of tables used within OpenVPMS along with a description of each (field name, type etc).