Configuration Files

Runtime behavior and logging are controlled using configuration files.

Properties File

The runtime behavior of the FHIR JPA server can be managed using the hdr_fhir.yaml file: <HDR_DOMAIN>/config/fhir/hdr_fhir.yaml

Example 4-1 hdr_fhir.yaml file

#Adds the option to go to eg. http://localhost:8080/actuator/health for seeing the running configuration
#see https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints
management:
  endpoints:
    web:
      exposure:
        include: "health,prometheus"
spring:
  main:
    allow-circular-references: true
    #allow-bean-definition-overriding: true
  flyway:
    enabled: false
    check-location: false
    baselineOnMigrate: true
#########    
# datasrouce - specify datasource here(name of the datasource configured in your app server)     
#########
  datasource:
    jndi_name: jdbc/OrclFhirDataSource
  jpa:
    properties:
      hibernate.format_sql: false
      hibernate.show_sql: false
      #Hibernate dialect is automatically detected except Postgres and H2.
      hibernate.hbm2ddl.auto: none
      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
  ###    These settings will enable fulltext search with lucene or elastic
      hibernate.search.enabled: true
  ### lucene parameters
      hibernate.search.backend.type: lucene
      hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers$HapiLuceneAnalysisConfigurer
      hibernate.search.backend.directory.type: local-filesystem
      hibernate.search.backend.directory.root: target/lucenefiles
      hibernate.search.backend.lucene_version: lucene_current
  ### elastic parameters ===> see also elasticsearch section below <===
#      hibernate.search.backend.type: elasticsearch
#      hibernate.search.backend.analysis.configurer: ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers$HapiElasticAnalysisConfigurer
hapi:
  fhir:
    ### This is the FHIR version. Choose between, DSTU2, DSTU3, R4 or R5
    fhir_version: R4  
    ### This enables the swagger-ui at <BaseUrl>/swagger-ui/index.html as well as the <BaseUrl>/api-docs
    openapi_enabled: true

    ### enable to use the ApacheProxyAddressStrategy which uses X-Forwarded-* headers
    ### to determine the FHIR server address
    #   use_apache_address_strategy: false
    ### forces the use of the https:// protocol for the returned server address.
    ### alternatively, it may be set using the X-Forwarded-Proto header.
    #   use_apache_address_strategy_https: false
    ### enables the server to host content like HTML, css, etc. under the url pattern of /static/**
    ### the deepest folder level will be used. E.g. - if you put file:/foo/bar/bazz as value then the files are resolved under /static/bazz/**
    #staticLocation: file:/foo/bar/bazz
    ### enable to set the Server URL
    #    server_address: http://hapi.fhir.org/baseR4
    #    defer_indexing_for_codesystems_of_size: 101
##########################
# Repository Validation(resource validation against Implementation Gudie)
# IG can be loaded from remote url(http:), local file(file:) or classpath(classpath:)
# If no url specified, IG is downloaded from central package respository(https://packages.fhir.org/)
# note: url can be either http:, https:, classpath:, or file: 
##########################
    load_ig_on_server_startup: false
    install_transitive_ig_dependencies: false
    implementationguides:
#      australia_core:
#        name: hl7.fhir.au.base
#        version: 4.1.0
#        url:           
      us_core:
        name: hl7.fhir.us.core
        version: 6.0.0
#        url:
    #    supported_resource_types:
    #      - Patient
    #      - Observation
###############
# Repository validation enable/disable 
###############    
    validation_repository_enabled: false    
    ##################################################
    # Allowed Bundle Types for persistence (defaults are: COLLECTION,DOCUMENT,MESSAGE)
    ##################################################
    allowed_bundle_types: COLLECTION,DOCUMENT,MESSAGE,TRANSACTION,TRANSACTIONRESPONSE,BATCH,BATCHRESPONSE,HISTORY,SEARCHSET
    allow_cascading_deletes: true
    allow_contains_searches: true
    allow_external_references: true
    allow_multiple_delete: true
    allow_override_default_search_params: true
    auto_create_placeholder_reference_targets: false
    #    cr_enabled: true
    #    ips_enabled: false
    default_encoding: JSON
    #    default_pretty_print: true
    default_page_size: 20
    delete_expunge_enabled: true

    enable_index_missing_fields: false
    #    enable_index_of_type: true
    #    enable_index_contained_resource: false
    ###  !!Extended Lucene/Elasticsearch Indexing is still a experimental feature, expect some features (e.g. _total=accurate) to not work as expected!!
    ###  more information here: https://hapifhir.io/hapi-fhir/docs/server_jpa/elastic.html
    advanced_lucene_indexing: false
    #    bulk_export_enabled: false
    #    bulk_import_enabled: false
    #    enforce_referential_integrity_on_delete: false
    # This is an experimental feature, and does not fully support _total and other FHIR features.
    enforce_referential_integrity_on_delete: false
    enforce_referential_integrity_on_write: false
    etag_support_enabled: true
    expunge_enabled: true
    #    client_id_strategy: ALPHANUMERIC
    fhirpath_interceptor_enabled: false
    filter_search_enabled: true
    graphql_enabled: true
    narrative_enabled: false
    #    mdm_enabled: true
    #    local_base_urls:
    #      - https://hapi.fhir.org/baseR4
    mdm_enabled: false
    #    partitioning:
    #      allow_references_across_partitions: false
    #      partitioning_include_in_search_hashes: false
    cors:
      allow_Credentials: true
      # These are allowed_origin patterns, see: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/cors/CorsConfiguration.html#setAllowedOriginPatterns-java.util.List-
      allowed_origin:
        - '*'

    # Search coordinator thread pool sizes
    search-coord-core-pool-size: 20
    search-coord-max-pool-size: 100
    search-coord-queue-capacity: 200
    
    # comma-separated package names, will be @ComponentScan'ed by Spring to allow for creating custom Spring beans
    #custom-bean-packages:
    
    # comma-separated list of fully qualified interceptor classes. 
    # classes listed here will be fetched from the Spring context when combined with 'custom-bean-packages', 
    # or will be instantiated via reflection using an no-arg contructor; then registered with the server  
    #custom-interceptor-classes:  

    # Threadpool size for BATCH'ed GETs in a bundle.
    #    bundle_batch_pool_size: 10
    #    bundle_batch_pool_max_size: 50

    logger:
      error_format: 'ERROR - ${requestVerb} ${requestUrl}'
      format: >-
        Path[${servletPath}] Source[${requestHeader.x-forwarded-for}]
        Operation[${operationType} ${operationName} ${idOrResourceName}]
        UA[${requestHeader.user-agent}] Params[${requestParameters}]
        ResponseEncoding[${responseEncodingNoDefault}]
      log_exceptions: true
      name: fhirtest.access
    max_binary_size: 104857600
    max_page_size: 200
    retain_cached_searches_mins: 60
    reuse_cached_search_results_millis: -1
