PrescExample¶
処方例を表すモデル。よく使う薬の量・用法・日数の組み合わせをあらかじめ登録しておくために使います。データベースの presc_example テーブルに対応します。
定義: src/lib/models/presc-example.ts
フィールド¶
| フィールド | 型 | 説明 |
|---|---|---|
prescExampleId |
number | 処方例 ID |
iyakuhincode |
number | 薬のコード(IyakuhinMaster) |
masterValidFrom |
string | 参照する医薬品マスターの有効開始日 (YYYY-MM-DD) |
amount |
string | 量 |
usage |
string | 用法 |
days |
number | 日数・回数 |
category |
number | 薬の区分(0 = 内服、1 = 頓服、2 = 外用) |
comment |
string | 備考・コメント |
型定義¶
import { z } from "zod";
export const prescExampleSchema = z.object({
prescExampleId: z.number(),
iyakuhincode: z.number(),
masterValidFrom: z.string(),
amount: z.string(),
usage: z.string(),
days: z.number(),
category: z.number(),
comment: z.string()
});
export type PrescExample = z.infer<typeof prescExampleSchema>;