-
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.
feat(LAB): implementa vista de laboratorios
- Loading branch information
Showing
9 changed files
with
259 additions
and
49 deletions.
There are no files selected for viewing
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
39 changes: 39 additions & 0 deletions
39
src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.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,39 @@ | ||
import { Component, Input, OnInit } from '@angular/core'; | ||
import { LaboratorioService } from 'projects/portal/src/app/services/laboratorio.service'; | ||
|
||
@Component({ | ||
selector: 'vista-laboratorio', | ||
templateUrl: 'vista-laboratorio.html', | ||
styleUrls: ['vista-laboratorio.scss'], | ||
}) | ||
|
||
export class VistaLaboratorioComponent implements OnInit { | ||
|
||
constructor(private laboratorioService: LaboratorioService) { } | ||
|
||
public gruposLaboratorio; | ||
public laboratorios: any = {}; | ||
|
||
@Input() protocolo; | ||
@Input() index: number; | ||
|
||
ngOnInit(): void { | ||
const id = this.protocolo.data.idProtocolo; | ||
|
||
this.laboratorioService.getByProtocolo(id).subscribe((resultados) => { | ||
this.laboratorios = this.groupByArea(resultados[0].Data); | ||
this.gruposLaboratorio = Object.keys(this.laboratorios); | ||
}); | ||
|
||
} | ||
|
||
public groupByArea(data: any): { [key: string]: any[] } { | ||
return data?.reduce((acc, item) => { | ||
if (!acc[item.grupo]) { | ||
acc[item.grupo] = []; | ||
} | ||
acc[item.grupo].push(item); | ||
return acc; | ||
}, {} as { [key: string]: any[] }); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.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,41 @@ | ||
<ng-container> | ||
<div justify class="w-100"> | ||
<div class="info-basica"> | ||
<div class="d-flex flex-column"> | ||
<plex-badge type="info"> | ||
Protocolo {{protocolo.data.idProtocolo}} | ||
</plex-badge> | ||
<b class="mt-1">{{protocolo.data.fecha | fecha}} {{protocolo.data.fecha | hora}}hs</b> | ||
</div> | ||
<plex-grid type="full" cols="3" size="sm"> | ||
<div class="datos"><span>Medico solicitante</span><b>{{protocolo.data.medicoSolicitante}}</b></div> | ||
<div class="datos"><span>Origen</span><b>{{protocolo.data.origen}}</b></div> | ||
<div class="datos"><span>Efector</span><b>{{protocolo.data.efectorSolicitante}}</b></div> | ||
</plex-grid> | ||
</div> | ||
</div> | ||
<div class="w-100 mt-2"> | ||
<plex-title titulo="Resultados" size="md"></plex-title> | ||
<table class="table table-striped table-hover"> | ||
<thead class="text-center"> | ||
<tr> | ||
<th></th> | ||
<th class="text-center">Resultado</th> | ||
<th class="text-center">Referencia/Método</th> | ||
<th class="text-center">Profesional</th> | ||
</tr> | ||
</thead> | ||
<tbody *ngFor="let grupo of this.gruposLaboratorio"> | ||
<tr> | ||
<th class="titulo-grupo"><b>{{grupo}}</b></th> | ||
</tr> | ||
<tr *ngFor="let resultado of laboratorios[grupo]" class="align-items-center"> | ||
<td><b>{{resultado.item}}</b></td> | ||
<td class="text-center">{{resultado.resultado}}</td> | ||
<td class="text-center">{{resultado.valorReferencia}}{{ resultado.Metodo ? '/' + resultado.Metodo : '' }}</td> | ||
<td class="text-center"><plex-badge type="info" size="sm">{{resultado.userValida}}</plex-badge></td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
</ng-container> |
54 changes: 54 additions & 0 deletions
54
src/app/modules/rup/components/ejecucion/laboratorios/vista-laboratorio.scss
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,54 @@ | ||
$blue: #00a8e0; | ||
$lightblue: #d6f7ff; | ||
|
||
.info-basica { | ||
padding: 15px; | ||
border: solid 1px $blue; | ||
border-radius: 8px; | ||
margin-top: 10px; | ||
width: 100%; | ||
display: flex; | ||
gap: 5%; | ||
font-size: smaller; | ||
|
||
} | ||
|
||
.info-basica .datos { | ||
display: flex; | ||
flex-direction: column; | ||
text-align: center; | ||
} | ||
|
||
.titulo-grupo { | ||
background-color: #fff; | ||
color: $blue; | ||
} | ||
|
||
table { | ||
tr { | ||
border: 1px solid white; | ||
} | ||
|
||
td { | ||
font-size: small; | ||
vertical-align: middle; | ||
} | ||
|
||
thead { | ||
th { | ||
border-top: none; | ||
} | ||
} | ||
|
||
tbody { | ||
tr:hover { | ||
background-color: $lightblue; | ||
border: 1px solid $blue; | ||
|
||
td { | ||
border-top: 1px solid $blue; | ||
border-bottom: 1px solid $blue; | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.