jinniudashu / hssc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HSSC (Healthcare Service Supply Chain) | 中文文档

🚀 Features

This project is the runtime framework subsystem of a system for customizing healthcare application.

  • The goal of the healthcare application is to coordinate and push the correct information to the right people at the right time.

  • The fundamental solution to this problem is to generate a suitable next task for each collaborator involved, where "suitable" means in accordance with the predetermined business rules.

  • In order to meet the unique needs of the healthcare industry, service tasks and business rules need to be customized by business designers. The system can immediately generate business applications for publication and operation based on the customized business design.

  • The application customized by the business designer can collaborate with multiple healthcare experts' service tasks according to the preset business rules to complete user service tasks.

  • The HSSC runtime framework subsystem imports the business system script generated by the design subsystem. After migration, it can be lunched, and the entire process can be completed in 10 minutes.

  • Service tasks will be pushed to each healthcare expert's tasks list on workbench at the right time according to the business rules defined by the business manager to achieve efficient team collaboration.

  • Reference design subsystem: https://github.com/jinniudashu/formdesign

🧠 Core concepts

The core business model consists of seven key elements, which is a general collaboration system abstraction.

  1. Service tasks: defined by service task metadata, management attribute, and business attribute.

  2. Service form: the work product of the service task, represented by a JSON form consisting of key-value pairs of multiple business fields.

  3. Business event: when the value of a business field in the service form meets certain conditions which is expressed as a logic expression, a certain business event is considered occurring.

  4. Service rules: after completing the service task, what action (system job) should be taken if a certain business event occurs.

  5. System job: system scheduling actions, currently including generating the next task, recommending the next task, sending WeChat public account messages, and sending Enterprise WeChat messages. Additional system jobs can be added based on user needs.

  6. Service process: used to manage and schedule service task status during service task runtime.

  7. Scheduler: determines which system scheduling action should be taken based on the business rules when the service process status changes.

Core business model relationship diagram

👨‍🚀 Getting Started

📋 Requirements

  • Redis server is required at "localhost:6379" to run the application. Please install Redis server first.

  • .env file is required at the root directory of the project, please refer to .env.example for the required environment variables.

🛠️ Manual Installation

  1. Clone the code repository to your local machine:
    git clone https://github.com/your_username/hssc.git
  1. Navigate to the project directory:
    cd hssc
  1. Create a virtual environment:
    python -m venv env
    source env/bin/activate  # Linux or macOS
    .\env\Scripts\activate  # Windows
  1. Install the dependencies:
    pip install -r requirements.txt
  1. Perform database migration:
    python manage.py migrate
  1. Create a superuser account:
    python manage.py createsuperuser
  1. Load initial data & test data:
    python manage.py loaddata initial_data.json
    python manage.py init_core_data
  1. Run Celery beat and worker in defirent terminal, this required a Redis server running in background:
    python celery -A hssc beat -l info
    python celery -A hssc worker -l info
  1. Run the development server:
    python manage.py runserver
  1. Open http://127.0.0.1:8000/admin in your browser to check if the application has started correctly.

  2. Register a test user account at http://127.0.0.1:8000/accounts/register. Any of the service tasks is trigered by the test user's action, no user no task.

  3. Choose a test operater from ./core/management/commands/test_data_clinic.json, or create a staff in admin, then login at http://127.0.0.1:8000/clinic, you will see the task list.

Congratulations! You have successfully installed and run the HSSC application.

🔧 Usage

  1. Import design from design subsystem:
    python manage.py import_design
    python manage.py makemigrations
    python manage.py migrate

    python manage.py loaddata initial_data.json
    python manage.py init_core_data

About


Languages

Language:Python 46.1%Language:JavaScript 39.9%Language:CSS 7.8%Language:HTML 6.1%Language:Dockerfile 0.1%Language:Procfile 0.0%