R/read_hl7_file.R

Defines functions read_hl7_file

Documented in read_hl7_file

#' @title reads date hl7 file
#' @param file path of the hl7 file
#'
#' reads whole hl7 file and returns the content of it ####
read_hl7_file <- function(file){
  filename <- paste0(fileparts(file)$name, fileparts(file)$ext)

  if (missing(file)){
    msg <- "File is missng!"
    stop(msg)
  }

  if(!file.exists(file)){
    msg <- paste("File ", file, "does not exists!")
    message(msg)
    return(NULL)
  }

  msg <- paste('Reading', filename)
  message(msg)
  # get the content of the hl7
  result <- get_hl7_data(file = file)
  return(result)
}

Try the rHL7 package in your browser

Any scripts or data that you put into this service are public.

rHL7 documentation built on March 18, 2022, 5:59 p.m.