Skip to content

Commit e9005af

Browse files
committed
fix - Cambios ( se saca directamente los datos que no son importantes)
1 parent daa315f commit e9005af

4 files changed

Lines changed: 19 additions & 43 deletions

File tree

src/app/modules/mpi/components/paciente-detalle.component.ts

Lines changed: 15 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class PacienteDetalleComponent implements OnInit, OnChanges {
2020
@Input() datos = [];
2121
@Input() paciente: IPaciente;
2222
@Input() fields: string[] = ['sexo', 'fechaNacimiento', 'edad', 'cuil', 'financiador', 'numeroAfiliado', 'telefono', 'direccion', 'lugarNacimiento'];
23-
@Input() verMas = true;
2423
@Input() reload: Boolean = false;
2524
@Input() showRelaciones = false;
2625
@Input() showDocumentos = false;
@@ -37,55 +36,48 @@ export class PacienteDetalleComponent implements OnInit, OnChanges {
3736
return this.orientacion === 'vertical' ? 'center' : 'start';
3837
}
3938

40-
get camposVisibles() {
41-
if (this.verMas) {
42-
return this.fields;
43-
}
44-
return this.fields.filter((f) => f === 'edad' || f === 'fechaNacimiento');
45-
}
46-
4739
get showSexo() {
48-
return this.camposVisibles.findIndex(i => i === 'sexo') >= 0;
40+
return this.fields.findIndex(i => i === 'sexo') >= 0;
4941
}
5042

5143
get showFechaNacimiento() {
52-
return this.camposVisibles.findIndex(i => i === 'fechaNacimiento') >= 0;
44+
return this.fields.findIndex(i => i === 'fechaNacimiento') >= 0;
5345
}
5446

5547
get showEdad() {
56-
return this.camposVisibles.findIndex(i => i === 'edad') >= 0;
48+
return this.fields.findIndex(i => i === 'edad') >= 0;
5749
}
5850

5951
get showCuil() {
60-
return this.camposVisibles.findIndex(i => i === 'cuil') >= 0;
52+
return this.fields.findIndex(i => i === 'cuil') >= 0;
6153
}
6254

6355
get showFinanciador() {
64-
return this.camposVisibles.findIndex(i => i === 'financiador') >= 0;
56+
return this.fields.findIndex(i => i === 'financiador') >= 0;
6557
}
6658

6759
get showNumeroAfiliado() {
68-
return this.camposVisibles.findIndex(i => i === 'numeroAfiliado') >= 0;
60+
return this.fields.findIndex(i => i === 'numeroAfiliado') >= 0;
6961
}
7062

7163
get notasDestacadas() {
7264
return this.paciente?.notas?.filter(n => n.destacada) || [];
7365
}
7466

7567
get showDireccion() {
76-
return this.camposVisibles.findIndex(i => i === 'direccion') >= 0;
68+
return this.fields.findIndex(i => i === 'direccion') >= 0;
7769
}
7870

7971
get showTelefono() {
80-
return this.camposVisibles.findIndex(i => i === 'telefono') >= 0;
72+
return this.fields.findIndex(i => i === 'telefono') >= 0;
8173
}
8274

8375
get estadoBadgeType() {
8476
return this.paciente?.estado === 'validado' ? 'success' : 'warning';
8577
}
8678

8779
get showLugarNacimiento() {
88-
return this.camposVisibles.findIndex(i => i === 'lugarNacimiento') >= 0;
80+
return this.fields.findIndex(i => i === 'lugarNacimiento') >= 0;
8981
}
9082

9183
get direccion() {
@@ -165,7 +157,6 @@ export class PacienteDetalleComponent implements OnInit, OnChanges {
165157
}
166158

167159
public relaciones: any[];
168-
private _cargado = false;
169160

170161
private doRelaciones() {
171162
if (this.paciente?.relaciones?.length) {
@@ -201,20 +192,15 @@ export class PacienteDetalleComponent implements OnInit, OnChanges {
201192
}
202193

203194

204-
ngOnChanges(changes) {
205-
const cambioPaciente = changes?.paciente &&
206-
changes.paciente.previousValue &&
207-
changes.paciente.currentValue?.id !== changes.paciente.previousValue?.id;
208-
209-
if (cambioPaciente) {
210-
this._cargado = false;
211-
}
195+
ngOnChanges() {
196+
const requiereReload = this.reload ||
197+
!this.paciente?.financiador ||
198+
!this.paciente?.direccion ||
199+
!this.paciente?.contacto;
212200

213-
// Se recarga solo cuando el paciente cambia (o es la primera carga), no al alternar verMas/fields
214-
if (this.paciente?.id && !this._cargado) {
201+
if (requiereReload && this.paciente?.id) {
215202
this.pacienteService.getById(this.paciente.id).subscribe(result => {
216203
this.paciente = result;
217-
this._cargado = true;
218204
this.loadObraSocial();
219205
this.doRelaciones();
220206
});

src/app/modules/mpi/components/paciente-detalle.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ img {
77
}
88

99
.plex-detail {
10-
margin-top: -20px;
11-
margin-bottom: -7px;
10+
margin-top: 5px;
11+
margin-bottom: -2px;
1212
}
1313

1414
.title {

src/app/modules/visualizacion-informacion/components/exportar-huds/exportar-huds.component.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,8 @@
2525
<plex-button type="link" icon="flecha-izquierda" (click)="onSearchClear()" tooltip="Volver">
2626
</plex-button>
2727
</plex-title>
28-
<div class="text-right mt-1" *ngIf="pacienteSelected">
29-
<plex-button type="link" size="sm" (click)="toggleVerMas()">
30-
{{ verMas ? 'VER MENOS' : 'VER MÁS' }}
31-
</plex-button>
32-
</div>
3328
<paciente-detalle orientacion="horizontal" *ngIf="pacienteSelected" [paciente]="pacienteSelected"
34-
reload="true" [fields]="todosLosCampos" [verMas]="verMas">
29+
reload="true" [fields]="camposBasicos">
3530
</paciente-detalle>
3631
<plex-title titulo="Motivos"></plex-title>
3732
<form #formSolicitud="ngForm">

src/app/modules/visualizacion-informacion/components/exportar-huds/exportar-huds.component.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export class ExportarHudsComponent implements OnInit {
2828
public turnosPrestaciones = false;
2929
public excluirVacunas;
3030
public excluirLaboratorio;
31-
public verMas = false;
32-
public todosLosCampos = ['sexo', 'fechaNacimiento', 'edad', 'cuil', 'financiador', 'numeroAfiliado', 'telefono', 'direccion', 'lugarNacimiento'];
31+
public camposBasicos = ['edad', 'fechaNacimiento'];
3332

3433

3534
constructor(
@@ -149,8 +148,4 @@ export class ExportarHudsComponent implements OnInit {
149148
this.excluirLaboratorio = false;
150149
this.excluirVacunas = false;
151150
}
152-
153-
toggleVerMas() {
154-
this.verMas = !this.verMas;
155-
}
156151
}

0 commit comments

Comments
 (0)