Validate microbial isolates & susceptibility records

validate_microbiology(specimens, isolates, susceptibilities)

Arguments

specimens

a data frame with one row per specimen sent to laboratory (see details)

isolates

a data frame with one row per microorganism isolated from the laboratory specimen (see details)

susceptibilities

a data frame with one row per susceptibility (see details)

Value

TRUE if the validation is passed

Specimens data frame

The following fields are mandatory:

specimen_id

a unique specimen identifier with no missing value

patient_id

a patient identifier with no missing value

status

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

datetime when specimen was sampled or received for processing.

specimen_type_code

character vector of descendants of the SNOMED CT concept 123038009 | Specimen (specimen) |. Admissible values are listed in reference_specimen_type

specimen_type_name

character vector of the SNOMED CT preferred terms for specimen_type_code

specimen_type_display

character vector of custom specimen types for display in user interfaces

The following fields are optional:

encounter_id

a hospital encounter identifier (if the specimen was sampled during admission)

test_display

free 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_display

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

Isolates data frame

The following fields are mandatory:

isolate_id

a unique isolated organism identifier with no missing value

specimen_id

a specimen identifier with no missing value

patient_id

a patient identifier with no missing value

organism_code

a 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_name

a microorganism name provided by mo_name(), or NA if no microorganism was isolated

organism_display_name

microorganism name as labelled by the laboratory, for display in user interfaces. No growth/mixed heavy growth should be referenced here

isolation_datetime

datetime when the organism was first isolated (or reported) by the laboratory

The following field is optional:

mdr_classification

character 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()

Susceptibilities data frame

The following fields are mandatory:

isolate_id

an isolated organism identifier with no missing value

specimen_id

a specimen identifier with no missing value

patient_id

a patient identifier with no missing value

organism_code

a microorganism code validated using as.mo(), with no missing values

organism_name

a microorganism name provided by mo_name(), with no missing values

organism_display_name

microorganism name as labelled by the laboratory, for display in user interfaces, with no missing values

agent_code

code of the antimicrobial tested as provided by as.ab()

agent_name

name of the antimicrobial tested as provided by ab_name()

agent_display_name

name 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