Skip to content

Commit

Permalink
Update modify.mdJSON.R
Browse files Browse the repository at this point in the history
  • Loading branch information
hdvincelette committed Jul 20, 2024
1 parent f566854 commit 49921ab
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions R/modify.mdJSON.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#' @param domain_codeName Conditionally optional character string. Name of the domain to add or modify.
#' @param domain_description Optional character string. Description of the domain specified with 'domain_codeName'.
#' @param domainItem Optional list. Permissible entry value(s), name(s), and definition(s) of the domain specified with 'domain_codeName', i.e., domainItem = list(list(name = "", value = "", definition = "")). Unnamed list elements must be ordered correctly (name, value, definition). 'domainItem' will override 'domainItem_value', 'domainItem_name', and 'domainItem_definition' when 'how' == 'add_attribute', 'add_domain' or 'add_domainItem.
#' @param domainItem_value Optional character string or vector. Permissible entry value(s) of the domain specified with 'domain_codeName'.
#' @param domainItem_name Optional character string or vector. Name(s) of permissible entry value(s) specified with 'domainItem_value'.
#' @param domainItem_value Optional character string or vector. Permissible entry value(s) of the domain specified with 'domain_codeName'.
#' @param domainItem_definition Optional character string or vector. Definition(s) of permissible entry value(s) specified with 'domainItem_value'.
#' @param new.attribute_codeName Optional character string. New name for the attribute specified with 'attribute_codeName'.
#' @param new.domain_codeName Optional character string. New name for the domain specified with 'domain_codeName'.
Expand Down Expand Up @@ -87,8 +87,8 @@ modify.mdJSON <-
domain_codeName = "",
domain_description = "",
domainItem = list(),
domainItem_value = "",
domainItem_name = "",
domainItem_value = "",
domainItem_definition = "",
new.attribute_codeName = "",
new.domain_codeName = "",
Expand Down Expand Up @@ -332,16 +332,6 @@ modify.mdJSON <-
}
domainItem.input <- domainItem

if (is.null(domainItem_value) == FALSE) {
if (missing(domainItem_value) |
domainItem_value == "") {
domainItem_value <- ""
} else {
definedparam <- c(definedparam, "domainItem_value")
}
}
domainItem_value.input <- domainItem_value

if (is.null(domainItem_name) == FALSE) {
if (missing(domainItem_name) |
domainItem_name == "") {
Expand All @@ -352,6 +342,16 @@ modify.mdJSON <-
}
domainItem_name.input <- domainItem_name

if (is.null(domainItem_value) == FALSE) {
if (missing(domainItem_value) |
domainItem_value == "") {
domainItem_value <- ""
} else {
definedparam <- c(definedparam, "domainItem_value")
}
}
domainItem_value.input <- domainItem_value

if (is.null(domainItem_definition) == FALSE) {
if (missing(domainItem_definition) |
domainItem_definition == "") {
Expand Down Expand Up @@ -1512,7 +1512,7 @@ modify.mdJSON <-
moredomainItems.choice <- 1

while (moredomainItems.choice == 1) {
if (length(newdomain[[1]][["domainItem"]][[1]][["name"]]) != 0) {
if (length(newdomain[[1]][["domainItem"]][[1]][["value"]]) != 0) {
newdomain[[1]][["domainItem"]] <-
append(newdomain[[1]][["domainItem"]], blankdomain[[1]][["domainItem"]])
domainItem.num <-
Expand All @@ -1521,6 +1521,7 @@ modify.mdJSON <-
domainItem.num <- 1
}


## domainItem name
domainItem_name.input <- ""

Expand Down Expand Up @@ -1803,7 +1804,7 @@ modify.mdJSON <-
moredomainItems.choice <- 1

while (moredomainItems.choice == 1) {
if (length(newdomain[[1]][["domainItem"]][[1]][["name"]]) != 0) {
if (length(newdomain[[1]][["domainItem"]][[1]][["value"]]) != 0) {
newdomain[[1]][["domainItem"]] <-
append(newdomain[[1]][["domainItem"]], blankdomain[[1]][["domainItem"]])
domainItem.num <-
Expand All @@ -1812,6 +1813,7 @@ modify.mdJSON <-
domainItem.num <- 1
}


## domainItem name
domainItem_name.input <- ""

Expand Down

0 comments on commit 49921ab

Please sign in to comment.