View source: R/validate_data.R
| validate_administrations | R Documentation |
This function performs a series of checks for mandatory and optional requirements on drug administrations data.
validate_administrations(data)
data |
a data frame containing one row per drug administration |
NULL if the data passes the validation. The function will trigger
errors when mandatory requirements are not met and warnings when
optional requirements are not met.
The following fields are required in order to pass the validation:
patient_ida patient identifier with no missing value
prescription_ida prescription identifier with no missing value
administration_idan administration identifier with no missing value
administration_texta character string summarising the drug to administer
(to be displayed in user interfaces, eg: 'Amoxicillin oral 500mg')
drug_codeidentifier of the drug (for antibacterials/antifungals,
use as.ab())
drug_namepreferred name of the drug in the drug dictionary
(see ab_name())
drug_display_namedrug name to display in reports and user interfaces
(can be the same as drug_name)
drug_groupthe antimicrobial class see ab_group()
antiinfective_typetype of antiinfective ("antibacterial", "antifungal", "antiviral", or "antiparasitic")
ATC_codethe ATC code, see ab_atc()
ATC_routeroute of administration as defined in the ATC (
"O" = oral; "P" = parenteral; "Inhal" = inhaled;
"N" = nasal; "SL" = sublingual/buccal/oromucosal;
"TD" = transdermal; "R" = rectal; "V" = vaginal)
dosea numeric vector of dosage quantities
unita character vector of dosage units
routethe route of administration value natively assigned by system
administration_datetimestamp of the drug administration
administration_statusone value from the following FHIR R4 reference set:
"in-progess" the administration has started but has not yet completed.
"not-done" the administration was terminated prior to any impact on
the subject (though preparatory actions may have been taken).
"on-hold" actions implied by the administration have been
temporarily halted, but are expected to continue later.
"completed" all actions that are implied by the administration
have occurred.
"entered-in-error" the administration was entered in error and
therefore nullified.
"stopped" actions implied by the administration have been permanently
halted, before all of them occurred.
"unknown" the authoring/source system does not know which of the
status values currently applies for this request. Note: This concept
is not to be used for 'other' - one of the listed statuses is presumed
to apply, but the authoring/source system does not know which.
DDDthe administered dose expressed in defined daily doses,
see compute_DDDs()
...any other field, as desired, can be loaded into the database.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.