@jescon-technologies/react-native-ui-kit 0.0.3 → 0.0.5
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 +66 -0
- package/index.js +0 -4
- package/package.json +3 -34
- package/src/Alerts/AAlert.js +3 -3
- package/src/Alerts/AAlertIOS.js +3 -3
- package/src/{common → Common}/NetworkServiceCall.js +1 -1
- package/src/CommonStyle/CommonTheme.js +11 -0
- package/src/CommonStyle/ComponentFunctions.js +632 -0
- package/src/CommonStyle/PopupStyle.js +146 -0
- package/src/CommonStyle/commonStyle.js +93 -0
- package/src/CommonStyle/componentStyle.js +545 -0
- package/src/CommonStyle/optionListStyles.js +175 -0
- package/src/Components/ByProductPage.js +200 -0
- package/src/Components/CDropDownListNew.js +153 -0
- package/src/Components/CSupplierList.js +88 -0
- package/src/Components/CVerificationCard.js +2822 -0
- package/src/Components/CustomButton.js +67 -0
- package/src/Components/CustomCard.js +127 -0
- package/src/Components/CustomTextInput.js +47 -0
- package/src/Components/EquipmentPage.js +313 -0
- package/src/Components/FilterInput.Copy.js +723 -0
- package/src/Components/FilterInput.js +569 -0
- package/src/Components/HSubHeading.js +68 -0
- package/src/Components/HeaderCard.js +40 -0
- package/src/Components/MoreOptionsScreen.js +251 -0
- package/src/Components/NonSwipableProductCard.js +226 -0
- package/src/Components/NonSwipableSupplierCard.js +348 -0
- package/src/Components/ProductCard.js +1336 -0
- package/src/Components/QualityProductCard.js +1059 -0
- package/src/Components/RateProductCard.js +1452 -0
- package/src/Components/RawMaterial.js +261 -0
- package/src/Components/SDropDownEdited.js +549 -0
- package/src/Components/SDropDownNew.js +529 -0
- package/src/Components/SHelpDescription.js +147 -0
- package/src/Components/STextInputNew.js +510 -0
- package/src/Components/SearchProductCard.js +470 -0
- package/src/Components/StageByProduct.js +199 -0
- package/src/Components/SupplierCard.js +243 -0
- package/src/Components/SupplierInvoiceCard.js +405 -0
- package/src/Components/SwipableSupplierCard.js +136 -0
- package/src/Components/TagTemplate.js +74 -0
- package/src/Components/WrappedComponent.js +25 -0
- package/src/Custom/CBooking.js +944 -0
- package/src/Custom/CBookingPostpone.js +1822 -0
- package/src/Custom/CCalendar.js +560 -0
- package/src/Custom/CCard.js +880 -0
- package/src/Custom/CDetailCard.js +205 -0
- package/src/Custom/CHelpImage.js +52 -0
- package/src/Custom/CReport.js +569 -0
- package/src/Custom/CScrollView.js +73 -0
- package/src/Custom/CSignature.js +112 -0
- package/src/Custom/CSliderMenu.js +339 -0
- package/src/Custom/CSupplierCard.js +99 -0
- package/src/Custom/CTemplateCard.js +438 -0
- package/src/Custom/CTokenAllocation.js +1402 -0
- package/src/Custom/CTokenListOverlay.js +122 -0
- package/src/Custom/CWardStatus.js +444 -0
- package/src/Custom/Charts/CBarChart.js +218 -0
- package/src/Custom/Charts/CDashBoardList.js +133 -0
- package/src/Custom/Charts/CDashBoardTable.js +172 -0
- package/src/Custom/Charts/CLineChart.js +193 -0
- package/src/Custom/Charts/CPieChart.js +186 -0
- package/src/Custom/Loader.js +182 -0
- package/src/Custom/OUserView.js +1121 -0
- package/src/Custom/PreviewDosage.js +115 -0
- package/src/Custom/SearchLoader.js +32 -0
- package/src/Custom/TableComponent/CActivityTable.js +707 -0
- package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
- package/src/Custom/TableComponent/CTable.js +185 -0
- package/src/Custom/TableComponent/CTextBody.js +40 -0
- package/src/Custom/TableComponent/CTextHeader.js +17 -0
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
- package/src/Custom/TableComponent/SDropdownTable.js +491 -0
- package/src/Custom/TableComponent/TagTable.js +1200 -0
- package/src/CustomComponents/CAddColumn.js +140 -0
- package/src/CustomComponents/CAssessmentDelete.js +307 -0
- package/src/CustomComponents/CAwesomeButton.js +83 -0
- package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
- package/src/CustomComponents/CBackHandler.js +273 -0
- package/src/CustomComponents/CCalendar.js +243 -0
- package/src/CustomComponents/CCommentOverlay.js +202 -0
- package/src/CustomComponents/CComments.js +162 -0
- package/src/CustomComponents/CContainerView.js +24 -0
- package/src/CustomComponents/CCustomTextInput.js +336 -0
- package/src/CustomComponents/CDetailView.js +40 -0
- package/src/CustomComponents/CDropDownList.js +153 -0
- package/src/CustomComponents/CDropdownSelect.js +555 -0
- package/src/CustomComponents/CFooterView.js +42 -0
- package/src/CustomComponents/CImagePickerSave.js +316 -0
- package/src/CustomComponents/CModalOverlay.js +91 -0
- package/src/CustomComponents/CNetworkStatus.js +327 -0
- package/src/CustomComponents/CNotesInstructions.js +1000 -0
- package/src/CustomComponents/COverlay.js +81 -0
- package/src/CustomComponents/CRemarks.js +176 -0
- package/src/CustomComponents/CRowAdd.js +143 -0
- package/src/CustomComponents/CSummaryDropDown.js +327 -0
- package/src/CustomComponents/CText.js +9 -0
- package/src/CustomComponents/CVectorIcon.js +34 -0
- package/src/CustomComponents/HtmlContentViewer.js +65 -0
- package/src/CustomComponents/PdfContentViewer.js +90 -0
- package/src/CustomComponents/SDropDownDosage.js +1087 -0
- package/src/CustomComponents/SwipableProductCard.js +246 -0
- package/src/CustomComponents/SwipableProductImageCard.js +254 -0
- package/src/CustomComponents/WorkOrderDetails.js +1216 -0
- package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
- package/src/HOC/ConfirmOverlay.js +2 -2
- package/src/HOC/HMoreButton.js +1 -1
- package/src/HOC/HNatureHeading.js +1 -1
- package/src/HOC/HShadowButton.js +1 -1
- package/src/HOC/HShadowCountButton.js +1 -1
- package/src/Json/Chart.json +818 -0
- package/src/Json/Consultation.json +622 -0
- package/src/Json/CreditBill.json +490 -0
- package/src/Json/Dropdown.json +216 -0
- package/src/Json/DropdownConsultation.json +228 -0
- package/src/Json/DynamicReports.json +623 -0
- package/src/Json/Footer.json +79 -0
- package/src/Media/AudioScreen.js +2 -7
- package/src/Media/CCaptureImageWithoutEdit.js +1 -1
- package/src/Media/CImageGallery.js +2 -2
- package/src/Media/CSingleImage.js +2 -2
- package/src/Media/CVideoPlay.js +1 -1
- package/src/Media/DocumentScreen.js +2 -7
- package/src/Media/DrawingScreen.js +2 -6
- package/src/Media/ImageScreen.js +2 -6
- package/src/Media/VideoScreen.js +2 -7
- package/src/Navigation/PageNavigation.js +224 -0
- package/src/Navigation/useFocusEffect.js +2 -0
- package/src/Navigation/useFocusEffect.native.js +1 -0
- package/src/Navigation/useFocusEffect.web.js +1 -0
- package/src/Navigation/useIsFocused.js +1 -0
- package/src/Navigation/useIsFocused.native.js +1 -0
- package/src/Navigation/useIsFocused.web.js +1 -0
- package/src/Navigation/useNavigation.js +2 -0
- package/src/Navigation/useNavigation.native.js +1 -0
- package/src/Navigation/useNavigation.web.js +1 -0
- package/src/Screens/CMedications.js +528 -0
- package/src/Screens/CWebViewGallery.js +203 -0
- package/src/Screens/ChartScan.js +279 -0
- package/src/Screens/ChartScreenNew.js +1579 -0
- package/src/Screens/Consultation.js +1500 -0
- package/src/Screens/Dashboard.js +778 -0
- package/src/Screens/FileExplorer.js +288 -0
- package/src/Screens/Footer.js +340 -0
- package/src/Screens/ForgotPassword.js +288 -0
- package/src/Screens/HeaderBlock.js +353 -0
- package/src/Screens/Login.js +328 -0
- package/src/Screens/Notification.js +149 -0
- package/src/Screens/OcrScreen.js +20 -0
- package/src/Screens/PdfPreview.js +507 -0
- package/src/Screens/RegistrationDetails.js +467 -0
- package/src/Screens/SearchScreen.js +582 -0
- package/src/Screens/Splash.js +788 -0
- package/src/Screens/SwipeLeftView.js +1867 -0
- package/src/StaticComponents/SDatePickerLabel.js +1 -1
- package/src/StaticComponents/SDatePickerNew.js +1 -1
- package/src/StaticComponents/SDateTimePickerNew.js +2 -2
- package/src/StaticComponents/SDropDownGenerate.js +3 -3
- package/src/StaticComponents/SDropDownHoc.js +4 -4
- package/src/StaticComponents/SDropDownIcon.js +1 -1
- package/src/StaticComponents/SMenuBox.js +2 -2
- package/src/StaticComponents/SSearch.js +2 -2
- package/src/StaticComponents/STextInput.js +1 -1
- package/src/StaticComponents/STimePicker.js +1 -1
- package/src/StaticComponents/STimingDropDownNew.js +2 -6
- package/src/StaticComponents/STimingSwitch.js +1 -1
- package/src/layout/CContainerView.js +1 -1
- package/src/layout/CDetailView.js +3 -3
- package/src/layout/HeaderBlock.js +5 -5
- package/src/layout/INVLoginLayout.js +3 -4
- package/src/layout/Loader.js +2 -2
- package/src/HOC/HAbsolute.js +0 -56
- package/src/HOC/HDiscontinue.js +0 -105
- package/src/HOC/HOverlay.js +0 -99
- package/src/layout/FooterBlock.js +0 -821
- /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
- /package/src/{common → Common}/Icons.js +0 -0
|
@@ -0,0 +1,944 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { Text, View, FlatList, TouchableOpacity, Dimensions, ActivityIndicator, ScrollView, Switch, TextInput, RefreshControl } from 'react-native';
|
|
3
|
+
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
|
4
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
6
|
+
import { ArrayCheck, getLoading, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
7
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
8
|
+
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
9
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
10
|
+
import CTextHeader from './TableComponent/CTextHeader';
|
|
11
|
+
import CTextBody from './TableComponent/CTextBody';
|
|
12
|
+
import HHeading from '../HOC/HHeading';
|
|
13
|
+
import STimePicker from '../StaticComponents/STimePicker';
|
|
14
|
+
import Loader from './Loader';
|
|
15
|
+
import moment from 'moment';
|
|
16
|
+
import SDropDownNew from '../Components/SDropDownNew';
|
|
17
|
+
|
|
18
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
19
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
import CAwesomeButton from '../CustomComponents/CAwesomeButton';
|
|
23
|
+
|
|
24
|
+
const CBooking = (props) => {
|
|
25
|
+
|
|
26
|
+
const navigation = useNavigation();
|
|
27
|
+
const { width, height } = Dimensions.get('screen');
|
|
28
|
+
const flatlistRef = useRef();
|
|
29
|
+
const dividedWidth = width / 7;
|
|
30
|
+
const [data, setData] = useState();
|
|
31
|
+
const [refresh, setRefresh] = useState(0);
|
|
32
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
33
|
+
const [footerData, setFooterData] = useState();
|
|
34
|
+
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
35
|
+
const d = new Date();
|
|
36
|
+
const k = new Date();
|
|
37
|
+
const [monthinno, setMonthInNo] = useState(d.getMonth());
|
|
38
|
+
console.log('d.getMonth()',d.getMonth());
|
|
39
|
+
let monthName = months[monthinno];
|
|
40
|
+
const [year, setYear] = useState(d.getFullYear());
|
|
41
|
+
const [edit, setEdit] = useState(false);
|
|
42
|
+
const [consultant, setConsultant] = useState(Global.userData.hosuconsultant);
|
|
43
|
+
const [pulltorefresh] = useState(false);
|
|
44
|
+
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
if (consultant > 0) {
|
|
47
|
+
getConsultation(consultant, year, monthinno);
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
function getFooterIconsFunctions(val) {
|
|
52
|
+
switch (val.functionid) {
|
|
53
|
+
case 'CB01':
|
|
54
|
+
( ValueCheck(footerData) && ValueCheck(footerData.daywisedata) && ArrayCheck(footerData.daywisedata.tokensArray) ? getSave() : console.log('Disabled'));
|
|
55
|
+
break;
|
|
56
|
+
case 'CB02':
|
|
57
|
+
props.callBack(4);
|
|
58
|
+
break;
|
|
59
|
+
case 'CB03':
|
|
60
|
+
props.callBack(2);
|
|
61
|
+
break;
|
|
62
|
+
case 'CB04':
|
|
63
|
+
props.callBack(0);
|
|
64
|
+
break;
|
|
65
|
+
case 'CB05':
|
|
66
|
+
props.callBack(1);
|
|
67
|
+
break;
|
|
68
|
+
case 'CB06':
|
|
69
|
+
props.callBack(5);
|
|
70
|
+
break;
|
|
71
|
+
default:
|
|
72
|
+
console.log('Deault');
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function getSave() {
|
|
78
|
+
var output = {
|
|
79
|
+
'groups': {
|
|
80
|
+
'procedurename': 'hocobookingtokenordertiming1',
|
|
81
|
+
'suuser': Global.userData.suuser,
|
|
82
|
+
'hosuconsultant': consultant,
|
|
83
|
+
'dataArray': footerData.daywisedata.tokensArray,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
let buttonapi = APIURL + 'commontemplatesave/RnCommonTemplateSave';
|
|
87
|
+
console.log('Buttonnnnnnnnnn apiiiiiiiiiiiiiiiiiiiiii', JSON.stringify(buttonapi));
|
|
88
|
+
console.log('output CBooking apiiiiiiiiiiiiiiiiiiiiii', JSON.stringify(output));
|
|
89
|
+
setIsLoading(true);
|
|
90
|
+
NetworkServiceCall('post', buttonapi, output).then(function (response) {
|
|
91
|
+
console.log('output CBooking apiiiiiiiiiiiiiiiiiiiiii', JSON.stringify(response));
|
|
92
|
+
if (response.httpstatus == 200
|
|
93
|
+
&& response.data != undefined && response.data != null
|
|
94
|
+
&& response.data.code != undefined && response.data.code > 0) {
|
|
95
|
+
notifyMessage('Data Saved!!!!!', 1);
|
|
96
|
+
setFooterData();
|
|
97
|
+
setEdit(false);
|
|
98
|
+
setIsLoading(false);
|
|
99
|
+
} else {
|
|
100
|
+
// getDateData(footerData)
|
|
101
|
+
setIsLoading(false);
|
|
102
|
+
notifyMessage('Data Not Saved!!!!!', 2);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
getLoading(v => setIsLoading(false));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function footerComponent() {
|
|
109
|
+
return (
|
|
110
|
+
<View style={{ marginBottom: normalize(50), marginTop: normalize(2) }}>
|
|
111
|
+
|
|
112
|
+
{ValueCheck(footerData) && ArrayCheck(footerData.data) ?
|
|
113
|
+
<View style={{ paddingHorizontal: normalize(5), flexDirection: 'row', flexWrap: 'wrap' }}>
|
|
114
|
+
{footerData.data.map((display, p) => {
|
|
115
|
+
return (
|
|
116
|
+
display != null && display != undefined ?
|
|
117
|
+
<View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4), paddingLeft: normalize(5) }}>
|
|
118
|
+
<View style={{
|
|
119
|
+
width: normalize(20), height: normalize(15),
|
|
120
|
+
backgroundColor: display.color, borderRadius: 5, alignItems: 'center', justifyContent: 'center',
|
|
121
|
+
marginRight: 5,
|
|
122
|
+
}}>
|
|
123
|
+
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: 'white' }}>{display.value}</Text>
|
|
124
|
+
</View>
|
|
125
|
+
<Text style={{ fontSize: normalize(12) }}>{display.key}</Text>
|
|
126
|
+
</View> : null);
|
|
127
|
+
})}
|
|
128
|
+
</View> : null}
|
|
129
|
+
|
|
130
|
+
{footerData != undefined && footerData.data != undefined ?
|
|
131
|
+
<View
|
|
132
|
+
style={{ backgroundColor: '#fff', height: normalize(25), alignItems: 'center', justifyContent: 'space-evenly', flexDirection: 'row' }}>
|
|
133
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '50%', justifyContent: 'center' }}>
|
|
134
|
+
<Icons.FontAwesome5 name={'calendar-day'} color={'black'} size={normalize(15)} />
|
|
135
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(15), color: 'black', paddingLeft: normalize(10) }}>
|
|
136
|
+
{footerData.displaytext + '/' + monthName + '/' + year}
|
|
137
|
+
</Text>
|
|
138
|
+
</View>
|
|
139
|
+
</View> : null}
|
|
140
|
+
|
|
141
|
+
{footerData != undefined && ValueCheck(footerData.daywisedata)
|
|
142
|
+
&& ArrayCheck(footerData.daywisedata.tokensArray) ?
|
|
143
|
+
<FlatList
|
|
144
|
+
nestedScrollEnabled={true}
|
|
145
|
+
data={footerData.daywisedata.tokensArray}
|
|
146
|
+
style={{ width: width }}
|
|
147
|
+
renderItem={(k) => renderFooterView(k)}
|
|
148
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
149
|
+
listKey={(item, index) => 'key' + index}
|
|
150
|
+
/> : null}
|
|
151
|
+
</View>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
function getExpand(params) {
|
|
156
|
+
// params.expand = !params.expand
|
|
157
|
+
// setRefresh(refresh + 1)
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function getTimeDiffernece(params) {
|
|
161
|
+
var startTime = moment(params.reportingtime, 'HH:mm:ss a');
|
|
162
|
+
var endTime = moment(params.reportingto, 'HH:mm:ss a');
|
|
163
|
+
var duration = moment.duration(endTime.diff(startTime));
|
|
164
|
+
var hours = parseInt(duration.asHours());
|
|
165
|
+
var minutes = parseInt(duration.asMinutes());
|
|
166
|
+
// console.log(hours + ' hr and ' + minutes + ' min');
|
|
167
|
+
params.waitingtime = minutes;
|
|
168
|
+
return minutes;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
function getSingleRT(item, val) {
|
|
172
|
+
item.reportingtime = val;
|
|
173
|
+
item.EditFlag = 2;
|
|
174
|
+
item.reportingto = moment(moment(item.reportingtime, 'HH:mm:ss a')).add(30, 'minutes').format('hh:mm A');
|
|
175
|
+
getEditFlag();
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function getSingleCT(item, val) {
|
|
179
|
+
item.reportingto = val;
|
|
180
|
+
item.EditFlag = 2;
|
|
181
|
+
// item.reportingtime = moment(moment(item.reportingto, 'HH:mm:ss a')).subtract(30, 'minutes').format('hh:mm A')
|
|
182
|
+
getEditFlag();
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function renderFooterView({ item }) {
|
|
186
|
+
return (
|
|
187
|
+
|
|
188
|
+
ArrayCheck(item.tokenArr) ?
|
|
189
|
+
<View style={{ flex: 1 }}>
|
|
190
|
+
|
|
191
|
+
<HHeading
|
|
192
|
+
styles={{
|
|
193
|
+
'iconname': item.iconname,
|
|
194
|
+
'bgcolor': '#f4f4f4',
|
|
195
|
+
'iconsize': 16,
|
|
196
|
+
'iconcolor': Global.AppTheme.primary_color,
|
|
197
|
+
'displaytext': item.tokentype,
|
|
198
|
+
'textsize': 14,
|
|
199
|
+
'textcolor': Global.AppTheme.primary_color,
|
|
200
|
+
}}
|
|
201
|
+
callBack={val => (val == undefined ? null : getExpand(item))}
|
|
202
|
+
Expand={val => (val == undefined ? null : getExpand(item))} />
|
|
203
|
+
|
|
204
|
+
{ArrayCheck(item.tokenArr) ?
|
|
205
|
+
<View>
|
|
206
|
+
<FlatList
|
|
207
|
+
data={item.tokenArr}
|
|
208
|
+
style={{ backgroundColor: '#fff' }}
|
|
209
|
+
numColumns={2}
|
|
210
|
+
initialNumToRender={10}
|
|
211
|
+
maxToRenderPerBatch={10}
|
|
212
|
+
renderItem={(k) => renderMrngEvngToken(k)}
|
|
213
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
214
|
+
listKey={(item, index) => 'key' + index}
|
|
215
|
+
/>
|
|
216
|
+
</View>
|
|
217
|
+
: null}
|
|
218
|
+
|
|
219
|
+
{/* <View style={{ flexDirection: 'row', marginLeft: normalize(5), marginRight: normalize(5), }}>
|
|
220
|
+
<View>
|
|
221
|
+
<View style={{ flexDirection: 'row' }}>
|
|
222
|
+
<CTextHeader text={"Token No."} widthArr={Dimensions.get('screen').width * (0.15)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
223
|
+
</View>
|
|
224
|
+
{ArrayCheck(item.tokenArr) ? item.tokenArr.map((subItems, k) => {
|
|
225
|
+
// console.log("SUBITEMSSSSSS", JSON.stringify(subItems))
|
|
226
|
+
return (
|
|
227
|
+
<View key={k} style={{ flexDirection: 'row', marginTop: 1, backgroundColor: 'white' }}>
|
|
228
|
+
|
|
229
|
+
<View style={{
|
|
230
|
+
borderWidth: 1,
|
|
231
|
+
backgroundColor: subItems.disabledtoken ? "lightgrey" : subItems.bookedstatus ? '#c1f2d4' : '#fff', borderColor: 'lightgrey', borderRadius: 5, elevation: 3
|
|
232
|
+
, width: Dimensions.get('screen').width * (0.15),
|
|
233
|
+
height: Dimensions.get('screen').height * 0.035, elevation: 3,
|
|
234
|
+
marginHorizontal: normalize(2), marginVertical: normalize(2), paddingHorizontal: normalize(5)
|
|
235
|
+
}}>
|
|
236
|
+
<TouchableOpacity
|
|
237
|
+
style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
238
|
+
<Icons.FontAwesome name={'circle'} color={ValueCheck(subItems.color) ? subItems.color : "black"}
|
|
239
|
+
size={normalize(15)} />
|
|
240
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(18), paddingLeft: normalize(5) }}>{subItems.tokenno}</Text>
|
|
241
|
+
|
|
242
|
+
{getTimeDiffernece(subItems) > 30 && getTimeDiffernece(subItems) > 0 ?
|
|
243
|
+
<Icons.Entypo name={"emoji-sad"} color={"red"}
|
|
244
|
+
size={normalize(15)} style={{ paddingLeft: normalize(5) }} /> : null}
|
|
245
|
+
</TouchableOpacity>
|
|
246
|
+
</View>
|
|
247
|
+
|
|
248
|
+
</View>)
|
|
249
|
+
}) : null}
|
|
250
|
+
</View>
|
|
251
|
+
|
|
252
|
+
<ScrollView horizontal={true} showsHorizontalScrollIndicator={true}>
|
|
253
|
+
<View style={{ flex: 1, marginTop: 0, marginRight: normalize(20), }}>
|
|
254
|
+
<View style={{ flexDirection: 'row' }}>
|
|
255
|
+
<CTextHeader text={" Patient Name"} widthArr={Dimensions.get('screen').width * (0.3)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
256
|
+
<CTextHeader text={" Reporting Time"} widthArr={Dimensions.get('screen').width * (0.3)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
257
|
+
<CTextHeader text={" Consultation Time"} widthArr={Dimensions.get('screen').width * (0.3)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
258
|
+
<CTextHeader text={" Waiting Time"} widthArr={Dimensions.get('screen').width * (0.2)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
259
|
+
<CTextHeader text={" Disable"} widthArr={Dimensions.get('screen').width * (0.2)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
260
|
+
<CTextHeader text={" Type"} widthArr={Dimensions.get('screen').width * (0.3)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
261
|
+
<CTextHeader text={" Remarks"} widthArr={Dimensions.get('screen').width * (0.6)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
262
|
+
<CTextHeader text={" Mobile"} widthArr={Dimensions.get('screen').width * (0.3)} bgColor={"#f4f4f4"} color={Global.AppTheme.primary_color} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3} />
|
|
263
|
+
</View>
|
|
264
|
+
{ArrayCheck(item.tokenArr) ? item.tokenArr.map((subItems, h) => {
|
|
265
|
+
return (
|
|
266
|
+
<View key={h} style={{ flexDirection: 'row', marginTop: 1, backgroundColor: 'white' }}>
|
|
267
|
+
<CTextBody widthArr={0.3} displaytext={ValueCheck(subItems.patientname) ? subItems.patientname.toUpperCase() : ''} />
|
|
268
|
+
|
|
269
|
+
<View style={{ width: Dimensions.get('screen').width * (0.3), marginLeft: normalize(1) }}>
|
|
270
|
+
<STimePicker
|
|
271
|
+
table={true}
|
|
272
|
+
height={normalize(23)}
|
|
273
|
+
width={normalize(82)}
|
|
274
|
+
bgcolor={'#fcffad'}
|
|
275
|
+
value={subItems.reportingtime}
|
|
276
|
+
callBack={val => (val == undefined ? null : getSingleRT(subItems, val))} />
|
|
277
|
+
</View>
|
|
278
|
+
|
|
279
|
+
<View style={{ width: Dimensions.get('screen').width * (0.3), marginLeft: normalize(5) }}>
|
|
280
|
+
<STimePicker
|
|
281
|
+
table={true}
|
|
282
|
+
height={normalize(23)}
|
|
283
|
+
width={normalize(82)}
|
|
284
|
+
bgcolor={'#d8f9d4'}
|
|
285
|
+
value={subItems.reportingto}
|
|
286
|
+
callBack={val => (val == undefined ? null : getSingleCT(subItems, val))} />
|
|
287
|
+
</View>
|
|
288
|
+
|
|
289
|
+
<CTextBody widthArr={0.2} color={subItems.waitingtime > 30 || subItems.waitingtime < 0 ? "#ffc9c9" : '#fff'}
|
|
290
|
+
displaytext={subItems.waitingtime > 0 ? subItems.waitingtime + ' min' : ''} />
|
|
291
|
+
|
|
292
|
+
<View style={{
|
|
293
|
+
borderWidth: 1, justifyContent: 'center',
|
|
294
|
+
backgroundColor: subItems.disabledtoken ? "lightgrey" : '#fff', borderColor: 'lightgrey', borderRadius: 5, elevation: 3
|
|
295
|
+
, width: Dimensions.get('screen').width * (0.2),
|
|
296
|
+
height: Dimensions.get('screen').height * 0.035, elevation: 3,
|
|
297
|
+
marginHorizontal: normalize(2), marginVertical: normalize(2), alignItems: 'center'
|
|
298
|
+
}}>
|
|
299
|
+
<Switch
|
|
300
|
+
trackColor={{ false: "black", true: "red" }}
|
|
301
|
+
thumbColor={"lightgrey"}
|
|
302
|
+
onChange={() => { subItems.disabledtoken = !subItems.disabledtoken, setRefresh(refresh + 1), setEdit(true) }}
|
|
303
|
+
value={subItems.disabledtoken}
|
|
304
|
+
/>
|
|
305
|
+
</View>
|
|
306
|
+
|
|
307
|
+
<CTextBody widthArr={0.3} displaytext={subItems.bookingtypename} />
|
|
308
|
+
|
|
309
|
+
<TextInput
|
|
310
|
+
style={{
|
|
311
|
+
borderWidth: 1,
|
|
312
|
+
backgroundColor: 'white',
|
|
313
|
+
borderColor: 'lightgrey',
|
|
314
|
+
elevation: 3,
|
|
315
|
+
borderRadius: 5,
|
|
316
|
+
fontWeight: 'bold',
|
|
317
|
+
color: 'black',
|
|
318
|
+
width: Dimensions.get('screen').width * 0.6,
|
|
319
|
+
paddingTop: 5,
|
|
320
|
+
paddingBottom: 5,
|
|
321
|
+
height: Dimensions.get('screen').height * 0.035,
|
|
322
|
+
textAlign: 'center',
|
|
323
|
+
marginTop: normalize(2),
|
|
324
|
+
marginHorizontal: normalize(2)
|
|
325
|
+
}}
|
|
326
|
+
keyboardType={'default'}
|
|
327
|
+
onChangeText={val => { subItems.remarks = val }}>
|
|
328
|
+
{subItems.remarks}
|
|
329
|
+
</TextInput>
|
|
330
|
+
<CTextBody widthArr={0.3} displaytext={subItems.mobilenumber} />
|
|
331
|
+
|
|
332
|
+
</View>)
|
|
333
|
+
}) : null}
|
|
334
|
+
</View>
|
|
335
|
+
</ScrollView>
|
|
336
|
+
</View> */}
|
|
337
|
+
</View> : null
|
|
338
|
+
);
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
function renderMrngEvngToken({ item }) {
|
|
342
|
+
return (
|
|
343
|
+
<View style={{ marginLeft: normalize(7), marginTop: normalize(5) }}>
|
|
344
|
+
<View style={{
|
|
345
|
+
flexDirection: 'column', alignItems: 'center',
|
|
346
|
+
borderWidth: 1, borderBottomWidth: normalize(3), borderColor: 'lightgrey',
|
|
347
|
+
borderRadius: normalize(10), borderBottomColor: 'lightgrey',
|
|
348
|
+
width: Dimensions.get('screen').width * 0.47, paddingBottom: normalize(6),
|
|
349
|
+
justifyContent: 'space-around',
|
|
350
|
+
}}>
|
|
351
|
+
|
|
352
|
+
<View style={{ flexDirection: 'row', marginTop: normalize(2), backgroundColor: 'lightgrey', paddingHorizontal: normalize(5), borderRadius: normalize(5), width: normalize(150) }}>
|
|
353
|
+
<Icons.FontAwesome5 name="user" color={'black'} size={normalize(12)} style={{ paddingHorizontal: normalize(5) }} />
|
|
354
|
+
<Text numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>
|
|
355
|
+
{item.patientname} - {item.mobilenumber}
|
|
356
|
+
</Text>
|
|
357
|
+
</View>
|
|
358
|
+
|
|
359
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-evenly', width: Dimensions.get('screen').width * 0.47 }}>
|
|
360
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
361
|
+
<View style={{ width: normalize(30), backgroundColor: item.color, height: normalize(30), borderRadius: normalize(1000), alignItems: 'center', justifyContent: 'center', elevation: 5 }} >
|
|
362
|
+
<Text numberOfLines={1} style={{ color: getTimeDiffernece(item) > 30 && getTimeDiffernece(item) > 0 ? 'red' : '#fff', fontSize: normalize(17), fontWeight: 'bold' }}>{item.tokenno}</Text>
|
|
363
|
+
</View>
|
|
364
|
+
|
|
365
|
+
<View style={{ alignItems: 'center' }}>
|
|
366
|
+
<Text style={{ fontSize: normalize(9) }}>Disable?</Text>
|
|
367
|
+
<Switch
|
|
368
|
+
trackColor={{ false: 'black', true: 'red' }}
|
|
369
|
+
thumbColor={'lightgrey'}
|
|
370
|
+
onChange={() => { item.disabledtoken = !item.disabledtoken, item.EditFlag = 2, setRefresh(refresh + 1), setEdit(true); }}
|
|
371
|
+
value={item.disabledtoken}
|
|
372
|
+
/>
|
|
373
|
+
</View>
|
|
374
|
+
|
|
375
|
+
<View>
|
|
376
|
+
{ValueCheck(item.waitingtime) ?
|
|
377
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
|
|
378
|
+
<Icons.MaterialCommunityIcons name="timer-sand-complete" color={item.waitingtime > 30 || item.waitingtime < 0 ? 'red' : 'black'} size={normalize(12)} />
|
|
379
|
+
<Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: item.waitingtime > 30 || item.waitingtime < 0 ? 'red' : 'black' }}>
|
|
380
|
+
{item.waitingtime + ' min'}
|
|
381
|
+
</Text>
|
|
382
|
+
</View> : null}
|
|
383
|
+
</View>
|
|
384
|
+
</View>
|
|
385
|
+
|
|
386
|
+
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
387
|
+
<View style={{ width: Dimensions.get('screen').width * (0.28) }}>
|
|
388
|
+
<STimePicker
|
|
389
|
+
disabled={true}
|
|
390
|
+
bgcolor={'#fff'}
|
|
391
|
+
placeholder={'Reporting Time:'}
|
|
392
|
+
height={normalize(23)}
|
|
393
|
+
width={normalize(76)}
|
|
394
|
+
value={item.reportingtime}
|
|
395
|
+
callBack={val => (val == undefined ? null : getSingleRT(item, val))} />
|
|
396
|
+
</View>
|
|
397
|
+
|
|
398
|
+
<View style={{ width: Dimensions.get('screen').width * (0.28) }}>
|
|
399
|
+
<STimePicker
|
|
400
|
+
bgcolor={'#fff'}
|
|
401
|
+
placeholder={'Consultation Time:'}
|
|
402
|
+
height={normalize(23)}
|
|
403
|
+
width={normalize(76)}
|
|
404
|
+
value={item.reportingto}
|
|
405
|
+
callBack={val => (val == undefined ? null : getSingleCT(item, val))} />
|
|
406
|
+
</View>
|
|
407
|
+
|
|
408
|
+
</View>
|
|
409
|
+
</View>
|
|
410
|
+
|
|
411
|
+
<TextInput
|
|
412
|
+
style={{
|
|
413
|
+
borderWidth: 1,
|
|
414
|
+
backgroundColor: 'white',
|
|
415
|
+
borderColor: 'lightgrey',
|
|
416
|
+
elevation: 3,
|
|
417
|
+
borderRadius: 5,
|
|
418
|
+
fontWeight: 'bold',
|
|
419
|
+
color: 'black',
|
|
420
|
+
width: Dimensions.get('screen').width * 0.4,
|
|
421
|
+
paddingTop: 5,
|
|
422
|
+
paddingBottom: 5,
|
|
423
|
+
height: Dimensions.get('screen').height * 0.035,
|
|
424
|
+
textAlign: 'center',
|
|
425
|
+
marginTop: normalize(5),
|
|
426
|
+
marginHorizontal: normalize(2),
|
|
427
|
+
}}
|
|
428
|
+
keyboardType={'default'}
|
|
429
|
+
placeholder="Remarks"
|
|
430
|
+
onChangeText={val => { item.remarks = val, item.EditFlag = 2; }}>
|
|
431
|
+
{item.remarks}
|
|
432
|
+
</TextInput>
|
|
433
|
+
</View>
|
|
434
|
+
</View>
|
|
435
|
+
);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
function getDateData(params) {
|
|
439
|
+
setEdit(false);
|
|
440
|
+
props.editFlag(false);
|
|
441
|
+
data.forEach((item) => {
|
|
442
|
+
item.selected = false;
|
|
443
|
+
});
|
|
444
|
+
params.selected = true;
|
|
445
|
+
params.daywisedata = [];
|
|
446
|
+
getApiPatientData(params);
|
|
447
|
+
// console.log("CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC", JSON.stringify(params.daywisedata))
|
|
448
|
+
setRefresh(refresh + 1);
|
|
449
|
+
setFooterData(params);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function getEditFlag() {
|
|
453
|
+
props.editFlag(true);
|
|
454
|
+
setEdit(true);
|
|
455
|
+
setRefresh(refresh + 1);
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
function renderItem({ item }) {
|
|
459
|
+
return (
|
|
460
|
+
<TouchableOpacity style={{
|
|
461
|
+
width: dividedWidth, alignItems: 'center', paddingTop: 5,
|
|
462
|
+
borderWidth: 0.5, backgroundColor: item.data != undefined && item.data.length > 0 ? '#f4fcf7' : '#fff',
|
|
463
|
+
}}
|
|
464
|
+
disabled={false}
|
|
465
|
+
onPress={() => item.data != undefined && item.data.length > 0 ? getDateData(item) : notifyMessage('No data found', 3)}
|
|
466
|
+
>
|
|
467
|
+
<View style={{
|
|
468
|
+
alignItems: 'center', justifyContent: 'center',
|
|
469
|
+
}}>
|
|
470
|
+
<Text style={{
|
|
471
|
+
color: item.data != undefined && item.data.length > 0 ? 'green' : '#b6b5b7', fontSize: normalize(20), fontWeight: 'bold', textShadowColor: '#b6b5b7',
|
|
472
|
+
textShadowOffset: { width: -1, height: 1 },
|
|
473
|
+
textShadowRadius: 3,
|
|
474
|
+
}}>{item.displaytext == 0 ? '' : item.displaytext}</Text>
|
|
475
|
+
</View>
|
|
476
|
+
|
|
477
|
+
<View style={{
|
|
478
|
+
flexDirection: 'row', width: '100%', flex: 1, alignItems: 'center',
|
|
479
|
+
justifyContent: 'space-between', flexWrap: 'wrap', paddingHorizontal: 1, paddingTop: normalize(2), paddingBottom: normalize(5),
|
|
480
|
+
}}>
|
|
481
|
+
{item.data != undefined ? item.data.map((subArray, h) => {
|
|
482
|
+
return (
|
|
483
|
+
<View key={h} style={{
|
|
484
|
+
width: normalize(22), borderRadius: 5, justifyContent: 'center',
|
|
485
|
+
alignItems: 'center', marginBottom: 1, marginTop: normalize(5),
|
|
486
|
+
backgroundColor: '#fff', borderWidth: 0.7, borderColor: subArray.color,
|
|
487
|
+
}}>
|
|
488
|
+
<Text adjustsFontSizeToFit style={{ fontSize: normalize(12), color: subArray.color }}>{subArray.value}</Text>
|
|
489
|
+
</View>
|
|
490
|
+
);
|
|
491
|
+
}) : null}
|
|
492
|
+
</View>
|
|
493
|
+
|
|
494
|
+
</TouchableOpacity>
|
|
495
|
+
);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function getConsultation(consultant, year, month) {
|
|
499
|
+
setConsultant(consultant);
|
|
500
|
+
var monthReal = month + 1;
|
|
501
|
+
let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationtokendate ' + consultant + ',' + year + ',' + monthReal;
|
|
502
|
+
console.log('>>>>>>>>>>>> MONTH DATATATAT>>>>>>>>>>Booking<<<<', JSON.stringify(buttonapi));
|
|
503
|
+
// let buttonapi = "http://111.92.109.30:8090/emr/emrcommonget/rnhococonsultationhistoryemr 7,2023,10"
|
|
504
|
+
setIsLoading(true);
|
|
505
|
+
setData();
|
|
506
|
+
setFooterData();
|
|
507
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
508
|
+
.then(function (response) {
|
|
509
|
+
if (response.httpstatus == 200 && response.data != null && response.data != undefined) {
|
|
510
|
+
setIsLoading(false);
|
|
511
|
+
setData(response.data.monthdata);
|
|
512
|
+
}
|
|
513
|
+
else {
|
|
514
|
+
setIsLoading(false);
|
|
515
|
+
notifyMessage('Booking not available,Please try again later', 2);
|
|
516
|
+
}
|
|
517
|
+
});
|
|
518
|
+
|
|
519
|
+
getLoading(v => setIsLoading(false));
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
function getApiPatientData(data) {
|
|
523
|
+
setIsLoading(true);
|
|
524
|
+
let buttonapi = APIURL + 'emr/emrcommonget/rnhopaptientconsultationtokens ' + consultant + ',' + JSON.stringify(data.date);
|
|
525
|
+
console.log('Butttonnnnnnnn apiiiiiiiiiiiiiiiiii CBooking', JSON.stringify(buttonapi));
|
|
526
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
527
|
+
.then(function (response) {
|
|
528
|
+
// response = {
|
|
529
|
+
// "success": true,
|
|
530
|
+
// "httpstatus": 200,
|
|
531
|
+
// "message": "SUCCESS",
|
|
532
|
+
// "data": {
|
|
533
|
+
// "title": "token allocations",
|
|
534
|
+
// "tokensArray": [
|
|
535
|
+
// {
|
|
536
|
+
// "keyid": 1,
|
|
537
|
+
// "tokentype": "Morning",
|
|
538
|
+
// "disabletokens": false,
|
|
539
|
+
// "iconname": "sun",
|
|
540
|
+
// "reportingtime": "10:35 AM",
|
|
541
|
+
// "reportingto": "01:00 PM",
|
|
542
|
+
// "tokenArr": [
|
|
543
|
+
// {
|
|
544
|
+
// "tokenno": 1,
|
|
545
|
+
// "bookingtypes": "P",
|
|
546
|
+
// "mrngorevng": 1,
|
|
547
|
+
// "disabledtoken": false,
|
|
548
|
+
// "bookedstatus": true,
|
|
549
|
+
// "bookingdate": "2023-10-10",
|
|
550
|
+
// "reportingto": "10:35 AM",
|
|
551
|
+
// "reportingtime": "10:30 AM",
|
|
552
|
+
// "duration": 0,
|
|
553
|
+
// "bookingtypename": "PHONE",
|
|
554
|
+
// "patientname": "Albert Paul",
|
|
555
|
+
// "mobilenumber": "7338483582",
|
|
556
|
+
// "totalamount": 30,
|
|
557
|
+
// "canceltokenno": 0,
|
|
558
|
+
// "paidstatus": true,
|
|
559
|
+
// "hopapatient": 0,
|
|
560
|
+
// "patientid": 0,
|
|
561
|
+
// "remarks": ""
|
|
562
|
+
// },
|
|
563
|
+
// {
|
|
564
|
+
// "tokenno": 2,
|
|
565
|
+
// "bookingtypes": "P",
|
|
566
|
+
// "mrngorevng": 1,
|
|
567
|
+
// "disabledtoken": false,
|
|
568
|
+
// "bookedstatus": false,
|
|
569
|
+
// "bookingdate": "2023-10-10",
|
|
570
|
+
// "reportingto": "10:35 AM",
|
|
571
|
+
// "reportingtime": "10:30 AM",
|
|
572
|
+
// "duration": 0,
|
|
573
|
+
// "bookingtypename": "PHONE",
|
|
574
|
+
// "patientname": "",
|
|
575
|
+
// "mobilenumber": "",
|
|
576
|
+
// "totalamount": 30,
|
|
577
|
+
// "canceltokenno": 0,
|
|
578
|
+
// "paidstatus": true,
|
|
579
|
+
// "hopapatient": 0,
|
|
580
|
+
// "patientid": 0,
|
|
581
|
+
// "remarks": ""
|
|
582
|
+
// },
|
|
583
|
+
// {
|
|
584
|
+
// "tokenno": 3,
|
|
585
|
+
// "bookingtypes": "P",
|
|
586
|
+
// "mrngorevng": 1,
|
|
587
|
+
// "disabledtoken": false,
|
|
588
|
+
// "bookedstatus": true,
|
|
589
|
+
// "bookingdate": "2023-10-10",
|
|
590
|
+
// "reportingto": "10:35 AM",
|
|
591
|
+
// "reportingtime": "10:30 AM",
|
|
592
|
+
// "duration": 0,
|
|
593
|
+
// "bookingtypename": "PHONE",
|
|
594
|
+
// "patientname": "Mathew",
|
|
595
|
+
// "mobilenumber": "",
|
|
596
|
+
// "totalamount": 30,
|
|
597
|
+
// "canceltokenno": 0,
|
|
598
|
+
// "paidstatus": true,
|
|
599
|
+
// "hopapatient": 0,
|
|
600
|
+
// "patientid": 0,
|
|
601
|
+
// "remarks": ""
|
|
602
|
+
// },
|
|
603
|
+
// {
|
|
604
|
+
// "tokenno": 4,
|
|
605
|
+
// "bookingtypes": "P",
|
|
606
|
+
// "mrngorevng": 1,
|
|
607
|
+
// "disabledtoken": false,
|
|
608
|
+
// "bookedstatus": false,
|
|
609
|
+
// "bookingdate": "2023-10-10",
|
|
610
|
+
// "reportingto": "10:35 AM",
|
|
611
|
+
// "reportingtime": "10:30 AM",
|
|
612
|
+
// "duration": 0,
|
|
613
|
+
// "bookingtypename": "PHONE",
|
|
614
|
+
// "patientname": "",
|
|
615
|
+
// "mobilenumber": "",
|
|
616
|
+
// "totalamount": 30,
|
|
617
|
+
// "canceltokenno": 0,
|
|
618
|
+
// "paidstatus": true,
|
|
619
|
+
// "hopapatient": 0,
|
|
620
|
+
// "patientid": 0,
|
|
621
|
+
// "remarks": ""
|
|
622
|
+
// },
|
|
623
|
+
// {
|
|
624
|
+
// "tokenno": 6,
|
|
625
|
+
// "bookingtypes": "P",
|
|
626
|
+
// "mrngorevng": 1,
|
|
627
|
+
// "disabledtoken": false,
|
|
628
|
+
// "bookedstatus": false,
|
|
629
|
+
// "bookingdate": "2023-10-10",
|
|
630
|
+
// "reportingto": "10:35 AM",
|
|
631
|
+
// "reportingtime": "10:30 AM",
|
|
632
|
+
// "duration": 0,
|
|
633
|
+
// "bookingtypename": "PHONE",
|
|
634
|
+
// "patientname": "",
|
|
635
|
+
// "mobilenumber": "",
|
|
636
|
+
// "totalamount": 30,
|
|
637
|
+
// "canceltokenno": 0,
|
|
638
|
+
// "paidstatus": true,
|
|
639
|
+
// "hopapatient": 0,
|
|
640
|
+
// "patientid": 0,
|
|
641
|
+
// "remarks": ""
|
|
642
|
+
// }
|
|
643
|
+
// ]
|
|
644
|
+
// },
|
|
645
|
+
// {
|
|
646
|
+
// "keyid": 1,
|
|
647
|
+
// "tokentype": "Evening",
|
|
648
|
+
// "disabletokens": false,
|
|
649
|
+
// "iconname": "moon",
|
|
650
|
+
// "reportingtime": "02:30 PM",
|
|
651
|
+
// "reportingto": "06:30 PM",
|
|
652
|
+
// "tokenArr": [
|
|
653
|
+
// {
|
|
654
|
+
// "tokenno": 1,
|
|
655
|
+
// "bookingtypes": "P",
|
|
656
|
+
// "mrngorevng": 0,
|
|
657
|
+
// "disabledtoken": true,
|
|
658
|
+
// "bookedstatus": false,
|
|
659
|
+
// "bookingdate": "2023-10-10",
|
|
660
|
+
// "reportingtime": "02:30 PM",
|
|
661
|
+
// "reportingto": "06:30 PM",
|
|
662
|
+
// "duration": 0,
|
|
663
|
+
// "bookingtypename": "PHONE",
|
|
664
|
+
// "patientname": "",
|
|
665
|
+
// "mobilenumber": "",
|
|
666
|
+
// "totalamount": 30,
|
|
667
|
+
// "canceltokenno": 0,
|
|
668
|
+
// "paidstatus": true,
|
|
669
|
+
// "hopapatient": 0,
|
|
670
|
+
// "patientid": 0,
|
|
671
|
+
// "remarks": ""
|
|
672
|
+
// }
|
|
673
|
+
// ]
|
|
674
|
+
// }
|
|
675
|
+
// ]
|
|
676
|
+
// }
|
|
677
|
+
// }
|
|
678
|
+
if (response.httpstatus == 200) {
|
|
679
|
+
data.daywisedata = response.data;
|
|
680
|
+
flatlistRef.current.scrollToEnd({ animating: true });
|
|
681
|
+
setIsLoading(false);
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
setIsLoading(false);
|
|
685
|
+
notifyMessage('Day wise data not available.', 4);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
getLoading(v => setIsLoading(false));
|
|
689
|
+
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
function IncrementMonth() {
|
|
693
|
+
console.log('INCREMENTTTTTTTTTTTTTT', monthinno);
|
|
694
|
+
setFooterData(null);
|
|
695
|
+
if (monthinno != 11) {
|
|
696
|
+
// if (monthinno != d.getMonth()) {
|
|
697
|
+
if (monthinno < 11) {
|
|
698
|
+
setMonthInNo(monthinno + 1);
|
|
699
|
+
} else {
|
|
700
|
+
setYear(year + 1);
|
|
701
|
+
setMonthInNo(0);
|
|
702
|
+
}
|
|
703
|
+
getConsultation(consultant, year, monthinno + 1);
|
|
704
|
+
// }
|
|
705
|
+
} else {
|
|
706
|
+
setMonthInNo(0);
|
|
707
|
+
setYear(year + 1);
|
|
708
|
+
getConsultation(consultant, year + 1, 0);
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
function DecrementMonth() {
|
|
713
|
+
if (monthinno != 0) {
|
|
714
|
+
if ((monthinno - 1 >= d.getMonth())) {
|
|
715
|
+
console.log('>>>>>>>>>>INSIDEEEEEE<<<<<<<<<', d.getMonth());
|
|
716
|
+
setFooterData(null);
|
|
717
|
+
if (monthinno > 0) {
|
|
718
|
+
setMonthInNo(monthinno - 1);
|
|
719
|
+
} else {
|
|
720
|
+
setYear(year - 1);
|
|
721
|
+
setMonthInNo(11);
|
|
722
|
+
}
|
|
723
|
+
getConsultation(consultant, year, monthinno - 1);
|
|
724
|
+
}
|
|
725
|
+
} else {
|
|
726
|
+
setYear(year - 1);
|
|
727
|
+
setMonthInNo(11);
|
|
728
|
+
getConsultation(consultant, year - 1, 11);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
return (
|
|
733
|
+
<View style={{
|
|
734
|
+
flex: 1,
|
|
735
|
+
marginTop: normalize(-2),
|
|
736
|
+
}}>
|
|
737
|
+
<View
|
|
738
|
+
style={{
|
|
739
|
+
backgroundColor: '#f2efef',
|
|
740
|
+
paddingVertical: 3,
|
|
741
|
+
paddingHorizontal: 6,
|
|
742
|
+
marginTop: 3,
|
|
743
|
+
marginBottom: 2,
|
|
744
|
+
display: 'flex',
|
|
745
|
+
flexDirection: 'row',
|
|
746
|
+
alignItems: 'center',
|
|
747
|
+
justifyContent: 'center',
|
|
748
|
+
borderTopLeftRadius: 20,
|
|
749
|
+
borderTopRightRadius: 20,
|
|
750
|
+
}}>
|
|
751
|
+
<TouchableOpacity onPress={() => { }}
|
|
752
|
+
disabled={true}
|
|
753
|
+
style={{
|
|
754
|
+
alignItems: 'center',
|
|
755
|
+
marginRight: 5,
|
|
756
|
+
}}>
|
|
757
|
+
<FontAwesome5
|
|
758
|
+
name={'user-md'}
|
|
759
|
+
color={Global.AppTheme.primary_color}
|
|
760
|
+
size={normalize(16)}
|
|
761
|
+
style={{ paddingHorizontal: normalize(5) }}
|
|
762
|
+
/>
|
|
763
|
+
</TouchableOpacity>
|
|
764
|
+
<Text
|
|
765
|
+
style={{
|
|
766
|
+
textShadowRadius: 2,
|
|
767
|
+
fontSize: normalize(14),
|
|
768
|
+
fontWeight: 'bold',
|
|
769
|
+
color: Global.AppTheme.primary_color,
|
|
770
|
+
flex: 1,
|
|
771
|
+
}}>
|
|
772
|
+
{'BOOKINGS'}
|
|
773
|
+
</Text>
|
|
774
|
+
<TouchableOpacity
|
|
775
|
+
onPress={() => {
|
|
776
|
+
navigation.navigate('PdfPreview', { 'link': APIURL + 'jremr/jrcommonreport/jrhocobookingtokenreport(' + Global.userData.hosuconsultant + ',' + year + ',' + `${monthinno + 1}` + ')/0/forbookingtoken' });
|
|
777
|
+
}}
|
|
778
|
+
style={{
|
|
779
|
+
borderWidth: 0,
|
|
780
|
+
justifyContent: 'center',
|
|
781
|
+
alignItems: 'center',
|
|
782
|
+
}}>
|
|
783
|
+
<HOCIcons.MaterialCommunityIcons
|
|
784
|
+
name={'table-account'}
|
|
785
|
+
color={Global.AppTheme.primary_color}
|
|
786
|
+
size={normalize(25)}
|
|
787
|
+
/>
|
|
788
|
+
<Text style={{
|
|
789
|
+
color: Global.AppTheme.primary_color,
|
|
790
|
+
fontSize: normalize(7),
|
|
791
|
+
fontWeight: 'bold',
|
|
792
|
+
textAlign: 'center',
|
|
793
|
+
}}>
|
|
794
|
+
{'Booking Summary'}
|
|
795
|
+
</Text>
|
|
796
|
+
</TouchableOpacity>
|
|
797
|
+
</View>
|
|
798
|
+
{isLoading ?
|
|
799
|
+
<Loader
|
|
800
|
+
displaytext={true}
|
|
801
|
+
/>
|
|
802
|
+
: null}
|
|
803
|
+
|
|
804
|
+
{Global.userData.hosuconsultant == 0 ?
|
|
805
|
+
<View style={{ paddingHorizontal: normalize(8), marginBottom: normalize(2) }}>
|
|
806
|
+
<Text style={{ fontSize: normalize(8), paddingHorizontal: 5 }}>Consultant :</Text>
|
|
807
|
+
<SDropDownNew
|
|
808
|
+
dropdownapi={'emr/emrcommonget/exec rndddwdropdownselect 1'}
|
|
809
|
+
dropdowndata={ValueCheck(Global.userData.hosuconsultant) &&
|
|
810
|
+
Global.userData.hosuconsultant > 0 ? Global.userData.username : ''}
|
|
811
|
+
onChangeData={val =>
|
|
812
|
+
val == undefined ? null : getConsultation(val.datavalue, year, monthinno)}
|
|
813
|
+
editable={true}
|
|
814
|
+
widthArr={Dimensions.get('screen').width * 0.96}
|
|
815
|
+
iconName={'user-md'}
|
|
816
|
+
refreshCount={val => val == undefined ? null : console.log('Refresh') }
|
|
817
|
+
/>
|
|
818
|
+
</View> : null}
|
|
819
|
+
|
|
820
|
+
<View style={{ backgroundColor: 'transparent' }}>
|
|
821
|
+
<View style={{ flexDirection: 'row', alignSelf: 'center', alignItems: 'center', justifyContent: 'space-between', width: '50%' }}>
|
|
822
|
+
<FontAwesome5 name="arrow-left" color="black" size={normalize(15)}
|
|
823
|
+
onPress={() => DecrementMonth()}
|
|
824
|
+
/>
|
|
825
|
+
<Text style={{ fontSize: normalize(14), color: 'black', paddingHorizontal: 10 }}>{monthName} {year}</Text>
|
|
826
|
+
<FontAwesome5 name="arrow-right" color="black" size={normalize(15)} onPress={() => IncrementMonth()} />
|
|
827
|
+
</View>
|
|
828
|
+
</View>
|
|
829
|
+
<View style={{ flexDirection: 'row', height: normalize(20), alignItems: 'center', justifyContent: 'center' }}>
|
|
830
|
+
{['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'].map((week, i) => {
|
|
831
|
+
return (
|
|
832
|
+
<View key={i} style={{ width: dividedWidth, alignItems: 'center', borderWidth: 0.5 }}>
|
|
833
|
+
<Text style={{ fontSize: normalize(12), fontWeight: 'bold', color: i == 0 ? 'red' : 'black' }}>{week}</Text>
|
|
834
|
+
</View>);
|
|
835
|
+
})}
|
|
836
|
+
</View>
|
|
837
|
+
<FlatList
|
|
838
|
+
ref={flatlistRef}
|
|
839
|
+
data={data}
|
|
840
|
+
style={{ width: '100%' }}
|
|
841
|
+
renderItem={(k) => renderItem(k)}
|
|
842
|
+
refreshControl={<RefreshControl
|
|
843
|
+
refreshing={pulltorefresh}
|
|
844
|
+
size={'large'}
|
|
845
|
+
tintColor={'blue'}
|
|
846
|
+
colors={['red', 'green', 'cyan', 'black']}
|
|
847
|
+
progressBackgroundColor={'white'}
|
|
848
|
+
onRefresh={() => getConsultation(consultant, year, monthinno)} />}
|
|
849
|
+
keyExtractor={(item) => item.displaytext}
|
|
850
|
+
numColumns={7}
|
|
851
|
+
ListFooterComponent={() => footerComponent()}
|
|
852
|
+
ListFooterComponentStyle={{ width: width }}
|
|
853
|
+
/>
|
|
854
|
+
<View style={{
|
|
855
|
+
position: 'absolute',
|
|
856
|
+
flexDirection: 'row',
|
|
857
|
+
borderTopColor: '#c9c7c7',
|
|
858
|
+
borderTopWidth: 2,
|
|
859
|
+
alignItems: 'center',
|
|
860
|
+
justifyContent: 'space-between',
|
|
861
|
+
bottom: 0,
|
|
862
|
+
paddingVertical: 5,
|
|
863
|
+
width: '100%',
|
|
864
|
+
backgroundColor: '#fff',
|
|
865
|
+
}}>
|
|
866
|
+
{[{
|
|
867
|
+
'displaytext': 'Save',
|
|
868
|
+
'icongroup':4,
|
|
869
|
+
'size': 10, 'iconname': 'save', 'iconcolor': Global.AppTheme.primary_color, 'fontcolor': Global.AppTheme.primary_color,
|
|
870
|
+
'shadowcolor': '#fff', 'selected': false, 'visibility': edit ? true : false, 'iconsize': 20, 'functionid': 'CB01', 'iconsize': 20, 'functionid': 'CB01', 'componentname': 'SetUpVitalSign',
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
'displaytext': 'Monthly',
|
|
874
|
+
'icongroup':4,
|
|
875
|
+
'iconname': 'calendar-check-o',
|
|
876
|
+
'stage': 1,
|
|
877
|
+
'visibility': true,
|
|
878
|
+
'functionid': 'CB04',
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
'iconname': 'stack-overflow',
|
|
882
|
+
'icongroup':4,
|
|
883
|
+
'displaytext': 'Tokens',
|
|
884
|
+
'stage': 2,
|
|
885
|
+
'visibility': true,
|
|
886
|
+
'functionid': 'CB03',
|
|
887
|
+
},
|
|
888
|
+
{
|
|
889
|
+
'iconname': 'user-md',
|
|
890
|
+
'icongroup':4,
|
|
891
|
+
'displaytext': 'Booking',
|
|
892
|
+
'stage': 2,
|
|
893
|
+
'visibility': true,
|
|
894
|
+
'selected': true,
|
|
895
|
+
'functionid': 'CB05',
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
'iconname': 'exchange',
|
|
899
|
+
'icongroup':4,
|
|
900
|
+
'displaytext': 'Postpone',
|
|
901
|
+
'stage': 5,
|
|
902
|
+
'visibility': true,
|
|
903
|
+
'selected': true,
|
|
904
|
+
'functionid': 'CB06',
|
|
905
|
+
},
|
|
906
|
+
// {
|
|
907
|
+
// "icongroup":4,
|
|
908
|
+
// "displaytext": "Report", "size": 10, "iconname": "file-pdf-o", "iconcolor": Global.AppTheme.primary_color,
|
|
909
|
+
// "fontcolor": Global.AppTheme.primary_color, "shadowcolor": '#fff', "selected": false, "visibility": true, "iconsize": 20, "functionid": "CB02",
|
|
910
|
+
// }
|
|
911
|
+
].map((item, i) => {
|
|
912
|
+
return (
|
|
913
|
+
item.visibility ?
|
|
914
|
+
|
|
915
|
+
<View>
|
|
916
|
+
<CAwesomeButton
|
|
917
|
+
key={i}
|
|
918
|
+
data={{
|
|
919
|
+
...item,
|
|
920
|
+
'width':normalize(45),
|
|
921
|
+
'shadowcolor': '#fff',
|
|
922
|
+
'iconcolor':
|
|
923
|
+
item.displaytext == 'Booking' ? '#db04ac' : item.displaytext == 'Save' ? 'red' : Global.AppTheme.primary_color,
|
|
924
|
+
'fontcolor': item.displaytext == 'Booking' ? '#db04ac' : item.displaytext == 'Save' ? 'red' : Global.AppTheme.primary_color,
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
callBack={val => val == undefined ? null : getFooterIconsFunctions(item)}
|
|
928
|
+
/>
|
|
929
|
+
</View>
|
|
930
|
+
|
|
931
|
+
// <TouchableOpacity key={i} style={{ alignItems: 'center' }}
|
|
932
|
+
// onPress={() => getFooterIconsFunctions(item)}>
|
|
933
|
+
// <Icons.FontAwesome name={item.iconname} color={item.displaytext == "Booking" ? "#db04ac" : item.displaytext == "Save" ? "red" : "black"} size={normalize(20)} />
|
|
934
|
+
// <Text style={{ color: item.displaytext == "Booking" ? "#db04ac" : item.displaytext == "Save" ? "red" : "black", fontSize: normalize(10) }}>{item.displaytext}</Text>
|
|
935
|
+
// </TouchableOpacity>
|
|
936
|
+
|
|
937
|
+
: null
|
|
938
|
+
);
|
|
939
|
+
})}
|
|
940
|
+
</View>
|
|
941
|
+
</View>
|
|
942
|
+
);
|
|
943
|
+
};
|
|
944
|
+
export default CBooking;
|