@mukulgoel/healthcare-shared
v1.0.1
Published
Shared types, schemas and constants for the Healthcare platform
Maintainers
Readme
@mukulgoel/healthcare-shared
Shared types, schemas and constants for the Healthcare platform — used across frontend, backend and admin apps.
Installation
npm install @mukulgoel/healthcare-sharedWhat's included
Auth Schemas
import { loginSchema, registerSchema, patientRegisterSchema, providerRegisterSchema } from '@mukulgoel/healthcare-shared'
import type { LoginInput, RegisterInput, PatientRegisterInput, ProviderRegisterInput } from '@mukulgoel/healthcare-shared'Appointment Schemas
import { createAppointmentSchema, updateAppointmentSchema } from '@mukulgoel/healthcare-shared'
import type { CreateAppointmentInput, UpdateAppointmentInput } from '@mukulgoel/healthcare-shared'Medical Record Schemas
import { createMedicalRecordSchema } from '@mukulgoel/healthcare-shared'
import type { CreateMedicalRecordInput } from '@mukulgoel/healthcare-shared'Doctor Schemas
import { updateDoctorSchema, doctorAvailabilitySchema, doctorQuerySchema } from '@mukulgoel/healthcare-shared'Enums & Constants
import { UserRole, DoctorStatus, AppointmentStatus, SPECIALIZATIONS } from '@mukulgoel/healthcare-shared'Usage Example
// Backend — validate incoming request
import { createAppointmentSchema } from '@mukulgoel/healthcare-shared'
const result = createAppointmentSchema.safeParse(req.body)
if (!result.success) {
return res.status(400).json({ errors: result.error.errors })
}
// Frontend — use same schema for form validation
import { createAppointmentSchema, type CreateAppointmentInput } from '@mukulgoel/healthcare-shared'
import { zodResolver } from '@hookform/resolvers/zod'
const { handleSubmit } = useForm<CreateAppointmentInput>({
resolver: zodResolver(createAppointmentSchema)
})Versioning
This package follows semantic versioning:
- Patch
1.0.x— bug fixes, no breaking changes - Minor
1.x.0— new schemas/types added - Major
x.0.0— breaking changes to existing schemas
License
MIT
