From c5e2991c332f16138c298c39eb1bc180d5abf9fb Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Mon, 16 Jan 2023 09:01:05 -0800 Subject: [PATCH] moving pipes into their own module. --- CONTRIBUTING.md | 2 -- frontend/src/app/app.module.ts | 4 ++- .../fhir/datatypes/coding/coding.component.ts | 2 +- frontend/src/app/components/shared.module.ts | 26 +++++++++++++------ frontend/src/app/pipes/pipes.module.ts | 22 ++++++++++++++++ .../resources/related-person-model.spec.ts | 5 ---- 6 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 frontend/src/app/pipes/pipes.module.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d867ac26..71753d5a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -215,8 +215,6 @@ a CDN or minimal Nginx deployment. ### How do I change the default encryption key and admin credentials - FASTEN_ISSUER_JWT_KEY -- FASTEN_COUCHDB_ADMIN_USERNAME -- FASTEN_COUCHDB_ADMIN_PASSWORD ### Generate JWT for local use diff --git a/frontend/src/app/app.module.ts b/frontend/src/app/app.module.ts index 6c4b38f1..7f214ee4 100644 --- a/frontend/src/app/app.module.ts +++ b/frontend/src/app/app.module.ts @@ -29,6 +29,7 @@ import {AuthService} from './services/auth.service'; import { PatientProfileComponent } from './pages/patient-profile/patient-profile.component'; import { MedicalHistoryComponent } from './pages/medical-history/medical-history.component'; import { ReportLabsComponent } from './pages/report-labs/report-labs.component'; +import {PipesModule} from './pipes/pipes.module'; @NgModule({ @@ -57,7 +58,8 @@ import { ReportLabsComponent } from './pages/report-labs/report-labs.component'; ChartsModule, NgxDropzoneModule, HighlightModule, - MomentModule + MomentModule, + PipesModule ], providers: [ { diff --git a/frontend/src/app/components/fhir/datatypes/coding/coding.component.ts b/frontend/src/app/components/fhir/datatypes/coding/coding.component.ts index 674d7ca0..97ddf4ff 100644 --- a/frontend/src/app/components/fhir/datatypes/coding/coding.component.ts +++ b/frontend/src/app/components/fhir/datatypes/coding/coding.component.ts @@ -13,7 +13,7 @@ export class CodingComponent implements OnInit { ngOnInit(): void { - this.has_additional_info = !!(this.coding.code || this.coding.system) + this.has_additional_info = !!(this.coding?.code || this.coding?.system) } } diff --git a/frontend/src/app/components/shared.module.ts b/frontend/src/app/components/shared.module.ts index 055e44e6..c2fbd0e2 100644 --- a/frontend/src/app/components/shared.module.ts +++ b/frontend/src/app/components/shared.module.ts @@ -31,14 +31,12 @@ import {ListDeviceComponent} from './list-generic-resource/list-device.component import {ListDiagnosticReportComponent} from './list-generic-resource/list-diagnostic-report.component'; import {ListGoalComponent} from './list-generic-resource/list-goal.component'; import { ListFallbackResourceComponent } from './list-fallback-resource/list-fallback-resource.component'; -import {NgbModule} from '@ng-bootstrap/ng-bootstrap'; +import {NgbCollapseModule, NgbModule} from '@ng-bootstrap/ng-bootstrap'; import { ToastComponent } from './toast/toast.component'; import { MomentModule } from 'ngx-moment'; import { ReportHeaderComponent } from './report-header/report-header.component'; -import { FhirPathPipe } from '../pipes/fhir-path.pipe'; import { ReportMedicalHistoryEditorComponent } from './report-medical-history-editor/report-medical-history-editor.component'; import { TreeModule } from '@circlon/angular-tree-component'; -import {FilterPipe} from '../pipes/filter.pipe'; import { ReportMedicalHistoryConditionComponent } from './report-medical-history-condition/report-medical-history-condition.component'; import { ReportLabsObservationComponent } from './report-labs-observation/report-labs-observation.component'; import { ChartsModule } from 'ng2-charts'; @@ -64,6 +62,9 @@ import { MedicationRequestComponent } from './fhir/resources/medication-request/ import { ProcedureComponent } from './fhir/resources/procedure/procedure.component'; import { DiagnosticReportComponent } from './fhir/resources/diagnostic-report/diagnostic-report.component'; import { PractitionerComponent } from './fhir/resources/practitioner/practitioner.component'; +import {FhirPathPipe} from '../pipes/fhir-path.pipe'; +import {FilterPipe} from '../pipes/filter.pipe'; +import {PipesModule} from '../pipes/pipes.module'; @NgModule({ imports: [ @@ -71,11 +72,13 @@ import { PractitionerComponent } from './fhir/resources/practitioner/practitione BrowserModule, NgxDatatableModule, NgbModule, + NgbCollapseModule, FormsModule, MomentModule, TreeModule, ChartsModule, HighlightModule, + PipesModule ], declarations: [ ComponentsSidebarComponent, @@ -109,9 +112,7 @@ import { PractitionerComponent } from './fhir/resources/practitioner/practitione ListFallbackResourceComponent, ToastComponent, ReportHeaderComponent, - FhirPathPipe, ReportMedicalHistoryEditorComponent, - FilterPipe, ReportMedicalHistoryConditionComponent, ReportLabsObservationComponent, LoadingSpinnerComponent, @@ -167,14 +168,23 @@ import { PractitionerComponent } from './fhir/resources/practitioner/practitione ToastComponent, ReportHeaderComponent, ReportMedicalHistoryEditorComponent, - FhirPathPipe, - FilterPipe, ReportMedicalHistoryConditionComponent, ReportLabsObservationComponent, LoadingSpinnerComponent, BinaryComponent, FhirResourceComponent, - FhirResourceOutletDirective + FhirResourceOutletDirective, + FallbackComponent, + ImmunizationComponent, + BadgeComponent, + TableComponent, + CodingComponent, + AllergyIntoleranceComponent, + MedicationComponent, + MedicationRequestComponent, + ProcedureComponent, + DiagnosticReportComponent, + PractitionerComponent ] }) diff --git a/frontend/src/app/pipes/pipes.module.ts b/frontend/src/app/pipes/pipes.module.ts new file mode 100644 index 00000000..9da4f831 --- /dev/null +++ b/frontend/src/app/pipes/pipes.module.ts @@ -0,0 +1,22 @@ +import { NgModule } from '@angular/core'; + + +// Pipes +import {FhirPathPipe} from './fhir-path.pipe'; +import {FilterPipe} from './filter.pipe'; + +@NgModule({ + declarations: [ + + FhirPathPipe, + FilterPipe, + ], + imports: [ + + ], + exports: [ + FhirPathPipe, + FilterPipe + ] +}) +export class PipesModule {} diff --git a/frontend/src/lib/models/resources/related-person-model.spec.ts b/frontend/src/lib/models/resources/related-person-model.spec.ts index 2d7f433d..7ba56d29 100644 --- a/frontend/src/lib/models/resources/related-person-model.spec.ts +++ b/frontend/src/lib/models/resources/related-person-model.spec.ts @@ -1,7 +1,2 @@ import { RelatedPersonModel } from './related-person-model'; -describe('RelatedPersonModel', () => { - it('should create an instance', () => { - expect(new RelatedPersonModel({})).toBeTruthy(); - }); -});