Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BB2-3290: Connect to BFD test environment for C4DIC #1222

Merged
merged 1 commit into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions apps/fhir/bluebutton/v2/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
SearchViewCoverage,
SearchViewExplanationOfBenefit,
SearchViewPatient,
SearchViewOrganization
)

admin.autodiscover()
Expand Down Expand Up @@ -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'),
]
15 changes: 3 additions & 12 deletions apps/fhir/bluebutton/views/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As is, this seems to always be false. Are we just enforcing this can't work at all for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wanted to leave this logic in there in case we wanted to hard code resources again, it would just be flipping these to true for whichever calls you wanted hard coded resources for and then adjusting the contents of the corresponding json file. Just to allow us to test with different resource fields without necessarily waiting for BFD.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect. I think that's fine to have to switch these manually to test. No world where we'd want that to work for anyone else, lol. Too ephemeral for a feature flag, otherwise

if return_c4dic:
return Response(get_response_json("bfd-c4dic-patient-read"))
else:
Expand All @@ -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)
Expand All @@ -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"))
15 changes: 3 additions & 12 deletions apps/fhir/bluebutton/views/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions docker-compose/source_env_secrets_from_aws.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions docker-compose/web-env-vars.env
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this an intentional change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine it must be. It just seemed like the kind of things I may accidentally commit after making local testing changes, lol

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea sorry probably not enough context in the description. C4DIC is only enabled in BFD's test env, so this change is meant to point over to that.

DJANGO_FHIR_CERTSTORE=/code/docker-compose/certstore/
Loading