コンテンツにスキップ

Patient

患者の基本情報を表すモデル。データベースの patient テーブルに対応します。

定義: src/lib/models/patient.ts

フィールド

フィールド 説明
patientId number 患者 ID
lastName string
firstName string
lastNameYomi string 姓のよみ(カナ)
firstNameYomi string 名のよみ(カナ)
sex string 性別(M = 男性、F = 女性)
birthday string 生年月日 (YYYY-MM-DD)
address string 住所
phone string 電話番号
memo object(省略可) 補助情報(メールアドレスなど)

型定義

import { z } from "zod";

export const patientSchema = z.object({
  patientId: z.number(),
  lastName: z.string(),
  firstName: z.string(),
  lastNameYomi: z.string(),
  firstNameYomi: z.string(),
  sex: z.string(),
  birthday: z.string(),
  address: z.string(),
  phone: z.string(),
  memo: z.record(z.string(), z.unknown()).optional()
});

export type Patient = z.infer<typeof patientSchema>;