Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: handle undefined provider #1629

Merged
merged 1 commit into from
Jun 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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