Skip to content

Commit

Permalink
Fixes: handle undefined provider (#1629)
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliouzbett authored Jun 15, 2023
1 parent b38d638 commit 25601a3
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { EncounterType } from '../../../models/encounter-type.model';
import { Pipe, PipeTransform } from '@angular/core';
import * as _ from 'lodash';

Expand All @@ -8,16 +7,20 @@ import * as _ from 'lodash';
})
export class PatientEncounterProviderPipe implements PipeTransform {
public transform(provider) {
if (provider.length === 0) {
return provider;
if (typeof provider === 'undefined') {
return '';
} else {
const providerName = provider.split('-')[2];

if (typeof providerName !== 'undefined') {
return providerName;
if (provider.length === 0) {
return provider;
} else {
console.error('ERROR : Undefined Provider Name', providerName);
return '';
const providerName = provider.split('-')[2];

if (typeof providerName !== 'undefined') {
return providerName;
} else {
console.error('ERROR : Undefined Provider Name', providerName);
return '';
}
}
}
}
Expand Down

0 comments on commit 25601a3

Please sign in to comment.