2017-01-16 18:30:54 +01:00
|
|
|
import { Blaze } from 'meteor/blaze';
|
2015-11-16 17:49:35 +01:00
|
|
|
/**
|
2016-01-13 16:17:32 +01:00
|
|
|
* Formats a patient name for display purposes
|
2015-11-16 17:49:35 +01:00
|
|
|
*/
|
2017-01-16 18:30:54 +01:00
|
|
|
const formatPN = context => {
|
2015-10-13 14:14:50 +02:00
|
|
|
if (!context) {
|
2016-01-13 16:17:32 +01:00
|
|
|
return;
|
2015-10-13 14:14:50 +02:00
|
|
|
}
|
2018-01-30 19:46:31 +01:00
|
|
|
|
2015-11-16 17:49:35 +01:00
|
|
|
return context.replace('^', ', ');
|
2016-01-13 16:17:32 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A global Blaze UI helper to format a patient name for display purposes
|
|
|
|
|
*/
|
2017-01-20 13:54:22 +01:00
|
|
|
|
|
|
|
|
// Check if global helper already exists to not override it
|
|
|
|
|
if (!Blaze._getGlobalHelper('formatPN')) {
|
|
|
|
|
Blaze.registerHelper('formatPN', formatPN);
|
|
|
|
|
}
|
2017-01-16 18:30:54 +01:00
|
|
|
|
|
|
|
|
export { formatPN };
|