Manages randomization data, including projects, configurations, allocation values, subjects, and results. Provides methods for validation, persistence, retrieval, and display of randomization objects.
Fields
uniqueIdCharacter string uniquely identifying the database instance.
creationDatePOSIXct timestamp of database creation.
randomProjectsList of
RandomProjectobjects.randomConfigurationsList of
RandomConfigurationobjects.randomAllocationValuesList of
RandomAllocationValueobjects.randomSubjectsList of
RandomSubjectobjects.randomResultsList of
RandomResultobjects.
Methods
- initialize(..., creationDate)
Initializes a new
RandomDataBaseinstance, assigns a unique ID, and sets up empty lists for all fields.- validateRandomProject(randomProject)
Checks if a project exists in the database; stops with an error if not.
- show()
Displays a summary of the database and its contents.
- toString()
Returns a string representation of the database and its statistics.
- persist(obj)
Persists an object to the appropriate list based on its class.
- getRandomProjectUniqueIds(objects)
Returns a character vector of unique IDs for the given objects' projects.
- getLastSubject(randomProject)
Retrieves the last subject for a given project.
- getLastRandomConfiguration(randomProject)
Retrieves the last configuration for a given project.
- createNewSubjectRandomNumber(randomProject)
Generates the next subject random number for a given project.