Fuenfgeld / DMA2024TeamA

MIT License
0 stars 0 forks source link

ER-Modell mit mermaid.js #8

Closed Uti404 closed 8 months ago

Uti404 commented 9 months ago

Versuch mit Mermaid.js ein übersichtliches ER-Modell zu gestalten.

CV293008 commented 9 months ago

title: Order example

erDiagram Patient ||--o{ Immunisations : erhaelt Immunisations ||--|{ Encounters : contains Patient ||--o{ Observations : erhaelt Observations ||--|{ Encounters : contains Patient ||--o{ Careplans : erhaelt Careplans ||--|{ Encounters : contains Patient ||--o{ Conditions : erhaelt Conditions ||--|{ Encounters : contains Patient ||--o{ Devices : erhaelt Devices ||--|{ Encounters : contains Patient ||--o{ Procedures : erhaelt Procedures ||--|{ Encounters : contains Patient ||--o{ Medications : erhaelt

CV293008 commented 9 months ago

view.pdf

Uti404 commented 8 months ago
---
title: Covid-19
---
   erDiagram
Patient ||--o{ Immunisations : erhaelt
Immunisations ||--|{ Encounters : contains
Patient ||--o{ Observations : erhaelt
Observations ||--|{ Encounters : contains
Patient ||--o{ Careplans : erhaelt
Careplans ||--|{ Encounters : contains
Patient ||--o{ Conditions : erhaelt
Conditions ||--|{ Encounters : contains
Patient ||--o{ Devices : erhaelt
Devices ||--|{ Encounters : contains
Patient ||--o{ Procedures : erhaelt
Procedures ||--|{ Encounters : contains
Patient ||--o{ Medications : erhaelt
 Patient {
        string ID PK
        date Birthdate
        date Deathdate
        string SSN
        string Drivers
        string Passport
        string Prefix
        string First
        string Last
        string Suffix
        string Maiden
        string Marital
        string Race
        string Ethnicity
        string Gender
        string Birthplace
        string Address
        string City
        string State
        string County
        string ZIP
        int LAT
        int LON
        int healthcare_expense
        int healthcare_coverage
    }
 Conditions {
        string Patient PK
        date Start
        date Stop
        string Encounter
        string Code
        string Desription
     }
 Medications {
        string Patient PK
        date Start
        date Stop
        string Payer
        string Encounter
        string Code
        string Description 
        int Base_cost
        int payer_coverage
        int Dispenses
        int Total_cost
        string Reasoncode
        string Reasondescription
     }
 Careplans {
        string Patient
        date Start
        date Stop
        string Patient
        string Encounter
        string Code
        string Description
        string Reasoncode
        string Reasondescription
     }
 Immunisations {
        date Date
        string Patient
        string Encounter
        string Code
        string Decritpion
        int Base_cost
     }
 Observations {
        date Date
        string Patient
        string Encounter
        string Code
        string Description
        string Value
        string Units
        string Type
     }
 Devices {
        date Start
        date Stop
        string Patient
        string Enounter
        string Code
        string Description
        string UID
     }
Procedures {
        date Date
        string Patient
        string Encounter
        string Code
        string Description
        int Base_cost
        string Reasoncode
        string Reasondescription
     }
Encounters {
        string ID
        date Start
        date Stop
        string Patient
        string Organisations
        string Provider
        string Payer
        string Encounterclass
        string Code
        string Description
        int Base_encounter_cost
        int Total_claim_cost
        int payer_coverage
        string Reasoncode
        string Reasondescription
}
Uti404 commented 8 months ago

Ich hab das ER jetzt mal auch im Wiki gespeichert. Es fehlen noch Markierungen mit primary key, sowie foreign key. Es wäre möglich diese so zu markieren, wie bei der Tabelle Patient in einer extra Spalte jeweils mit PK oder FK.

Uti404 commented 8 months ago

@Fuenfgeld Wir haben folgende Fragen:

  1. Können wir den primary Key in dem ER-Modell mit Mermaid anderweitig kennzeichnen? Kann man die Primary Key eventuell unterstreichen lassen?
  2. Kann man hier die foreign Key farblich kennzeichnen?
Fuenfgeld commented 8 months ago

Zum aktuellen Stand unterstützt Mermaid keine direkte Methode, um Primärschlüssel (oder irgendeinen Text) innerhalb eines Diagramms zu unterstreichen oder auf ähnliche Weise speziell zu kennzeichnen. In der Praxis werden Primärschlüssel oft durch Konventionen in der Benennung (wie ein vorangestelltes PK_ oder ähnliches) oder durch Kommentare neben den Schlüsselattributen hervorgehoben.