![](../../assets/img/logsbig.PNG)
MEDICAL SERVICES PERFORMANCE REPORT BY BETWEEN AND
Number of clients served by service provider
SERVICE DATE |
SERVICE PROVIDER |
AGE GORUP |
-- |
GENDER |
-- |
TOTAL |
|
|
10 - 14 |
15 - 19 |
20 - 24 |
Above 24 |
|
FEMALE |
MALE |
|
|
prepare("SELECT DATECREATED, SERVICEPROVIDER,
sum( if( AGE_GROUP = '10-14', RECORDCOUNTER, 0 ) ) AS aa,
sum( if( AGE_GROUP = '15-19', RECORDCOUNTER, 0 ) ) AS bb,
sum( if( AGE_GROUP = '20-24', RECORDCOUNTER, 0 ) ) AS cc,
sum( if( AGE_GROUP = '24', RECORDCOUNTER, 0 ) ) AS dd,
sum( if( SEX = 'FEMALE', RECORDCOUNTER, 0 ) ) AS FEMALEA,
sum( if( SEX = 'MALE', RECORDCOUNTER, 0 ) ) AS MALEA
FROM cmpatientsregistration
WHERE DATECREATED BETWEEN :a AND :b AND INSVCSTATUS='TREATMENT ROOM' GROUP BY SERVICEPROVIDER ASC ");
$result->bindParam(':a', $d1);
$result->bindParam(':b', $d2);
$result->execute();
for($i=0; $row = $result->fetch(); $i++){
?>
|
|
|
|
|
|
|
|
|
|
|
TOTAL: |
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE
DATECREATED BETWEEN :a AND :b AND AGE_GROUP = '10-14' AND INSVCSTATUS='TREATMENT ROOM'");
$results->bindParam(':a', $d1);
$results->bindParam(':b', $d2);
$results->execute();
for($i=0; $rows = $results->fetch(); $i++){
$dsdsd=$rows['sum(RECORDCOUNTER)'];
echo formatMoney($dsdsd, true);
}
?>
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE
DATECREATED BETWEEN :c AND :d AND AGE_GROUP = '15-19' AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE
DATECREATED BETWEEN :c AND :d AND AGE_GROUP = '20-24' AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE
DATECREATED BETWEEN :c AND :d AND AGE_GROUP = '24' AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
--
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE SEX = 'FEMALE'
AND DATECREATED BETWEEN :c AND :d AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE SEX = 'MALE'
AND DATECREATED BETWEEN :c AND :d AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
--
|
prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE DATECREATED BETWEEN :c AND :d AND INSVCSTATUS='TREATMENT ROOM'");
$resultia->bindParam(':c', $d1);
$resultia->bindParam(':d', $d2);
$resultia->execute();
for($i=0; $cxz = $resultia->fetch(); $i++){
$zxc=$cxz['sum(RECORDCOUNTER)'];
echo formatMoney($zxc, true);
}
?>
|
connect_error) {
exit("There was an error with your connection: ".$dbhandle->connect_error);
}
?>
= '" . $from_date . "' AND DATECREATED <= '" . $to_date . "'
AND INSVCSTATUS='TREATMENT ROOM' GROUP BY SERVICEPROVIDER ASC";
// Execute the query, or else return the error message.
$result = $dbhandle->query($strQuery) or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}");
// If the query returns a valid response, prepare the JSON string
if ($result) {
// The `$arrData` array holds the chart attributes and data
$arrData = array(
"chart" => array(
"caption" => "General service performance as per service provider",
"paletteColors" => "#3c8dbc",
"bgColor" => "#ffffff",
"borderAlpha"=> "20",
"canvasBorderAlpha"=> "0",
"usePlotGradientColor"=> "0",
"plotBorderAlpha"=> "10",
"showXAxisLine"=> "1",
"xAxisLineColor" => "#000",
"showValues" => "0",
"divlineColor" => "#999999",
"divLineIsDashed" => "1",
"showAlternateHGridColor" => "0"
)
);
$arrData["data"] = array();
// Push the data into the array
while($row = mysqli_fetch_array($result)) {
array_push($arrData["data"], array(
"label" => $row["SERVICEPROVIDER"],
"value" => $row["SUM(RECORDCOUNTER)"]
)
);
}
/*JSON Encode the data to retrieve the string containing the JSON representation of the data in the array. */
$jsonEncodedData = json_encode($arrData);
$columnChart = new FusionCharts("column2D", "myFirstChart" , 1060, 290, "chart-1", "json", $jsonEncodedData);
// Render the chart
$columnChart->render();
// Close the database connection
$dbhandle->close();
}
?>