tweaks.
This commit is contained in:
parent
99a9ac67d7
commit
f6681a8e62
|
@ -9,6 +9,6 @@
|
||||||
|
|
||||||
<ul class="list-group">
|
<ul class="list-group">
|
||||||
<li class="list-group-item" *ngFor="let resource of resourceList">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -23,9 +23,4 @@ export class ListFallbackResourceComponent implements OnInit, ResourceListCompo
|
||||||
this.changeRef.markForCheck()
|
this.changeRef.markForCheck()
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO this should eb moved to a Pipe
|
|
||||||
getResourceIdEncoded(resource: ResourceFhir){
|
|
||||||
return Base64.Encode(resource._id)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<div class="patient-row row">
|
<div class="patient-row row">
|
||||||
<div class="col-7 patient-name"><h3 class="pull-left text-primary">{{getPatientName()}}</h3></div>
|
<div class="col-7 patient-name"><h3 class="pull-left text-primary">{{getPatientName()}}</h3></div>
|
||||||
<div class="col-5">
|
<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>
|
<i class="fas fa-info-circle"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -9,6 +9,7 @@ export interface IDatabaseDocument {
|
||||||
_rev?: string
|
_rev?: string
|
||||||
doc_type: string
|
doc_type: string
|
||||||
populateId(): void
|
populateId(): void
|
||||||
|
base64Id(): string
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IDatabasePaginatedResponse {
|
export interface IDatabasePaginatedResponse {
|
||||||
|
|
|
@ -29,4 +29,8 @@ export class ResourceFhir {
|
||||||
//TODO: source_id should be base64 encoded (otherwise we get nested : chars)
|
//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}`
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata';
|
import {LighthouseSourceMetadata} from '../lighthouse/lighthouse-source-metadata';
|
||||||
import {SourceType} from './source_types';
|
import {SourceType} from './source_types';
|
||||||
import {DocType} from '../../../lib/database/constants';
|
import {DocType} from '../../../lib/database/constants';
|
||||||
|
import {Base64} from '../../utils/base64';
|
||||||
|
|
||||||
export class Source extends LighthouseSourceMetadata{
|
export class Source extends LighthouseSourceMetadata{
|
||||||
_id?: string
|
_id?: string
|
||||||
|
@ -23,4 +24,8 @@ export class Source extends LighthouseSourceMetadata{
|
||||||
populateId(){
|
populateId(){
|
||||||
this._id = `${this.doc_type}:${this.source_type}:${this.patient}`
|
this._id = `${this.doc_type}:${this.source_type}:${this.patient}`
|
||||||
}
|
}
|
||||||
|
base64Id(): string {
|
||||||
|
this.populateId()
|
||||||
|
return Base64.Encode(this._id)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue