Skip to content

Commit

Permalink
explicitly convert collection_date to character type during specimen …
Browse files Browse the repository at this point in the history
…checking
  • Loading branch information
bgpalmer committed Jan 23, 2024
1 parent 4896408 commit 6621c78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/UploadSamples.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ UploadSamples <- function(sample_type_id, upload_data) {
eval.study_subject_id <- filter(CheckTableTx(conn = conn, "study_subject"), name == eval.subject, study_id == eval.study_id)$id

#3a. check if this sample exists (subject+study+specimen_type) in the database
tmp_table.specimen <- inner_join(CheckTableTx(conn = conn, "specimen")[,c("study_subject_id", "specimen_type_id", "collection_date")],
tmp_table.specimen <- inner_join(dbReadTable(conn = conn, "specimen") %>%
select("study_subject_id", "specimen_type_id", "collection_date") %>%
dplyr::mutate(collection_date = as.character(collection_date)),
tibble(study_subject_id = eval.study_subject_id, specimen_type_id = eval.specimen_type_id, collection_date = eval.collection_date),
by = c("study_subject_id", "specimen_type_id", "collection_date"))

Expand Down

0 comments on commit 6621c78

Please sign in to comment.