diff --git a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html index b67231f5..7830336d 100644 --- a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html +++ b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.html @@ -9,6 +9,6 @@ diff --git a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts index a8a18d6d..5cec5f91 100644 --- a/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts +++ b/frontend/src/app/components/list-fallback-resource/list-fallback-resource.component.ts @@ -23,9 +23,4 @@ export class ListFallbackResourceComponent implements OnInit, ResourceListCompo this.changeRef.markForCheck() } - //TODO this should eb moved to a Pipe - getResourceIdEncoded(resource: ResourceFhir){ - return Base64.Encode(resource._id) - } - } diff --git a/frontend/src/app/pages/source-detail/source-detail.component.html b/frontend/src/app/pages/source-detail/source-detail.component.html index d440c975..c112bdf8 100644 --- a/frontend/src/app/pages/source-detail/source-detail.component.html +++ b/frontend/src/app/pages/source-detail/source-detail.component.html @@ -18,7 +18,7 @@

{{getPatientName()}}

- +
diff --git a/frontend/src/lib/database/interface.ts b/frontend/src/lib/database/interface.ts index 77631545..812c6ba5 100644 --- a/frontend/src/lib/database/interface.ts +++ b/frontend/src/lib/database/interface.ts @@ -9,6 +9,7 @@ export interface IDatabaseDocument { _rev?: string doc_type: string populateId(): void + base64Id(): string } export interface IDatabasePaginatedResponse { diff --git a/frontend/src/lib/models/database/resource_fhir.ts b/frontend/src/lib/models/database/resource_fhir.ts index 62df4446..66b4c967 100644 --- a/frontend/src/lib/models/database/resource_fhir.ts +++ b/frontend/src/lib/models/database/resource_fhir.ts @@ -29,4 +29,8 @@ export class ResourceFhir { //TODO: source_id should be base64 encoded (otherwise we get nested : chars) this._id = `${this.doc_type}:${Base64.Encode(this.source_id)}:${this.source_resource_type}:${this.source_resource_id}` } + base64Id(): string { + this.populateId() + return Base64.Encode(this._id) + } } diff --git a/frontend/src/lib/models/database/source.ts b/frontend/src/lib/models/database/source.ts index f8da6fbb..f1fb2cb1 100644 --- a/frontend/src/lib/models/database/source.ts +++ b/frontend/src/lib/models/database/source.ts @@ -1,6 +1,7 @@ import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata'; import {SourceType} from './source_types'; import {DocType} from '../../../lib/database/constants'; +import {Base64} from '../../utils/base64'; export class Source extends LighthouseSourceMetadata{ _id?: string @@ -23,4 +24,8 @@ export class Source extends LighthouseSourceMetadata{ populateId(){ this._id = `${this.doc_type}:${this.source_type}:${this.patient}` } + base64Id(): string { + this.populateId() + return Base64.Encode(this._id) + } }