Skip to content

Commit

Permalink
adding popover info for General Practitioner/Primary Care.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Aug 18, 2023
1 parent 5b01441 commit 97f15d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h6>Oct 10, 2018</h6>
<div *ngIf="primaryCare" class="media">
<div class="media-body">
<label>Primary Care</label>
<h6>{{primaryCare | fhirPath: "Practitioner.name.family.first()"}}, {{primaryCare | fhirPath: "Practitioner.name.given.first()"}}</h6>
<h6 class="cursor-pointer" [ngbPopover]="primaryCarePopoverContent" placement="bottom" >{{primaryCare?.name?.[0]?.displayName }}</h6>
</div><!-- media-body -->
</div><!-- media -->
<div class="media">
Expand All @@ -38,3 +38,7 @@ <h6>All Sources</h6>
<a class="nav-link" routerLink="/" ngbTooltip="not yet implemented"><i class="fas fa-ellipsis-h"></i></a>
</nav>
</div>

<ng-template #primaryCarePopoverContent>
<fhir-resource [displayModel]="primaryCare"></fhir-resource>
</ng-template>
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Component, Input, OnInit} from '@angular/core';
import {ResourceFhir} from '../../models/fasten/resource_fhir';
import {FastenApiService} from '../../services/fasten-api.service';
import * as fhirpath from 'fhirpath';
import {PractitionerModel} from '../../../lib/models/resources/practitioner-model';

@Component({
selector: 'report-header',
Expand All @@ -10,7 +11,7 @@ import * as fhirpath from 'fhirpath';
})
export class ReportHeaderComponent implements OnInit {
patient: ResourceFhir = null
primaryCare: ResourceFhir = null
primaryCare: PractitionerModel = null
@Input() reportHeaderTitle: string = ""
@Input() reportHeaderSubTitle: string = "Organized by condition and encounters"

Expand All @@ -31,7 +32,9 @@ export class ReportHeaderComponent implements OnInit {
if(primaryCareIdParts.length == 2) {
console.log(primaryCareIdParts)
this.fastenApi.getResources(primaryCareIdParts[0], this.patient.source_id, primaryCareIdParts[1]).subscribe(primaryResults => {
this.primaryCare = primaryResults[0]
if (primaryResults.length > 0){
this.primaryCare = new PractitionerModel(primaryResults[0].resource_raw)
}
})
}
}
Expand Down

0 comments on commit 97f15d5

Please sign in to comment.