init: treatment report
feat(treatment-report): add treatment report component with sample data Implement new treatment report feature including list view component, sample data, and configuration. The component supports pagination, filtering by date range, and search functionality. Also integrates with encounter process and home views. wip: init form and schema
This commit is contained in:
No files matched your search
@@ -0,0 +1,89 @@
|
||||
import { z } from 'zod'
|
||||
|
||||
const isoDateTime = z.string().min(1, 'Tanggal / waktu wajib diisi')
|
||||
const positiveInt = z.number().int().nonnegative()
|
||||
|
||||
const OperatorTeamSchema = z.object({
|
||||
dpjpId: z.number().int(),
|
||||
operatorId: z.number().int(),
|
||||
assistantOperatorId: z.number().int().optional().nullable(),
|
||||
instrumentNurseId: z.number().int().optional().nullable(),
|
||||
|
||||
surgeryDate: isoDateTime,
|
||||
actionDiagnosis: z.string().min(1),
|
||||
|
||||
postOpNurseId: z.number().int().optional().nullable(),
|
||||
})
|
||||
|
||||
const ProcedureSchema = z.object({
|
||||
id: z.number().int().optional(),
|
||||
name: z.string().min(1),
|
||||
code: z.string().min(1),
|
||||
})
|
||||
|
||||
const OperationExecutionSchema = z.object({
|
||||
surgeryType: z.enum(['kecil', 'sedang', 'besar', 'khusus']),
|
||||
billingCode: z.string().min(1),
|
||||
operationSystem: z.enum(['khusus', 'cito', 'elektif']),
|
||||
|
||||
operationStartAt: isoDateTime,
|
||||
operationEndAt: isoDateTime,
|
||||
|
||||
anesthesiaStartAt: isoDateTime,
|
||||
anesthesiaEndAt: isoDateTime,
|
||||
|
||||
surgeryCleanType: z.enum(['bersih', 'bersih_terkontaminasi', 'terkontaminasi', 'kotor']).optional(),
|
||||
surgeryNumber: z.enum(['1', '2', '3', '4+', 'tidak_diketahui']).optional(),
|
||||
|
||||
birthPlaceNote: z.string().optional(),
|
||||
babyWeightGram: positiveInt.optional(),
|
||||
birthCondition: z.string().optional(),
|
||||
|
||||
operationDescription: z.string().min(1),
|
||||
|
||||
bleedingAmountCc: positiveInt.optional(),
|
||||
|
||||
birthRemark: z.enum(['lahir_hidup', 'lahir_mati', 'abortus', 'tidak_diketahui']).optional(),
|
||||
})
|
||||
|
||||
const BloodComponentSchema = z.object({
|
||||
used: z.boolean().default(false),
|
||||
volumeCc: positiveInt.optional(),
|
||||
})
|
||||
|
||||
const BloodInputSchema = z.object({
|
||||
prc: BloodComponentSchema,
|
||||
ffp: BloodComponentSchema,
|
||||
wb: BloodComponentSchema,
|
||||
tc: BloodComponentSchema,
|
||||
})
|
||||
|
||||
const ImplantSchema = z.object({
|
||||
brand: z.string().optional(),
|
||||
name: z.string().optional(),
|
||||
stickerNumber: z.string().optional(),
|
||||
companionName: z.string().optional(),
|
||||
})
|
||||
|
||||
const SpecimenSchema = z.object({
|
||||
destination: z.string().min(1),
|
||||
})
|
||||
|
||||
const TissueNoteSchema = z.object({
|
||||
note: z.string().min(1),
|
||||
})
|
||||
|
||||
export const ActionReportSchema = z.object({
|
||||
operatorTeam: OperatorTeamSchema,
|
||||
procedures: z.array(ProcedureSchema).min(1),
|
||||
|
||||
operationExecution: OperationExecutionSchema,
|
||||
|
||||
bloodInput: BloodInputSchema.optional(),
|
||||
implant: ImplantSchema.optional(),
|
||||
specimen: SpecimenSchema.optional(),
|
||||
|
||||
tissueNotes: z.array(TissueNoteSchema).optional(),
|
||||
})
|
||||
|
||||
export type ActionReportFormData = z.infer<typeof ActionReportSchema>
|
||||
Reference in New Issue
Block a user