外来診療管理システムのデータモデルを考えてみた

こんにちは!kossyです。

今回は、外来診療管理システムのデータモデルの例が掲載されている書籍がありまして、そちらの内容を自分なりに咀嚼してRDBMSに落とし込んでみたので、備忘録としてブログに残してみたいと思います。

WIPですので随時更新します。

登場人物

  • 患者
  • 医師
  • システム管理者

ユーザーストーリー

患者

DB設計

テーブルは全てid、created_at、updated_atカラムが定義されているものとします。

patients

患者テーブル

name type options description
number string null: false 患者番号
born_on date null: false 生年月日
sex integer null: false 性別
job_id bigint foreign_key: true, index: true, optional: true 職業(外部キー)

jobs

職業テーブル

name type options description
name string null: false, index: true 職業名

insurance_cards

保険証テーブル

name type options description
symbol string null: false 記号
number string null: false 番号
delivery_on date null: false 交付日
acquisition_on date 資格取得日
relationship integer null: false 続柄
expires_on date 有効期限
insurer_number string null: false, 6桁or8桁 保険者番号

備考

  • 被用者保険か国民健康保険かで記載してある項目にバラつきがあり、必ずnullになることもあるが、許容する

departments

診療科テーブル

name type options description
name string null: false 診療科名

doctors

医師テーブル

name type options description
last_name string null: false
first_name string null: false
last_name_kana string null: false 姓(カナ)
first_name_kana string null: false 名(カナ)

doctor_departments

医師と診療科の中間テーブル

name type options description
doctor_id bigint null: false, index: true, foreign_key: true 外部キー
department_id bigint null: false, index: true, foreign_key: true 外部キー

consultations

受診履歴テーブル

name type options description
patient_id bigint null: false, index: true, foreign_key: true 外部キー
doctor_id bigint null: false, index: true, foreign_key: true 外部キー
visited_on date null: false 受診日
self_pay_ratio integer null: false 自己負担割合
chief_complaint text null: false 主訴
findings text null: false 所見
visit_category integer null: false 受診区分。初診または再診
status integer null: false 受診状況

medical_histories

既往歴テーブル

name type options description
patient_id bigint null: false, index: true, foreign_key: true 外部キー
age integer null: false 罹患時年齢
name string 傷病名
descriptions text 摘要

consultation_schedules

診察日程テーブル

name type options description
department_id bigint null: false, index: true, foreign_key: true 外部キー
schedule_on date null: false, index: true 診察日
time_category integer null: false 午前/午後区分
patient_count integer null: false, default: 0 診察患者数
max_wait_patient_count integer null: false, default: 0 最大待ち患者数

doctor_schedules

医師日程テーブル

name type options description
doctor_id bigint null: false, index: true, foreign_key: true 外部キー
consultation_schedule_id bigint null: false, index: true, foreign_key: true 外部キー
patient_count integer null: false, default: 0 診察患者数

business_times

診察受付日時テーブル

name type options description
am_start_at datetime null: false 午前診察開始日時
am_start_at datetime null: false 午前診察終了日時
pm_start_at datetime null: false 午後診察開始日時
pm_start_at datetime null: false 午後診察終了日時

sy_masters

傷病マスターテーブル

name type options description
code string null: false, index: true 傷病コード
name string null: false, index: true 傷病名

consultation_sy_details

傷病明細テーブル

name type options description
code string null: false, index: true 傷病コード
consultation_id bigint null: false, index: true, foreign_key: true 外部キー
outcome_category integer null: false 転帰区分
is_main_disease boolean null: false, default: false 主傷病フラグ

treatment_masters

処置マスターテーブル

name type options description
code string null: false 処置コード
name string null: false 処置名
category integer null: false 処置区分(処置/注射/点滴)

treatment_details

処置明細テーブル

name type options description
code string null: false 処置コード
consultation_id bigint null: false, index: true, foreign_key: true 外部キー
descriptions text null: false 摘要

medicine_masters

薬品マスターテーブル

name type options description
code string null: false 薬品コード
name string null: false 薬品名
unit string null: false 単位

consultation_medicine_details

投薬明細テーブル

name type options description
code string null: false 薬品コード
dosing string null: false 服用方法
per_time integer null: false 1回あたり服用量
doses integer null: false 服用回数
way string null: false 投薬方法