3b246b4f1f
Rows name their patient with pac_id (a decimal string) or the legacy id_seudonimo. pac_id wins; an invalid pac_id is never replaced by the legacy field, and a page that repeats a patient or mixes both fields is not drawn or exported. The table, patient record, PDF and spreadsheet follow the announced identifier column and label. CaCu requests risk only with a pac_id.
37 lines
1.7 KiB
HTML
37 lines
1.7 KiB
HTML
<h2 mat-dialog-title>{{ titulo }}</h2>
|
|
<form [formGroup]="form" (ngSubmit)="agregar()">
|
|
<mat-dialog-content>
|
|
<p>Paciente {{ data.paciente.id }}</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>
|