Skip to content

ueno12345/modernTimes

Repository files navigation

English | 日本語

modernTimes

modernTimes is a tool to assist nurses in creating schedules. The system has two methods for creating schedules.

  1. automatic generation by block programming
  2. manual generation by inputting and editing the schedule table

In method 1, an AUK is generated by describing constraints with visual blocks using google Blockly, and the schedule is created using the AUK. AUK is a DSL (Domain Specific Language) that can describe nurse scheduling problems.

The system is based on AUK and can generate AUK not only from visual blocks but also from schedules. Therefore, the system enables interactive schedule creation by editing the AUK representing the schedule (adding constraints using blocks) and then solving the schedule again. The system uses an extension of sparrow for the schedule solver. sparrow uses SAT solvers for schedule solving. An interface to SAT Solver is provided by Ravensat.

Requirements

  • Ruby 3.1.2
  • ruby on rails 7~

Setup

modernTimes

  1. Download modernTimes
    $ git clone https://github.com/nomlab/modernTimes.git

SAT solver install

  1. Install Minisat
     $ sudo apt install minisat

Launch

Preparation

  1. Execute bundle install

    $ bundle install
  2. Execute npm install

    $ npm install
  3. Remove Existing Credentials (Optional)

    If a shared credentials.yml.enc and master.key exist, you may need to remove them first.

       $ rm config/credentials.yml.enc
  4. Generate a New master.key

    Each user can generate their own master.key using the following command: bin/rails credentials:edit This will create a new master.key in the config/ directory. A new credentials.yml.enc file will also be generated if it does not exist. When the editor opens, you can add the required settings (e.g., secret_key_base).

  5. Add Required Settings to credentials.yml.enc

    Redirect the output of rails secret directly into the credentials editor to simplify the process:

    $ EDITOR="echo secret_key_base: $(rails secret) >>" bin/rails credentials:edit
  6. Create a DB

    $ bundle exec rails db:migrate RAILS_ENV=production

Linux

  1. Launch
    To run the following, you need to pass exe/modernTimes.
  • Start the system.
    $ modernTimes start production.
  • Restart the system.
    $ modernTimes restart production
  • Stop the system.
    $ modernTimes stop After launching, open http://localhost:54321 in your browser to open the modernTimes screen

Install for developpers

  1. Download modenTimes
    $ git clone https://github.com/nomlab/modernTimes.git
  2. Install Minisat
     $ sudo apt install minisat
  3. Execute bundle install
    $ bundle install
  4. Execute npm install
    $ npm install
  5. Create a DB
    $ bundle exec rails db:migrate RAILS_ENV=development
  6. Create a dummy data
    $ bin/rails runner scripts/create_dummy_data.rb
    
  7. Launch
    To run the following, you need to pass exe/modernTimes.
  • Start the system.
    $ modernTimes start development.

  • Restart the system.
    $ modernTimes restart development.

  • Stop the system.
    $ modernTimes stop

    After launching, open http://localhost:3000 in your browser to open the modernTimes screen

ER diagram

%%{init:{'theme':'base','themeVariables':{'primaryColor':'#ffffff','primaryTextColor':'#ffffff','primaryBorderColor':'#000000','secondaryColor':'#000000','lineColor':'#000000','noteTextColor':'#000000','noteBkgColor':'#000000','textColor':'#000000','fontSize':'20px','fontFamily':''},'themeCSS':"text.actor {font-size:24px !important;}"}}%%
 erDiagram
   rails_nurses }|--|| teams : "many to one"
   rails_nurses ||--|{ assignments : "one to many"
   assignments }|--|| shift_types : "many to one"
   rails_nurses {
     integer id PK
     string name "name"
     integer ladder_level "1-5: the more experienced, the bigger"
     references team_id FK
   }

   teams {
     integer id PK
     string name "team name"
   }

   assignments {
     integer id PK
     date date "date"
     references rails_nurse_id FK
     references shift_type_id FK
     integer state "number of states such as fixed, unfixed, requested, etc"
   }

   shift_types {
     integer id PK
     string name "Shift type (day, semi-night, night, rest, etc)"
     integer kind "Type of how the value is handled"
   }
Loading

About

No description, website, or topics provided.

Resources

License

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
blockly_LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •