Skip to content

Instantly share code, notes, and snippets.

@ilfey
Last active March 12, 2024 11:58
Show Gist options
  • Select an option

  • Save ilfey/1cf653c9720d7e253d6e6f1c2af5ba74 to your computer and use it in GitHub Desktop.

Select an option

Save ilfey/1cf653c9720d7e253d6e6f1c2af5ba74 to your computer and use it in GitHub Desktop.
Схема бд
erDiagram
    User {
        int id pk
        string login
        string firstname
        string lastname
        string middlename
        date birthday
        int user_worker_id fk
    }

    Patient {
        string firstname
        string lastname
        string middlename
        date birthday
    }

    UserWorker {
        int id pk
        int role_id fk
        int specialization_id fk
    }

    Role {
        int id pk
        string title
    }

    Specialization {
        int id pk
        string title
    }

    PatientVisitResult {
        int id pk
        %% регистратор
        int user_id fk
        %% пациент
        int patient_id fk
        int visit_result_id fk
        datetime date
    }

    VisitResult {
        int id pk
        string diagnosis
        string note
    }

    User ||--o{ UserWorker : ""
    Role ||--o{ UserWorker : ""
    Specialization ||--o{ UserWorker : ""

    User ||--o{ PatientVisitResult : ""
    Patient ||--o{ PatientVisitResult : ""
    PatientVisitResult ||--o| VisitResult : ""
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment