diff --git a/src/models/prescription.model.ts b/src/models/prescription.model.ts index 70e0d63..ce5929e 100644 --- a/src/models/prescription.model.ts +++ b/src/models/prescription.model.ts @@ -30,7 +30,13 @@ const prescriptionSchema = new Schema({ dispensedAt: { type: Date }, supplies: [{ _id: false, - supply: supplySchema, + supply: { + ...supplySchema.obj, + type: { + type: String, + enum: ['device', 'nutrition', 'magistral'] + }, + }, quantity: Number, quantityPresentation: Number, diagnostic: { diff --git a/src/models/supply.model.ts b/src/models/supply.model.ts index b462694..9ea3113 100644 --- a/src/models/supply.model.ts +++ b/src/models/supply.model.ts @@ -11,7 +11,7 @@ export const supplySchema = new Schema({ activePrinciple: { type: String }, - pharmaceutical_form:{ + pharmaceutical_form: { type: String }, power: { @@ -32,7 +32,7 @@ export const supplySchema = new Schema({ fsn: String, semanticTag: String } -},{ +}, { timestamps: true });