This commit is contained in:
Jason Kulatunga 2022-10-07 21:23:29 -07:00
parent 99a9ac67d7
commit f6681a8e62
6 changed files with 12 additions and 7 deletions

View File

@ -9,6 +9,6 @@
<ul class="list-group">
<li class="list-group-item" *ngFor="let resource of resourceList">
<a routerLink="/resource/{{getResourceIdEncoded(resource)}}">{{resource.source_resource_id}}</a>
<a routerLink="/resource/{{resource.base64Id()}}">{{resource.source_resource_id}}</a>
</li>
</ul>

View File

@ -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)
}
}

View File

@ -18,7 +18,7 @@
<div class="patient-row row">
<div class="col-7 patient-name"><h3 class="pull-left text-primary">{{getPatientName()}}</h3></div>
<div class="col-5">
<a routerLink="/source/{{selectedSource._id}}/resource/{{selectedPatient.source_resource_id}}" class="btn btn-indigo btn-icon float-right">
<a routerLink="/resource/{{selectedPatient.base64Id()}}" class="btn btn-indigo btn-icon float-right">
<i class="fas fa-info-circle"></i>
</a>
</div>

View File

@ -9,6 +9,7 @@ export interface IDatabaseDocument {
_rev?: string
doc_type: string
populateId(): void
base64Id(): string
}
export interface IDatabasePaginatedResponse {

View File

@ -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)
}
}

View File

@ -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)
}
}