-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RUP - Componente para visualización de alergias (#2685)
* feat(rup): componente para visualizar alergias del paciente * correcciones
- Loading branch information
Showing
6 changed files
with
89 additions
and
24 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/app/apps/rup/mapa-camas/views/plan-indicaciones/alergias-paciente.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { Component, OnInit, Input } from '@angular/core'; | ||
import { Observable } from 'rxjs'; | ||
import { map } from 'rxjs/operators'; | ||
import { PrestacionesService } from '../../../../../modules/rup/services/prestaciones.service'; | ||
import { IPaciente } from '../../../../../core/mpi/interfaces/IPaciente'; | ||
|
||
@Component ({ | ||
selector: 'alergias-paciente', | ||
templateUrl: './alergias-paciente.html', | ||
styles: [` | ||
.bordered { | ||
width: 175px; | ||
height: 36px; | ||
border: #ff8d22 solid 1px; | ||
} | ||
`] | ||
}) | ||
export class AlergiasPacienteComponent implements OnInit { | ||
@Input() paciente: IPaciente; | ||
@Input() cardSize: 'half' | 'full' = 'half'; | ||
|
||
public registrosAlergia$: Observable<any[]>; | ||
private expression = '<<39579001 OR <<419199007'; | ||
|
||
constructor( | ||
private prestacionesService: PrestacionesService | ||
) {} | ||
|
||
ngOnInit() { | ||
this.registrosAlergia$ = this.prestacionesService.getRegistrosHuds(this.paciente.id, this.expression, null, null, null, 'inferred').pipe( | ||
map(alergias => alergias.map(a => { | ||
return { | ||
nombre: a.registro.nombre, | ||
evolucion: a.registro.valor.evolucion?.replace(/<[/]*p>/gi, ' '), | ||
fechaInicio: a.registro.valor.fechaInicio | ||
}; | ||
}) | ||
) | ||
); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/app/apps/rup/mapa-camas/views/plan-indicaciones/alergias-paciente.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<ng-container *ngIf="(registrosAlergia$ | async) as alergias"> | ||
<div *ngIf="alergias.length" class="mr-1 bordered" justify="between"> | ||
<plex-label class="ml-2" titulo="Paciente alérgico" [tituloBold]="false" subtitulo="" type="warning" size="md"> | ||
</plex-label> | ||
<plex-help size="md" btnType="warning" [cardSize]="cardSize" icon="alert-circle-outline"> | ||
<plex-table size="sm"> | ||
<tr *ngFor="let registro of alergias"> | ||
<td> | ||
<plex-label grow="4" titulo="{{ registro.nombre }}" subtitulo="{{ registro.fechaInicio | fecha }}"></plex-label> | ||
</td> | ||
<td *ngIf="registro.evolucion?.length"> | ||
<plex-label> | ||
<b class="mr-1">Evolución:</b> | ||
<div [innerHtml]="registro.evolucion"></div> | ||
</plex-label> | ||
</td> | ||
<td *ngIf="!registro.evolucion?.length"> | ||
<plex-label>Sin observaciones</plex-label> | ||
</td> | ||
</tr> | ||
</plex-table> | ||
</plex-help> | ||
</div> | ||
</ng-container> |
3 changes: 2 additions & 1 deletion
3
src/app/apps/rup/mapa-camas/views/plan-indicaciones/plan-indicaciones.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters