Skip to content

Commit

Permalink
feat(MISC-225): Agregar filtro por conceptos en el reporte c2
Browse files Browse the repository at this point in the history
  • Loading branch information
MarianoCampetella committed May 16, 2022
1 parent c7f842b commit 68c8653
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
35 changes: 31 additions & 4 deletions src/app/components/reportes/encabezadoReportes.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import { AgendaService } from '../../services/turnos/agenda.service';
import { ZonaSanitariaService } from '../../../../src/app/services/zonaSanitaria.service';
import { Observable } from 'rxjs';
import { cache } from '@andes/shared';



import { Cie10Service } from 'src/app/apps/mitos';
@Component({
selector: 'encabezadoReportes',
templateUrl: 'encabezadoReportes.html',
Expand All @@ -26,8 +24,10 @@ export class EncabezadoReportesComponent implements OnInit {
public horaInicio: any;
public horaFin: any;
public tipoReportes;
public reportes = false;
public diagnosticos = [];
public diagnostico;
public cie10;
// Propiedades reporteC2
public totalConsultas = 0;
public totalMenor1 = 0;
Expand All @@ -53,7 +53,8 @@ export class EncabezadoReportesComponent implements OnInit {
private router: Router,
private agendaService: AgendaService,
private zonaSanitariaService: ZonaSanitariaService,
public auth: Auth,
private auth: Auth,
public cie10Service: Cie10Service
) { }

public ngOnInit() {
Expand Down Expand Up @@ -109,6 +110,11 @@ export class EncabezadoReportesComponent implements OnInit {
this.parametros['zonaSanitaria'] = null;
}
}
if (tipo === 'cie10') {
this.parametros['cie10'] = value.value ? this.cie10.codigo : null;
} else if (tipo === 'reporte') {
this.reportes = this.tipoReportes?.nombre === 'Reporte C2';
}
}


Expand Down Expand Up @@ -164,6 +170,8 @@ export class EncabezadoReportesComponent implements OnInit {
});
break;
case 'Consultas por prestación':
delete this.parametros.cie10;
this.cie10 = null;
this.showCantidadConsultaXPrestacion = true;
this.showReporteC2 = false;
this.agendaService.findCantidadConsultaXPrestacion(this.parametros).subscribe((diagnosticos) => {
Expand All @@ -178,4 +186,23 @@ export class EncabezadoReportesComponent implements OnInit {
add(a, b) {
return a + b;
}

codigoCIE10(event) {
if (event?.query) {
const query = {
nombre: event.query
};
this.cie10Service.get(query).subscribe((datos) => {
const cie10s = datos.map(dato => ({
id: dato.id,
codigo: dato.codigo,
nombre: `(${dato.codigo}) ${dato.nombre}`
}));
event.callback(cie10s);
});

} else {
event.callback([]);
}
}
}
7 changes: 6 additions & 1 deletion src/app/components/reportes/encabezadoReportes.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@
(change)="refreshSelection($event,'organizacion')" [(ngModel)]="organizacion"
name="organizacion" [readonly]="totalOrganizaciones || zonaSanitaria">
</plex-select>
<plex-select *ngIf="tipoReportes?.nombre === 'Reporte C2'" label="Diagnostico"
(change)="refreshSelection($event,'cie10')" [(ngModel)]="cie10" name="diagnostico"
(getData)="codigoCIE10($event)">
</plex-select>
<plex-select [(ngModel)]="tipoReportes" name="tipoReportes" [data]="opciones"
label-field="Tipo de reportes" label="Seleccione reporte" [required]="true">
label-field="Tipo de reportes" label="Seleccione reporte" [required]="true"
(change)="refreshSelection($event,'reporte')">
</plex-select>
</plex-wrapper>
</plex-grid>
Expand Down

0 comments on commit 68c8653

Please sign in to comment.