R/validate_data.R
validate_microbiology.RdValidate microbial isolates & susceptibility records
validate_microbiology(specimens, isolates, susceptibilities)a data frame with one row per specimen sent to laboratory (see details)
a data frame with one row per microorganism isolated from the laboratory specimen (see details)
a data frame with one row per susceptibility (see details)
TRUE if the validation is passed
The following fields are mandatory:
specimen_ida unique specimen identifier with no missing value
patient_ida patient identifier with no missing value
statusone value from the following FHIR R4 reference set:
"available": The physical specimen is present and
in good condition.
"unavailable": There is no physical specimen because it is either
lost, destroyed or consumed.
"unsatisfactory": The specimen cannot be used because of a
quality issue such as a broken container, contamination, or too old.
"entered-in-error": The specimen was entered in error and
therefore nullified.
specimen_datetimedatetime when specimen was sampled or received for processing.
specimen_type_codecharacter vector of descendants of
the SNOMED CT concept 123038009 | Specimen (specimen) |. Admissible
values are listed in reference_specimen_type
specimen_type_namecharacter vector of the SNOMED CT
preferred terms for specimen_type_code
specimen_type_displaycharacter vector of custom specimen types for display in user interfaces
The following fields are optional:
encounter_ida hospital encounter identifier (if the specimen was sampled during admission)
test_displayfree text description of test requested for display in user interfaces. For instance: "Mycobacteria culture" or "Microbial culture, anaerobic, initial isolation". Coded concepts should be stored in other custom columns.
reason_displayfree text reason for a procedure for display in user interfaces. For instance, "Suspected urinary tract infection", or "Surgical site microbiological sample". Coded concepts should be stored in other custom columns.
The following fields are mandatory:
isolate_ida unique isolated organism identifier with no missing value
specimen_ida specimen identifier with no missing value
patient_ida patient identifier with no missing value
organism_codea character vector containing either:
a microorganism code validated using as.mo()
NA_character_ if no microorganism was isolated, for instance
due to no growth or mixed heavy growth
organism_namea microorganism name provided by
mo_name(), or NA if no microorganism was isolated
organism_display_namemicroorganism name as labelled by the laboratory, for display in user interfaces. No growth/mixed heavy growth should be referenced here
isolation_datetimedatetime when the organism was first isolated (or reported) by the laboratory
The following field is optional:
mdr_classificationcharacter vector of classifications produced by
mdro(). Admissible values are:
NA_character_ when susceptibilities are not available/conclusive
"Negative" for isolate presenting no wide resistance phenotype
other character codes dependent on the guideline parameter
provided to mdro()
The following fields are mandatory:
isolate_idan isolated organism identifier with no missing value
specimen_ida specimen identifier with no missing value
patient_ida patient identifier with no missing value
organism_codea microorganism code validated using
as.mo(), with no missing values
organism_namea microorganism name provided by
mo_name(), with no missing values
organism_display_namemicroorganism name as labelled by the laboratory, for display in user interfaces, with no missing values
agent_codecode of the antimicrobial tested as provided by
as.ab()
agent_namename of the antimicrobial tested as provided by
ab_name()
agent_display_namename of the antimicrobial tested,
with no missing values, for display in reports and user interfaces
(can be the same as drug_name)
rsi_code"R" (resistant), "S" (susceptible),
or "I" (intermediate exposure), as determined by the laboratory or by
as.sir() on the basis of minimum inhibitory concentrations
or disk diffusion diameters