base: (data.table). A patient discharge database, in the form of a data.table. The data.table should have at least the following columns: sID: patientID (character) fID: facilityID (character) Adate: admission date (POSIXct, but character can be converted to POSIXct) Ddate: discharge date (POSIXct, but character can be converted to POSIXct)
convertDates: (boolean) indicating if dates need to be converted to POSIXct if they are not
dateFormat: (character) giving the input format of the date character string (e.g. "ymd" for dates like "2019-10-30") See parse_date_time for more information on the format.
deleteMissing: (character) How to handle records that contain a missing value in at least one of the four mandatory variables: NULL (default): do not delete. Stops the function with an error message. "record": deletes just the incorrect record. "patient": deletes all records of each patient with one or more incorrect records.
deleteErrors: (character) How incorrect records should be deleted: "record" deletes just the incorrect record "patient" deletes all records of each patient with one or more incorrect records.
subjectID: (character) the columns name containing the subject ID. Default is "sID"
facilityID: (character) the columns name containing the facility ID. Default is "fID"
disDate: (character) the columns name containing the discharge date. Default is "Ddate"
admDate: (character) the columns name containing the admission date. Default is "Adate"
maxIteration: (integer) the maximum number of times the function will try and remove overlapping admissions
retainAuxData: (boolean) allow retaining additional data provided in the database. Default is TRUE.
verbose: (boolean) print diagnostic messages. Default is TRUE.
...: other parameters passed on to internal functions
Returns
The adjusted database as a data.table with a new class attribute "hospinet.base" and an attribute "report" containing information related to the quality of the database.