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 5, 2022
1 parent fca007b commit d15f018
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 5 deletions.
33 changes: 29 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') {
(value.value) ? this.parametros['cie10'] = this.cie10.codigo : this.parametros['cie10'] = null;
} else if (tipo === 'reporte') {
this.reportes = this.tipoReportes?.nombre === 'Reporte C2';
}
}


Expand Down Expand Up @@ -178,4 +184,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([]);
}
}
}
6 changes: 5 additions & 1 deletion src/app/components/reportes/encabezadoReportes.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@
(change)="refreshSelection($event,'organizacion')" [(ngModel)]="organizacion"
name="organizacion" [readonly]="totalOrganizaciones || zonaSanitaria">
</plex-select>
<plex-select label="Diagnostico" (change)="refreshSelection($event,'cie10')" [(ngModel)]="cie10"
name="diagnostico" (getData)="codigoCIE10($event)" [readonly]="reportes">
</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 d15f018

Please sign in to comment.