text: (window["webpackJsonp"] = window["webpackJsonp"] || []).push([[44],{
  
  /***/ "./src/modules/statistics/components/page.statistics.tsx":
  /*!***************************************************************!*\
    !*** ./src/modules/statistics/components/page.statistics.tsx ***!
    \***************************************************************/
  /*! exports provided: StatisticsPage */
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
  
  "use strict";
  eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"StatisticsPage\", function() { return StatisticsPage; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _common_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @common-components */ \"./src/common-components/index.ts\");\n/* harmony import */ var _core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @core */ \"./src/core/index.ts\");\n/* harmony import */ var _modules__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @modules */ \"./src/modules/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @utils */ \"./src/utils/index.ts\");\n/* harmony import */ var mobx__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! mobx */ \"./node_modules/mobx/lib/mobx.module.js\");\n/* harmony import */ var mobx_react__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! mobx-react */ \"./node_modules/mobx-react/index.module.js\");\n/* harmony import */ var office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! office-ui-fabric-react */ \"./node_modules/office-ui-fabric-react/lib/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var modules_patients__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! modules/patients */ \"./src/modules/patients/index.ts\");\n/* harmony import */ var modules_expenses__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! modules/expenses */ \"./src/modules/expenses/index.ts\");\n/* harmony import */ var _chart_procedures_number__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./chart.procedures-number */ \"./src/modules/statistics/components/chart.procedures-number.tsx\");\n\n\n\n\n\n\n\n\n\n\n\n\nlet StatisticsPage = class StatisticsPage extends react__WEBPACK_IMPORTED_MODULE_8__[\"Component\"] {\n    constructor() {\n        super(...arguments);\n        this.state = {\n            currentPageKey: \"1\"\n        };\n        this.appointment = null;\n        //added newly\n        this.selectdate = new Date();\n        //financesByDateChart,\n        this.charts = [\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"proceduresByGenderChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"mostAppliedProceduresChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"appointmentsByDateChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"treatmentsNumberChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"mostAppliedTreatmentsChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"treatmentsByGenderChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"genderPieChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"mostInvolvedTeethChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"ageBarChart\"],\n            _chart_procedures_number__WEBPACK_IMPORTED_MODULE_11__[\"proceduresNumberChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"topPatientByPaymentChart\"],\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"topProceduresAppliedPatientChart\"]\n        ];\n    }\n    /***Added on a later date */\n    get isNewPercentile() {\n        return this.calculatePercentile(true);\n    }\n    get existingPercentile() {\n        return this.calculatePercentile(false);\n    }\n    /****Added */\n    calculatePercentile(isnew) {\n        // var mydate = this.selectdate;\n        // if (mydate) {\n        // \treturn patients.list\n        // \t\t.map(patient => patient)\n        // \t\t.filter((x, i) => x.isNew === isnew && x.datex === mydate.getTime().toString()).length\n        // }\n        // console.log(statistics.selectedPatientsByDayInsurance);\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedPatientsByDayInsurance\n            .map(patient => patient.isNew)\n            .filter((x, i) => x === isnew).length;\n    }\n    calculatePercentileProcedure(status) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n            .filter((item, i) => item.patientID !== \"\" && item.procedureId !== \"\" && item.status === status).length;\n    }\n    calculatePercentileVisits(status) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n            .filter((item, i) => item.patientID !== \"\" && item.status === status).length;\n    }\n    calculatePercentileVisitsTime(status, time) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n            .filter((item, i) => item.patientID !== \"\" && item.status === status && new Date(item.date).toDateString() === time).length;\n    }\n    calculateRoomsHigh() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return {};\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.sort((a, b) => _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.roomNumber === a.roomNumber).length\n            - _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.roomNumber === b.roomNumber).length).pop();\n    }\n    calculateRoomsLow() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return {};\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.sort((a, b) => _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.roomNumber === a.roomNumber).length\n            - _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.roomNumber === b.roomNumber).length).shift();\n    }\n    calculateRoomsCount(room) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        if (!this.calculateRoomsLow().roomNumber) {\n            return 0;\n        }\n        else if (!this.calculateRoomsHigh().roomNumber) {\n            return 0;\n        }\n        var occurrences = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((appoint) => {\n            return appoint.roomNumber === room;\n        }).length;\n        return occurrences;\n    }\n    calculateRoomsPayments(room) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        if (!this.calculateRoomsLow().roomNumber) {\n            return 0;\n        }\n        else if (!this.calculateRoomsHigh().roomNumber) {\n            return 0;\n        }\n        var occurrences = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((appoint) => {\n            return appoint.roomNumber === room;\n        }).reduce((acc, curVal) => Number(curVal.paidAmount) + acc, 0);\n        return occurrences;\n    }\n    calculateTopDentistVisits() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return {};\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.sort((a, b) => _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.dentist === a.dentist).length\n            - _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.dentist === b.dentist).length).pop();\n    }\n    calculateTopDentistVisitsCount(id) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        var occurrences = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((appoint) => {\n            return appoint._id === id;\n        }).length;\n        return occurrences;\n    }\n    calculateFinancialPaid() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n            .reduce((acc, curVal) => Number(curVal.paidAmount) + acc, 0);\n    }\n    calculateTopDentistProcedures() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return {};\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.sort((a, b) => _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.procedureId === a.procedureId).length\n            - _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter(item => item.procedureId === b.procedureId).length).pop();\n    }\n    calculateTopDentistProceduresCount(proc) {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((appoint) => {\n            return appoint.procedureId === proc;\n        }).length;\n    }\n    calculateFinancialProfit() {\n        if (_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.length <= 0) {\n            return 0;\n        }\n        return _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n            .reduce((acc, curVal) => Number(curVal.profit) + acc, 0);\n    }\n    /****Added here */\n    render() {\n        return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"sc-pg p-15 p-l-10 p-r-10\" },\n            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"Dropdown\"]\n            // placeholder={text(\n            // \t\"General Statistic\"\n            // )}\n            , { \n                // placeholder={text(\n                // \t\"General Statistic\"\n                // )}\n                defaultSelectedKey: this.state.currentPageKey, options: [\n                    {\n                        key: \"1\",\n                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"General Statistic\")\n                    },\n                    {\n                        key: \"2\",\n                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Patients Financial\")\n                    },\n                    {\n                        key: \"3\",\n                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Insuarance\")\n                    },\n                    {\n                        key: \"4\",\n                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Lab Orders\")\n                    },\n                    {\n                        key: \"5\",\n                        text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Payments and Expenses\")\n                    },\n                ], onChange: (ev, member) => {\n                    this.setState({ currentPageKey: member.key });\n                } }),\n            this.state.currentPageKey === \"1\" && react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"sc-pg p-15 p-l-10 p-r-10\" },\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"DataTableComponent\"], { maxItemsOnLoad: 20, className: \"appointments-data-table\", heads: [\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Appointment\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Lab\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Price\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Paid\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Outstanding\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"OverPaid\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Expenses\"),\n                        Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Profits\")\n                    ], rows: _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.map(appointment => ({\n                        id: appointment._id,\n                        searchableString: appointment.searchableString,\n                        cells: [\n                            {\n                                dataValue: (appointment.patient || new _modules__WEBPACK_IMPORTED_MODULE_3__[\"Patient\"]()).name,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"ProfileComponent\"], { secondaryElement: react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null,\n                                        Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(appointment.date, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\")),\n                                        \" \",\n                                        \"/\",\n                                        \" \",\n                                        appointment.operatingStaff.map(x => (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"i\", { key: x._id },\n                                            x.name,\n                                            \" \")))), name: (appointment.patient ||\n                                        new _modules__WEBPACK_IMPORTED_MODULE_3__[\"Patient\"]()).name, size: 3 })),\n                                onClick: () => {\n                                    this.appointment = appointment;\n                                },\n                                className: \"no-label\"\n                            },\n                            {\n                                dataValue: appointment.treatmentID,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"ProfileComponent\"], { secondaryElement: react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, appointment.treatUnitGroup.map((tr, i) => {\n                                        return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_8__[\"Fragment\"], null,\n                                            tr.treatment.split(\"|\")[1] + \" || \" + tr.fees,\n                                            \" \",\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"br\", null)));\n                                    })), name: '', size: 3 })),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.finalPrice,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.finalPrice).toString())),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.paidAmount,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.paidAmount).toString())),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.outstandingAmount,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, appointment.outstandingAmount < 0 ? _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") + '0' : _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.outstandingAmount).toString())),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.overpaidAmount,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, appointment.overpaidAmount < 0 ? _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") + '0' : _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.overpaidAmount).toString())),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.expenses,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.expenses).toString())),\n                                className: \"hidden-xs\"\n                            },\n                            {\n                                dataValue: appointment.profit,\n                                component: (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"span\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                    Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(appointment.profit).toString())),\n                                className: \"hidden-xs\"\n                            }\n                        ]\n                    })), farItems: [\n                        {\n                            key: \"1\",\n                            onRender: () => {\n                                return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"Dropdown\"], { placeholder: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Filter by staff member\"), defaultValue: \"\", options: [\n                                        {\n                                            key: \"\",\n                                            text: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"All members\")\n                                        }\n                                    ].concat(_modules__WEBPACK_IMPORTED_MODULE_3__[\"staff\"].list.map(member => {\n                                        return {\n                                            key: member._id,\n                                            text: member.name\n                                        };\n                                    })), onChange: (ev, member) => {\n                                        _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].filterByMember = member.key.toString(); //\n                                    } }));\n                            }\n                        }\n                    ], hideSearch: true, commands: [\n                        {\n                            key: \"2\",\n                            onRender: () => {\n                                return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"DatePicker\"], { onSelectDate: date => {\n                                        if (date) {\n                                            _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].startingDate = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].getDayStartingPoint(date.getTime());\n                                        }\n                                    }, value: new Date(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].startingDate), formatDate: d => `${Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"From\")}: ${Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(d, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\"))}` }));\n                            }\n                        },\n                        {\n                            key: \"3\",\n                            onRender: () => {\n                                return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](office_ui_fabric_react__WEBPACK_IMPORTED_MODULE_7__[\"DatePicker\"], { onSelectDate: date => {\n                                        if (date) {\n                                            _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].endingDate = _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].getDayStartingPoint(date.getTime());\n                                        }\n                                    }, value: new Date(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].endingDate), formatDate: d => `${Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Until\")}: ${Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"formatDate\"])(d, _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"date_format\"))}` }));\n                            }\n                        }\n                    ] }),\n                this.appointment ? (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"AsyncComponent\"], { key: \"ae\", loader: () => tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"](this, void 0, void 0, function* () {\n                        const AppointmentEditorPanel = (yield __webpack_require__.e(/*! import() */ 2).then(__webpack_require__.bind(null, /*! ../../appointments/components/appointment-editor */ \"./src/modules/appointments/components/appointment-editor.tsx\")))\n                            .AppointmentEditorPanel;\n                        return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](AppointmentEditorPanel, { appointment: this.appointment, onDismiss: () => (this.appointment = null), onDelete: () => (this.appointment = null) }));\n                    }) })) : (\"\"),\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"container-fluid m-t-20 quick\" },\n                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Quick stats\") },\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Row\"], null,\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Appointments\"),\n                                    \":\",\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments\n                                            .length).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].primary }))),\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Payments\"),\n                                    \":\",\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                            Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalPayments + modules_expenses__WEBPACK_IMPORTED_MODULE_10__[\"expenses\"].totalPayments).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].warning }))),\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Expenses\"),\n                                    \":\",\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                            Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalExpenses + modules_expenses__WEBPACK_IMPORTED_MODULE_10__[\"expenses\"].totalExpenses).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].danger }))),\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { sm: 6, xs: 12 },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"label\", null,\n                                    Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Profits\"),\n                                    \":\",\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagComponent\"], { text: _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\") +\n                                            Object(_utils__WEBPACK_IMPORTED_MODULE_4__[\"round\"])(_modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].totalProfits).toString(), type: _common_components__WEBPACK_IMPORTED_MODULE_1__[\"TagType\"].success })))))),\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](react__WEBPACK_IMPORTED_MODULE_8__[\"Fragment\"], null,\n                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Row\"], { gutter: 24 },\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Procedures', image: 'EditContact' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"h3\", null,\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", null, \" Total :\"),\n                                    \"  \",\n                                    _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((item, i) => item.patientID !== \"\" && item.procedureId !== \"\").length),\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"PieChartComponent\"], Object.assign({ height: 400 }, {\n                                    data: [\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Completed: \" + this.calculatePercentileProcedure('Completed')), value: this.calculatePercentileProcedure('Completed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Not Completed: \" + this.calculatePercentileProcedure('Not Completed')), value: this.calculatePercentileProcedure('Not Completed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"In Processing: \" + this.calculatePercentileProcedure('In Processing')), value: this.calculatePercentileProcedure('In Processing') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Missed: \" + this.calculatePercentileProcedure('Missed')), value: this.calculatePercentileProcedure('Delayed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Discontinued: \" + this.calculatePercentileProcedure('Discontinued')), value: this.calculatePercentileProcedure('Discontinued') }\n                                    ]\n                                })))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Patients', image: 'PeopleAlert' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"h3\", null,\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", null, \" Total :\"),\n                                    _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedPatientsByDayInsurance.length),\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"PieChartComponent\"], Object.assign({ height: 400 }, {\n                                    data: [\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"New Patients: \" + this.isNewPercentile), value: this.isNewPercentile },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Existing Patients: \" + this.existingPercentile), value: this.existingPercentile }\n                                    ]\n                                })))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Visits', image: 'CalendarMirrored' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"h3\", null,\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", null, \" Total :\"),\n                                    \"  \",\n                                    _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.filter((item, i) => item.patientID !== \"\").length),\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"PieChartComponent\"], Object.assign({ height: 400 }, {\n                                    data: [\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Completed: \" + this.calculatePercentileVisits('Completed')), value: this.calculatePercentileVisits('Completed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Confirmed: \" + this.calculatePercentileVisits('Confirmed')), value: this.calculatePercentileVisits('Confirmed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Unconfirmed: \" + this.calculatePercentileVisits('Unconfirmed')), value: this.calculatePercentileVisits('Unconfirmed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Delayed: \" + this.calculatePercentileVisits('Delayed')), value: this.calculatePercentileVisits('Delayed') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Checked In: \" + this.calculatePercentileVisits('CheckedIn')), value: this.calculatePercentileVisits('CheckedIn') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"In Progress: \" + this.calculatePercentileVisits('InProgress')), value: this.calculatePercentileVisits('InProgress') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Cancelled: \" + this.calculatePercentileVisits('Cancelled')), value: this.calculatePercentileVisits('Cancelled') },\n                                        { label: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Missed: \" + this.calculatePercentileVisits('Missed')), value: this.calculatePercentileVisits('Missed') }\n                                    ]\n                                })))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Financials', image: 'Money' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"p\", null,\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", { style: { fontSize: '20px' } }, \" Total Income:  \"),\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", { style: { fontSize: '14px' } },\n                                        \"  \",\n                                        _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\"),\n                                        \"  \",\n                                        this.calculateFinancialProfit(),\n                                        \" \"),\n                                    \"   \"),\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"p\", null,\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", { style: { fontSize: '20px' } }, \" Total Payments:  \"),\n                                    \" \",\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"b\", { style: { fontSize: '14px' } },\n                                        \"  \",\n                                        _modules__WEBPACK_IMPORTED_MODULE_3__[\"setting\"].getSetting(\"currencySymbol\"),\n                                        \"  \",\n                                        this.calculateFinancialPaid(),\n                                        \" \"),\n                                    \"   \"))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Top Dentist', image: 'PeopleAdd' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"table\", { className: \"ms-table\" },\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"thead\", null,\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tr\", null,\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Name\")),\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Procedures\")),\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Value\")))),\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tbody\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.map(item => react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tr\", null,\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null,\n                                            \" \",\n                                            this.calculateTopDentistVisits() ? this.calculateTopDentistVisits().dentist : \"No dentist\",\n                                            \" \"),\n                                        \"  \",\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null, this.calculateTopDentistProceduresCount(this.calculateTopDentistProcedures().procedureId)),\n                                        \"  \",\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null,\n                                            \" \",\n                                            this.calculateTopDentistVisits() ? this.calculateTopDentistVisitsCount(this.calculateTopDentistVisits()._id) : \"Nil\",\n                                            \" \"))))))),\n                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"Col\"], { md: 8 },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: 'Room performance', image: 'CalendarWorkWeek' },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"table\", { className: \"ms-table\" },\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"thead\", null,\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tr\", null,\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"\")),\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"High\")),\n                                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"th\", null, Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(\"Low\")))),\n                                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tbody\", null, _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.map(item => react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"tr\", null,\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null, \"Name \"),\n                                        \" \",\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null,\n                                            \" Room: \",\n                                            this.calculateRoomsHigh() ? this.calculateRoomsHigh().roomNumber : 'Nil',\n                                            \" \"),\n                                        \"  \",\n                                        react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"td\", null,\n                                            \" Room: \",\n                                            this.calculateRoomsLow() ? this.calculateRoomsLow().roomNumber : 'Nil',\n                                            \" \"))))))))),\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"charts container-fluid\" },\n                    react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { className: \"row\" }, this.charts.map((chart, index) => {\n                        return (react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](\"div\", { key: index + chart.name, className: \"chart-wrapper \" +\n                                (chart.className ||\n                                    \"col-xs-12 col-md-5 col-lg-4\") },\n                            react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_common_components__WEBPACK_IMPORTED_MODULE_1__[\"SectionComponent\"], { title: Object(_core__WEBPACK_IMPORTED_MODULE_2__[\"text\"])(chart.name) },\n                                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](chart.Component, null))));\n                    })))),\n            this.state.currentPageKey === \"2\" &&\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](_modules__WEBPACK_IMPORTED_MODULE_3__[\"PatientPaymentListPanel\"], null),\n            this.state.currentPageKey === \"3\" &&\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](modules_patients__WEBPACK_IMPORTED_MODULE_9__[\"PatientInsuranceListPanel\"], null),\n            this.state.currentPageKey === \"4\" &&\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](modules_patients__WEBPACK_IMPORTED_MODULE_9__[\"PatientLabOrdersListPanel\"], null),\n            this.state.currentPageKey === \"5\" &&\n                react__WEBPACK_IMPORTED_MODULE_8__[\"createElement\"](modules_expenses__WEBPACK_IMPORTED_MODULE_10__[\"Expenses\"], null),\n            _modules__WEBPACK_IMPORTED_MODULE_3__[\"statistics\"].selectedAppointments.map(appointment => appointment.ex)));\n    }\n};\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"observable\"]\n], StatisticsPage.prototype, \"appointment\", void 0);\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"observable\"]\n], StatisticsPage.prototype, \"selectdate\", void 0);\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"observable\"]\n], StatisticsPage.prototype, \"charts\", void 0);\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"computed\"]\n], StatisticsPage.prototype, \"isNewPercentile\", null);\ntslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx__WEBPACK_IMPORTED_MODULE_5__[\"computed\"]\n], StatisticsPage.prototype, \"existingPercentile\", null);\nStatisticsPage = tslib__WEBPACK_IMPORTED_MODULE_0__[\"__decorate\"]([\n    mobx_react__WEBPACK_IMPORTED_MODULE_6__[\"observer\"]\n], StatisticsPage);\n\n\n\n//# sourceURL=webpack:///./src/modules/statistics/components/page.statistics.tsx?");
  
  /***/ })
  
  }]);