#############
#Resource validation configuration
#############    
    validation:
      requests_enabled: false
      responses_enabled: false
# if remote terminology validation is set to true, make sure that request validation is also enabled(requests_enabled property).    
      remote_terminology_service_enabled: false
      remote_terminology_server_base_url: https://lforms-fhir.nlm.nih.gov/baseR4
#############      
    binary_storage_enabled: true
############    
#below property decides whether to store the resource as plain text in RES_TEXT_VC column. 
#if the resource size is below the size as set in the below property, it goes RES_TEXT_VC column, 
#if its larger than the property set value, it goes to RES_TEXT as compressed blob.
# summary -  the resource is stored in either RES_TEXT_VC or RES_TEXT dependeing on the size set below.
    inline_resource_storage_below_size: 0
#    bulk_export_enabled: true
    subscription:
      resthook_enabled: false
      websocket_enabled: false
#      email:
#       from: some@test.com
#       host: localhost
#        port: 22
#        username: 
#        password:  
#        auth:
#        startTlsEnable:
#        startTlsRequired:
#        quitWait:
#    lastn_enabled: true
#    store_resource_in_lucene_index_enabled: true
###  This is configuration for normalized quantity search level default is 0
###   0: NORMALIZED_QUANTITY_SEARCH_NOT_SUPPORTED - default
###   1: NORMALIZED_QUANTITY_STORAGE_SUPPORTED
###   2: NORMALIZED_QUANTITY_SEARCH_SUPPORTED
    normalized_quantity_search_level: 0
    metadata:
      implementation_description: Oracle FHIR Server
      software_name: Oracle FHIR Server
      publisher: Oracle Corporation
      software_version: 8.1.4
      
    resource_count_enabled: false
    resource_compression_enabled: true
    response_highlighter_enabled: true
    allow_placeholder_references: true
    response_timing_log_enabled: false
    
############
# for extracting unique request id from the incoming REST HTTP request and log the id into server log file.
    enable_http_header_logging: true
    request_id_key_http_header: X-Request-ID
############

############
# for controlling scheduled job - resourcecountcache
    enable_resource_count_scheduling_job: false
    resource_count_cache_expiry_time_in_minutes: 240
    resource_count_job_scheduling_time_in_minutes: 10
############

    audit:
      enabled: true
      datastore_type: DB
      savemessagepayload_enabled: false
      standard: CUSTOM
      
elasticsearch:
  debug:
    pretty_print_json_log: false
    refresh_after_write: false
  enabled: false  
  required_index_status: YELLOW
  rest_url: 'localhost:9200'
  protocol: 'http'
  schema_management_strategy: CREATE
  username: SomeUsername
  password: SomePassword
  
oauth:
  enabled: false
  token_issuer: "https://dev-t9brtcqa.auth0.com/"
  token_audience: "https://fhir-hdr.auth.com/api/v2/"
  token_alg: HS256
  scopes: "fhir.admin,fhir.users,fhir.users.restricted"
  fhir.admin: read,create,update,delete
  fhir.users: read,create
  fhir.users.restricted: read
  #note: add more if needed
  #scopes and allowed fhir resources
  fhir.admin.allowedapis: ALL
  fhir.users.allowedapis: ALL
  #ResearchStudy
  fhir.users.restricted.allowedapis: Patient, Observation, AllergyIntolerance, Medication, Condition, Procedure, Immunization

Log Configurations

HDR FHIR has several logging mechanisms that each serve a distinct purpose. These mechanisms are described in the table below. Oracle HDR FHIR uses the log4j2 logging framework to emit these logs. These logs are generated at runtime by all components of the FHIR. The location of the log4j2.properties is: <HDR_DOMAIN>/config/fhir/ log4j2.properties.

Table 4-1 Log files

Log File Purpose Retention

Application log

<HDR_DOMAIN>/logs/ hdr-fhir.log

Application Logging is a traditional file-based log of events and internal processing details of Oracle HDR FHIR. These logs are useful for troubleshooting. Application logs can be enabled and disabled at runtime by modifying the log4j2 properties file.

Logs are rotated and compressed on a Time basis, although this can be configured using the log4j2.properties file.

Audit Log

<HDR_DOMAIN>/logs/ audit-hdr-fhir.log

The audit log is intended to record actions taken by users. This log can be enabled or disabled using “audit.enabled" property defined in the hdr_fhir.properties file.

Logs are rotated and compressed on a Time basis, although this can be configured using log4j2.properties file.