@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2 -66
- package/index.js +1 -66
- package/package.json +1 -1
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
package/src/Custom/CCalendar.js
DELETED
|
@@ -1,560 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { Text, View, FlatList, TouchableOpacity, Dimensions, ActivityIndicator } from 'react-native';
|
|
3
|
-
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
|
4
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
-
import CPiechart from '../Custom/Charts/CPieChart';
|
|
6
|
-
import CTable from '../Custom/TableComponent/CTable';
|
|
7
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
8
|
-
import { ArrayCheck, getLoading, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
9
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
10
|
-
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
11
|
-
import HHeading from '../HOC/HHeading';
|
|
12
|
-
import Loader from './Loader';
|
|
13
|
-
import CCard from './CCard';
|
|
14
|
-
import { useIsFocused, useNavigation } from '@react-navigation/native';
|
|
15
|
-
|
|
16
|
-
const CCalendar = () => {
|
|
17
|
-
const navigation = useNavigation();
|
|
18
|
-
const { width, height } = Dimensions.get('screen');
|
|
19
|
-
const flatlistRef = useRef();
|
|
20
|
-
const dividedWidth = width / 7;
|
|
21
|
-
const [data, setData] = useState();
|
|
22
|
-
const [refresh, setRefresh] = useState(0);
|
|
23
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
24
|
-
const [showTable, setShowTable] = useState(false);
|
|
25
|
-
const [PichartVisibility, setPiechartVisibility] = useState(true);
|
|
26
|
-
const [footerData, setFooterData] = useState();
|
|
27
|
-
const formatedPieChart = [];
|
|
28
|
-
const formatedPieDisplayText = [];
|
|
29
|
-
const formatedPieColor = [];
|
|
30
|
-
|
|
31
|
-
const SumwithoutFS = [];
|
|
32
|
-
var PiechartSecondWOFV = []; //totalsum - firstvisitsum
|
|
33
|
-
var monthlysumResult = []; //totalsum - monthly
|
|
34
|
-
var monthlyColorCode = [];
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const [monthTotal, setmonthTotal] = useState();
|
|
39
|
-
const [totalMonthChart, settotalMonthChart] = useState([]);
|
|
40
|
-
const [ColorCode, setColorCode] = useState([]);
|
|
41
|
-
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
42
|
-
const d = new Date();
|
|
43
|
-
const [monthinno, setMonthInNo] = useState(d.getMonth());
|
|
44
|
-
let monthName = months[monthinno];
|
|
45
|
-
const [year, setYear] = useState(d.getFullYear());
|
|
46
|
-
const isFocused = useIsFocused();
|
|
47
|
-
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
if (isFocused == true) {
|
|
50
|
-
Global.PatientDetails = null;
|
|
51
|
-
Global.ChartDataLeft = null;
|
|
52
|
-
Global.ChartDataAll = null;
|
|
53
|
-
Global.ChartDataLeft = null;
|
|
54
|
-
}
|
|
55
|
-
}, [isFocused]);
|
|
56
|
-
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
getConsultation(Global.userData.hosuconsultant, year, monthinno);
|
|
59
|
-
}, []);
|
|
60
|
-
|
|
61
|
-
if (footerData) {
|
|
62
|
-
footerData.data != undefined && footerData.data.map((item, index) => {
|
|
63
|
-
formatedPieChart.push(item.value);
|
|
64
|
-
formatedPieDisplayText.push({ 'display': item.key, 'color': item.color });
|
|
65
|
-
formatedPieColor.push(item.color);
|
|
66
|
-
if (item.key != 'FIRSTVISIT') {
|
|
67
|
-
SumwithoutFS.push(item.value);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
const sum1 = SumwithoutFS.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
71
|
-
const sum2 = formatedPieChart.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
72
|
-
var SubstractedFV = sum2 - sum1;
|
|
73
|
-
PiechartSecondWOFV = [sum1, SubstractedFV];
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function getConsultation(consultant, year, month) {
|
|
78
|
-
var monthReal = month + 1;
|
|
79
|
-
// let buttonapi = "http://111.92.109.30:8090/emr/emrcommonget/rnhococonsultationhistory%207,2022,8"
|
|
80
|
-
let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationhistoryemr ' + consultant + ',' + year + ',' + monthReal;
|
|
81
|
-
console.log('>>>>>>>><<<<<<<<<<KKKKKK>>>>>>>>><<<<<<<<<<<<<', buttonapi);
|
|
82
|
-
setIsLoading(true);
|
|
83
|
-
NetworkServiceCall('get', buttonapi, '')
|
|
84
|
-
.then(function (response) {
|
|
85
|
-
if (response.httpstatus == 200 && response.data != null && response.data != undefined) {
|
|
86
|
-
setIsLoading(false);
|
|
87
|
-
setData(response.data.monthdata);
|
|
88
|
-
getMonthSum(response.data.monthdata);
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
setIsLoading(false);
|
|
92
|
-
notifyMessage('Consultation not available,Please try again later', 4);
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
getLoading(v => setIsLoading(false));
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function getApiPatientData(data) {
|
|
100
|
-
setIsLoading(true);
|
|
101
|
-
let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationhistorypatient ' + Global.userData.hosuconsultant + ',' + JSON.stringify(data.date);
|
|
102
|
-
console.log('Button Apiiiiiiiiiii', JSON.stringify(buttonapi));
|
|
103
|
-
NetworkServiceCall('get', buttonapi, '')
|
|
104
|
-
.then(function (response) {
|
|
105
|
-
if (response.httpstatus == 200) {
|
|
106
|
-
data.patientdetails = response.data.patientdata;
|
|
107
|
-
setTimeout(() => {
|
|
108
|
-
flatlistRef.current.scrollToEnd({ animating: true });
|
|
109
|
-
}, 2000);
|
|
110
|
-
setIsLoading(false);
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
setIsLoading(false);
|
|
114
|
-
notifyMessage('Patient data not available', 4);
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
getLoading(v => setIsLoading(false));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function onPressPieChart() {
|
|
122
|
-
setPiechartVisibility(!PichartVisibility);
|
|
123
|
-
// flatlistRef.current.scrollToEnd({ animating: true });
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function IncrementMonth() {
|
|
127
|
-
setFooterData(null);
|
|
128
|
-
if (monthinno != 11) {
|
|
129
|
-
if (monthinno < 11) {
|
|
130
|
-
setMonthInNo(monthinno + 1);
|
|
131
|
-
} else {
|
|
132
|
-
setYear(year + 1);
|
|
133
|
-
setMonthInNo(0);
|
|
134
|
-
}
|
|
135
|
-
getConsultation(Global.userData.hosuconsultant, year, monthinno + 1);
|
|
136
|
-
} else {
|
|
137
|
-
setMonthInNo(0);
|
|
138
|
-
setYear(year + 1);
|
|
139
|
-
getConsultation(Global.userData.hosuconsultant, year + 1, 0);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
function DAYNAME(year, month) {
|
|
144
|
-
var date = new Date(year, month, 1);
|
|
145
|
-
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
146
|
-
return days[date.getDay()];
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function DecrementMonth() {
|
|
150
|
-
if (monthinno != 0) {
|
|
151
|
-
setFooterData(null);
|
|
152
|
-
if (monthinno > 0) {
|
|
153
|
-
setMonthInNo(monthinno - 1);
|
|
154
|
-
} else {
|
|
155
|
-
setYear(year - 1);
|
|
156
|
-
setMonthInNo(11);
|
|
157
|
-
}
|
|
158
|
-
getConsultation(Global.userData.hosuconsultant, year, monthinno - 1);
|
|
159
|
-
} else {
|
|
160
|
-
setYear(year - 1);
|
|
161
|
-
setMonthInNo(11);
|
|
162
|
-
getConsultation(Global.userData.hosuconsultant, year - 1, 11);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
return (
|
|
167
|
-
<View style={{ marginTop: normalize(-3) }}>
|
|
168
|
-
<HHeading
|
|
169
|
-
styles={{
|
|
170
|
-
'iconname': 'calendar',
|
|
171
|
-
'bgcolor': '#f2efef',
|
|
172
|
-
'iconsize': 16,
|
|
173
|
-
'iconcolor': Global.AppTheme.primary_color,
|
|
174
|
-
'displaytext': 'CONSULTATION',
|
|
175
|
-
'textsize': 14,
|
|
176
|
-
'textcolor': Global.AppTheme.primary_color,
|
|
177
|
-
}}
|
|
178
|
-
callBack={val => (val == undefined ? null : console.log(val))} />
|
|
179
|
-
|
|
180
|
-
{isLoading ?
|
|
181
|
-
<Loader displaytext={true} />
|
|
182
|
-
: null}
|
|
183
|
-
<View style={{ backgroundColor: 'transparent' }}>
|
|
184
|
-
{/* <Text style={{ fontWeight: 'bold', fontSize: normalize(16), alignSelf: 'flex-end', paddingRight: 10 }}>{monthTotal}</Text> */}
|
|
185
|
-
<View style={{ flexDirection: 'row', alignSelf: 'center', alignItems: 'center', justifyContent: 'space-between', width: '50%' }}>
|
|
186
|
-
<FontAwesome5 name="arrow-left" color="black" size={normalize(20)} onPress={() => DecrementMonth()} />
|
|
187
|
-
<Text style={{ fontSize: normalize(16), color: 'black', paddingHorizontal: 10 }}>{monthName} {year}</Text>
|
|
188
|
-
<FontAwesome5 name="arrow-right" color="black" size={normalize(20)} onPress={() => IncrementMonth()} />
|
|
189
|
-
</View>
|
|
190
|
-
</View>
|
|
191
|
-
<View style={{ flexDirection: 'row', height: normalize(20), alignItems: 'center', justifyContent: 'center' }}>
|
|
192
|
-
{['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'].map((week, i) => {
|
|
193
|
-
return (
|
|
194
|
-
<View key={i} style={{ width: dividedWidth, alignItems: 'center', borderWidth: 0.5 }}>
|
|
195
|
-
<Text style={{ fontSize: normalize(12), fontWeight: 'bold', color: i == 0 ? 'red' : 'black' }}>{week}</Text>
|
|
196
|
-
</View>);
|
|
197
|
-
})}
|
|
198
|
-
</View >
|
|
199
|
-
<FlatList
|
|
200
|
-
ref={flatlistRef}
|
|
201
|
-
data={data}
|
|
202
|
-
style={{ width: '100%', marginBottom: normalize(85) }}
|
|
203
|
-
renderItem={renderItem}
|
|
204
|
-
keyExtractor={(item) => item.displaytext}
|
|
205
|
-
numColumns={7}
|
|
206
|
-
ListFooterComponent={footerComponent}
|
|
207
|
-
ListFooterComponentStyle={{ width: width }}
|
|
208
|
-
/>
|
|
209
|
-
</View>
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
function footerComponent() {
|
|
213
|
-
return (
|
|
214
|
-
<View>
|
|
215
|
-
{totalMonthChart != null && totalMonthChart != undefined && totalMonthChart.length > 0 ?
|
|
216
|
-
<View>
|
|
217
|
-
{/* <Text style={{ fontSize: normalize(12), alignSelf: 'center', paddingVertical: 5 }}>Monthly Summary of {monthName},{year}</Text> */}
|
|
218
|
-
<View style={{ flexDirection: 'row' }}>
|
|
219
|
-
<CPiechart
|
|
220
|
-
data={totalMonthChart.map((item) => ({
|
|
221
|
-
'value': item,
|
|
222
|
-
}))}
|
|
223
|
-
colorArr={ColorCode}
|
|
224
|
-
style={{ 'innerRadius': 40, 'outerRadius': 60, 'labelRadius': 75, 'height': 0.27 }} />
|
|
225
|
-
|
|
226
|
-
<View style={{ flex: 1, justifyContent: 'center' }} >
|
|
227
|
-
{ColorCode.map((display, p) => {
|
|
228
|
-
return (
|
|
229
|
-
display != null && display != undefined ?
|
|
230
|
-
<View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
|
|
231
|
-
<View style={{
|
|
232
|
-
width: normalize(20), height: normalize(15),
|
|
233
|
-
backgroundColor: ColorCode[p], borderRadius: 5, alignItems: 'center', justifyContent: 'center',
|
|
234
|
-
marginRight: 5,
|
|
235
|
-
}}>
|
|
236
|
-
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: 'white' }}>{totalMonthChart[p]}</Text>
|
|
237
|
-
</View>
|
|
238
|
-
<Text style={{ fontSize: normalize(12) }}>{getDisplayText(display)}</Text>
|
|
239
|
-
</View> : null);
|
|
240
|
-
})}
|
|
241
|
-
|
|
242
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
|
|
243
|
-
<View style={{
|
|
244
|
-
width: normalize(30), height: normalize(20),
|
|
245
|
-
backgroundColor: 'black', borderRadius: 5, alignItems: 'center', justifyContent: 'center',
|
|
246
|
-
marginRight: 5,
|
|
247
|
-
}}>
|
|
248
|
-
<Text style={{ fontSize: normalize(14), fontWeight: 'bold', color: 'white' }}>{monthTotal}</Text>
|
|
249
|
-
</View>
|
|
250
|
-
<Text style={{ fontSize: normalize(12), fontWeight: 'bold' }}>{'Total'}</Text>
|
|
251
|
-
</View>
|
|
252
|
-
{/* <Text style={{ alignSelf: 'center', paddingTop: 5, fontSize: normalize(10) }}>Total :<Text style={{ fontSize: normalize(16), fontWeight: 'bold' }}>{monthTotal} </Text></Text> */}
|
|
253
|
-
</View>
|
|
254
|
-
</View>
|
|
255
|
-
</View> : null}
|
|
256
|
-
{footerData != null && footerData != undefined ?
|
|
257
|
-
<View>
|
|
258
|
-
<Text style={{ fontSize: normalize(12), fontWeight: 'bold', alignSelf: 'center', paddingVertical: 0 }}>Daywise Summary for {footerData.displaytext} {monthName}-{year}</Text>
|
|
259
|
-
{/* <View>
|
|
260
|
-
<Text style={{ fontSize: normalize(12), alignSelf: 'center', paddingVertical: 5 }}>Daywise Summary for {footerData.displaytext} {monthName}-{year}</Text>
|
|
261
|
-
<View style={{ flexDirection: 'row' }}>
|
|
262
|
-
{PiechartSecondWOFV.length > 0 ?
|
|
263
|
-
<CPiechart
|
|
264
|
-
data={PiechartSecondWOFV.map((item) => ({
|
|
265
|
-
"value": item
|
|
266
|
-
}))}
|
|
267
|
-
style={{ "innerRadius": 30, "outerRadius": 60, "labelRadius": 80, "height": 0.30 }} /> : null}
|
|
268
|
-
<View>
|
|
269
|
-
<View style={{ flex: 1, paddingVertical: 15 }} >
|
|
270
|
-
{["OTHERS", "NEW PATIENT"].map((display, p) => {
|
|
271
|
-
return (
|
|
272
|
-
<View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
|
|
273
|
-
<View style={{ width: normalize(15), height: normalize(15), backgroundColor: getPieColor(p), borderRadius: 5, marginHorizontal: 10 }}></View>
|
|
274
|
-
<Text style={{ fontSize: normalize(12) }}>{display}</Text>
|
|
275
|
-
</View>)
|
|
276
|
-
})}
|
|
277
|
-
</View>
|
|
278
|
-
<TouchableOpacity style={{ alignSelf: 'flex-end', paddingBottom: normalize(20) }} onPress={() => onPressPieChart()}>
|
|
279
|
-
<Text style={{ fontSize: normalize(12), backgroundColor: PichartVisibility ? '#cbf7a5' : '#f4efef', padding: 5, borderRadius: 10 }}>Split Up</Text>
|
|
280
|
-
</TouchableOpacity>
|
|
281
|
-
</View>
|
|
282
|
-
</View>
|
|
283
|
-
</View> */}
|
|
284
|
-
{PichartVisibility && formatedPieChart.length > 0 ?
|
|
285
|
-
<View style={{ flexDirection: 'row' }}>
|
|
286
|
-
<CPiechart
|
|
287
|
-
data={formatedPieChart.map((item) => ({
|
|
288
|
-
'value': item,
|
|
289
|
-
}))}
|
|
290
|
-
colorArr={formatedPieColor}
|
|
291
|
-
style={{ 'innerRadius': 40, 'outerRadius': 60, 'labelRadius': 75, 'height': 0.25 }} />
|
|
292
|
-
<View style={{ flex: 1, paddingVertical: normalize(5), justifyContent: 'center' }}>
|
|
293
|
-
{formatedPieDisplayText.map((display, p) => {
|
|
294
|
-
return (
|
|
295
|
-
<View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
|
|
296
|
-
<View style={{ width: normalize(15), height: normalize(15), backgroundColor: display.color, borderRadius: 5, marginHorizontal: 10 }} />
|
|
297
|
-
<Text style={{ fontSize: normalize(11) }}>{display.display}</Text>
|
|
298
|
-
</View>);
|
|
299
|
-
})}
|
|
300
|
-
</View>
|
|
301
|
-
</View> : null}
|
|
302
|
-
|
|
303
|
-
{ValueCheck(footerData) && ArrayCheck(footerData.patientdetails) && footerData.patientdetails != 'NULL' ?
|
|
304
|
-
<View style={{}}>
|
|
305
|
-
<HHeading
|
|
306
|
-
styles={{
|
|
307
|
-
'iconname': 'user-injured',
|
|
308
|
-
'bgcolor': '#f2efef',
|
|
309
|
-
'iconsize': 16,
|
|
310
|
-
'iconcolor': Global.AppTheme.primary_color,
|
|
311
|
-
'displaytext': 'PATIENTS - ' + footerData.displaytext + ' ' + monthName + ' ' + year,
|
|
312
|
-
'textsize': 14,
|
|
313
|
-
'textcolor': Global.AppTheme.primary_color,
|
|
314
|
-
}}
|
|
315
|
-
callBack={val => (val == undefined ? null : console.log(val))} />
|
|
316
|
-
|
|
317
|
-
<View style={{ marginLeft: 10, flex: 1, marginBottom: normalize(40) }}>
|
|
318
|
-
<CCard
|
|
319
|
-
// filter={filter}
|
|
320
|
-
search={''}
|
|
321
|
-
noscroll={true}
|
|
322
|
-
disableTouch={true}
|
|
323
|
-
navigation={navigation}
|
|
324
|
-
data={(footerData.patientdetails.map((Pdata, i) => ({
|
|
325
|
-
'datalistid': i + 1,
|
|
326
|
-
'bordercolor': '#143A81',
|
|
327
|
-
'hopapatient': ValueCheck(Pdata.hopapatient) ? Pdata.hopapatient : 0,
|
|
328
|
-
'verified': false,
|
|
329
|
-
'homrpatientchartdetailstatus': 0,
|
|
330
|
-
'homrpatientchart': 0,
|
|
331
|
-
'profilecontent': [
|
|
332
|
-
{
|
|
333
|
-
'patientno': ValueCheck(Pdata.patientid) ? (Pdata.patientid).toString() : '',
|
|
334
|
-
'patientname': ValueCheck(Pdata.patientname) ? Pdata.patientname : '',
|
|
335
|
-
'heading3': '',
|
|
336
|
-
'patienttype': 'OP',
|
|
337
|
-
'gender': Pdata.gender == 'F' ? 'FEMALE' : 'MALE',
|
|
338
|
-
'age': ValueCheck(Pdata.age) ? Pdata.age : '',
|
|
339
|
-
'mobileno': ValueCheck(Pdata.mobileno) ? Pdata.mobileno : '',
|
|
340
|
-
'badgecolor': 'red',
|
|
341
|
-
'badgenumber': ValueCheck(Pdata.key) ? Pdata.key : i + 1,
|
|
342
|
-
'logo1': ValueCheck(Pdata.bookingstatus) ? 'BOOKING' : 'OP',
|
|
343
|
-
'place': ValueCheck(Pdata.place) ? Pdata.place : '',
|
|
344
|
-
'clinicalunit': ValueCheck(Pdata.clinicalunit) ? Pdata.clinicalunit : '',
|
|
345
|
-
'admitteddoctor': ValueCheck(Pdata.admitteddoctor) ? Pdata.admitteddoctor : '',
|
|
346
|
-
},
|
|
347
|
-
],
|
|
348
|
-
'centercontent': [
|
|
349
|
-
{
|
|
350
|
-
'id': 1,
|
|
351
|
-
'displaytext': ValueCheck(Pdata.place) ? Pdata.place : '',
|
|
352
|
-
'iconname': 'home',
|
|
353
|
-
'iconcolor': '#000000',
|
|
354
|
-
},
|
|
355
|
-
{
|
|
356
|
-
'id': 3,
|
|
357
|
-
'displaytext': ValueCheck(Pdata.clinicalunit) ? Pdata.clinicalunit : '',
|
|
358
|
-
'iconname': 'hospital',
|
|
359
|
-
'iconcolor': '#000000',
|
|
360
|
-
},
|
|
361
|
-
],
|
|
362
|
-
'rightcontent': [
|
|
363
|
-
{
|
|
364
|
-
'contentid': 1,
|
|
365
|
-
'displaytext': 'Last Visited',
|
|
366
|
-
'value': ValueCheck(Pdata.lastvisited) ? Pdata.lastvisited : '',
|
|
367
|
-
},
|
|
368
|
-
],
|
|
369
|
-
'leftcontent': [
|
|
370
|
-
{
|
|
371
|
-
'contentid': 1,
|
|
372
|
-
'displaytext': 'Last Visited',
|
|
373
|
-
'value': '',
|
|
374
|
-
},
|
|
375
|
-
],
|
|
376
|
-
})))}
|
|
377
|
-
/>
|
|
378
|
-
</View>
|
|
379
|
-
</View> : null}
|
|
380
|
-
|
|
381
|
-
{/* {footerData.patientdetails != undefined && footerData.patientdetails != "NULL" ?
|
|
382
|
-
<CTable data={footerData.patientdetails} date={footerData.displaytext + " " + monthName + " " + year} /> : null} */}
|
|
383
|
-
|
|
384
|
-
</View> : null}
|
|
385
|
-
|
|
386
|
-
</View>
|
|
387
|
-
);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function getDateData(params) {
|
|
391
|
-
data.forEach((item) => {
|
|
392
|
-
item.selected = false;
|
|
393
|
-
});
|
|
394
|
-
params.selected = true;
|
|
395
|
-
params.patientdetails = [];
|
|
396
|
-
getApiPatientData(params);
|
|
397
|
-
// console.log("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", JSON.stringify(params.patientdetails))
|
|
398
|
-
setRefresh(refresh + 1);
|
|
399
|
-
setFooterData(params);
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function renderItem({ item }) {
|
|
403
|
-
return (
|
|
404
|
-
<TouchableOpacity style={{
|
|
405
|
-
width: dividedWidth, alignItems: 'center', paddingTop: 5,
|
|
406
|
-
borderWidth: 0.5, backgroundColor: item.selected == true ? '#dbd6d6' : '#fff',
|
|
407
|
-
}} onPress={() => getDateData(item)} disabled={item.data == undefined ? true : false}
|
|
408
|
-
>
|
|
409
|
-
<View style={{
|
|
410
|
-
alignItems: 'center', justifyContent: 'center',
|
|
411
|
-
}}>
|
|
412
|
-
<Text style={{ color: '#b6b5b7', fontSize: normalize(16), fontWeight: 'bold' }}>{item.displaytext == 0 ? '' : item.displaytext}</Text>
|
|
413
|
-
</View>
|
|
414
|
-
<View style={{
|
|
415
|
-
flexDirection: 'row', width: '100%', flex: 1, alignItems: 'center',
|
|
416
|
-
justifyContent: 'space-between', flexWrap: 'wrap', paddingHorizontal: 1, paddingTop: normalize(10), paddingBottom: normalize(5),
|
|
417
|
-
}}>
|
|
418
|
-
{item.data != undefined ? item.data.map((subArray, h) => {
|
|
419
|
-
return (
|
|
420
|
-
<View key={h} style={{
|
|
421
|
-
width: normalize(22), borderRadius: 5, justifyContent: 'center',
|
|
422
|
-
alignItems: 'center', marginBottom: 1, marginTop: normalize(5),
|
|
423
|
-
backgroundColor: '#fff', borderWidth: 0.7, borderColor: subArray.color,
|
|
424
|
-
}}>
|
|
425
|
-
<Text adjustsFontSizeToFit style={{ fontSize: normalize(12), color: subArray.color }}>{subArray.value}</Text>
|
|
426
|
-
</View>
|
|
427
|
-
);
|
|
428
|
-
}) : null}
|
|
429
|
-
</View>
|
|
430
|
-
{item.data != undefined && item.data.length > 0 ?
|
|
431
|
-
<View style={{ width: '100%', alignItems: 'center', flexDirection: 'row', justifyContent: 'space-evenly' }}>
|
|
432
|
-
<Text style={{ fontWeight: 'bold', fontSize: normalize(16) }}>{item.data != undefined ? getSum(item.data) : null}</Text>
|
|
433
|
-
</View> : null}
|
|
434
|
-
</TouchableOpacity>
|
|
435
|
-
);
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
function getMonthSum(params) {
|
|
439
|
-
var HHH = [];
|
|
440
|
-
var TotalMonthSumRevisit = [];
|
|
441
|
-
var TotalMonthSumRenewal = [];
|
|
442
|
-
var TotalMonthSumFirstVisit = [];
|
|
443
|
-
var TotalMonthSumAdmission = [];
|
|
444
|
-
var TotalMonthSumRegistration = [];
|
|
445
|
-
var TotalMonthSumBooking = [];
|
|
446
|
-
var monthSum;
|
|
447
|
-
var TotalSumReVisit;
|
|
448
|
-
var TotalSumRenewal;
|
|
449
|
-
var TotalfirstvisitSum;
|
|
450
|
-
var TotalMonthAdmission;
|
|
451
|
-
var TotalMonthRegistration;
|
|
452
|
-
var TotalMonthBooking;
|
|
453
|
-
|
|
454
|
-
params.map((items, i) => {
|
|
455
|
-
var array = (items.data != undefined ? items.data : []).reduce((n, { value }) => n + value, 0);
|
|
456
|
-
HHH.push(array);
|
|
457
|
-
monthSum = HHH.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
458
|
-
});
|
|
459
|
-
for (var i = 0; i < params.length; i++) {
|
|
460
|
-
var Narray = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
461
|
-
return el.key === 'CROSS CONSULTATION';
|
|
462
|
-
});
|
|
463
|
-
var NarrayRenewal = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
464
|
-
return el.key === 'RENEWAL';
|
|
465
|
-
});
|
|
466
|
-
var NarrayFirstVisit = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
467
|
-
return el.key === 'FIRSTVISIT';
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
var NarrayAdmission = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
471
|
-
return el.key === 'ADMISSION';
|
|
472
|
-
});
|
|
473
|
-
|
|
474
|
-
var NarrayRegistration = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
475
|
-
return el.key === 'REGISTRATION';
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
var NarrayBooking = params[i].data != undefined && params[i].data.filter(function (el) {
|
|
479
|
-
return el.key === 'BOOKING';
|
|
480
|
-
});
|
|
481
|
-
|
|
482
|
-
if (Narray != false) {
|
|
483
|
-
TotalMonthSumRevisit.push(Narray[0].value);
|
|
484
|
-
var c1 = Narray[0].color;
|
|
485
|
-
}
|
|
486
|
-
if (NarrayRenewal != false) {
|
|
487
|
-
TotalMonthSumRenewal.push(NarrayRenewal[0].value);
|
|
488
|
-
var c2 = NarrayRenewal[0].color;
|
|
489
|
-
}
|
|
490
|
-
if (NarrayFirstVisit != false) {
|
|
491
|
-
TotalMonthSumFirstVisit.push(NarrayFirstVisit[0].value);
|
|
492
|
-
var c3 = NarrayFirstVisit[0].color;
|
|
493
|
-
}
|
|
494
|
-
if (NarrayAdmission != false) {
|
|
495
|
-
TotalMonthSumAdmission.push(NarrayAdmission[0].value);
|
|
496
|
-
var c4 = NarrayAdmission[0].color;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
if (NarrayRegistration != false) {
|
|
500
|
-
TotalMonthSumRegistration.push(NarrayRegistration[0].value);
|
|
501
|
-
var c5 = NarrayAdmission[0].color;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
if (NarrayBooking != false) {
|
|
505
|
-
TotalMonthSumBooking.push(NarrayBooking[0].value);
|
|
506
|
-
var c6 = NarrayBooking[0].color;
|
|
507
|
-
}
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
TotalSumReVisit = TotalMonthSumRevisit.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
511
|
-
TotalSumRenewal = TotalMonthSumRenewal.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
512
|
-
TotalfirstvisitSum = TotalMonthSumFirstVisit.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
513
|
-
TotalMonthAdmission = TotalMonthSumAdmission.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
514
|
-
TotalMonthRegistration = TotalMonthSumRegistration.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
515
|
-
TotalMonthBooking = TotalMonthSumBooking.reduce((partial_sum, a) => partial_sum + a, 0);
|
|
516
|
-
|
|
517
|
-
}
|
|
518
|
-
setmonthTotal(monthSum);
|
|
519
|
-
monthlysumResult = [TotalSumReVisit, TotalSumRenewal, TotalfirstvisitSum, TotalMonthAdmission, TotalMonthRegistration, TotalMonthBooking];
|
|
520
|
-
monthlyColorCode = [c1, c2, c3, c4, c5, c6];
|
|
521
|
-
setColorCode(monthlyColorCode);
|
|
522
|
-
settotalMonthChart(monthlysumResult);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
|
-
function getSum(data) {
|
|
526
|
-
// console.log("DATTATATATTAT",JSON.stringify(data))
|
|
527
|
-
var val = data.reduce(function (previousValue, currentValue) {
|
|
528
|
-
return {
|
|
529
|
-
value: previousValue.value + currentValue.value,
|
|
530
|
-
};
|
|
531
|
-
});
|
|
532
|
-
return val.value;
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
function getPieColor(params) {
|
|
536
|
-
switch (params) {
|
|
537
|
-
case 0: return 'blue';
|
|
538
|
-
case 1: return '#0f6d2e';
|
|
539
|
-
case 2: return '#e81717';
|
|
540
|
-
case 3: return '#7a0c0c';
|
|
541
|
-
case 4: return '#7b36bc';
|
|
542
|
-
case 5: return '#f28909';
|
|
543
|
-
case 6: return '#0cd3cd';
|
|
544
|
-
case 7: return '#ad400a';
|
|
545
|
-
default: return 'black';
|
|
546
|
-
}
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
function getDisplayText(params) {
|
|
550
|
-
switch (params) {
|
|
551
|
-
case '#00cccc': return 'Cross Consultation';
|
|
552
|
-
case '#ff9900': return 'Renewal';
|
|
553
|
-
case '#0066ff': return 'First Visit';
|
|
554
|
-
case '#7a1241': return 'Booking';
|
|
555
|
-
case '#cc3300': return 'Admission';
|
|
556
|
-
default: return 'black';
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
};
|
|
560
|
-
export default CCalendar;
|