Skip to content

Commit

Permalink
FI-2429: migrate to HL7 validator wrapper (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen MacVicar <smacvicar@mitre.org>
  • Loading branch information
dehall and Jammjammjamm authored May 24, 2024
1 parent dabd8f2 commit 2b68e2b
Show file tree
Hide file tree
Showing 11 changed files with 189 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .env.development
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VALIDATOR_URL=http://localhost/validatorapi
FHIR_RESOURCE_VALIDATOR_URL=http://localhost/hl7validatorapi
REDIS_URL=redis://localhost:6379/0
2 changes: 1 addition & 1 deletion .env.production
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
REDIS_URL=redis://redis:6379/0
VALIDATOR_URL=http://validator_service:4567
FHIR_RESOURCE_VALIDATOR_URL=http://hl7_validator_service:3500
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VALIDATOR_URL=https://example.com/validatorapi
FHIR_RESOURCE_VALIDATOR_URL=https://example.com/validatorapi
ASYNC_JOBS=false
110 changes: 50 additions & 60 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ PATH
remote: .
specs:
shc_vaccination_test_kit (0.1.0)
health_cards
inferno_core (>= 0.4.2)
health_cards (= 0.0.2)
inferno_core (>= 0.4.37)

GEM
remote: https://rubygems.org/
Expand All @@ -20,7 +20,7 @@ GEM
base64 (0.2.0)
bcp47 (0.3.3)
i18n
bigdecimal (3.1.7)
bigdecimal (3.1.8)
blueprinter (0.25.2)
byebug (11.1.3)
chunky_png (1.4.0)
Expand All @@ -41,40 +41,25 @@ GEM
diff-lcs (1.5.1)
domain_name (0.6.20240107)
dotenv (2.8.1)
dry-auto_inject (0.9.0)
dry-container (>= 0.3.4)
dry-configurable (0.13.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.6)
dry-container (0.9.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.13, >= 0.13.0)
dry-core (0.8.1)
concurrent-ruby (~> 1.0)
dry-inflector (0.3.0)
dry-logic (1.2.0)
dry-auto_inject (1.0.1)
dry-core (~> 1.0)
zeitwerk (~> 2.6)
dry-configurable (1.0.0)
dry-core (~> 1.0, < 2)
zeitwerk (~> 2.6)
dry-container (0.10.0)
concurrent-ruby (~> 1.0)
dry-core (~> 0.5, >= 0.5)
dry-struct (1.4.0)
dry-core (~> 0.5, >= 0.5)
dry-types (~> 1.5)
ice_nine (~> 0.11)
dry-system (0.20.0)
dry-core (1.0.0)
concurrent-ruby (~> 1.0)
dry-auto_inject (>= 0.4.0)
dry-configurable (~> 0.13, >= 0.13.0)
dry-container (~> 0.9, >= 0.9.0)
dry-core (~> 0.5, >= 0.5)
dry-inflector (~> 0.1, >= 0.1.2)
dry-struct (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.0.0)
dry-system (1.0.0)
dry-auto_inject (~> 1.0.0.rc1, < 2)
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0, < 2)
dry-inflector (~> 1.0, < 2)
dry-transformer (1.0.1)
zeitwerk (~> 2.6)
dry-types (1.5.1)
concurrent-ruby (~> 1.0)
dry-container (~> 0.3)
dry-core (~> 0.5, >= 0.5)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 1.0, >= 1.0.2)
factory_bot (6.4.6)
activesupport (>= 5.0.0)
faraday (1.10.3)
Expand Down Expand Up @@ -128,44 +113,45 @@ GEM
date_time_precision (>= 0.8)
mime-types (>= 3.0)
nokogiri (>= 1.11.4)
hanami-controller (2.0.0.beta1)
dry-configurable (~> 0.13, >= 0.13.0)
hanami-utils (~> 2.0.beta)
hanami-controller (2.0.0)
dry-configurable (~> 1.0, < 2)
dry-core (~> 1.0)
hanami-utils (~> 2.0)
rack (~> 2.0)
zeitwerk (~> 2.6)
hanami-router (2.0.0)
mustermann (~> 1.0)
mustermann-contrib (~> 1.0)
rack (~> 2.0)
hanami-utils (2.0.0)
hanami-utils (2.1.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-transformer (~> 1.0, < 2)
hansi (0.2.1)
hashdiff (1.1.0)
health_cards (1.1.0)
health_cards (0.0.2)
fhir_models (>= 4.0.0)
rqrcode
rqrcode_core (>= 1.2.0)
http-accept (1.7.0)
http-cookie (1.0.5)
domain_name (~> 0.5)
i18n (1.14.4)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
inferno_core (0.4.33)
inferno_core (0.4.37)
activesupport (~> 6.1.7.5)
base62-rb (= 0.3.1)
blueprinter (= 0.25.2)
dotenv (~> 2.7)
dry-configurable (= 0.13.0)
dry-container (= 0.9.0)
dry-core (= 0.8.1)
dry-inflector (= 0.3)
dry-system (= 0.20.0)
dry-configurable (= 1.0.0)
dry-container (= 0.10.0)
dry-core (= 1.0.0)
dry-inflector (= 1.0.0)
dry-system (= 1.0.0)
faraday (~> 1.2)
faraday_middleware (~> 1.2)
fhir_client (>= 5.0.3)
fhir_models (>= 4.2.2)
hanami-controller (= 2.0.0.beta1)
hanami-controller (= 2.0.0)
hanami-router (= 2.0.0)
oj (= 3.11.0)
pry
Expand All @@ -185,26 +171,27 @@ GEM
base64
kramdown (2.4.0)
rexml
method_source (1.0.0)
method_source (1.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0305)
minitest (5.22.3)
mime-types-data (3.2024.0507)
minitest (5.23.1)
multi_json (1.15.0)
multi_xml (0.6.0)
multipart-post (2.4.0)
multi_xml (0.7.1)
bigdecimal (~> 3.1)
multipart-post (2.4.1)
mustermann (1.1.2)
ruby2_keywords (~> 0.0.1)
mustermann-contrib (1.1.2)
hansi (~> 0.2.0)
mustermann (= 1.1.2)
netrc (0.11.0)
nio4r (2.7.1)
nokogiri (1.16.3-arm64-darwin)
nio4r (2.7.3)
nokogiri (1.16.5-arm64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-darwin)
nokogiri (1.16.5-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.16.3-x86_64-linux)
nokogiri (1.16.5-x86_64-linux)
racc (~> 1.4)
oauth2 (1.4.11)
faraday (>= 0.17.3, < 3.0)
Expand All @@ -226,7 +213,7 @@ GEM
public_suffix (5.0.5)
puma (5.6.8)
nio4r (~> 2.0)
racc (1.7.3)
racc (1.8.0)
rack (2.2.9)
rake (13.2.1)
rdoc (6.6.3.1)
Expand All @@ -239,7 +226,8 @@ GEM
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
rexml (3.2.6)
rexml (3.2.8)
strscan (>= 3.0.9)
rouge (4.2.1)
rqrcode (2.2.0)
chunky_png (~> 1.0)
Expand Down Expand Up @@ -273,6 +261,7 @@ GEM
unicode-display_width (>= 1.5, < 3.0)
unicode_utils (~> 1.4)
strings-ansi (0.2.0)
strscan (3.1.0)
thor (1.2.2)
tilt (2.3.0)
tty-color (0.6.0)
Expand All @@ -292,10 +281,11 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
zeitwerk (2.6.13)
zeitwerk (2.6.14)

PLATFORMS
arm64-darwin-21
arm64-darwin-23
x86_64-darwin-20
x86_64-linux

Expand Down
47 changes: 32 additions & 15 deletions config/nginx.background.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,38 @@ http {
# the server will close connections after this time
keepalive_timeout 600;

location /validator {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
# location /validator {
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-Port $server_port;
# proxy_redirect off;
# proxy_set_header Connection '';
# proxy_http_version 1.1;
# chunked_transfer_encoding off;
# proxy_buffering off;
# proxy_cache off;
#
# proxy_pass http://fhir_validator_app;
# }

proxy_pass http://fhir_validator_app;
}
# location /validatorapi/ {
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-Port $server_port;
# proxy_redirect off;
# proxy_set_header Connection '';
# proxy_http_version 1.1;
# chunked_transfer_encoding off;
# proxy_buffering off;
# proxy_cache off;
#
# proxy_pass http://validator_service:4567/;
# }
# }

location /validatorapi/ {
location /hl7validatorapi/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
Expand All @@ -79,8 +95,9 @@ http {
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 600s;

proxy_pass http://validator_service:4567/;
proxy_pass http://hl7_validator_service:3500/;
}
}
}
50 changes: 33 additions & 17 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,37 @@ http {
proxy_pass http://inferno:4567;
}

location /validator {
# location /validator {
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-Port $server_port;
# proxy_redirect off;
# proxy_set_header Connection '';
# proxy_http_version 1.1;
# chunked_transfer_encoding off;
# proxy_buffering off;
# proxy_cache off;
#
# proxy_pass http://fhir_validator_app;
# }

# location /validatorapi/ {
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $http_host;
# proxy_set_header X-Forwarded-Proto $scheme;
# proxy_set_header X-Forwarded-Port $server_port;
# proxy_redirect off;
# proxy_set_header Connection '';
# proxy_http_version 1.1;
# chunked_transfer_encoding off;
# proxy_buffering off;
# proxy_cache off;
#
# proxy_pass http://validator_service:4567/;
# }

location /hl7validatorapi/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
Expand All @@ -79,23 +109,9 @@ http {
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 600s;

proxy_pass http://fhir_validator_app;
}

location /validatorapi/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Port $server_port;
proxy_redirect off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
proxy_buffering off;
proxy_cache off;

proxy_pass http://validator_service:4567/;
proxy_pass http://hl7_validator_service:3500/;
}
}
}
Loading

0 comments on commit 2b68e2b

Please sign in to comment.