-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathhapi.application.yaml
More file actions
515 lines (477 loc) · 20.5 KB
/
hapi.application.yaml
File metadata and controls
515 lines (477 loc) · 20.5 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
# -------------------------------------------------------------------------------------
# Server & Spring Boot
# -------------------------------------------------------------------------------------
server:
# Uncomment to serve FHIR under a non-default context path (e.g., /example/path/fhir)
# servlet:
# context-path: /example/path
port: 8080
tomcat:
# allow | as a separator in URLs
relaxed-query-chars: "|"
management:
# Actuator endpoints: only /actuator/health exposed by default
endpoints:
enabled-by-default: false
web:
exposure:
include: "health" # or "info,health,prometheus,metrics" or "*" for all
endpoint:
info:
enabled: true
metrics:
enabled: true
health:
enabled: true
probes:
enabled: true
group:
liveness:
include: [ "livenessState", "readinessState" ]
prometheus:
enabled: true
prometheus:
metrics:
export:
enabled: true
spring:
# elasticsearch:
# uris: http://localhost:9200
# username: elastic
# password: elastic
# -------------------------------------------------------------------------------
# Application Name
# -------------------------------------------------------------------------------
application:
name: "@project.artifactId@"
# -------------------------------------------------------------------------------
# A. Spring AI — Model Context Protocol (MCP)
# -------------------------------------------------------------------------------
ai:
# Run e.g. `npx @modelcontextprotocol/inspector` and connect to http://localhost:8080/mcp/messages using Streamable HTTP
# Add the following to the MCP server settings file in e.g. cursor or claude (Desktop applications) for local debugging:
# cursor:
# {
# "mcpServers": {
# "hapi": {
# "url": "http://localhost:8080/mcp/messages"
# }
# }
# }
# or claude:
# {
# "mcpServers": {
# "hapi": {
# "command": "npx",
# "args": [
# "mcp-remote@latest",
# "http://localhost:8080/mcp/messages"
# ]
# }
# }
# }
mcp:
server:
name: FHIR MCP Server
version: 1.0.0
instructions: "This server provides access to a FHIR RESTful API. You can use it to query FHIR resources, perform operations, and retrieve data in a structured format."
enabled: true
streamable-http:
mcp-endpoint: /mcp/messages
# -------------------------------------------------------------------------------
# B. Core Spring
# -------------------------------------------------------------------------------
main:
allow-bean-definition-overriding: false
allow-circular-references: true
banner-mode: off
autoconfigure:
# This exclude is only needed for setups not using Elasticsearch where the elasticsearch sniff is not needed.
exclude: org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration
flyway:
enabled: false
baseline-on-migrate: true
fail-on-missing-locations: false
datasource:
# url: "jdbc:h2:file:./target/database/h2"
url: jdbc:h2:mem:test_mem
username: sa
password: null
driver-class-name: org.h2.Driver
# max-active: 15 # (ignored with HikariCP; use hikari.maximum-pool-size)
hikari:
maximum-pool-size: 10
jpa:
properties:
hibernate:
format_sql: false
show_sql: false
# Hibernate dialect is auto-detected except for H2/Postgres.
# If using H2: ca.uhn.fhir.jpa.model.dialect.HapiFhirH2Dialect
# If using Postgres: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
dialect: ${HIBERNATE_DIALECT:ca.uhn.fhir.jpa.model.dialect.HapiFhirH2Dialect}
# --- Optional Hibernate DDL & tuning (commented out from source) ---
hbm2ddl:
auto: update
jdbc:
batch_size: 20
cache:
use_query_cache: false
use_second_level_cache: false
use_structured_entries: false
use_minimal_puts: false
# --- Hibernate Search (Lucene/Elasticsearch) ---
#search:
# schema_management:
# strategy: CREATE
# enabled: true
# Lucene backend (default example)
# backend:
# type: lucene
# analysis:
# configurer: ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers$HapiLuceneAnalysisConfigurer
# directory:
# type: local-filesystem
# root: target/lucenefiles
# lucene_version: lucene_current
# Elasticsearch backend (alternative) — see also hapi.fhir.elasticsearch section in docs
# backend:
# layout:
# strategy: ca.uhn.fhir.jpa.search.elastic.IndexNamePrefixLayoutStrategy
# type: elasticsearch
# protocol: http
# analysis:
# configurer: ca.uhn.fhir.jpa.search.HapiHSearchAnalysisConfigurers$HapiElasticsearchAnalysisConfigurer
# scroll_timeout: 60
# schema_management:
# settings_file: ca/uhn/fhir/jpa/elastic/index-settings.json
# minimal_required_status_wait_timeout: 10000
# minimal_required_status: YELLOW
#
# dynamic_mapping: true
# indexing:
# plan:
# synchronization:
# strategy: async
# -------------------------------------------------------------------------------------
# HAPI FHIR — grouped by domain
# -------------------------------------------------------------------------------------
hapi:
fhir:
# -------------------------------------------------------------------------------
# A. Core Server & API
# -------------------------------------------------------------------------------
openapi_enabled: true # Swagger UI at /fhir/swagger-ui/index.html; API docs at /fhir/api-docs
fhir_version: R4 # DSTU2 | DSTU3 | R4 | R5
# use_apache_address_strategy: false
# use_apache_address_strategy_https: false
# custom_content_path: ./custom # folder name must be 'custom'
# app_content_path: ./configs/app # served under /web/app
# server_address: http://hapi.fhir.org/baseR4
# defer_indexing_for_codesystems_of_size: 101
# -------------------------------------------------------------------------------
# B. Implementation Guides (IG) & Package Install
# -------------------------------------------------------------------------------
ig_runtime_upload_enabled: true
# validate_resource_status_for_package_upload: false # default true
# install_transitive_ig_dependencies: true
# implementationguides:
# swiss:
# name: swiss.mednet.fhir
# version: 0.8.0
# reloadExisting: false
# installMode: STORE_AND_INSTALL
# ips_1_0_0:
# packageUrl: https://costateixeira.github.io/smart-ips-pilgrimage-fulltest/package.tgz
# name: smart.who.int.ips-pilgrimage-test
# version: 0.1.0
# installMode: STORE_AND_INSTALL
# additionalResourceFolders:
# - example
# - example2
# supported_resource_types:
# - Patient
# - Observation
# allowed_bundle_types: COLLECTION,DOCUMENT,MESSAGE,TRANSACTION,TRANSACTIONRESPONSE,BATCH,BATCHRESPONSE,HISTORY,SEARCHSET
# -------------------------------------------------------------------------------
# C. Clinical Reasoning / CQL / Care Gaps / CDS Hooks
# -------------------------------------------------------------------------------
cr:
enabled: false # exposes Clinical Reasoning operation endpoints
caregaps:
reporter: "default"
section_author: "default"
terminologyServerClientSettings:
maxRetryCount: 3
retryIntervalMillis: 1000
timeoutSeconds: 30
socketTimeout: 60
cql:
use_embedded_libraries: true
# namespaces: # namespaces to be registered with the CQL engine
# example
# hl7.fhir.uv.cql: http://hl7.org/fhir/uv/cql
compiler:
# low-level compiler options (typically not needed)
# validate_units: true
# verify_only: false
# compatibility_level: "1.5"
error_level: Info
signature_level: All
# analyze_data_requirements: false
# collapse_data_requirements: false
# translator_format: JSON
# enable_date_range_optimization: true
enable_annotations: true
enable_locators: true
enable_results_type: true
enable_detailed_errors: true
# disable_list_traversal: false
# disable_list_demotion: false
# enable_interval_demotion: false
# enable_interval_promotion: false
# disable_method_invocation: false
# require_from_keyword: false
# disable_default_model_info_load: false
runtime:
debug_logging_enabled: false
# enable_validation: false
# enable_expression_caching: true
terminology:
valueset_preexpansion_mode: IGNORE # USE_IF_PRESENT | REQUIRE | IGNORE
valueset_expansion_mode: USE_EXPAND_OPERATION # AUTO | USE_EXPANSION_OPERATION | PERFORM_NAIVE_EXPANSION
valueset_membership_mode: USE_VALIDATE_CODE_OPERATION # AUTO | USE_VALIDATE_CODE_OPERATION | USE_EXPANSION
code_lookup_mode: USE_VALIDATE_CODE_OPERATION # AUTO | USE_VALIDATE_CODE_OPERATION | USE_CODESYSTEM_URL
remote_terminology:
- url: '${ONTO_SERVER_URL}'
client_interceptor_beans:
- terminologyInterceptor
data:
search_parameter_mode: USE_SEARCH_PARAMETERS # AUTO | USE_SEARCH_PARAMETERS | FILTER_IN_MEMORY
terminology_parameter_mode: USE_VALUE_SET_URL # AUTO | USE_VALUE_SET_URL | USE_INLINE_CODES | FILTER_IN_MEMORY
profile_mode: DECLARED # ENFORCED | DECLARED | OPTIONAL | TRUST | OFF
cdshooks:
enabled: false
clientIdHeaderName: client_id
# -------------------------------------------------------------------------------
# D. Search & Indexing
# -------------------------------------------------------------------------------
# NOTE: Extended Lucene/Elasticsearch indexing is experimental.
# See https://hapifhir.io/hapi-fhir/docs/server_jpa/elastic.html
# advanced_lucene_indexing: true
# search_index_full_text_enabled: true
# language_search_parameter_enabled: true
# upliftedRefchains_enabled: true
# index_storage_optimized: false
# enable_index_missing_fields: false
# enable_index_of_type: true
# enable_index_contained_resource: false
# store_resource_in_lucene_index_enabled: true
# -------------------------------------------------------------------------------
# Elasticsearch Configuration
# -------------------------------------------------------------------------------
# elasticsearch:
# index_prefix: "myprefix" # Prefix for all Elasticsearch indexes (e.g., myprefix_observation_index)
# -------------------------------------------------------------------------------
# E. Bulk Operations
# -------------------------------------------------------------------------------
bulk_export_enabled: false
bulk_import_enabled: false
bulk_export_file_retention_period_hours: 2
# -------------------------------------------------------------------------------
# F. Write / Delete / Integrity
# -------------------------------------------------------------------------------
# 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
# mass_ingestion_mode_enabled: false
# auto_version_reference_at_paths: Device.patient, Device.location, Device.parent, DeviceMetric.parent, DeviceMetric.source, Observation.device, Observation.subject
# client_id_strategy: ALPHANUMERIC
# server_id_strategy: SEQUENTIAL_NUMERIC
# enforce_referential_integrity_on_delete: false
# enforce_referential_integrity_on_write: false
# etag_support_enabled: true
# expunge_enabled: true
# fhirpath_interceptor_enabled: false
# filter_search_enabled: true
# graphql_enabled: true
# Thread pool configuration for maintenance operations
# Defaults to Runtime.getRuntime().availableProcessors() if not specified
# reindex_thread_count: 4 # Number of threads to use for reindex operations
# expunge_thread_count: 4 # Number of threads to use for expunge operations
# mark_resources_for_reindexing_upon_search_parameter_change: false
# -------------------------------------------------------------------------------
# G. Narrative & Validation
# -------------------------------------------------------------------------------
narrative_enabled: false
# validation:
# requests_enabled: true
# responses_enabled: true
# -------------------------------------------------------------------------------
# H. MDM (Master Data Management)
# -------------------------------------------------------------------------------
mdm_enabled: false
mdm_rules_json_location: "mdm-rules.json"
# userRequestRetryVersionConflictsInterceptorEnabled: false
# -------------------------------------------------------------------------------
# I. Terminology / ValueSet Expansion
# -------------------------------------------------------------------------------
# pre_expand_value_sets: true
# enable_task_pre_expand_value_sets: true
# pre_expand_value_sets_default_count: 1000
# pre_expand_value_sets_max_count: 1000
# maximum_expansion_size: 1000
logical_urls:
- http://terminology.hl7.org/*
- https://terminology.hl7.org/*
- http://snomed.info/*
- https://snomed.info/*
#- http://unitsofmeasure.org/*
#- https://unitsofmeasure.org/*
#- http://loinc.org/*
#- https://loinc.org/*
# additional logical urls as per https://digital.nhs.uk/services/terminology-server
- https://dmd.nhs.uk*
- http://hl7.org/fhir/sid/icd-10*
- https://icd.who.int/browse10*
- http://read.info*
- https://nicip.nhs.uk*
- http://www.datadictionary.nhs.uk/data_dictionary/attributes/o/opcs_4*
# -------------------------------------------------------------------------------
# J. Partitioning & Multitenancy
# -------------------------------------------------------------------------------
# partitioning:
# allow_references_across_partitions: false
# partitioning_include_in_search_hashes: false
# default_partition_id: 0
# database_partition_mode_enabled: true
# patient_id_partitioning_mode: true
# request_tenant_partitioning_mode: false
# -------------------------------------------------------------------------------
# K. CORS
# -------------------------------------------------------------------------------
cors:
# allow_Credentials: false
allowed_origin:
- "*"
# If you enable allow_Credentials=true, use explicit origins instead of "*".
# Optional overrides. If omitted, built-in defaults are used.
# allowed_headers:
# - Origin
# - Accept
# - Content-Type
# - Authorization
# - Cache-Control
# - If-Match
# - If-None-Match
# exposed_headers:
# - Location
# - Content-Location
# - ETag
# allowed_methods:
# - GET
# - POST
# - PUT
# - DELETE
# - OPTIONS
# - PATCH
# - HEAD
# -------------------------------------------------------------------------------
# L. Search Orchestration
# -------------------------------------------------------------------------------
search-coord-core-pool-size: 20
search-coord-max-pool-size: 100
search-coord-queue-capacity: 200
# Search Prefetch Thresholds.
# This setting sets the number of search results to prefetch. For example, if this list
# is set to [100, 1000, -1] then the server will initially load 100 results and not
# attempt to load more. If the user requests subsequent page(s) of results and goes
# past 100 results, the system will load the next 900 (up to the following threshold of 1000).
# The system will progressively work through these thresholds.
# A threshold of -1 means to load all results. Note that if the final threshold is a
# number other than -1, the system will never prefetch more than the given number.
# CSV list; -1 as final value means "all"
search_prefetch_thresholds: 13,503,2003,-1
# -------------------------------------------------------------------------------
# M. Extensibility (custom beans / interceptors / providers)
# -------------------------------------------------------------------------------
# comma-separated package names, will be @ComponentScan'ed by Spring to allow for creating custom Spring beans
custom-bean-packages:
- com.nhs
# custom-interceptor-classes:
# custom-provider-classes:
# store_meta_source_information: NONE
# bundle_batch_pool_size: 10
# bundle_batch_pool_max_size: 50
# -------------------------------------------------------------------------------
# N. Logging
# -------------------------------------------------------------------------------
# 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
# -------------------------------------------------------------------------------
# O. Storage / Pagination / Caching
# -------------------------------------------------------------------------------
# max_binary_size: 104857600
# max_page_size: 200
# retain_cached_searches_mins: 60
# reuse_cached_search_results_millis: 60000
# binary_storage_enabled: true
# binary_storage_mode: FILESYSTEM
# binary_storage_filesystem_base_directory: /binstore
# When binary_storage_mode is FILESYSTEM and this value is not set,
# the starter defaults to 102400 bytes so smaller binaries stay inline.
binary_storage_minimum_binary_size: 4000
# -------------------------------------------------------------------------------
# P. Remote Terminology Service (disabled by default)
# -------------------------------------------------------------------------------
# remote_terminology_service:
# all:
# system: "*"
# url: "https://tx.fhir.org/r4/"
# snomed:
# system: "http://snomed.info/sct"
# url: "https://tx.fhir.org/r4/"
# loinc:
# system: "http://loinc.org"
# url: "https://hapi.fhir.org/baseR4/"
# -------------------------------------------------------------------------------
# Q. Subscriptions (disabled by default)
# -------------------------------------------------------------------------------
# subscription:
# resthook_enabled: true
# websocket_enabled: false
# polling_interval_ms: 5000
# immediately_queued: false
# email:
# from: some@test.com
# host: google.com
# port:
# username:
# password:
# auth:
# startTlsEnable:
# startTlsRequired:
# quitWait:
# -------------------------------------------------------------------------------
# R. LastN (analytics)
# -------------------------------------------------------------------------------
# lastn_enabled: true
# -------------------------------------------------------------------------------
# S. Testers (webui)
# -------------------------------------------------------------------------------
tester:
home:
name: Local Tester
server_address: 'http://localhost:8080/fhir'
refuse_to_fetch_third_party_urls: false
fhir_version: R4