mirror of
https://github.com/Sudo-JHare/FHIRFLARE-IG-Toolkit.git
synced 2025-08-01 17:15:34 +00:00
Compare commits
No commits in common. "11e8569c564727c39024b2e1ff75caf82be1a7a3" and "5efae0c64e7d947cfff19d54c65d50fb5c4d0b99" have entirely different histories.
11e8569c56
...
5efae0c64e
@ -156,9 +156,7 @@ echo Updating docker-compose.yml with APP_MODE=%APP_MODE%...
|
||||
echo - FLASK_APP=app.py
|
||||
echo - FLASK_ENV=development
|
||||
echo - NODE_PATH=/usr/lib/node_modules
|
||||
echo - APP_MODE=%APP_MODE%
|
||||
echo - APP_BASE_URL=http://localhost:5000
|
||||
echo - HAPI_FHIR_URL=http://localhost:8080/fhir
|
||||
echo - APP_MODE=%APP_MODE%
|
||||
echo command: supervisord -c /etc/supervisord.conf
|
||||
) > docker-compose.yml.tmp
|
||||
|
||||
|
8
app.py
8
app.py
@ -55,8 +55,6 @@ app.config['API_KEY'] = os.environ.get('API_KEY', 'your-fallback-api-key-here')
|
||||
app.config['VALIDATE_IMPOSED_PROFILES'] = True
|
||||
app.config['DISPLAY_PROFILE_RELATIONSHIPS'] = True
|
||||
app.config['UPLOAD_FOLDER'] = '/app/static/uploads' # For GoFSH output
|
||||
app.config['APP_BASE_URL'] = os.environ.get('APP_BASE_URL', 'http://localhost:5000')
|
||||
app.config['HAPI_FHIR_URL'] = os.environ.get('HAPI_FHIR_URL', 'http://localhost:8080/fhir')
|
||||
CONFIG_PATH = '/usr/local/tomcat/conf/application.yaml'
|
||||
|
||||
# Register blueprints immediately after app setup
|
||||
@ -1319,10 +1317,10 @@ def proxy_hapi(subpath):
|
||||
logger.info(f"Proxy target identified from header: {final_base_url}")
|
||||
except ValueError as e:
|
||||
logger.warning(f"Invalid URL in X-Target-FHIR-Server header: '{target_server_header}'. Falling back. Error: {e}")
|
||||
final_base_url = current_app.config['HAPI_FHIR_URL'].rstrip('/')
|
||||
final_base_url = "http://localhost:8080/fhir"
|
||||
logger.debug(f"Falling back to default local HAPI due to invalid header: {final_base_url}")
|
||||
else:
|
||||
final_base_url = current_app.config['HAPI_FHIR_URL'].rstrip('/')
|
||||
final_base_url = "http://localhost:8080/fhir"
|
||||
logger.debug(f"No target header found, proxying to default local HAPI: {final_base_url}")
|
||||
|
||||
# Construct the final URL for the target server request
|
||||
@ -1426,7 +1424,7 @@ def load_ig_to_hapi():
|
||||
resource_id = resource.get('id')
|
||||
if resource_type and resource_id:
|
||||
response = requests.put(
|
||||
f"{current_app.config['HAPI_FHIR_URL'].rstrip('/')}/{resource_type}/{resource_id}",
|
||||
f"http://localhost:8080/fhir/{resource_type}/{resource_id}",
|
||||
json=resource,
|
||||
headers={'Content-Type': 'application/fhir+json'}
|
||||
)
|
||||
|
@ -16,7 +16,5 @@ services:
|
||||
- FLASK_APP=app.py
|
||||
- FLASK_ENV=development
|
||||
- NODE_PATH=/usr/lib/node_modules
|
||||
- APP_MODE=lite
|
||||
- APP_BASE_URL=http://localhost:5000
|
||||
- HAPI_FHIR_URL=http://localhost:8080/fhir
|
||||
- APP_MODE=lite
|
||||
command: supervisord -c /etc/supervisord.conf
|
||||
|
@ -1616,7 +1616,7 @@ def validate_resource_against_profile(package_name, version, resource, include_d
|
||||
# Attempt HAPI validation if a profile is specified
|
||||
if result['profile']:
|
||||
try:
|
||||
hapi_url = f"{current_app.config['HAPI_FHIR_URL'].rstrip('/')}/{resource['resourceType']}/$validate?profile={result['profile']}"
|
||||
hapi_url = f"http://localhost:8080/fhir/{resource['resourceType']}/$validate?profile={result['profile']}"
|
||||
response = requests.post(
|
||||
hapi_url,
|
||||
json=resource,
|
||||
@ -3766,7 +3766,7 @@ def retrieve_bundles(fhir_server_url, resources, output_zip, validate_references
|
||||
|
||||
|
||||
# --- Determine Base URL and Headers for Proxy ---
|
||||
base_proxy_url = f"{current_app.config['APP_BASE_URL'].rstrip('/')}/fhir"
|
||||
base_proxy_url = 'http://localhost:5000/fhir' # Always target the proxy endpoint
|
||||
headers = {'Accept': 'application/fhir+json, application/fhir+xml;q=0.9, */*;q=0.8'}
|
||||
is_custom_url = fhir_server_url != '/fhir' and fhir_server_url is not None and fhir_server_url.startswith('http')
|
||||
if is_custom_url:
|
||||
|
@ -195,8 +195,6 @@ services:
|
||||
- FLASK_ENV=development
|
||||
- NODE_PATH=/usr/lib/node_modules
|
||||
- APP_MODE=${APP_MODE}
|
||||
- APP_BASE_URL=http://localhost:5000
|
||||
- HAPI_FHIR_URL=http://localhost:8080/fhir
|
||||
command: supervisord -c /etc/supervisord.conf
|
||||
EOF
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user