Skip to content

Commit

Permalink
Fix healthcare oie profile bug (#485)
Browse files Browse the repository at this point in the history
Co-authored-by: noi narisak <[email protected]>
  • Loading branch information
noinarisak and noi narisak committed Jan 31, 2022
1 parent 8d80e22 commit dca72e2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ UDP_CONFIG_URL="https://api.staging.udp.unidemo.live"
UDP_ISSUER="https://udp-stg.oktapreview.com/oauth2/default"
UDP_CLIENT_ID=""
UDP_CLIENT_SECRET=""
UDP_APP_NAME=""
UDP_SUB_DOMAIN=""


# Third Party Service Setting
Expand Down
5 changes: 2 additions & 3 deletions GlobalBehaviorandComponents/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ def is_authenticated(f):
@wraps(f)
def decorated_function(*args, **kws):
logger.debug("is_authenticated()")
access_token = TokenUtil.get_access_token(request.cookies)
# logger.debug("token: {0}".format(token))

if TokenUtil.is_valid(access_token, session[SESSION_INSTANCE_SETTINGS_KEY]):
id_token = TokenUtil.get_id_token(request.cookies)
if TokenUtil.is_valid(id_token, session[SESSION_INSTANCE_SETTINGS_KEY]):
return f(*args, **kws)
else:
logger.debug("Access Denied")
Expand Down
12 changes: 6 additions & 6 deletions _healthcareoie/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def healthcareoie_profile():
is_evident_validated = user["profile"][get_udp_ns_fieldname("is_evident_validated")]

return render_template(
"healthcare/profile.html",
"healthcareoie/profile.html",
id_token=TokenUtil.get_id_token(request.cookies),
access_token=TokenUtil.get_access_token(request.cookies),
user_info=get_userinfo(),
Expand Down Expand Up @@ -102,7 +102,7 @@ def healthcareoie_accept_terms():
def healthcareoie_account():
logger.debug("healthcareoie_account")
return render_template(
"healthcare/account.html",
"healthcareoie/account.html",
user_info=get_userinfo(),
config=session[SESSION_INSTANCE_SETTINGS_KEY])

Expand All @@ -123,7 +123,7 @@ def healthcareoie_schedule():
gender = user["profile"][get_udp_ns_fieldname("gender")]

return render_template(
"healthcare/schedule.html",
"healthcareoie/schedule.html",
id_token=TokenUtil.get_id_token(request.cookies),
access_token=TokenUtil.get_access_token(request.cookies),
user_info=get_userinfo(),
Expand Down Expand Up @@ -271,7 +271,7 @@ def healthcareoie_clear_consent(userid):
def healthcareoie_healthrecord():
logger.debug("healthcareoie_healthrecord")
return render_template(
"healthcare/healthrecord.html",
"healthcareoie/healthrecord.html",
user_info=get_userinfo(),
config=session[SESSION_INSTANCE_SETTINGS_KEY])

Expand Down Expand Up @@ -327,7 +327,7 @@ def healthcareoie_healthins():
claims.append(claimEntry)

return render_template(
"healthcare/healthins.html",
"healthcareoie/healthins.html",
user_info=get_userinfo(),
patient_name=name,
medication_info=medications,
Expand Down Expand Up @@ -394,7 +394,7 @@ def _get_smart(request):
smart_config = {
'app_id': session[SESSION_INSTANCE_SETTINGS_KEY]["settings"]["app_ins_fhir_clientid"],
'api_base': session[SESSION_INSTANCE_SETTINGS_KEY]["settings"]["app_ins_fhir_api_base"],
'redirect_uri': request.url_root + "healthcare/smartfhir_callback",
'redirect_uri': request.url_root + "healthcareoie/smartfhir_callback",
'scope': 'launch/patient patient/Patient.read patient/MedicationRequest.read patient/Claim.read skip_patient_selection'
}
sessionId = session.get('fhir_session_id')
Expand Down

0 comments on commit dca72e2

Please sign in to comment.