Skip to content

Commit 31ea5a0

Browse files
committed
Add load example action to FHIR internationalizer
1 parent 3ebebab commit 31ea5a0

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/app/fhir-internationalizer/fhir-internationalizer.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ <h1 class="mat-headline-5">FHIR Resource Internationalizer</h1>
3232
Browse file
3333
</button>
3434
<input #fileInput type="file" hidden accept=".json" (change)="onFileSelected($event)" />
35+
<button mat-button color="primary" (click)="loadExample()" style="margin-top: 4px;">
36+
<mat-icon>science</mat-icon>
37+
Load example
38+
</button>
3539
</div>
3640

3741
<mat-error *ngIf="validationError" class="upload-error">

src/app/fhir-internationalizer/fhir-internationalizer.component.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,15 @@ export class FhirInternationalizerComponent implements OnInit, OnDestroy {
135135
event.target.value = '';
136136
}
137137

138+
loadExample(): void {
139+
fetch('assets/data/ips-example-argentina-problematic-use.json')
140+
.then(r => r.blob())
141+
.then(blob => {
142+
const file = new File([blob], 'ips-example-argentina-problematic-use.json', { type: 'application/json' });
143+
this.processFile(file);
144+
});
145+
}
146+
138147
async processFile(file: File): Promise<void> {
139148
this.validationError = '';
140149
this.fhirResource = null;

0 commit comments

Comments
 (0)