import createReactClass from 'create-react-class'
const Td = createReactClass({
render () {
return (
<td
onClick = { this.props.handleTdClick(item, e) }
key = { this.props.index }
className={this.props.item.state ===1 "empty" ? "not-empty" :}>
</td>
...
<Td {...props} />
<input type="radio"
value={this.state.result}
checked={this.state.check}
onChange={this.onSiteChanged} />
$term_children = get_term_children( $parent_term_id, 'product_cat' );
select
l.loc,
sum(coalesce(ps.cnt, 0) + coalesce(e.cnt, 0)) AS ser,
count(distinct l.patient) AS patient
from
(
select ps_user_loc as loc, ps_ur as patient from patient_services
union
select eng_user_loc as loc, eng_ur as patient from engagements where length(eng_ur) > 0
) l
left outer join
(
select
ps_user_loc as loc,
ps_ur as patient,
count(*) as cnt
from patient_services
group by ps_user_loc, ps_ur
) ps on ps.loc = l.loc and ps.patient = l.patient
left outer join
(
select
eng_user_loc as loc,
eng_ur as patient,
count(*) as cnt
from engagements
where length(eng_ur) > 0
group by eng_user_loc, eng_ur
) e on e.loc = l.loc and e.patient = l.patient
group by l.loc
SELECT
SUM( CASE WHEN patient_gender = 'Male' THEN 1*xxx.Value ELSE 0 END ) Male,
SUM( CASE WHEN patient_gender = 'Female' THEN 1*xxx.Value ELSE 0 END ) Female
FROM patients JOIN (
SELECT ps_ur AS UR, COUNT(ps_ur) AS Value
FROM patient_services
GROUP BY UR
UNION ALL
SELECT eng_ur AS UR, COUNT(eng_ur) AS Value
FROM engagements
WHERE LENGTH( eng_ur )>0
GROUP BY UR ) xxx ON patients.patient_ur = xxx.UR