-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from OxfordIHTM/dev
refresh repository
- Loading branch information
Showing
13 changed files
with
158 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,78 @@ | ||
#' | ||
#' Structure ORA XML outputs | ||
#' | ||
#' @param ora_xml XML outputs | ||
#' @param ora_xml XML outputs. | ||
#' | ||
#' @return A structured output | ||
#' @return A tibble outputs. | ||
#' | ||
#' @examples | ||
#' #ora_identify() |> ora_identify_structure() | ||
#' ora_identify() | ||
#' ora_list_meta_formats() | ||
#' | ||
#' @rdname ora_structure | ||
#' @export | ||
#' | ||
|
||
ora_structure_identify <- function(ora_xml) { | ||
field_names <- ora_xml |> | ||
xml2::xml_children() |> | ||
xml2::xml_children() |> | ||
xml2::xml_name() | ||
|
||
values <- ora_xml |> | ||
xml2::xml_children() |> | ||
xml2::xml_attrs(".//verb") | ||
xml2::xml_children() |> | ||
xml2::xml_contents() |> | ||
xml2::xml_children() |> | ||
xml2::xml_contents() | ||
xml_list <- xml2::as_list(ora_xml) | ||
|
||
responseDate <- xml_list |> | ||
unlist(recursive = FALSE) |> | ||
(\(x) x[[1]][[1]])() | ||
|
||
request <- xml_list[[1]][2] |> | ||
(\(x) paste0(x$request, "?verb=", attributes(x$request)))() | ||
|
||
description <- xml_list |> | ||
unlist(recursive = FALSE) |> | ||
(\(x) x[[3]][8])() |> | ||
unlist() |> | ||
dplyr::bind_rows() | ||
|
||
names(description) <- names(description) |> | ||
tools::file_ext() | ||
|
||
tibble::tibble( | ||
responseDate, | ||
request, | ||
xml_list |> | ||
unlist(recursive = FALSE) |> | ||
(\(x) x[[3]][1:7] |> unlist() |> dplyr::bind_rows())(), | ||
description | ||
) | ||
} | ||
|
||
#' | ||
#' @rdname ora_structure | ||
#' @export | ||
#' | ||
|
||
ora_structure_meta_formats <- function(ora_xml) { | ||
xml_list <- ora_xml |> | ||
xml2::as_list() |> | ||
unlist(recursive = FALSE) | ||
|
||
xml_list[1:2] <- xml_list[1:2] |> | ||
unlist(recursive = FALSE) | ||
|
||
xml_list[2] <- paste0( | ||
xml_list[2], | ||
"?verb=", | ||
ora_xml |> | ||
xml2::as_list() |> | ||
(\(x) attributes(x[[1]][2][[1]]))() | ||
) | ||
|
||
names(xml_list) <- names(xml_list) |> | ||
tools::file_ext() | ||
|
||
xml_list[[3]] <- xml_list[[3]] |> | ||
dplyr::bind_rows() |> | ||
tidyr::unnest( | ||
cols = c( | ||
.data$metadataPrefix, .data$schema, .data$metadataNamespace | ||
) | ||
) | ||
|
||
dplyr::bind_cols(xml_list) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
citHeader("To cite codigo in publications use:") | ||
|
||
citEntry( | ||
entry = "Manual", | ||
title = "codigo: Interface to the International Classification of Diseases (ICD) API", | ||
author = c(person("Anita Makori"), person("Ernest Guevarra")), | ||
year = "2024", | ||
note = "R package version 0.0.9000", | ||
url = "https://oxford-ihtm.io/codigo/", | ||
textVersion = paste( | ||
paste("Anita Makori and Ernest Guevarra (2024).", | ||
"codigo: Interface to the International Classification of Diseases (ICD) API.", | ||
"R package version 0.0.9000.", | ||
"URL https://oxford-ihtm.io/codigo/") | ||
) | ||
bibentry( | ||
bibtype = "Manual", | ||
header = "To cite aurora in publications use:", | ||
title = "aurora: Interface to the Oxord University Research Archive (ORA) API", | ||
author = person("Ernest Guevarra"), | ||
year = "2024", | ||
note = "R package version 0.0.9000", | ||
url = "https://oxford-ihtm.io/aurora/" | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.