Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(FEAT) ABM de restricción por paciente #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ConceptosTurneablesComponent } from './conceptos-turneables/components/
import { MonitoreoActivacionesComponent } from './monitor-activaciones/monitoreo-activaciones.component';
import { WebhookLogComponent } from './webhook-log/webhook-log.component';
import { EstadoFuentesAutenticasComponent } from './fuentes-autenticas/components/estado-fa.component';
import { restriccionHudsComponent } from './restriccion-huds/restriccion-huds';

const appRoutes: Routes = [
{ path: '', redirectTo: '/login', pathMatch: 'full' },
Expand All @@ -24,6 +25,7 @@ const appRoutes: Routes = [
{ path: 'novedades', loadChildren: () => import('./registro-novedades/novedades.module').then(m => m.NovedadesModule) },
{ path: 'rupers', loadChildren: () => import('./rupers/rupers.module').then(m => m.RupersModule) },
{ path: 'fuentes-autenticas', component: EstadoFuentesAutenticasComponent, canActivate: [RoutingGuard] },
{ path: 'restriccion-huds', component: restriccionHudsComponent, canActivate: [RoutingGuard] },
{ path: '**', redirectTo: '/home', pathMatch: 'full' }
];

Expand Down
9 changes: 6 additions & 3 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { environment } from './../environments/environment';
import { environment } from '../environments/environment';
import { Server } from '@andes/shared';
import { Plex } from '@andes/plex';
import { Auth } from '@andes/auth';
Expand Down Expand Up @@ -34,8 +34,7 @@ export class AppComponent {
if (this.auth.loggedIn()) {
this.auth.organizaciones().subscribe(data => {
if (data.length > 1) {
this.menuList = [{ label: 'Seleccionar Organización', icon: 'hospital-building', route: '/login/select-organizacion' },
...this.menuList];
this.menuList = [{ label: 'Seleccionar Organización', icon: 'hospital-building', route: '/login/select-organizacion' }, ...this.menuList];
this.plex.updateMenu(this.menuList);
}
});
Expand Down Expand Up @@ -84,6 +83,10 @@ export class AppComponent {
this.menuList.push({ label: 'Elementos RUP', icon: 'magnify', route: '/rupers/elementos-rup' });
}

if (this.auth.check('monitoreo:restriccionHuds')) {
this.menuList.push({ label: 'Restricciones a la HUDS', icon: 'magnify', route: '/restriccion-huds' });
}

this.menuList.push({ label: 'Cerrar Sesión', icon: 'logout', route: '/login/logout' });

this.plex.updateMenu(this.menuList);
Expand Down
36 changes: 28 additions & 8 deletions src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { Server } from '@andes/shared';
import { routing } from './app-routing.module';
import { InfiniteScrollModule } from 'ngx-infinite-scroll';

// pipes
import { SharedModule } from '@andes/shared';

// Components
import { AppComponent } from './app.component';
import { HomeComponent } from './home/home.component';
Expand All @@ -30,7 +33,17 @@ import { ModulosModule } from './modulos/modulos.module';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { EstadoFuentesAutenticasComponent } from './fuentes-autenticas/components/estado-fa.component';
import { FuentesAutenticasService } from './fuentes-autenticas/services/fuentes-autenticas.service';
import { TokenExpiredInterceptor } from './services/token-expired.interceptor';
import { restriccionHudsComponent } from './restriccion-huds/restriccion-huds';
import { UsuariosHttp } from './services/usuarios.service';
import { PermisosService } from './services/permisos.service';
import { PacienteBuscarComponent } from './restriccion-huds/paciente-buscar.component';
import { PacienteListadoComponent } from './restriccion-huds/paciente-listado.component';
import { PacienteBuscarService } from './services/paciente-buscar.service';
import { PacienteCacheService } from './services/pacienteCache.service';
import { PacienteService } from './services/paciente.service';
import { AdjuntosService } from './services/adjuntos.service';
import { GaleriaArchivosComponent } from './shared/galeria-archivos.component';
import { ProfesionalService } from './services/profesional.service';

@NgModule({
declarations: [
Expand All @@ -43,7 +56,11 @@ import { TokenExpiredInterceptor } from './services/token-expired.interceptor';
NuevoConceptoTurneableComponent,
MonitoreoActivacionesComponent,
BuscadorSnomedComponent,
EstadoFuentesAutenticasComponent
EstadoFuentesAutenticasComponent,
restriccionHudsComponent,
PacienteBuscarComponent,
PacienteListadoComponent,
GaleriaArchivosComponent
],
imports: [
BrowserModule,
Expand All @@ -54,7 +71,8 @@ import { TokenExpiredInterceptor } from './services/token-expired.interceptor';
AuthModule,
InfiniteScrollModule,
ModulosModule,
NoopAnimationsModule
NoopAnimationsModule,
SharedModule
],
providers: [
Server,
Expand All @@ -70,11 +88,13 @@ import { TokenExpiredInterceptor } from './services/token-expired.interceptor';
WebhookLogService,
ModulosService,
FuentesAutenticasService,
{
provide: HTTP_INTERCEPTORS,
useClass: TokenExpiredInterceptor,
multi: true,
}
UsuariosHttp,
PermisosService,
PacienteCacheService,
PacienteService,
PacienteBuscarService,
AdjuntosService,
ProfesionalService
],
bootstrap: [AppComponent]
})
Expand Down
7 changes: 7 additions & 0 deletions src/app/interfaces/IContacto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface IContacto {
tipo: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como tipo hace referencia a "celular, fijo o email" se puede cambiar su declaración por string en vez de any

valor: string;
ranking: number;
activo: boolean;
ultimaActualizacion: Date;
}
11 changes: 11 additions & 0 deletions src/app/interfaces/ICreatedBy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export interface ICreatedBy {
documento: number;
username: number;
apellido: string;
nombre: string;
nombreCompleto: string;
organizacion: {
id: string;
nombre: string;
};
}
11 changes: 11 additions & 0 deletions src/app/interfaces/IDireccion.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { IUbicacion } from './IUbicacion';

export interface IDireccion {
valor: String;
codigoPostal: String;
ubicacion: IUbicacion;
ranking: Number;
geoReferencia: [Number, Number];
ultimaActualizacion: Date;
activo: Boolean;
}
7 changes: 7 additions & 0 deletions src/app/interfaces/IMatricula.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface IMatricula {
numero: Number;
descripcion: String;
activo: Boolean;
fechaInicio: Date;
fechaVencimiento: Date;
}
14 changes: 14 additions & 0 deletions src/app/interfaces/IObraSocial.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export interface IObraSocial {
id: string;
tipoDocumento: String;
dni: Number;
transmite: String;
nombre: String;
codigoFinanciador: Number;
financiador: String;
version: Date;
numeroAfiliado: String;
prepaga?: Boolean;
codigoPuco?: Number;
idObraSocial?: Number;
}
106 changes: 106 additions & 0 deletions src/app/interfaces/IPaciente.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { IPacienteRelacion } from './IPacienteRelacion.inteface';
import { IContacto } from './IContacto';
import { IDireccion } from './IDireccion';
import { EstadoCivil } from '../shared/enumerados';
import { IUbicacion } from './IUbicacion';
import { IObraSocial } from './IObraSocial';
import { ICreatedBy } from './ICreatedBy';

export interface IPaciente {
id: string;
documento: string;
cuil: string;
activo: boolean;
estado: string;
nombre: string;
apellido: string;
nombreCompleto: string;
alias: string;
contacto: IContacto[];
sexo: string;
genero: string;
tipoIdentificacion: string;
numeroIdentificacion: string;
fechaNacimiento: Date; // Fecha Nacimiento
edad: number;
edadReal: { valor: number; unidad: string };
fechaFallecimiento: Date;
direccion: IDireccion[];
lugarNacimiento?: IUbicacion;
estadoCivil: EstadoCivil;
fotoId: string;
foto: string;
createdBy: ICreatedBy;
relaciones: [IPacienteRelacion];
financiador: [{
codigoPuco: Number;
nombre: string;
financiador: string;
id: string;
numeroAfiliado: string;
}];
identificadores: [{
entidad: string;
valor: string;
}];
claveBlocking: [string];
entidadesValidadoras?: [string];
scan: string;
reportarError: Boolean;
notaError: string;
carpetaEfectores?: [{
organizacion: {
id: string;
nombre: string;
};
nroCarpeta: string;
}];
notas?: [{
fecha: Date;
nota: string;
destacada: Boolean;
}];
_score?: number;
vinculos: [string];
documentos: {
fecha: Date;
tipo: {
id: string;
label: string;
};
archivos: {
id: string;
ext: string;
}[];
}[];
idPacientePrincipal?: string;
}

export interface IPacienteBasico {
id: string;
nombre: string;
apellido: string;
alias: string;
documento: string;
numeroIdentificacion: string;
sexo: string;
genero: string;
fechaNacimiento: Date;
obraSocial?: IObraSocial;
telefono?: string;
carpetaEfectores?: [{
organizacion: {
id: string;
nombre: string;
};
nroCarpeta: string;
}];
}

export interface IPacienteRestringido {
idPaciente: string;
observaciones: string;
createdBy: any;
createdAt: Date;
archivos?: any[];
}
8 changes: 8 additions & 0 deletions src/app/interfaces/IPacienteMatch.inteface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

import { IPaciente } from './IPaciente';

export interface IPacienteMatch {
id: String;
paciente: IPaciente;
_score: number;
}
22 changes: 22 additions & 0 deletions src/app/interfaces/IPacienteRelacion.inteface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

export interface IPacienteRelacion {
id?: string;
relacion: {
id: string;
nombre: string;
opuesto: string;
};
referencia: string;
nombre: string;
apellido: string;
documento: string;
numeroIdentificacion?: string;
fechaNacimiento?: Date;
fechaFallecimiento?: Date;
sexo?: string;
foto: any;
fotoId: any;
activo?: boolean;
alias?: string;
genero?: string;
}
84 changes: 84 additions & 0 deletions src/app/interfaces/IProfesional.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import { IUbicacion } from './IUbicacion';
// import { IMatricula } from './IMatricula';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remover comentario!

import { Sexo, Genero, EstadoCivil, tipoComunicacion } from '../shared/enumerados';

export interface IProfesional {
id: String;
documento: String;
activo: Boolean;
habilitado: boolean;
nombre: String;
apellido: String;
contacto: [{
tipo: tipoComunicacion;
valor: String;
ranking: Number; // Specify preferred order of use (1 = highest) // Podemos usar el rank para guardar un historico de puntos de contacto (le restamos valor si no es actual???)
ultimaActualizacion: Date;
activo: Boolean;
}];
sexo: Sexo;
genero: Genero; // identidad autopercibida
fechaNacimiento: Date; // Fecha Nacimiento
fechaFallecimiento: Date;
direccion: [{
valor: String;
codigoPostal: String;
ubicacion: IUbicacion;
ranking: Number;
geoReferencia: {
type: [Number]; // [<longitude>, <latitude>]
index: '2d'; // create the geospatial index
};
ultimaActualizacion: Date;
activo: Boolean;
}];
estadoCivil: EstadoCivil;
foto: String;
rol: String; // Ejemplo Jefe de Terapia intensiva
especialidad: [{ // El listado de sus especialidades
id: string;
nombre: String;
}];
matriculas: [{
numero: Number;
descripcion: String;
fechaInicio: Date;
fechaVencimiento: Date;
activo: Boolean;
}];
formacionGrado: [{
exportadoSisa?: Boolean;
profesion: {
nombre: string;
codigo: number;
tipoDeFormacion: String;
};
entidadFormadora: {
nombre: string;
codigo: number;
};
titulo: string;
fechaEgreso: Date;
fechaTitulo: Date;
renovacion: boolean;
papelesVerificados: boolean;
matriculacion?: [{
matriculaNumero: Number;
libro: String;
folio: String;
inicio: Date;
baja: {
motivo: String;
fecha: any;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cambiar any por Date

};
notificacionVencimiento: Boolean;
fin: Date;
revalidacionNumero: Number;
}];
matriculado: boolean;
fechaDeInscripcion?: Date;
}];
profesionalMatriculado: Boolean;
profesionExterna: any;
matriculaExterna: String;
}
Loading
Loading