Spaces:
Sleeping
Sleeping
| import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; | |
| import { Document } from 'mongoose'; | |
| export type DiagnosticCodeDocument = DiagnosticCode & Document; | |
| ({ timestamps: true }) | |
| export class DiagnosticCode { | |
| ({ required: true, unique: true, uppercase: true, trim: true }) | |
| code: string; // e.g. J18.9 | |
| ({ required: true, trim: true }) | |
| description: string; | |
| ({ trim: true }) | |
| category: string; // e.g. Diseases of the respiratory system | |
| ({ trim: true }) | |
| chapter: string; // ICD-10 chapter | |
| ([String]) | |
| includes: string[]; | |
| ([String]) | |
| excludes: string[]; | |
| ({ default: true }) | |
| billable: boolean; | |
| ({ default: true }) | |
| isActive: boolean; | |
| } | |
| export const DiagnosticCodeSchema = SchemaFactory.createForClass(DiagnosticCode); | |
| DiagnosticCodeSchema.index({ code: 'text', description: 'text', category: 'text' }); | |