-
Notifications
You must be signed in to change notification settings - Fork 1
/
ImportRG.cmake.in
82 lines (77 loc) · 4.15 KB
/
ImportRG.cmake.in
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
#---------------------------------------------------------------------------
# Copyright 2011 The Open Source Electronic Health Record Agent
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#---------------------------------------------------------------------------
macro(CheckResult Result Message)
if(NOT "${Result}" EQUAL 0)
message(FATAL_ERROR "ERROR: ${Message}")
endif()
endmacro()
set(SETUP_SITE "@VISTA_SETUP_SITE@")
if(EXISTS "@ccontrol@")
message(STATUS "Stopping cache instance @INSTANCE@")
execute_process( COMMAND "@ccontrol@" stop @INSTANCE@ quietly)
message(STATUS "Replacing @VISTA_Path@/CACHE.DAT")
file(COPY @PRISTINE_CACHE_DAT_PATH@/CACHE.DAT DESTINATION @VISTA_Path@)
message(STATUS "Starting cache instance @INSTANCE@")
execute_process(COMMAND "@ccontrol@" start @INSTANCE@)
else()
message(STATUS "Removing database.dat in Directory @VISTA_GLOBALS_DIR@")
file(REMOVE @VISTA_GLOBALS_DIR@/database.dat )
message(STATUS "Removing Routine files from @VISTA_ROUTINE_DIR@")
file(REMOVE_RECURSE @VISTA_ROUTINE_DIR@/)
file(MAKE_DIRECTORY @VISTA_ROUTINE_DIR@)
message(STATUS "Creating a new database.dat in @VISTA_GLOBALS_DIR@")
execute_process(COMMAND "mupip" create WORKING_DIRECTORY @VISTA_GLOBALS_DIR@/ RESULT_VARIABLE return )
CheckResult(return "mupip create Failed")
execute_process(COMMAND "dse" change -f -key_max=1023 -rec=4096 WORKING_DIRECTORY @VISTA_GLOBALS_DIR@/ RESULT_VARIABLE return )
CheckResult(return "Database Configuration Failed")
if(SETUP_SITE)
message(STATUS "Copying @VISTA_SOURCE_DIR@/Patches/ZTLOAD1.m into @OSEHRA_PATH@/Packages/Kernel/Routines/")
file(COPY @VISTA_SOURCE_DIR@/Patches/ZTLOAD1.m DESTINATION "@OSEHRA_PATH@/Packages/Kernel/Routines/")
endif()
endif()
message(STATUS "Collecting routines...")
execute_process(COMMAND "@GIT_EXECUTABLE@" ls-files "*.m" COMMAND "@PYTHON_EXECUTABLE@" Scripts/PackRO.py WORKING_DIRECTORY @OSEHRA_PATH@ OUTPUT_FILE routines.ro RESULT_VARIABLE return )
CheckResult(return "Routine Pack Failed")
message(STATUS "Collecting globals...")
execute_process(COMMAND "@GIT_EXECUTABLE@" ls-files "*.zwr" WORKING_DIRECTORY @OSEHRA_PATH@ OUTPUT_FILE globals.lst RESULT_VARIABLE return )
CheckResult(return "Global Pack Failed")
file(MAKE_DIRECTORY "@VISTA_BINARY_DIR@/Testing/Log")
message(STATUS "Importing Routines...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/RoutineImport.py" RESULT_VARIABLE return )
CheckResult(return "Routine Import Failed")
message(STATUS "Importing globals...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/GlobalImport.py" RESULT_VARIABLE return )
CheckResult(return "Global Import Failed")
if(EXISTS "@ccontrol@")
message(STATUS "Initializing VistA...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/Initialize.py" )
endif()
if(SETUP_SITE)
message(STATUS "Running PostImportSetup script...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/PostImportSetupScript.py" RESULT_VARIABLE return )
CheckResult(return "Post Import Setup Failed")
message(STATUS "Running ImportUsers script...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/importUsers.py" RESULT_VARIABLE return )
CheckResult(return "ImportUsers Failed")
message(STATUS "Running ClinicSetup script...")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/ClinicSetup.py" RESULT_VARIABLE return )
CheckResult(return "ClinicSetup Failed")
endif()
set(INSTALL_MUNIT "@INSTALL_MUNIT@")
if(EXISTS @MUNIT_KIDS_FILE@ AND INSTALL_MUNIT)
message(STATUS "Installing MUnit Kids Build")
execute_process(COMMAND "@PYTHON_EXECUTABLE@" "@VISTA_BINARY_DIR@/@MUNIT_INSTALLATION_SCRIPT@" RESULT_VARIABLE return)
endif()