diff --git a/solicitudesHUDS/index.ts b/solicitudesHUDS/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/solicitudesHUDS/package.json b/solicitudesHUDS/package.json new file mode 100644 index 0000000..253cefc --- /dev/null +++ b/solicitudesHUDS/package.json @@ -0,0 +1,25 @@ +{ + "name": "solicitudes-huds", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "../node_modules/concurrently/bin/concurrently.js -r \"npm run tsc:w\" \"npm run node\" ", + "lint": "tslint --project .", + "tsc": "../node_modules/typescript/bin/tsc", + "tsc:w": "../node_modules/typescript/bin/tsc -w", + "node": "nodemon -q ./index.js" + }, + "author": "", + "license": "ISC", + "dependencies": { + "@andes/bootstrap": "file:../bootstrap", + "@andes/log": "^2.2.5", + "@andes/match": "^1.1.12", + "async": "^2.6.1", + "html-entities": "^1.2.1", + "moment": "^2.22.0", + "mongoose": "^5.3.12", + "request": "^2.88.0" + } +} \ No newline at end of file diff --git a/solicitudesHUDS/squemas/pedidoSolic.squema.ts b/solicitudesHUDS/squemas/pedidoSolic.squema.ts new file mode 100644 index 0000000..91fc7d0 --- /dev/null +++ b/solicitudesHUDS/squemas/pedidoSolic.squema.ts @@ -0,0 +1,53 @@ +import * as mongoose from 'mongoose'; + +export type IPedidoSolic = { + institucion: { + id: number; + nombre: string; + }; + descripcion: string; + efector: { + id: number; + nombre: string; + }; + efectorParticular?: string; + paciente: any; + adjuntos: { + nombre: string; + path: string; + size: number; + mimetype: string; + fecha: Date; + }[]; +}; + + +export const PedidoSolicSchema = new mongoose.Schema( + { + institucion: { + id: { type: Number, required: true }, + nombre: { type: String, required: true } + }, + descripcion: { type: String, required: true }, + efector: { + id: { type: Number, required: true }, + nombre: { type: String, required: true } + }, + efectorParticular: { type: String }, + paciente: { type: mongoose.Schema.Types.ObjectId, ref: 'solicitudPac' }, + adjuntos: [ + { + nombre: String, + path: String, + size: Number, + mimetype: String, + fecha: { type: Date, default: Date.now } + } + ] + }, + { timestamps: true } +); + + + +export const PedidoSolic = mongoose.model('pedidoSolic', PedidoSolicSchema); diff --git a/solicitudesHUDS/squemas/solicitante.squema.ts b/solicitudesHUDS/squemas/solicitante.squema.ts new file mode 100644 index 0000000..6595be7 --- /dev/null +++ b/solicitudesHUDS/squemas/solicitante.squema.ts @@ -0,0 +1,37 @@ +import * as mongoose from 'mongoose'; + +export type ISolicitante = { + nombre: string; + apellido: string; + tipoDocumento: { + dni: number; + pasaporte: number; + }; + email: string; + telefono: number; + organismo: { + nombre: string; + codigo: number; + otro: string; + }; +}; + +export const SolicitanteSchema = new mongoose.Schema({ + nombre: String, + apellido: String, + tipoDocumento: { + dni: Number, + pasaporte: Number + }, + email: String, + telefono: Number, + organismo: { + nombre: String, + codigo: Number, + otro: String, + }, +}); + + + +export const Solicitante = mongoose.model('solicitantes', SolicitanteSchema); diff --git a/solicitudesHUDS/squemas/solicitudPac.squema.ts b/solicitudesHUDS/squemas/solicitudPac.squema.ts new file mode 100644 index 0000000..d00ba27 --- /dev/null +++ b/solicitudesHUDS/squemas/solicitudPac.squema.ts @@ -0,0 +1,30 @@ +import * as mongoose from 'mongoose'; + +export type ISolicitudPac = { + nombre: string; + apellido: string; + documento: number; + email: string; + fechadeNacimiento: Date; + genero: { + id: number; + tipo: string; + } + +}; + +export const SolicitudPacSchema = new mongoose.Schema({ + nombre: String, + apellido: String, + documento: Number, + email: String, + fechadeNacimiento: Date, + genero: { + id: Number, + tipo: String, + }, +}); + + + +export const SolicitudPac = mongoose.model('solicitudPac', SolicitudPacSchema); diff --git a/solicitudesHUDS/tsconfig.json b/solicitudesHUDS/tsconfig.json new file mode 100644 index 0000000..3ae8d8b --- /dev/null +++ b/solicitudesHUDS/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "../tsconfig.json", + "include": [ + "**/*.ts" + ] +} \ No newline at end of file