Skip to content

Commit

Permalink
updating bundle details endpoint, trimming initial whitespace on meas…
Browse files Browse the repository at this point in the history
…ure strings
  • Loading branch information
szydlofj committed Feb 1, 2024
1 parent 439bae7 commit 7543854
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
4 changes: 3 additions & 1 deletion web/src/app/pages/activities/bundle/bundle.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
[hasPadding]=true
titleAlign="center"
>
<app-loader *ngIf="!isDataLoaded" />
<app-mini-content title="Facility Name">
<app-link [link]="{url: '/facilities/facility/' + tenantId, title: mockBundleDetails?.facility?.name, target: '_self'}"></app-link>
</app-mini-content>
Expand Down Expand Up @@ -45,7 +46,7 @@
[hasPadding]=true
titleAlign="center"
>

<app-loader *ngIf="!isDataLoaded" />
<app-mini-content *ngFor="let n of [1,2,3]" [title]="'Concept Map ' + n">
<strong>ID:</strong> 923123124<br>
<strong>Contexts:</strong> FHIRPath<br>
Expand All @@ -62,6 +63,7 @@
[hasPadding]=true
titleAlign="center"
>
<app-loader *ngIf="!isDataLoaded" />
<app-mini-content>
<div class="d-flex align-items-start mb-2 u-gap2">
<div class="chip mr-1">CDI</div>
Expand Down
33 changes: 18 additions & 15 deletions web/src/app/pages/activities/bundle/bundle.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ActivatedRoute, Router } from '@angular/router';
import { forkJoin } from 'rxjs';
import { HeroComponent } from 'src/app/shared/hero/hero.component';
import { ButtonComponent } from 'src/app/shared/button/button.component';
import { SectionComponent } from 'src/app/shared/section/section.component';
Expand All @@ -11,15 +12,16 @@ import { MiniContentComponent } from 'src/app/shared/mini-content/mini-content.c
import { IconComponent } from 'src/app/shared/icon/icon.component';
import { TableComponent } from 'src/app/shared/table/table.component';
import { LinkComponent } from 'src/app/shared/link/link.component';
import { ReportApiService } from 'src/services/api/report/report-api.service';
import { LoaderComponent } from 'src/app/shared/loader/loader.component';
import { GlobalApiService } from 'src/services/api/globals/globals-api.service';

/* dummy data */
import { normalizationData } from 'src/app/helpers/ReportHelper';

@Component({
selector: 'app-bundle',
standalone: true,
imports: [CommonModule, HeroComponent, ButtonComponent, SectionComponent, TabContainerComponent, TabComponent, CardComponent, MiniContentComponent, IconComponent, TableComponent, LinkComponent],
imports: [CommonModule, HeroComponent, ButtonComponent, SectionComponent, TabContainerComponent, TabComponent, CardComponent, MiniContentComponent, IconComponent, TableComponent, LinkComponent, LoaderComponent],
templateUrl: './bundle.component.html',
styleUrls: ['./bundle.component.scss']
})
Expand All @@ -28,6 +30,8 @@ export class BundleComponent {
tenantId: string | null = 'ehr-test'
dtOptions: DataTables.Settings = {}
bundleDetails: any = {}
isDataLoaded: boolean = false


// purely placeholder
mockBundleDetails: any = {
Expand Down Expand Up @@ -76,7 +80,7 @@ export class BundleComponent {
constructor(
private route: ActivatedRoute,
private router: Router,
private reportsApiService: ReportApiService
private globalApiService: GlobalApiService
) {}

async ngOnInit() {
Expand All @@ -86,24 +90,23 @@ export class BundleComponent {

this.dtOptions = this.calculateDtOptions(this.mockBundleDetails.normalizations.details)

if(this.bundleId) {
this.GetBundleDetails(this.bundleId)
if(this.bundleId && this.tenantId) {

forkJoin({
bundleDetails: this.globalApiService.getContentObservable(`${this.tenantId}/report/${this.bundleId}/aggregate`),
// other stuff, if needed
}).subscribe(({ bundleDetails }) => {
// currently this endpoint doesn't return anything, but someday
this.bundleDetails = bundleDetails

this.isDataLoaded = true
})
} else {
this.router.navigate(['/activities'])
}
})
}

async GetBundleDetails(id: string) {
try {
this.bundleDetails = await this.reportsApiService.fetchReportById(id)
console.log('Bundle Details:', this.bundleDetails)
} catch (error) {
console.error('Error loading the bundle detail:', error)
}
}


generateFacilityLink(): { url: string } {
const url = this.tenantId
? `/facilities/facility/${this.tenantId}`
Expand Down
2 changes: 1 addition & 1 deletion web/src/app/pages/facilities/facilities.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export class FacilitiesComponent implements OnInit {
MEASURES: td.measures
.filter(m => m && m.shortName)
.map(m => {
const measure = this.pascalCaseToSpace.transform(m.shortName)
const measure = this.pascalCaseToSpace.transform(m.shortName.trimStart())
return measure.split(' ')[0]
})
};
Expand Down
1 change: 0 additions & 1 deletion web/src/services/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export class AuthService {

// This method will call the getToken and cache the response values.
handleAuth(code: string) {
debugger;
return this.getToken(code).pipe(
tap(response => {
// Store tokens in a secure storage
Expand Down

0 comments on commit 7543854

Please sign in to comment.