From f13db2d4162c142da377ddcc4da3a9fd5360cb17 Mon Sep 17 00:00:00 2001 From: Piotr Mankowski Date: Thu, 14 Oct 2021 16:04:08 -0700 Subject: [PATCH] Server setup updates (#34) * Updates for sedish server * HAPI config updates --- .env | 2 - .gitignore | 2 + configs/opencr-hapi/.env.template | 4 + configs/opencr-hapi/hapi.properties.template | 5 - configs/opencr/config_docker_template.json | 2 +- configs/opencr/mediator.json | 6 +- configs/shr/.env.template | 4 + configs/shr/hapi.properties.template | 165 ------------------- docker-compose.yml | 17 +- 9 files changed, 22 insertions(+), 185 deletions(-) create mode 100644 configs/opencr-hapi/.env.template delete mode 100644 configs/opencr-hapi/hapi.properties.template create mode 100644 configs/shr/.env.template delete mode 100644 configs/shr/hapi.properties.template diff --git a/.env b/.env index ff94caed..cb1a91b2 100644 --- a/.env +++ b/.env @@ -15,5 +15,3 @@ OPENHIM_PORT=9201 ISANTEPLUS_DB_PORT=3307 OPENMRS_DB_PORT=3308 - - diff --git a/.gitignore b/.gitignore index 5d0f2efa..c86697be 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,5 @@ server/log *.log hapi.properties +configs/shr/.env +configs/opencr-hapi/.env diff --git a/configs/opencr-hapi/.env.template b/configs/opencr-hapi/.env.template new file mode 100644 index 00000000..deeb84da --- /dev/null +++ b/configs/opencr-hapi/.env.template @@ -0,0 +1,4 @@ +SHR_DATABASE_URL= +SHR_DATABASE_USERNAME= +SHR_DATABASE_PW= +JAVA_OPTS='-Dspring.datasource.url=${SHR_DATABASE_URL} -Dspring.datasource.username=${SHR_DATABASE_USERNAME} -Dspring.datasource.password=${SHR_DATABASE_PW} -Dspring.datasource.driverClassName=org.postgresql.Driver' diff --git a/configs/opencr-hapi/hapi.properties.template b/configs/opencr-hapi/hapi.properties.template deleted file mode 100644 index 3638cbd6..00000000 --- a/configs/opencr-hapi/hapi.properties.template +++ /dev/null @@ -1,5 +0,0 @@ -datasource.driver=org.postgresql.Driver -datasource.url= -hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect -datasource.username= -datasource.password= \ No newline at end of file diff --git a/configs/opencr/config_docker_template.json b/configs/opencr/config_docker_template.json index bc778646..1ba77370 100644 --- a/configs/opencr/config_docker_template.json +++ b/configs/opencr/config_docker_template.json @@ -73,7 +73,7 @@ } }, "sync": { - "lastFHIR2ESSync": "2021-10-03T02:16:30" + "lastFHIR2ESSync": "2021-10-14T18:31:24" }, "__comments": { "matching.tool": "this tells if the app should use mediator algorithms or elasticsearch algorithms for matching, two options mediator and elasticsearch" diff --git a/configs/opencr/mediator.json b/configs/opencr/mediator.json index 90b07e7e..de8607c7 100644 --- a/configs/opencr/mediator.json +++ b/configs/opencr/mediator.json @@ -1,13 +1,11 @@ { "urn": "urn:uuid:4bc42b2f-b5a8-473d-8207-5dd5c61f0c4a", - "version": "1.0.0", + "version": "1.0.3", "name": "Client Registry", "description": "Haiti Client Registry", "config": { "fhirServer": { - "username": "hapi", - "password": "hapi", - "baseURL": "http://opencr-fhir/fhir" + "baseURL": "http://opencr-fhir:8080/fhir" }, "elastic": { "server": "http://es:9200", diff --git a/configs/shr/.env.template b/configs/shr/.env.template new file mode 100644 index 00000000..deeb84da --- /dev/null +++ b/configs/shr/.env.template @@ -0,0 +1,4 @@ +SHR_DATABASE_URL= +SHR_DATABASE_USERNAME= +SHR_DATABASE_PW= +JAVA_OPTS='-Dspring.datasource.url=${SHR_DATABASE_URL} -Dspring.datasource.username=${SHR_DATABASE_USERNAME} -Dspring.datasource.password=${SHR_DATABASE_PW} -Dspring.datasource.driverClassName=org.postgresql.Driver' diff --git a/configs/shr/hapi.properties.template b/configs/shr/hapi.properties.template deleted file mode 100644 index 9d39b53d..00000000 --- a/configs/shr/hapi.properties.template +++ /dev/null @@ -1,165 +0,0 @@ -# Adjust this to set the version of FHIR supported by this server. See -# FhirVersionEnum for a list of available constants. Example values include -# DSTU2, DSTU3, R4. -fhir_version=R4 - -# This is the address that the FHIR server will report as its own address. -# If this server will be deployed (for example) to an internet accessible -# server, put the DNS name of that server here. -# -# Note that this is also the address that the hapi-fhir-testpage-overlay -# (the web UI similar to the one at http://hapi.fhir.org) will use to -# connect internally to the FHIR server, so this also needs to be a name -# accessible from the server itself. -server_address=http://shr-fhir.sedish-haiti.org/hapi-fhir-jpaserver/fhir/ - -enable_index_missing_fields=false -auto_create_placeholder_reference_targets=false -enforce_referential_integrity_on_write=false -enforce_referential_integrity_on_delete=false -default_encoding=JSON -etag_support=ENABLED -reuse_cached_search_results_millis=60000 -retain_cached_searches_mins=60 -default_page_size=20 -max_page_size=200 -allow_override_default_search_params=true -allow_contains_searches=true -allow_multiple_delete=true -allow_external_references=true -allow_cascading_deletes=true -allow_placeholder_references=false -expunge_enabled=true -persistence_unit_name=HAPI_PU -logger.name=fhirtest.access -logger.format=Path[${servletPath}] Source[${requestHeader.x-forwarded-for}] Operation[${operationType} ${operationName} ${idOrResourceName}] UA[${requestHeader.user-agent}] Params[${requestParameters}] ResponseEncoding[${responseEncodingNoDefault}] -logger.error_format=ERROR - ${requestVerb} ${requestUrl} -logger.log_exceptions=true - -server.name=SHR FHIR Server -server.id=home -test.port= - -################################################### -# Binary Storage (104857600 = 100mb) -################################################### -max_binary_size=104857600 - -################################################### -# Validation -################################################### -# Should all incoming requests be validated -validation.requests.enabled=false -# Should outgoing responses be validated -validation.responses.enabled=false - -################################################### -# Search Features -################################################### -filter_search.enabled=true -graphql.enabled=true -# See FhirPathFilterInterceptor -fhirpath_interceptor.enabled=false - -################################################### -# Supported Resources -################################################### -# Enable the following property if you want to customize the -# list of resources that is supported by the server (i.e. to -# disable specific resources) -#supported_resource_types=Patient,Observation,Encounter - -################################################### -# Database Settings -################################################### -datasource.driver=org.postgresql.Driver -datasource.url= -hibernate.dialect=org.hibernate.dialect.PostgreSQL95Dialect -datasource.username= -datasource.password= - -#datasource.driver=com.mysql.jdbc.Driver -#datasource.url=jdbc:mysql://shr-db:3306/shr -#hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect -#datasource.username=shr -#datasource.password=shr - -hibernate.search.model_mapping=ca.uhn.fhir.jpa.search.LuceneSearchMappingFactory -hibernate.format_sql=false -hibernate.show_sql=false -hibernate.hbm2ddl.auto=update -hibernate.jdbc.batch_size=20 -hibernate.cache.use_query_cache=false -hibernate.cache.use_second_level_cache=false -hibernate.cache.use_structured_entries=false -hibernate.cache.use_minimal_puts=false -hibernate.search.default.directory_provider=filesystem -hibernate.search.default.indexBase=target/lucenefiles -hibernate.search.lucene_version=LUCENE_CURRENT -tester.config.refuse_to_fetch_third_party_urls=false - -################################################## -# ElasticSearch -# Note that using ElasticSearch is disabled by -# default and the server will use Lucene instead. -################################################## -elasticsearch.enabled=false -elasticsearch.rest_url=http://localhost:9200 -elasticsearch.username=SomeUsername -elasticsearch.password=SomePassword -elasticsearch.required_index_status=YELLOW -elasticsearch.schema_management_strategy=CREATE -# Immediately refresh indexes after every write. This is very bad for -# performance, but can be helpful for testing. -elasticsearch.debug.refresh_after_write=false -elasticsearch.debug.pretty_print_json_log=false - - -################################################## -# Binary Storage Operations -################################################## -binary_storage.enabled=true - -################################################## -# Bulk Data Specification -################################################## -bulk.export.enabled=true - -################################################## -# CORS Settings -################################################## -cors.enabled=true -cors.allowCredentials=true -# Supports multiple, comma separated allowed origin entries -# cors.allowed_origin=http://localhost:8080,https://localhost:8080,https://fhirtest.uhn.ca -cors.allowed_origin=* - -################################################## -# Allowed Bundle Types for persistence (defaults are: COLLECTION,DOCUMENT,MESSAGE) -################################################## -#allowed_bundle_types=COLLECTION,DOCUMENT,MESSAGE,TRANSACTION,TRANSACTIONRESPONSE,BATCH,BATCHRESPONSE,HISTORY,SEARCHSET - -################################################## -# Subscriptions -################################################## - -# Enable REST Hook Subscription Channel -subscription.resthook.enabled=true - -# Enable Email Subscription Channel -subscription.email.enabled=false -email.enabled=false -email.from=some@test.com -email.host= -email.port=0 -email.username= -email.password= - -# Enable Websocket Subscription Channel -subscription.websocket.enabled=false - -################################################### -# Partitioning And Multitenancy -################################################### -partitioning.multitenancy.enabled=false -#daoconfig.client_id_strategy=ANY diff --git a/docker-compose.yml b/docker-compose.yml index 6a1d7099..f6453376 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -55,11 +55,12 @@ services: opencr: container_name: opencr hostname: opencr + #image: intrahealth/opencr:latest image: intrahealth/opencr:fdb3d44 restart: unless-stopped environment: - NODE_ENV=docker - - HAPI_FHIR_URL=http://opencr-fhir:8080/hapi-fhir-jpaserver/fhir/metadata + - HAPI_FHIR_URL=http://opencr-fhir:8080/fhir/metadata networks: - sedish volumes: @@ -76,9 +77,8 @@ services: restart: unless-stopped volumes: - cr-data:/data/hapi - - ./configs/opencr-hapi/hapi.properties:/conf/hapi/hapi.properties - environment: - JAVA_OPTS: '-Dhapi.properties=/conf/hapi/hapi.properties' + env_file: + - configs/opencr-hapi/.env networks: - sedish @@ -87,6 +87,8 @@ services: hostname: es image: intrahealth/elasticsearch:latest restart: unless-stopped + ports: + - 9200 environment: - node.name=es01 - discovery.type=single-node @@ -120,9 +122,8 @@ services: restart: unless-stopped volumes: - hapi-data:/data/hapi - - ./configs/shr/hapi.properties:/conf/hapi/hapi.properties - environment: - JAVA_OPTS: '-Dhapi.properties=/conf/hapi/hapi.properties' + env_file: + - configs/shr/.env networks: - sedish @@ -144,7 +145,7 @@ services: isanteplus-test: container_name: isanteplus-test hostname: isanteplus-test - build: ./docker/openmrs-server-2 + build: ./docker/openmrs-server restart: unless-stopped env_file: - ./openmrs/isanteplus_test/openmrs-server.env