Skip to content

Instantly share code, notes, and snippets.

@arthcc
Last active March 12, 2024 15:45
Show Gist options
  • Save arthcc/a76d658a578a6ffcb5a826a03ee92c01 to your computer and use it in GitHub Desktop.
Save arthcc/a76d658a578a6ffcb5a826a03ee92c01 to your computer and use it in GitHub Desktop.
user.ts
import { BaseEntity, Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
export enum Gender {
MALE = 'Homem',
FEMALE = 'Mulher',
OTHER = 'Outro',
}
@Entity('patient')
export class Patient extends BaseEntity {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ nullable: false, type: 'varchar', length: 200 })
patientName: string;
@Column({ nullable: false, type: 'varchar', length: 200 })
patientEmail: string;
@Column({ nullable: false, type: 'varchar', length: 20 })
phone: string;
@Column({ nullable: false, type: 'varchar', length: 20 })
cpf: string;
@Column({ nullable: false, type: 'varchar', length: 20 })
rg: string;
@Column({ nullable: false, type: 'enum', enum: Gender })
genre: Gender;
@Column({ nullable: false, type: 'date' })
birthDate: Date;
@Column({ nullable: false, type: 'varchar', length: 200 })
address: string;
@Column({ nullable: true, type: 'varchar', length: 10 })
number: string;
@Column({ nullable: true, type: 'varchar', length: 200 })
complement: string;
@Column({ nullable: false, type: 'varchar', length: 200 })
city: string;
@Column({ nullable: false, type: 'varchar', length: 100 })
state: string;
@Column({ nullable: false, type: 'varchar', length: 9 })
zipCode: string;
@Column({ nullable: true, type: 'text' })
allergies: string;
@Column({ nullable: true, type: 'text' })
currentMedications: string;
@Column({ nullable: true, type: 'text' })
medicalConditions: string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment