Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MISC - Agregar filtro por conceptos en el reporte c2 #2634

Merged
merged 1 commit into from
Jul 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,10 +24,12 @@ export class EncabezadoReportesComponent implements OnInit {
public horaInicio: any;
public horaFin: any;
public tipoReportes;
public reportes = false;
public diagnosticos = [];
public diagnostico;
public inicio = true;
public estaVacio = false;
public cie10;
// Propiedades reporteC2
public totalConsultas = 0;
public totalMenor1 = 0;
Expand All @@ -55,7 +55,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 @@ -112,6 +113,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';
}
}

public imprimir() {
Expand Down Expand Up @@ -168,6 +174,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 @@ -183,4 +191,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