From f72c504136c66f61853d19b3d466fc1b29b625ac Mon Sep 17 00:00:00 2001 From: jimmyfagan Date: Mon, 15 Jul 2024 15:11:56 -0500 Subject: [PATCH] Updates and point to bfd test env --- apps/fhir/bluebutton/v2/urls.py | 6 ------ apps/fhir/bluebutton/views/read.py | 15 +++------------ apps/fhir/bluebutton/views/search.py | 15 +++------------ docker-compose/source_env_secrets_from_aws.sh | 8 ++++---- docker-compose/web-env-vars.env | 4 ++-- 5 files changed, 12 insertions(+), 36 deletions(-) diff --git a/apps/fhir/bluebutton/v2/urls.py b/apps/fhir/bluebutton/v2/urls.py index 8720413ea..2a0584387 100755 --- a/apps/fhir/bluebutton/v2/urls.py +++ b/apps/fhir/bluebutton/v2/urls.py @@ -10,7 +10,6 @@ SearchViewCoverage, SearchViewExplanationOfBenefit, SearchViewPatient, - SearchViewOrganization ) admin.autodiscover() @@ -52,9 +51,4 @@ SearchViewExplanationOfBenefit.as_view(version=2), name="bb_oauth_fhir_eob_search_v2", ), - # Digital Insurance Card View - re_path( - r'Organization[/]?', - SearchViewOrganization.as_view(version=2), - name='bb_oauth_dic_organization_v2'), ] diff --git a/apps/fhir/bluebutton/views/read.py b/apps/fhir/bluebutton/views/read.py index 2b39f6222..40d9ecac6 100644 --- a/apps/fhir/bluebutton/views/read.py +++ b/apps/fhir/bluebutton/views/read.py @@ -56,7 +56,7 @@ def __init__(self, version=1): self.resource_type = "Patient" def get(self, request, *args, **kwargs): - return_c4dic = True + return_c4dic = False if return_c4dic: return Response(get_response_json("bfd-c4dic-patient-read")) else: @@ -71,7 +71,8 @@ def __init__(self, version=1): def get(self, request, *args, **kwargs): profile = request.query_params.get('_profile', '') - if profile == "http://hl7.org/fhir/us/insurance-card/StructureDefinition/C4DIC-Coverage": + return_c4dic = False + if return_c4dic and profile == "http://hl7.org/fhir/us/insurance-card/StructureDefinition/C4DIC-Coverage": return Response(get_response_json("bfd-c4dic-coverage-read")) else: return super().get(request, *args, **kwargs) @@ -82,13 +83,3 @@ class ReadViewExplanationOfBenefit(ReadView): def __init__(self, version=1): super().__init__(version) self.resource_type = "ExplanationOfBenefit" - - -class ReadViewOrganization(ReadView): - # Class used for Patient resource - def __init__(self, version=1): - super().__init__(version) - self.resource_type = "Organization" - - def get(self, request, *args, **kwargs): - return Response(get_response_json("organization_read_c4dic")) diff --git a/apps/fhir/bluebutton/views/search.py b/apps/fhir/bluebutton/views/search.py index 456222d9d..07a6c22a3 100644 --- a/apps/fhir/bluebutton/views/search.py +++ b/apps/fhir/bluebutton/views/search.py @@ -63,16 +63,6 @@ def build_url(self, resource_router, resource_type, *args, **kwargs): resource_type) -class SearchViewOrganization(SearchView): - - def __init__(self, version=1): - super().__init__(version) - self.resource_type = "Organization" - - def get(self, request, *args, **kwargs): - return Response(get_response_json("organization_search_c4dic")) - - class SearchViewPatient(SearchView): # Class used for Patient resource search view @@ -87,7 +77,7 @@ def build_parameters(self, request, *args, **kwargs): } def get(self, request, *args, **kwargs): - return_c4dic = True + return_c4dic = False if return_c4dic: return Response(get_response_json("bfd-c4dic-patient-search")) else: @@ -109,7 +99,8 @@ def build_parameters(self, request, *args, **kwargs): def get(self, request, *args, **kwargs): profile = request.query_params.get('_profile', '') - if profile == "http://hl7.org/fhir/us/insurance-card/StructureDefinition/C4DIC-Coverage": + return_c4dic = False + if return_c4dic and profile == "http://hl7.org/fhir/us/insurance-card/StructureDefinition/C4DIC-Coverage": return Response(get_response_json("bfd-c4dic-coverage-search")) else: return super().get(request, *args, **kwargs) diff --git a/docker-compose/source_env_secrets_from_aws.sh b/docker-compose/source_env_secrets_from_aws.sh index 0a36755cb..594dfd9da 100755 --- a/docker-compose/source_env_secrets_from_aws.sh +++ b/docker-compose/source_env_secrets_from_aws.sh @@ -76,10 +76,10 @@ SYSTEM=$(uname -s) if [[ ${SYSTEM} == "Linux" || ${SYSTEM} == "Darwin" ]] then - aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_certificate --query 'SecretString' --output text | base64 -d > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.cert.pem - aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_private_key --query 'SecretString' --output text | base64 -d > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.key.nocrypt.pem + aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_certificate_test --query 'SecretString' --output text | base64 -d > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.cert.pem + aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_private_key_test --query 'SecretString' --output text | base64 -d > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.key.nocrypt.pem else # support cygwin - aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_certificate --query 'SecretString' --output text |base64 -di > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.cert.pem - aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_private_key --query 'SecretString' --output text |base64 -di > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.key.nocrypt.pem + aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_certificate_test --query 'SecretString' --output text |base64 -di > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.cert.pem + aws secretsmanager get-secret-value --secret-id /bb2/local_integration_tests/fhir_client/certstore/local_integration_tests_private_key_test --query 'SecretString' --output text |base64 -di > ${CERTSTORE_TEMPORARY_MOUNT_PATH}/ca.key.nocrypt.pem fi diff --git a/docker-compose/web-env-vars.env b/docker-compose/web-env-vars.env index 85d11a08c..216fe8e48 100644 --- a/docker-compose/web-env-vars.env +++ b/docker-compose/web-env-vars.env @@ -14,8 +14,8 @@ AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} -# BFD credentials/settings +# BFD credentials/settings Change here DJANGO_USER_ID_SALT=${DJANGO_USER_ID_SALT} DJANGO_USER_ID_ITERATIONS=${DJANGO_USER_ID_ITERATIONS} -FHIR_URL="https://prod-sbx.bfd.cms.gov" +FHIR_URL="https://test.bfd.cms.gov" DJANGO_FHIR_CERTSTORE=/code/docker-compose/certstore/