Skip to content

Commit

Permalink
Update REST api to read daily cached file
Browse files Browse the repository at this point in the history
  • Loading branch information
svginc committed Sep 5, 2023
1 parent c4285b1 commit 26ba5a4
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions api/download/downloadsmodule.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ get_endpoint_organizations <- function(db_connection) {
get_endpoint_export_tbl <- function(db_tables) {

endpoint_organization_tbl <- get_endpoint_organizations(db_connection)
print(endpoint_organization_tbl)
endpoint_export_tbl <- db_tables$endpoint_export %>%
collect() %>%
mutate(vendor_name = na_if(vendor_name, "")) %>%
Expand All @@ -28,8 +27,6 @@ endpoint_export_tbl <- db_tables$endpoint_export %>%
mutate(endpoint_names = gsub("NULL", "", as.character(endpoint_names))) %>%
mutate(endpoint_names = gsub("(\")", "", as.character(endpoint_names))) %>%
mutate(format = gsub("(\"|\"|\\[|\\])", "", as.character(format)))
print("endpoint_export_tbl")
print(endpoint_export_tbl)
endpoint_export_tbl
}

Expand Down
2 changes: 0 additions & 2 deletions api/download/restendpoints.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ function(res) {
res$setHeader("Content-Disposition", "attachment; filename=fhir_endpoints.csv")
st <- format(Sys.time(), "%Y-%m-%d")
filename <- paste("fhir_endpoints_", st, ".csv", sep = "")
print(filename)
if (!file.exists(filename)) {
print("Not")
write.csv(get_fhir_endpoints_tbl(db_tables), file=filename, row.names=FALSE)
}
include_file(filename, res, content_type = "text/csv")
Expand Down

0 comments on commit 26ba5a4

Please sign in to comment.