knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(DiagrammeR)
# library(Ramses)

Introduction and rationale

This article introduces the way Ramses handles entities such as patients, prescriptions, or therapy episodes. Each of these entities is associated with specific data analysis operations, and is represented in their own type of records in the backend database.

To ensure users can access the relevant records and perform the desired analytical operations, Ramses employs a object model that consists of S4 classes representing each of these entities, and giving access to relevant functions or methods.

More information on, objects, classes, and methods in R is available from the Object-oriented programming section by @Hadley2019.

Objects in Ramses

Ramses objects are S4 classes. They all conform to the RamsesObject virtual class specification:

MedicationRequest objects, which represent a single drug-dose order, which may or may not participate in combination therapy (2 or more drugs). MedicationRequest objects are associated with one episode of antimicrobial therapy (represented by TherapyEpisode objects). It is possible to retrieve the TherapyEpisode entity from any MedicationRequest object x by passing it to the TherapyEpisode() function.

htmltools::HTML(DiagrammeRsvg::export_svg(grViz("ramses-objects/ramses-class-diagram.gv")))

Database objects

Ramses uses other objects for backend database connections and tables. They follow the dbplyr architecture:

htmltools::HTML(DiagrammeRsvg::export_svg(grViz("ramses-objects/tbl-class-diagram.gv")))

References



ramses-antibiotics/ramses-package documentation built on Feb. 13, 2024, 1:01 p.m.