Practitioner UI tweaks.
This commit is contained in:
parent
410696c26f
commit
169dc28776
|
@ -48,16 +48,6 @@ export class PractitionerComponent implements OnInit, FhirResourceComponentInter
|
|||
// ),
|
||||
// status: isContactData,
|
||||
// },
|
||||
{
|
||||
label: 'Address',
|
||||
data: this.displayModel?.address,
|
||||
enabled: !!this.displayModel?.address,
|
||||
},
|
||||
{
|
||||
label: 'Telephone',
|
||||
data: this.displayModel.telecom,
|
||||
enabled: !!this.displayModel.telecom,
|
||||
},
|
||||
];
|
||||
for(let idCoding of (this.displayModel?.identifier || [])){
|
||||
this.tableData.push({
|
||||
|
@ -66,6 +56,28 @@ export class PractitionerComponent implements OnInit, FhirResourceComponentInter
|
|||
enabled: true,
|
||||
})
|
||||
}
|
||||
if(this.displayModel?.address){
|
||||
let address = this.displayModel?.address
|
||||
let addressParts = []
|
||||
if(address.line){
|
||||
addressParts.push(address.line.join(' '))
|
||||
}
|
||||
if(address.city){
|
||||
addressParts.push(address.city)
|
||||
}
|
||||
if(address.state){
|
||||
addressParts.push(address.state)
|
||||
}
|
||||
if(address.postalCode){
|
||||
addressParts.push(address.postalCode)
|
||||
}
|
||||
|
||||
this.tableData.push({
|
||||
label: 'Address',
|
||||
data: addressParts.join(", "),
|
||||
enabled: !!addressParts,
|
||||
})
|
||||
}
|
||||
for(let telecom of (this.displayModel?.telecom || [])){
|
||||
this.tableData.push({
|
||||
label: telecom.system,
|
||||
|
|
|
@ -9,6 +9,9 @@ export class AddressModel {
|
|||
|
||||
|
||||
constructor(fhirData: any) {
|
||||
if(!fhirData){
|
||||
return
|
||||
}
|
||||
this.city = fhirpath.evaluate(fhirData, "city").join("")
|
||||
this.line = fhirpath.evaluate(fhirData, "line")
|
||||
this.state = fhirpath.evaluate(fhirData, "state").join("")
|
||||
|
|
|
@ -6,6 +6,7 @@ import {CodingModel} from '../datatypes/coding-model';
|
|||
import {FastenDisplayModel} from '../fasten/fasten-display-model';
|
||||
import {FastenOptions} from '../fasten/fasten-options';
|
||||
import {HumanNameModel} from '../datatypes/human-name-model';
|
||||
import {AddressModel} from '../datatypes/address-model';
|
||||
|
||||
export class PractitionerModel extends FastenDisplayModel {
|
||||
|
||||
|
@ -19,7 +20,7 @@ export class PractitionerModel extends FastenDisplayModel {
|
|||
relationship: string
|
||||
}|undefined
|
||||
telecom: { system?: string, value?: string, use?: string }[]|undefined
|
||||
address: string|undefined
|
||||
address: AddressModel|undefined
|
||||
birthdate: string|undefined
|
||||
qualification: { code: string, system: string }[]|undefined
|
||||
|
||||
|
@ -50,7 +51,7 @@ export class PractitionerModel extends FastenDisplayModel {
|
|||
|
||||
stu3DTO(fhirResource:any){
|
||||
this.name = _.get(fhirResource, 'name',[]).map((name:any): HumanNameModel => new HumanNameModel(name));
|
||||
this.address = _.get(fhirResource, 'address.0');
|
||||
this.address = new AddressModel(_.get(fhirResource, 'address.0'));
|
||||
this.telecom = _.get(fhirResource, 'telecom');
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue