# TOBE 원무 ERD

```mermaid
erDiagram
    tb_pt["tb_pt<br/>(환자 마스터)"] {
        string pt_no PK
    }
    tb_room["tb_room<br/>(병실 마스터)"] {
        string room_cd PK
    }
    tb_apnt["tb_apnt<br/>(예약 정보)"] {
        string apnt_no PK
    }
    tb_enc["tb_enc<br/>(내원/진료 에피소드)"] {
        string enc_no PK
        string pt_no FK
        string apnt_no FK
    }
    tb_adm["tb_adm<br/>(입원 정보)"] {
        string adm_no PK
        string enc_no FK
        string room_cd FK
    }
    tb_chg_itm["tb_chg_itm<br/>(청구 항목 마스터)"] {
        string chg_cd PK
    }
    tb_enc_chg["tb_enc_chg<br/>(에피소드별 청구 내역)"] {
        string enc_no PK
        int chg_seq PK
        string chg_cd FK
    }
    tb_bill["tb_bill<br/>(수납 청구서)"] {
        string bill_no PK
        string enc_no FK
    }
    tb_pay["tb_pay<br/>(수납 정보)"] {
        string pay_no PK
        string bill_no FK
    }
    tb_clm["tb_clm<br/>(보험 청구)"] {
        string clm_no PK
        string bill_no FK
    }

    tb_apnt ||--o{ tb_enc : converts
    tb_pt ||--o{ tb_enc : has
    tb_enc ||--o{ tb_adm : admits
    tb_room ||--o{ tb_adm : assigned
    tb_chg_itm ||--o{ tb_enc_chg : billed
    tb_enc ||--o{ tb_enc_chg : charged
    tb_enc ||--o| tb_bill : billed
    tb_bill ||--o{ tb_pay : paid
    tb_bill ||--o{ tb_clm : claims
```
