Ejemplo n.º 1
0
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve in-patient report for the specified dates!");
        exit;
    }
} elseif ($intent == 'consultationReport') {
    ReportController::datesIncluded();
    $result = ReportController::consultationReport();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve consultation report for the specified dates!");
        exit;
    }
} elseif ($intent == 'patientDiagnosis') {
    ReportController::datesIncluded();
    $result = ReportController::patientDiagnosis();
    if (is_array($result)) {
        echo JsonResponse::success($result);
        exit;
    } else {
        echo JsonResponse::error("Unable to retrieve patient diagnosis report for the specified dates!");
        exit;
    }
} else {
    echo JsonResponse::error("Invalid request intent!");
    exit;
}