-
Notifications
You must be signed in to change notification settings - Fork 1
/
oh-api.bat
executable file
·96 lines (79 loc) · 2.5 KB
/
oh-api.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@echo off
REM # Open Hospital (www.open-hospital.org)
REM # Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org)
REM #
REM # Open Hospital is a free and open source software for healthcare data management.
REM #
REM # This program is free software: you can redistribute it and/or modify
REM # it under the terms of the GNU General Public License as published by
REM # the Free Software Foundation, either version 3 of the License, or
REM # (at your option) any later version.
REM #
REM # https://www.gnu.org/licenses/gpl-3.0-standalone.html
REM #
REM # This program is distributed in the hope that it will be useful,
REM # but WITHOUT ANY WARRANTY; without even the implied warranty of
REM # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
REM # GNU General Public License for more details.
REM #
REM # You should have received a copy of the GNU General Public License
REM # along with this program. If not, see <http://www.gnu.org/licenses/>.
REM #
REM ################### Script configuration ###################
REM
REM launch oh.bat -h to see available options
REM
REM -> default startup script called is oh-api.ps1 (powershell) <-
REM
REM ############################################################
REM ###### Functions and script start
goto :init
:header
echo.
echo Open Hospital startup script
echo %__BAT_NAME% v%__SCRIPTVERSION%
echo.
goto :eof
:usage
echo USAGE:
echo %__BAT_NAME% [-option]
echo.
echo. -h, -?, --help shows this help
goto :eof
:init
set "__SCRIPTVERSION=1.0"
set "__BAT_FILE=%~0"
set "__BAT_PATH=%~dp0"
set "__BAT_NAME=%~nx0"
:parse
if "%~1"=="" goto :main
if /i "%~1"=="/?" call :header & call :usage & goto :end
if /i "%~1"=="-?" call :header & call :usage & goto :end
if /i "%~1"=="-h" call :header & call :usage & goto :end
if /i "%~1"=="-help" call :header & call :usage & goto :end
if /i "%~1"=="--help" call :header & call :usage & goto :end
shift
goto :parse
:main
REM ################### oh-api.ps1 ###################
REM default startup script called: oh.ps1
echo Starting OH with oh.ps1...
REM launch powershell script
powershell.exe -ExecutionPolicy Bypass -File ./oh-api.ps1
goto end
:error
echo Error starting Open Hospital, exiting.
cd /d %OH_PATH%
goto end
:end
call :cleanup
exit /B
:cleanup
REM The cleanup function is only really necessary if you
REM are _not_ using SETLOCAL.
set "__SCRIPTVERSION="
set "__BAT_FILE="
set "__BAT_PATH="
set "__BAT_NAME="
set "LEGACYMODE="
goto :eof