Files
WebApp/src/app/features/indicadores/paciente-detalle/paciente-registro-dialog.html
T
Roberto Treviño Cervantes e6e6fb7210 preliminary release
2026-10-29 12:12:15 -06:00

37 lines
1.7 KiB
HTML

<h2 mat-dialog-title>{{ titulo }}</h2>
<form [formGroup]="form" (ngSubmit)="agregar()">
<mat-dialog-content>
<p>Paciente {{ data.id_seudonimo }}</p>
<div class="fields">
<mat-form-field appearance="outline">
<mat-label>{{ etiquetaTipo }}</mat-label>
<mat-select formControlName="seleccion" required>
@for (opcion of tipos; track opcion.valor) {
<mat-option [value]="opcion.valor">{{ opcion.etiqueta }}</mat-option>
}
</mat-select>
@if (form.controls.seleccion.hasError('required')) { <mat-error>Selecciona una opción.</mat-error> }
@else { <mat-error>Selecciona una opción válida.</mat-error> }
</mat-form-field>
@if (data.tipo === 'resultado') {
<mat-form-field appearance="outline">
<mat-label>Resultado</mat-label>
<mat-select formControlName="resultado" required>
@for (opcion of resultados; track opcion.valor) {
<mat-option [value]="opcion.valor">{{ opcion.etiqueta }}</mat-option>
}
</mat-select>
<mat-hint>Selecciona primero el tipo de estudio.</mat-hint>
@if (form.controls.resultado.hasError('required')) { <mat-error>Selecciona un resultado para este estudio.</mat-error> }
@else { <mat-error>El resultado no corresponde al estudio seleccionado.</mat-error> }
</mat-form-field>
}
<app-fecha-compuesta formControlName="fecha" [etiqueta]="etiquetaFecha" />
</div>
</mat-dialog-content>
<mat-dialog-actions align="end">
<button mat-button type="button" [mat-dialog-close]="undefined">Cancelar</button>
<button mat-flat-button type="submit" [disabled]="form.invalid">Agregar</button>
</mat-dialog-actions>
</form>