{"id":42866950,"url":"https://github.com/informatici/openhospital-api","last_synced_at":"2026-01-30T12:49:27.584Z","repository":{"id":39979280,"uuid":"208050596","full_name":"informatici/openhospital-api","owner":"informatici","description":"Open Hospital API","archived":false,"fork":false,"pushed_at":"2026-01-19T22:31:51.000Z","size":5545,"stargazers_count":38,"open_issues_count":12,"forks_count":76,"subscribers_count":16,"default_branch":"develop","last_synced_at":"2026-01-20T05:38:50.963Z","etag":null,"topics":["healthcare","java","openhospital","rest-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/informatici.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-09-12T12:52:38.000Z","updated_at":"2026-01-15T13:36:23.000Z","dependencies_parsed_at":"2024-03-14T12:28:28.827Z","dependency_job_id":"156d8d90-f26b-46ea-917c-5c5213455c49","html_url":"https://github.com/informatici/openhospital-api","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/informatici/openhospital-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/informatici%2Fopenhospital-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/informatici%2Fopenhospital-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/informatici%2Fopenhospital-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/informatici%2Fopenhospital-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/informatici","download_url":"https://codeload.github.com/informatici/openhospital-api/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/informatici%2Fopenhospital-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28912927,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["healthcare","java","openhospital","rest-api"],"created_at":"2026-01-30T12:49:26.851Z","updated_at":"2026-01-30T12:49:27.567Z","avatar_url":"https://github.com/informatici.png","language":"Java","readme":"# Open Hospital API\n\n[![Java CI with Maven](https://github.com/informatici/openhospital-api/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/informatici/openhospital-api/actions?query=workflow%3A%22Java+CI+with+Maven%22)\n\nThis is the API project of [Open Hospital][openhospital]: it exposes a REST API of the business logic implemented in the [openhospital-core project][core].\n\n## Summary\n\n  * [How to build [WIP]](#how-to-build-wip)\n    + [Using Swagger-UI](#using-swagger-ui)\n    + [Using Postman](#using-postman)\n  * [How to build a war file](#how-to-build-a-war-file)\n  * [How to deploy backend in docker environment](#how-to-deploy-backend-in-docker-environment)\n  * [How to generate openapi specs](#how-to-generate-openapi-specs)\n  * [Cleaning](#cleaning)\n  * [How to contribute](#how-to-contribute)\n  * [Community](#community)\n  * [Code style](#code-style)\n\n\u003csmall\u003eTable of contents generated with \u003ci\u003e\u003ca href='http://ecotrust-canada.github.io/markdown-toc/'\u003emarkdown-toc\u003c/a\u003e\u003c/i\u003e\u003c/small\u003e\n\n\n## How to build [WIP]\n\nFor the moment, to build this project you should \n\n 1. fetch and build the [core] project\n    \n        git clone https://github.com/informatici/openhospital-core.git\n        cd openhospital-core\n        mvn clean install -DskipTests=true\n        \n 2. clone and build this project\n \n        git clone https://github.com/informatici/openhospital-api\n        cd openhospital-api\n        mvn clean install -DskipTests=true\n        \n 3. prepare settings from each rsc/*.dist file\n \n        rsc/application.properties \u003c- set a SHA-256 jwt token\n        rsc/database.properties\n        rsc/log4j2-spring.properties\n        rsc/...\n        \n 4. set target/rsc/database.properties\n \n        DB can be created with `docker-compose up` from `openhospital-core` or using a dedicated MySQL server\n        \n 5. start openhospital-api (in `target` folder)\n \n        # Windows\n        java -cp \"openhospital-api-0.1.0.jar;rsc/;static/\" org.springframework.boot.loader.launch.JarLauncher\n\n        # Linux\n        java -cp \"openhospital-api-0.1.0.jar:rsc/:static/\" org.springframework.boot.loader.launch.JarLauncher\n        \n 6. call services\n    - URL base: http://localhost:8080\n    - URL login: http://localhost:8080/auth/login\n    - URL patients: http://localhost:8080/patients\n    - URL swagger: http://localhost:8080/swagger-ui/index.html\n\nYou can see Swagger API Documentation at: http://localhost:8080/swagger-ui/index.html\n\n 7. enable LAN networking\n\n        # set in application.properties\n        ...\n        server.address=0.0.0.0 # or the machine server IP\n        ...\n\n![image](https://github.com/informatici/openhospital-api/assets/2938553/ea855a4a-2a57-4b6e-aa62-f218d4937ed8)\n\n### Using Swagger-UI\n\n 1. use endpoint /auth/login to login and get the token\n \n![image](https://github.com/informatici/openhospital-api/assets/2938553/d77d88a7-893d-4163-a89d-06c0bbdccb4b)\n![image](https://github.com/informatici/openhospital-api/assets/2938553/ce1a6ace-b4db-4672-9f36-b6d5aefc005f)\n\n 2. use the Authorize button at the top of the Swagger-UI, paste the token from step #1 and click Authorize\n\n![image](https://github.com/informatici/openhospital-api/assets/2938553/388450d5-7b8b-4f54-8210-ef37e5f85324)\n \n 3. close the dialog\n\n![image](https://github.com/informatici/openhospital-api/assets/2938553/787546c1-8378-4aac-99a1-ace2e28af160)\n\n 4. now all the endpoints are automatically secured and the token will be added to the request\n\n![image](https://github.com/informatici/openhospital-api/assets/2938553/131aa220-b134-4afc-a508-5e369427c0b8)\n\n### Using Postman\n\n 1. import postman_collection.json in your Postman installation\n \n## How to build a war file\n\n 1. Prepare settings from each `rsc/*.dist` file \n\n ```\n ### Note: \n ### server.address, server.port, server.servlet.context-path and server.tomcat.accesslog.* will be ignored\n ### jwt.token.secret \u003c- set a SHA-256 jwt token\n ### api.host \u003c- set and add /openhospital-api-0.1.0 (\u003cartifactId\u003e-\u003cversion\u003e) or any /\u003cappname\u003e that will match \u003cappname\u003e.war\n rsc/application.properties\n \n ### note: if the DB is on the host, use 'host.docker.internal' as hostname\n rsc/database.properties\n \n ### note: if the DB is on the host, use 'host.docker.internal' as DBSERVER\n rsc/log4j2-spring.properties\n \n ### as required in [Admin Doc](https://github.com/informatici/openhospital-doc/blob/develop/doc_admin/AdminManual.adoc#settings-properties)\n rsc/settings.properties\n ```\n \n 2. Build war file\n \n ```\n ### OH-core must have been built and available in .m2 (Maven) repo\n ./mvnw clean install -DskipTests=true -P war\n ```\n \n 3. (Optional) rename war to the desired `\u003cappname\u003e.war`:\n \n ```\n mv /target/openhospital-api-0.1.0.war \u003cappname\u003e.war\n ```\n \n## How to deploy backend in Docker environment\n\nMake sure you have docker with docker-compose installed, then run the following commands:\n\n- copy `dotenv` file into `.env` and set variables as needed (the SHA-256 jwt token is needed)\n- run `make`\n- run `docker compose up -d database` (wait for some seconds the very first time to build the DB)\n- (optional - demo data after set the database container, English only) run `docker compose run --rm oh-database-init`\n- run `docker compose up backend`\n\nWhen done successfully, head over at http://localhost:[API_PORT]/swagger-ui/index.html\n\nYou can change the deployment branch using the .env file.\n\nNOTE: \n\n- API should be already available from LAN at http://your-server-ip:[API_PORT]\n- Swagger will be available at http://[API_HOST]:[API_PORT]/swagger-ui/index.html\n\n## How to generate openapi specs\n\nMake sure to have API started without errors.\n\nRun the Maven command and it will overwrite the `openapi/oh.yaml`\n\n\tmvn springdoc-openapi:generate\n\t\nTo redirect the output to another file, use:\n\n\tmvn springdoc-openapi:generate -Dspringdoc.outputFileName=my_revision.yaml\n\t\n\n## Cleaning\n\n\tdocker compose rm --stop --volumes --force\n\tmake clean\n\tmake clean-all # remove deps/ folder\n\n\n## How to contribute\n\nYou can find the contribution guidelines in the [Open Hospital wiki][contribution-guide].  \nA list of open issues is available on [Jira][jira].\n\n## Community\n\nYou can reach out to the community of contributors by joining \nour [Slack workspace][slack] or by subscribing to our [mailing list][ml].\n\n\n## Code style\n\nThis project uses a consistent code style and provides definitions for use in both IntelliJ and Eclipse IDEs.\n\n\u003cdetails\u003e\u003csummary\u003eIntelliJ IDEA instructions\u003c/summary\u003e\n\nFor IntelliJ IDEA the process for importing the code style is:\n\n* Select *Settings* in the *File* menu\n* Select *Editor*\n* Select *Code Style*\n* Expand the menu item and select *Java*\n* Go to *Scheme* at the top, click on the setting button by the side of the drop-down list\n* Select *Import Scheme*\n* Select *IntelliJ IDE code style XML*\n* Navigate to the location of the file which relative to the project root is:  `.ide-settings/idea/OpenHospital-code-style-configuration.xml`\n* Select *OK* \n* At this point the code style is stored as part of the IDE and is used for **all** projects opened in the editor.  To restrict the settings to just this project again select the setting button by the side of the *Scheme* list and select *Copy to Project...*. If successful a notice appears in the window that reads: *For current project*.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003eEclipse instructions\u003c/summary\u003e\n\nFor Eclipse the process requires loading the formatting style and the import order separately.\n\n* Select *Preferences* in the *Window* menu\n* Select *Java*\n* Select *Code Style* and expand the menu\n* Select *Formatter*\n* Select the *Import...* button\n* Navigate to the location of the file which relative to the project root is:  `.ide-settings/eclipse/OpenHospital-Java-CodeStyle-Formatter.xml`\n* Select *Open*\n* 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*.\n* Back in the *Code Style* menu area, select *Organize Imports*\n* Select *Import...*\n* Navigate to the location of the file which relative to the project root is:  `.ide-settings/eclipse/OpenHospital.importorder`\n* Select *Open*\n* 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...*\n \n\u003c/details\u003e \n\n[openhospital]: https://www.open-hospital.org/\n[core]: https://github.com/informatici/openhospital-core\n[contribution-guide]: https://openhospital.atlassian.net/wiki/display/OH/Contribution+Guidelines\n[jira]: https://openhospital.atlassian.net/jira/software/c/projects/OP/issues/\n[slack]: https://join.slack.com/t/openhospitalworkspace/shared_invite/enQtOTc1Nzc0MzE2NjQ0LWIyMzRlZTU5NmNlMjE2MDcwM2FhMjRkNmM4YzI0MTAzYTA0YTI3NjZiOTVhMDZlNWUwNWEzMjE5ZDgzNWQ1YzE\n[ml]: https://sourceforge.net/projects/openhospital/lists/openhospital-devel\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformatici%2Fopenhospital-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finformatici%2Fopenhospital-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finformatici%2Fopenhospital-api/lists"}