diff --git a/frontend/src/app/components/fhir/resources/practitioner/practitioner.component.ts b/frontend/src/app/components/fhir/resources/practitioner/practitioner.component.ts index 699c4ca3..4d5e6a53 100644 --- a/frontend/src/app/components/fhir/resources/practitioner/practitioner.component.ts +++ b/frontend/src/app/components/fhir/resources/practitioner/practitioner.component.ts @@ -53,14 +53,14 @@ export class PractitionerComponent implements OnInit, FhirResourceComponentInter // enabled: !!this.displayModel.telecom, // }, ]; - for(let idCoding of this.displayModel.identifier){ + for(let idCoding of (this.displayModel?.identifier || [])){ this.tableData.push({ label: `Identifier (${idCoding.system})`, data: idCoding.display || idCoding.value, enabled: true, }) } - for(let telecom of this.displayModel.telecom){ + for(let telecom of (this.displayModel?.telecom || [])){ this.tableData.push({ label: telecom.system, data: telecom.value, diff --git a/frontend/src/app/components/nlm-typeahead/nlm-typeahead.component.spec.ts b/frontend/src/app/components/nlm-typeahead/nlm-typeahead.component.spec.ts index 84b620fa..ea4a6bf8 100644 --- a/frontend/src/app/components/nlm-typeahead/nlm-typeahead.component.spec.ts +++ b/frontend/src/app/components/nlm-typeahead/nlm-typeahead.component.spec.ts @@ -1,6 +1,10 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { NlmTypeaheadComponent } from './nlm-typeahead.component'; +import {HttpClientTestingModule} from '@angular/common/http/testing'; +import {NgbActiveModal, NgbCollapseModule, NgbTypeaheadModule} from '@ng-bootstrap/ng-bootstrap'; +import {FastenApiService} from '../../services/fasten-api.service'; +import {NlmClinicalTableSearchService} from '../../services/nlm-clinical-table-search.service'; describe('NlmTypeaheadComponent', () => { let component: NlmTypeaheadComponent; @@ -8,7 +12,27 @@ describe('NlmTypeaheadComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ NlmTypeaheadComponent ] + imports: [ + NgbTypeaheadModule + ], + declarations: [ NlmTypeaheadComponent ], + providers: [{ + provide: NlmClinicalTableSearchService, + useValue: jasmine.createSpyObj('NlmClinicalTableSearchService', [ + 'searchAllergy', + 'searchAllergyReaction', + 'searchCondition', + 'searchCountries', + 'searchMedicalContactIndividualProfession', + 'searchMedicalContactIndividual', + 'searchMedicalContactOrganization', + 'searchMedicalContactOrganizationType', + 'searchMedication', + 'searchMedicationWhyStopped', + 'searchProcedure', + 'searchVaccine', + ]) + }] }) .compileComponents(); diff --git a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html index 6e8eefbd..81582588 100644 --- a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html +++ b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.html @@ -6,7 +6,7 @@ {{conditionDisplayModel?.sort_title ? conditionDisplayModel?.sort_title : (conditionGroup | fhirPath: "Condition.code.text.first()":"Condition.code.coding.display.first()")}}