Open Hospital API
This is the API project of Open Hospital: it exposes a REST API of the business logic implemented in the openhospital-core project.
For the moment, to build this project you should
- fetch and build the core project
git clone https://github.com/informatici/openhospital-core.git
cd openhospital-core
mvn clean install -DskipTests=true
- clone and build this project
git clone https://github.com/informatici/openhospital-api
cd openhospital-api
mvn clean install -DskipTests=true
- call services
URL base: localhost:8080/oh-api/patients
URL swagger: http://localhost:8080/oh-api/swagger-ui.html
- set rsc/database.properties
DB can be created with `docker-compose up` from `openhospital-core` or using a dedicated MySQL server
- start openhospital-api
java -jar openhospital-api-<version>.jar
Service available on localhost:8080
This project uses a consistent code style and provides definitions for use in both IntelliJ and Eclipse IDEs.
IntelliJ IDEA instructions
For IntelliJ IDEA the process for importing the code style is:Eclipse instructions
For Eclipse the process requires loading the formatting style and the import order separately.
- Select Preferences in the Window menu
- Select Java
- Select Code Style and expand the menu
- Select Formatter
- Select the Import... button
- Navigate to the location of the file which relative to the project root is:
.ide-settings/eclipse/OpenHospital-Java-CodeStyle-Formatter.xml
- Select Open
- At this point the code style is stored and is applicable to all projects opened in the IDE. To restrict the settings just to this project select Configure Project Specific Settings... in the upper right. In the next dialog select the openhospital repository and select OK. In the next dialog select the Enable project specific settings checkbox. Finally select Apply and Close.
- Back in the Code Style menu area, select Organize Imports
- Select Import...
- Navigate to the location of the file which relative to the project root is:
.ide-settings/eclipse/OpenHospital.importorder
- Select Open
- As with the formatting styles the import order is applicable to all projects. In order to change it just for this project repeat the same steps as above for Configure Project Specific Settings...