This function performs a series of checks for mandatory and optional requirements on drug administrations data.

validate_administrations(data)

Arguments

data

a data frame containing one row per drug administration

Value

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.

Mandatory fields

The following fields are required in order to pass the validation:

patient_id

a patient identifier with no missing value

prescription_id

a prescription identifier with no missing value

administration_id

an administration identifier with no missing value

administration_text

a character string summarising the drug to administer (to be displayed in user interfaces, eg: 'Amoxicillin oral 500mg')

drug_code

identifier of the drug (for antibacterials/antifungals, use as.ab())

drug_name

preferred name of the drug in the drug dictionary (see ab_name())

drug_display_name

drug name to display in reports and user interfaces (can be the same as drug_name)

drug_group

the antimicrobial class see ab_group()

antiinfective_type

type of antiinfective ("antibacterial", "antifungal", "antiviral", or "antiparasitic")

ATC_code

the ATC code, see ab_atc()

ATC_route

route 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)

dose

a numeric vector of dosage quantities

unit

a character vector of dosage units

route

the route of administration value natively assigned by system

administration_date

timestamp of the drug administration

administration_status

one 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.

Optional fields

DDD

the administered dose expressed in defined daily doses, see compute_DDDs()

...

any other field, as desired, can be loaded into the database.