Skip to content

Commit

Permalink
MAT-7013: Modify values to environmental variables. nest related vari…
Browse files Browse the repository at this point in the history
…ables
  • Loading branch information
mcmcphillips committed Apr 23, 2024
1 parent ced0109 commit 8a27e34
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public ResponseEntity<List<QdmValueSet>> getValueSetsExpansions(
public ResponseEntity<List<CodeSystem>> retrieveAndUpdateCodeSystems(
Principal principal,
HttpServletRequest request,
@Value("${admin-api-key}") String apiKey,
@Value("${code-system-refresh-task.admin-api-key}") String apiKey,
@RequestHeader("Authorization") String accessToken) {
final String username = principal.getName();
UmlsUser umlsUser = vsacService.verifyUmlsAccess(username);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ public class UpdateCodeSystemTask {
private final FhirTerminologyService fhirTerminologyService;


@Value("${admin-api-key}")
private String adminApiKey;
@Scheduled(cron = "@midnight") // every midnight
@Value("${code-system-refresh-task.terminology-key}")
private String apiKey;
@Scheduled(cron = "${code-system-refresh-task.code-system-cron-date-time}") // every midnight
public void updateCodeSystems() {
log.info("Starting scheduled task to update code systems.");

UmlsUser user = new UmlsUser();
user.setApiKey(adminApiKey);
user.setApiKey(apiKey);
ResponseEntity<List<CodeSystem>> response = ResponseEntity.ok()
.body(fhirTerminologyService.retrieveAllCodeSystems(user));
log.info("Successfully retrieved and updated code systems for user: {}", response);
Expand Down
5 changes: 4 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ okta:
issuer: ${OKTA_ISSUER:https://dev-18092578.okta.com/oauth2/default}
audience: ${OKTA_AUDIENCE:api://default}

admin-api-key: ${ADMIN_API_KEY:0a51991c}
code-system-refresh-task:
admin-api-key: ${ADMIN_API_KEY:0a51991c}
terminology-key: ${VSAC_API_KEY}
code-system-cron-date-time: ${REFRESH_TIME:@midnight}

client:
vsac_base_url: https://vsac.nlm.nih.gov/vsac
Expand Down

0 comments on commit 8a27e34

Please sign in to comment.