terra-clinical-result
Version:
The Terra Clinical Result package is a collection of standardized views for presenting clinical results documented to a Patient's Medical Chart, such as Vital Signs, Laboratory Results, and Discretely Documented Values
46 lines (40 loc) • 1.72 kB
JSX
import React from 'react';
import PropTypes from 'prop-types';
import IconModified from 'terra-icon/lib/icon/IconModified';
import IconComment from 'terra-icon/lib/icon/IconComment';
import IconUnverified from 'terra-icon/lib/icon/IconDiamond';
import { injectIntl } from 'react-intl';
import classNames from 'classnames/bind';
import styles from './ClinicalResult.module.scss';
const cx = classNames.bind(styles);
const propTypes = {
/**
* If the Result value has not been authenticated and committed to patient chart.
*/
isModified: PropTypes.bool,
/**
* If the Result value has been modified from it's original value for the same clinically documented event & datetime.
*/
hasComment: PropTypes.bool,
/**
* If Result has not been verified
*/
isUnverified: PropTypes.bool,
/**
* Internationalization object with translation APIs. Provided by `injectIntl`.
*/
intl: PropTypes.shape({ formatMessage: PropTypes.func }),
};
const Icons = ({
isUnverified, isModified, hasComment, intl,
}) => (
isUnverified ? (<IconUnverified className={cx('icon-unverified')} a11yLabel={intl.formatMessage({ id: 'Terra.clinicalResult.resultUnverified' })} role="img" focusable="true" />)
: (
<React.Fragment>
{isModified ? (<IconModified className={cx('icon-modified')} a11yLabel={intl.formatMessage({ id: 'Terra.clinicalResult.resultModified' })} role="img" focusable="true" />) : null}
{hasComment ? (<IconComment className={cx('icon-comment')} a11yLabel={intl.formatMessage({ id: 'Terra.clinicalResult.resultComment' })} role="img" focusable="true" />) : null}
</React.Fragment>
)
);
Icons.propTypes = propTypes;
export default injectIntl(Icons);