Skip to content

CB Medical Archives ​

A department-based medical records system for RSG Core, with patient registration, visit records, deceased status, death certificates, shared documents, and optional Discord certificate delivery.

Current resource version: 2.2.4
Framework: RSG Core
Dependencies: rsg-core, rsg-inventory, cb-libs, ox_lib, oxmysql

Installation ​

  1. Copy the inner cb-marchives directory into your resources folder.
  2. Import install/cb-marchives.sql.
  3. Configure departments, jobs, access methods, and death certificates in shared/config.lua.
  4. If item access is enabled, add archive_book from the install item file to RSGShared.Items.
  5. Start resources in this order:
ini
ensure rsg-core
ensure rsg-inventory
ensure cb-libs
ensure ox_lib
ensure oxmysql
ensure cb-marchives

Features ​

  • Department-scoped patient archive
  • Patient lookup, registration, and nearest-player registration
  • Paginated medical history
  • Create and update medical records
  • Deceased declarations and certificate amendments
  • Configurable manners of death
  • Shareable patient documents
  • Multiple medical jobs and minimum grades per department
  • Target, prompt, item, or command access
  • Optional office blips

Access configuration ​

lua
Config.Access = {
    target = true,
    prompt = false,
    item = false,
    command = false,
    itemName = 'archive_book',
    commandName = 'marchives'
}

Enable only the access methods you intend to support. The default command, when enabled, is /marchives.

Departments ​

Each department supports a label, patient ID prefix, prompt identifier, blip settings, job/grade map, and multiple locations.

lua
valentine = {
    label = "Valentine Physician's Office",
    prefix = 'VAL',
    jobs = { valmedic = 0, doctor = 0, medic = 0 },
    locations = { vector3(-289.46, 806.82, 119.31) }
}

Use unique department keys and prefixes. Replace the example job names with the exact job keys used by your RSG server.

Duty and patient IDs ​

  • Config.RequireOnDuty restricts archive use to on-duty medical staff.
  • Config.PatientIdPrefix is the global fallback prefix.
  • A department's prefix identifies records created through that office.

Death certificates ​

Config.DeathCertificates controls the feature, certificate title, seal image, webhook presentation, and valid manners of death. Leave the webhook blank when Discord delivery is not required.

Webhook URLs are credentials. Store and distribute them privately, rotate any webhook that has appeared in source control, and never place one in public documentation.

Typical workflow ​

  1. Open a permitted medical archive.
  2. Search for an existing patient or register the nearest player.
  3. Open the patient record and add a medical entry.
  4. Update the entry when follow-up treatment is performed.
  5. When necessary, declare the patient deceased and complete the certificate.
  6. Upload or share the resulting document through the configured workflow.

Troubleshooting ​

The archive will not open ​

Check job name, minimum grade, duty state, department location, and enabled access method. Ensure cb-libs and ox_lib started first.

Nearest-player registration fails ​

The target must be online and close enough to the medical worker. Make sure the selected character has fully loaded into RSG Core.

Death certificates do not reach Discord ​

Confirm the feature is enabled, the webhook has not been revoked, and the VPS can make outbound HTTPS requests. Check the server console for Discord HTTP errors.

Patient records disappear ​

Verify the SQL import and database connection. Do not change department prefixes after issuing records unless you also migrate existing data.