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()")}}
- {{conditionDisplayModel?.onset_datetime | date }} - {{conditionDisplayModel.abatement_datetime | date}} + {{conditionDisplayModel?.onset_datetime | date }} - {{conditionDisplayModel.abatement_datetime | date}}
diff --git a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts index e63cc7e3..15cb0c12 100644 --- a/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts +++ b/frontend/src/app/components/report-medical-history-condition/report-medical-history-condition.component.ts @@ -66,6 +66,10 @@ export class ReportMedicalHistoryConditionComponent implements OnInit { constructor() { } ngOnInit(): void { + if(!this.conditionGroup){ + return + } + //add resources to the lookup table, ensure uniqueness. this.conditionDisplayModel = this.recExtractResources(this.conditionGroup) diff --git a/frontend/src/app/pages/resource-creator/resource-creator.component.spec.ts b/frontend/src/app/pages/resource-creator/resource-creator.component.spec.ts index f25ff8f1..a02f82d0 100644 --- a/frontend/src/app/pages/resource-creator/resource-creator.component.spec.ts +++ b/frontend/src/app/pages/resource-creator/resource-creator.component.spec.ts @@ -1,6 +1,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ResourceCreatorComponent } from './resource-creator.component'; +import {HttpClientTestingModule} from '@angular/common/http/testing'; +import {RouterTestingModule} from '@angular/router/testing'; +import {NgbCollapseModule, NgbDatepickerModule} from '@ng-bootstrap/ng-bootstrap'; describe('ResourceCreatorComponent', () => { let component: ResourceCreatorComponent; @@ -8,6 +11,7 @@ describe('ResourceCreatorComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ + imports: [HttpClientTestingModule, RouterTestingModule, NgbDatepickerModule, NgbCollapseModule], declarations: [ ResourceCreatorComponent ] }) .compileComponents(); diff --git a/frontend/src/app/services/nlm-clinical-table-search.service.spec.ts b/frontend/src/app/services/nlm-clinical-table-search.service.spec.ts index a298d1b7..c6502541 100644 --- a/frontend/src/app/services/nlm-clinical-table-search.service.spec.ts +++ b/frontend/src/app/services/nlm-clinical-table-search.service.spec.ts @@ -1,12 +1,15 @@ import { TestBed } from '@angular/core/testing'; import { NlmClinicalTableSearchService } from './nlm-clinical-table-search.service'; +import {HttpClientTestingModule} from '@angular/common/http/testing'; describe('NlmClinicalTableSearchService', () => { let service: NlmClinicalTableSearchService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + imports: [HttpClientTestingModule], + }); service = TestBed.inject(NlmClinicalTableSearchService); });