@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.7

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.
Files changed (205) hide show
  1. package/dist/Common/ErrorBoundary.d.ts +15 -0
  2. package/dist/Common/ErrorBoundary.d.ts.map +1 -0
  3. package/dist/Common/ErrorBoundary.js +64 -0
  4. package/dist/Common/ErrorBoundary.js.map +1 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +8 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/src/Common/ErrorBoundary.d.ts +15 -0
  10. package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
  11. package/dist/src/Common/ErrorBoundary.js +64 -0
  12. package/dist/src/Common/ErrorBoundary.js.map +1 -0
  13. package/package.json +17 -5
  14. package/.gitattributes +0 -2
  15. package/index.d.ts +0 -66
  16. package/index.js +0 -66
  17. package/src/Alerts/AAlert.js +0 -137
  18. package/src/Alerts/AAlertIOS.js +0 -97
  19. package/src/Alerts/ABlink.js +0 -40
  20. package/src/Common/ErrorBoundary.tsx +0 -73
  21. package/src/Common/Icons.js +0 -49
  22. package/src/Common/NetworkServiceCall.js +0 -265
  23. package/src/CommonStyle/CommonTheme.js +0 -11
  24. package/src/CommonStyle/ComponentFunctions.js +0 -632
  25. package/src/CommonStyle/PopupStyle.js +0 -146
  26. package/src/CommonStyle/commonStyle.js +0 -93
  27. package/src/CommonStyle/componentStyle.js +0 -545
  28. package/src/CommonStyle/optionListStyles.js +0 -175
  29. package/src/Components/ByProductPage.js +0 -200
  30. package/src/Components/CDropDownListNew.js +0 -153
  31. package/src/Components/CSupplierList.js +0 -88
  32. package/src/Components/CVerificationCard.js +0 -2822
  33. package/src/Components/CustomButton.js +0 -67
  34. package/src/Components/CustomCard.js +0 -127
  35. package/src/Components/CustomTextInput.js +0 -47
  36. package/src/Components/EquipmentPage.js +0 -313
  37. package/src/Components/FilterInput.Copy.js +0 -723
  38. package/src/Components/FilterInput.js +0 -569
  39. package/src/Components/HSubHeading.js +0 -68
  40. package/src/Components/HeaderCard.js +0 -40
  41. package/src/Components/MoreOptionsScreen.js +0 -251
  42. package/src/Components/NonSwipableProductCard.js +0 -226
  43. package/src/Components/NonSwipableSupplierCard.js +0 -348
  44. package/src/Components/ProductCard.js +0 -1336
  45. package/src/Components/QualityProductCard.js +0 -1059
  46. package/src/Components/RateProductCard.js +0 -1452
  47. package/src/Components/RawMaterial.js +0 -261
  48. package/src/Components/SDropDownEdited.js +0 -549
  49. package/src/Components/SDropDownNew.js +0 -529
  50. package/src/Components/SHelpDescription.js +0 -147
  51. package/src/Components/STextInputNew.js +0 -510
  52. package/src/Components/SearchProductCard.js +0 -470
  53. package/src/Components/StageByProduct.js +0 -199
  54. package/src/Components/SupplierCard.js +0 -243
  55. package/src/Components/SupplierInvoiceCard.js +0 -405
  56. package/src/Components/SwipableSupplierCard.js +0 -136
  57. package/src/Components/TagTemplate.js +0 -74
  58. package/src/Components/WrappedComponent.js +0 -25
  59. package/src/Custom/CBooking.js +0 -944
  60. package/src/Custom/CBookingPostpone.js +0 -1822
  61. package/src/Custom/CCalendar.js +0 -560
  62. package/src/Custom/CCard.js +0 -880
  63. package/src/Custom/CDetailCard.js +0 -205
  64. package/src/Custom/CHelpImage.js +0 -52
  65. package/src/Custom/CReport.js +0 -569
  66. package/src/Custom/CScrollView.js +0 -73
  67. package/src/Custom/CSignature.js +0 -112
  68. package/src/Custom/CSliderMenu.js +0 -339
  69. package/src/Custom/CSupplierCard.js +0 -99
  70. package/src/Custom/CTemplateCard.js +0 -438
  71. package/src/Custom/CTokenAllocation.js +0 -1402
  72. package/src/Custom/CTokenListOverlay.js +0 -122
  73. package/src/Custom/CWardStatus.js +0 -444
  74. package/src/Custom/Charts/CBarChart.js +0 -218
  75. package/src/Custom/Charts/CDashBoardList.js +0 -133
  76. package/src/Custom/Charts/CDashBoardTable.js +0 -172
  77. package/src/Custom/Charts/CLineChart.js +0 -193
  78. package/src/Custom/Charts/CPieChart.js +0 -186
  79. package/src/Custom/Loader.js +0 -182
  80. package/src/Custom/OUserView.js +0 -1121
  81. package/src/Custom/PreviewDosage.js +0 -115
  82. package/src/Custom/SearchLoader.js +0 -32
  83. package/src/Custom/TableComponent/CActivityTable.js +0 -707
  84. package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
  85. package/src/Custom/TableComponent/CTable.js +0 -185
  86. package/src/Custom/TableComponent/CTextBody.js +0 -40
  87. package/src/Custom/TableComponent/CTextHeader.js +0 -17
  88. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
  89. package/src/Custom/TableComponent/SDropdownTable.js +0 -491
  90. package/src/Custom/TableComponent/TagTable.js +0 -1200
  91. package/src/CustomComponents/CAddColumn.js +0 -140
  92. package/src/CustomComponents/CAssessmentDelete.js +0 -307
  93. package/src/CustomComponents/CAwesomeButton.js +0 -83
  94. package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
  95. package/src/CustomComponents/CBackHandler.js +0 -273
  96. package/src/CustomComponents/CCalendar.js +0 -243
  97. package/src/CustomComponents/CCommentOverlay.js +0 -202
  98. package/src/CustomComponents/CComments.js +0 -162
  99. package/src/CustomComponents/CContainerView.js +0 -24
  100. package/src/CustomComponents/CCustomTextInput.js +0 -336
  101. package/src/CustomComponents/CDetailView.js +0 -40
  102. package/src/CustomComponents/CDropDownList.js +0 -153
  103. package/src/CustomComponents/CDropdownSelect.js +0 -555
  104. package/src/CustomComponents/CFooterView.js +0 -42
  105. package/src/CustomComponents/CImagePickerSave.js +0 -316
  106. package/src/CustomComponents/CModalOverlay.js +0 -91
  107. package/src/CustomComponents/CNetworkStatus.js +0 -327
  108. package/src/CustomComponents/CNotesInstructions.js +0 -1000
  109. package/src/CustomComponents/COverlay.js +0 -81
  110. package/src/CustomComponents/CRemarks.js +0 -176
  111. package/src/CustomComponents/CRowAdd.js +0 -143
  112. package/src/CustomComponents/CSummaryDropDown.js +0 -327
  113. package/src/CustomComponents/CText.js +0 -9
  114. package/src/CustomComponents/CVectorIcon.js +0 -34
  115. package/src/CustomComponents/HtmlContentViewer.js +0 -65
  116. package/src/CustomComponents/PdfContentViewer.js +0 -90
  117. package/src/CustomComponents/SDropDownDosage.js +0 -1087
  118. package/src/CustomComponents/SwipableProductCard.js +0 -246
  119. package/src/CustomComponents/SwipableProductImageCard.js +0 -254
  120. package/src/CustomComponents/WorkOrderDetails.js +0 -1216
  121. package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
  122. package/src/HOC/ConfirmOverlay.js +0 -192
  123. package/src/HOC/HHeading.js +0 -70
  124. package/src/HOC/HMoreButton.js +0 -88
  125. package/src/HOC/HNatureHeading.js +0 -402
  126. package/src/HOC/HOCIcons.js +0 -80
  127. package/src/HOC/HOverlayCentered.js +0 -140
  128. package/src/HOC/HShadowButton.js +0 -45
  129. package/src/HOC/HShadowCountButton.js +0 -82
  130. package/src/HOC/OptionOverlay.js +0 -48
  131. package/src/Json/Chart.json +0 -818
  132. package/src/Json/Consultation.json +0 -622
  133. package/src/Json/CreditBill.json +0 -490
  134. package/src/Json/Dropdown.json +0 -216
  135. package/src/Json/DropdownConsultation.json +0 -228
  136. package/src/Json/DynamicReports.json +0 -623
  137. package/src/Json/Footer.json +0 -79
  138. package/src/Media/AudioScreen.js +0 -342
  139. package/src/Media/BarcodeScan.js +0 -145
  140. package/src/Media/CAudioPlay.js +0 -228
  141. package/src/Media/CCaptureImageWithoutEdit.js +0 -330
  142. package/src/Media/CImageGallery.js +0 -289
  143. package/src/Media/CImageZoom.js +0 -82
  144. package/src/Media/CSingleImage.js +0 -391
  145. package/src/Media/CSketchCanvas.js +0 -76
  146. package/src/Media/CVideoPlay.js +0 -31
  147. package/src/Media/DocumentScreen.js +0 -362
  148. package/src/Media/DrawingScreen.js +0 -578
  149. package/src/Media/ImageScreen.js +0 -309
  150. package/src/Media/RecordAudio.js +0 -250
  151. package/src/Media/RecordVideo.js +0 -223
  152. package/src/Media/VideoScreen.js +0 -378
  153. package/src/Navigation/PageNavigation.js +0 -224
  154. package/src/Navigation/useFocusEffect.js +0 -2
  155. package/src/Navigation/useFocusEffect.native.js +0 -1
  156. package/src/Navigation/useFocusEffect.web.js +0 -1
  157. package/src/Navigation/useIsFocused.js +0 -1
  158. package/src/Navigation/useIsFocused.native.js +0 -1
  159. package/src/Navigation/useIsFocused.web.js +0 -1
  160. package/src/Navigation/useNavigation.js +0 -2
  161. package/src/Navigation/useNavigation.native.js +0 -1
  162. package/src/Navigation/useNavigation.web.js +0 -1
  163. package/src/Screens/CMedications.js +0 -528
  164. package/src/Screens/CWebViewGallery.js +0 -203
  165. package/src/Screens/ChartScan.js +0 -279
  166. package/src/Screens/ChartScreenNew.js +0 -1579
  167. package/src/Screens/Consultation.js +0 -1500
  168. package/src/Screens/Dashboard.js +0 -778
  169. package/src/Screens/FileExplorer.js +0 -288
  170. package/src/Screens/Footer.js +0 -340
  171. package/src/Screens/ForgotPassword.js +0 -288
  172. package/src/Screens/HeaderBlock.js +0 -353
  173. package/src/Screens/Login.js +0 -328
  174. package/src/Screens/Notification.js +0 -149
  175. package/src/Screens/OcrScreen.js +0 -20
  176. package/src/Screens/PdfPreview.js +0 -507
  177. package/src/Screens/RegistrationDetails.js +0 -467
  178. package/src/Screens/SearchScreen.js +0 -582
  179. package/src/Screens/Splash.js +0 -788
  180. package/src/Screens/SwipeLeftView.js +0 -1867
  181. package/src/StaticComponents/SAlphabet.js +0 -47
  182. package/src/StaticComponents/SCheckBox.js +0 -42
  183. package/src/StaticComponents/SDatePicker.js +0 -208
  184. package/src/StaticComponents/SDatePickerLabel.js +0 -253
  185. package/src/StaticComponents/SDatePickerNew.js +0 -258
  186. package/src/StaticComponents/SDateTimePickerNew.js +0 -381
  187. package/src/StaticComponents/SDropDownGenerate.js +0 -450
  188. package/src/StaticComponents/SDropDownHoc.js +0 -636
  189. package/src/StaticComponents/SDropDownIcon.js +0 -500
  190. package/src/StaticComponents/SMenuBox.js +0 -131
  191. package/src/StaticComponents/SOverlay.js +0 -177
  192. package/src/StaticComponents/SOverlayTextInput.js +0 -109
  193. package/src/StaticComponents/SSearch.js +0 -438
  194. package/src/StaticComponents/SSearchBar.js +0 -53
  195. package/src/StaticComponents/SSpeedDial.js +0 -303
  196. package/src/StaticComponents/STextInput.js +0 -289
  197. package/src/StaticComponents/STextInputProps.js +0 -36
  198. package/src/StaticComponents/STimePicker.js +0 -171
  199. package/src/StaticComponents/STimingDropDownNew.js +0 -1585
  200. package/src/StaticComponents/STimingSwitch.js +0 -34
  201. package/src/layout/CContainerView.js +0 -21
  202. package/src/layout/CDetailView.js +0 -81
  203. package/src/layout/HeaderBlock.js +0 -353
  204. package/src/layout/INVLoginLayout.js +0 -657
  205. package/src/layout/Loader.js +0 -176
@@ -1,778 +0,0 @@
1
- import React, { useState, useEffect, useRef, useLayoutEffect, useContext } from 'react';
2
- import {
3
- StyleSheet,
4
- Text,
5
- View,
6
- Dimensions,
7
- FlatList,
8
- BackHandler,
9
- Image,
10
- Platform
11
- } from 'react-native';
12
- import moment from 'moment';
13
- import ComponentStyles, { normalize, width } from '../CommonStyle/componentStyle';
14
- import NetworkServiceCall from '../Common/NetworkServiceCall';
15
- import { APIURL, BASE_URL } from '../../../../../src/Common/apiConstants';
16
- import Loader from '../Custom/Loader';
17
- import { Global } from '../../../../../src/Common/Global';
18
- import HeaderBlock from './HeaderBlock';
19
- import CContainerView from '../CustomComponents/CContainerView';
20
- import CDetailView from '../CustomComponents/CDetailView';
21
- import CFooterView from '../CustomComponents/CFooterView';
22
- import {
23
- CButtonShadow,
24
- CShadowDynamic,
25
- getLoading,
26
- isBNUL,
27
- isNU,
28
- notifyMessage,
29
- } from '../CommonStyle/ComponentFunctions';
30
- import CCard from '../Custom/CCard';
31
- import SSearch from '../StaticComponents/SSearch';
32
- import CBackHandler from '../CustomComponents/CBackHandler';
33
- import HShadowButton from '../HOC/HShadowButton';
34
- import CProgressCircle from '../CustomComponents/CProgressCircle';
35
- import SDatePickerLabel from '../StaticComponents/SDatePickerLabel';
36
- import { useDataContext } from '../Handlers/ContextBio';
37
- import { useNavigation } from '../Navigation/useNavigation';
38
- import { useIsFocused } from '../Navigation/useIsFocused';
39
-
40
- export default function Dashboard({ route }) {
41
- // State declarations
42
- const routeData = route?.params;
43
- const [searchWord, setSearchWord] = useState('');
44
- const [isLoading, setIsLoading] = useState(false);
45
- const { dashData, setDashData } = useDataContext();
46
- const [patientdata, setPatientData] = useState();
47
- const [index, setIndex] = useState(0);
48
- const [refresh, setRefresh] = useState(0);
49
- const [SearchRefresh, setSearchRefresh] = useState(0);
50
- const isFocused = useIsFocused();
51
- const [backHandlerLogOut, setBackHandlerLogOut] = useState(false);
52
- const [totalObj, setTotalObj] = useState();
53
- const [filter, setFilter] = useState('Patient ID');
54
-
55
- const today = moment().format('YYYY-MM-DD');
56
- const [dateData, setDateData] = useState({
57
- fromdate: today,
58
- todate: today,
59
- dateview: false,
60
- });
61
-
62
- const navigation = useNavigation();
63
- const scrollRef = useRef();
64
-
65
- // Footer menu configuration
66
- const FooterArr = [
67
- {
68
- keyid: 2,
69
- icongroup: 5,
70
- displaytext: "SEARCH",
71
- size: 10,
72
- iconname: 'cogs', // perfect for "more"
73
- iconcolor: "#F16767",
74
- fontcolor: "#F16767",
75
- shadowcolor: "#fce0e0",
76
- selected: false,
77
- visibility: true,
78
- iconsize: 20,
79
- functionid: "D02",
80
- componenttype: "screen",
81
- component: "MoreOptionsScreen",
82
- procedurename: "rnjrintrpurequestdynamicdetailreport",
83
- argumentname: "13",
84
- optiondetailhelpurl: "hisfiles/help/video/loginhelp.mp4",
85
- },
86
- {
87
- keyid: 1,
88
- icongroup: 3,
89
- displaytext: "MENU",
90
- size: 10,
91
- iconname: "dots-horizontal-circle", // perfect for "more"
92
- iconcolor: "#F16767",
93
- fontcolor: "#F16767",
94
- shadowcolor: "#fce0e0",
95
- selected: false,
96
- visibility: true,
97
- iconsize: 20,
98
- functionid: "D01",
99
- componenttype: "screen",
100
- component: "MoreOptionsScreen",
101
- procedurename: "rnjrintrpurequestdynamicdetailreport",
102
- argumentname: "13",
103
- optiondetailhelpurl: "hisfiles/help/video/loginhelp.mp4",
104
- more: true,
105
- },
106
- ];
107
-
108
- // Effects
109
- useEffect(() => {
110
- if (routeData?.patientData?.id) {
111
- setSearchWord(routeData.patientData.id);
112
- }
113
- }, [routeData]);
114
-
115
- useEffect(() => {
116
- getAllMedicines();
117
- }, []);
118
-
119
- useLayoutEffect(() => {
120
- FirstGetData();
121
- }, []);
122
-
123
- useEffect(() => {
124
- if (isFocused) {
125
- Global.PatientDetails = null;
126
- Global.ChartDataLeft = null;
127
- Global.ChartDataAll = null;
128
- }
129
- }, [isFocused]);
130
-
131
- useEffect(() => {
132
- const backAction = () => {
133
- if (!navigation.isFocused()) {
134
- return false;
135
- }
136
- else { setBackHandlerLogOut(true) }
137
- return true;
138
- };
139
- const backHandler = BackHandler.addEventListener(
140
- 'hardwareBackPress', backAction);
141
- return () => backHandler.remove();
142
- }, [navigation]);
143
-
144
-
145
- // Functions
146
- function FirstGetData() {
147
- setIsLoading(true);
148
- setIndex(0);
149
- setPatientData(null);
150
- setDashData();
151
- Global.PatientDetails = null;
152
- const buttonapi = APIURL + Global.userData.insurancedetailapi
153
- console.log('insurancedeetailapi', JSON.stringify(buttonapi))
154
- NetworkServiceCall(
155
- 'get',
156
- buttonapi,
157
- '',
158
- ).then(function (response) {
159
- if (response.httpstatus === 200) {
160
- let objForProgress = response.data.dashboard.find(
161
- val => val.dbname === 'TOTAL',
162
- );
163
- if (objForProgress !== undefined) {
164
- setTotalObj(objForProgress.dbvalue);
165
- }
166
- setDashData(response.data.dashboard);
167
- setPatientData(response.data.datalist);
168
- setIsLoading(false);
169
- } else {
170
- setIsLoading(false);
171
- notifyMessage('No Dashboard icons', 4);
172
- }
173
- });
174
-
175
- getLoading(v => setIsLoading(false));
176
- }
177
-
178
- function getAllMedicines() {
179
- const buttonapi =
180
- "insuranceadvanceget/emrcommonget/exec rndddaconsultationaddparameter 20,''";
181
-
182
- NetworkServiceCall('get', APIURL + buttonapi, '').then(function (response) {
183
- if (
184
- response.httpstatus === 200 &&
185
- isNU(response.data) &&
186
- isNU(response.data.data)
187
- ) {
188
- Global.AllMedicinesArr = response.data.data;
189
- }
190
- });
191
- }
192
-
193
- function getTotalPatientList(data, index, fromdate, todate) {
194
- setIndex(index);
195
- setIsLoading(true);
196
- setPatientData(null);
197
-
198
- const buttonapi = `${APIURL}${data?.dbdetailapi},'${fromdate}','${todate}',${Global?.userData?.suuser}`;
199
- console.log('GETTOTALPATIENTLISTAPI', JSON.stringify(buttonapi))
200
- NetworkServiceCall('get', buttonapi, '').then(function (response) {
201
- if (response.httpstatus === 200) {
202
- if (
203
- response.data.datalist !== undefined &&
204
- response.data.datalist.length > 0
205
- ) {
206
- setPatientData(response.data.datalist);
207
- setDashData(response.data.dashboard);
208
- setRefresh(refresh + 1);
209
- setIsLoading(false);
210
- } else {
211
- setIsLoading(false);
212
- notifyMessage('No Patients', 3);
213
- }
214
- } else {
215
- setIsLoading(false);
216
- notifyMessage('Network Error', 4);
217
- }
218
- });
219
-
220
- getLoading(v => setIsLoading(false));
221
- }
222
-
223
- function getNewUser() {
224
- setSearchWord('');
225
- setIsLoading(true);
226
-
227
- let buttonapi =
228
- filter !== 'Patient ID'
229
- ? `${APIURL}insuranceadvanceget/emrcommonget/rnlainsure ${searchWord},0,${Global.userData.suuser}`
230
- : `${APIURL}insuranceadvanceget/emrcommonget/rnlainsure 0,${searchWord},${Global.userData.suuser}`;
231
-
232
- console.log('buttonapi------------', buttonapi)
233
- NetworkServiceCall('get', buttonapi, '').then(function (response) {
234
- if (response.httpstatus === 200) {
235
- if (
236
- response.data &&
237
- response.data !== null &&
238
- response.data.datalist !== undefined &&
239
- response.data.datalist.length > 0
240
- ) {
241
- setIsLoading(false);
242
- setPatientData(null);
243
- setTimeout(() => {
244
- setPatientData(response.data.datalist);
245
- });
246
- } else {
247
- setIsLoading(false);
248
- notifyMessage('Please enter valid patient id or mobile number', 3);
249
- }
250
- } else {
251
- setIsLoading(false);
252
- notifyMessage('Please enter valid patient id or mobile number', 3);
253
- }
254
- });
255
-
256
- getLoading(v => setIsLoading(false));
257
- }
258
-
259
- function onDetectVisionCameraBarcode(params) {
260
- setSearchWord(params.data);
261
- }
262
-
263
- function FnNavigate() {
264
- if (Platform.OS === "web") return;
265
- navigation.navigate('CCaptureImageWithoutEdit', {
266
- cameramoduletype: 2,
267
- hidebuttons: true,
268
- cameratype: 'back',
269
- onSelect: s => (s && isNU(s) ? onDetectVisionCameraBarcode(s) : null),
270
- });
271
- }
272
-
273
- function getFunctions(params) {
274
- console.log('getfunctiondashboard---', JSON.stringify(params))
275
- if (!params.visibility) {
276
- notifyMessage('Incorporate Soon', 5);
277
- return;
278
- }
279
- switch (params.functionid) {
280
- case 'D01':
281
- navigation.navigate('MoreOptionsScreen')
282
- break;
283
- case 'D02':
284
- navigation.navigate('SearchScreen', { searchKey: 1 });
285
- break;
286
- default:
287
- notifyMessage('Incorporate Soon', 5);
288
- break;
289
- }
290
- }
291
-
292
- function renderItemNew(data) {
293
- return (
294
- <View style={styles.progressCircleContainer}>
295
- <CProgressCircle
296
- borderWidth={2}
297
- radius={normalize(24)}
298
- bgColor={
299
- index === data.index ? getColorCodeDashboard(data.item) : null
300
- }
301
- percent={(data.item.dbvalue / totalObj) * 100}
302
- iconname={data.item.iconname ? data.item.iconname : 'file-alt'}
303
- iconcolor={
304
- index === data.index ? null : getColorCodeDashboard(data.item)
305
- }
306
- iconsize={normalize(15)}
307
- displaytext={isNU(data.item.dbvalue) ? data.item.dbvalue : ''}
308
- textFontSize={normalize(15)}
309
- textColor={
310
- index === data.index ? null : getColorCodeDashboard(data.item)
311
- }
312
- onCallback={s => {
313
- getTotalPatientList(
314
- data.item,
315
- data.index,
316
- dateData.fromdate,
317
- dateData.todate,
318
- );
319
- }}
320
- />
321
- <Text style={[styles.progressCircleText, { color: index === data.index ? getColorCodeDashboard(data.item) : Global.AppTheme.primary_color }]}>{data.item.dbname}</Text>
322
- </View>
323
- );
324
- }
325
-
326
- function getColorCodeDashboard(params) {
327
- switch (params.dbname) {
328
- case 'ALLOCATED':
329
- return '#28a745';
330
- case 'DEALLOCATED':
331
- return '#dc3545';
332
- case 'CANCELED':
333
- return '#fd7e14';
334
- case 'TOTAL':
335
- return Global.AppTheme.secondary_color;
336
- default:
337
- return Global.AppTheme.primary_color;
338
- }
339
- }
340
-
341
- function getFilter(params) {
342
- let dayBefore = null;
343
-
344
- const updateDateData = (from, to, dateview = false) => {
345
- setDateData(prevState => ({
346
- ...prevState,
347
- fromdate: from,
348
- todate: to,
349
- dateview,
350
- }));
351
- };
352
-
353
- const fetchPatients = (from, to) => {
354
- getTotalPatientList(dashData[index], index, from, to);
355
- };
356
-
357
- switch (params.datavalue) {
358
- case 2: // Today
359
- updateDateData(today, today, false);
360
- fetchPatients(today, today);
361
- break;
362
-
363
- case 3: // Yesterday
364
- dayBefore = moment().subtract(1, 'days').format('YYYY-MM-DD');
365
- updateDateData(dayBefore, today, false);
366
- fetchPatients(dayBefore, today);
367
- break;
368
-
369
- case 4: // One week before
370
- dayBefore = moment().subtract(7, 'days').format('YYYY-MM-DD');
371
- updateDateData(dayBefore, today, false);
372
- fetchPatients(dayBefore, today);
373
- break;
374
-
375
- case 5: // One month before
376
- dayBefore = moment().subtract(1, 'month').format('YYYY-MM-DD');
377
- updateDateData(dayBefore, today, false);
378
- fetchPatients(dayBefore, today);
379
- break;
380
-
381
- case 6: // Six months before
382
- dayBefore = moment().subtract(6, 'months').format('YYYY-MM-DD');
383
- updateDateData(dayBefore, today, false);
384
- fetchPatients(dayBefore, today);
385
- break;
386
-
387
- case 7: // One year before
388
- dayBefore = moment().subtract(1, 'year').format('YYYY-MM-DD');
389
- updateDateData(dayBefore, today, false);
390
- fetchPatients(dayBefore, today);
391
- break;
392
-
393
- case 8: // Five years before
394
- dayBefore = moment().subtract(5, 'years').format('YYYY-MM-DD');
395
- updateDateData(dayBefore, today, false);
396
- fetchPatients(dayBefore, today);
397
- break;
398
-
399
- case 9: // Custom date view
400
- if (dateData?.dateview) {
401
- fetchPatients(dateData.fromdate, dateData.todate);
402
- } else {
403
- updateDateData(today, today, true);
404
- }
405
- break;
406
- default:
407
- console.error('Unknown datavalue:', params.datavalue);
408
- break;
409
- }
410
- }
411
-
412
- // Render
413
- return (
414
- <CContainerView>
415
- {<HeaderBlock
416
- navigation={navigation.navigate}
417
- callback={() => {
418
- setBackHandlerLogOut(true);
419
- }}
420
- />}
421
-
422
- <CDetailView hideCard={true} >
423
- <View style={styles.detailContainer}>
424
- {isBNUL(dashData) && (
425
- <FlatList
426
- data={dashData}
427
- renderItem={renderItemNew}
428
- numColumns={4}
429
- keyExtractor={(item, index) => 'key' + index}
430
- columnWrapperStyle={styles.dashboardColumnWrapper}
431
- // refreshControl={
432
- // <RefreshControl
433
- // refreshing={refreshing}
434
- // onRefresh={onRefresh}
435
- // colors={[Global.AppTheme.primary_color]}
436
- // tintColor={Global.AppTheme.primary_color}
437
- // />
438
- // }
439
- />
440
- )}
441
-
442
- {/* Date Search Section */}
443
- {isBNUL(dashData) && (
444
- <View style={styles.dateSearchContainer}>
445
- <SSearch
446
- disabled={false}
447
- editable={true}
448
- dropdownapi={`insurance/emrcommonget/rnddhosudatefilter`}
449
- disablesearchcomponent={true}
450
- onChangeData={val => val && getFilter(val)}
451
- />
452
- </View>
453
- )}
454
-
455
- {dateData?.dateview && (
456
- <View style={styles.datePickerRow}>
457
- <View style={styles.datePickerContainer}>
458
- <SDatePickerLabel
459
- labeltext={'From Date'}
460
- icon={{
461
- icongroup: 5,
462
- name: 'calendar-alt',
463
- color: Global.AppTheme.primary_color,
464
- size: normalize(15),
465
- style: styles.datePickerIcon,
466
- }}
467
- positionviewstyle={styles.datePickerLabel}
468
- positiontextstyle={styles.datePickerLabelText}
469
- pickerstyle={styles.datePicker}
470
- textstyle={styles.datePickerText}
471
- maximumdate={today}
472
- passingDate={moment(dateData?.fromdate).format('YYYY-MM-DD')}
473
- onChangeData={val =>
474
- val &&
475
- (setDateData(prevState => ({
476
- ...prevState,
477
- fromdate: moment(val).format('YYYY-MM-DD'),
478
- })),
479
- fetchPatients(
480
- moment(val).format('YYYY-MM-DD'),
481
- dateData.todate,
482
- ))
483
- }
484
- />
485
- </View>
486
-
487
- <View style={styles.datePickerContainer}>
488
- <SDatePickerLabel
489
- labeltext={'To Date'}
490
- icon={{
491
- icongroup: 5,
492
- name: 'calendar-alt',
493
- color: Global.AppTheme.primary_color,
494
- size: normalize(15),
495
- style: styles.datePickerIcon,
496
- }}
497
- positionviewstyle={styles.datePickerLabel}
498
- positiontextstyle={styles.datePickerLabelText}
499
- pickerstyle={styles.datePicker}
500
- textstyle={styles.datePickerText}
501
- maximumdate={today}
502
- passingDate={moment(dateData?.todate).format('YYYY-MM-DD')}
503
- onChangeData={val =>
504
- val &&
505
- (setDateData(prevState => ({
506
- ...prevState,
507
- todate: moment(val).format('YYYY-MM-DD'),
508
- })),
509
- fetchPatients(
510
- dateData.fromdate,
511
- moment(val).format('YYYY-MM-DD'),
512
- ))
513
- }
514
- />
515
- </View>
516
- </View>
517
- )}
518
-
519
-
520
- <SSearch
521
- editable={true}
522
- navigation={navigation.navigate}
523
- value={searchWord}
524
- visibility={val => val && {}}
525
- onChangeText={text => setSearchWord(text)}
526
- onChangeData={val => val && setFilter(val.searchparam)}
527
- onBarCodeScan={val => val && FnNavigate()}
528
- onSearch={val => val && getNewUser()}
529
- onRefresh={val => val && setSearchRefresh(SearchRefresh + 1)}
530
- />
531
-
532
- {!(isBNUL(dashData) || isLoading) && (
533
- <View style={styles.refreshContainer}>
534
- <HShadowButton
535
- useicon={true}
536
- usetext={true}
537
- buttonstyle={styles.refreshButton}
538
- icongroup={4}
539
- iconcolor={Global.AppTheme.primary_color}
540
- iconname={'refresh'}
541
- iconsize={normalize(22)}
542
- iconstyle={styles.refreshIcon}
543
- displaytext={'Refresh'}
544
- buttonCallback={FirstGetData}
545
- textstyle={styles.refreshText}
546
- />
547
- </View>
548
- )}
549
- </View>
550
-
551
- {patientdata && patientdata !== undefined && (
552
- <View ref={scrollRef} style={styles.patientListContainer}>
553
- <CCard
554
- filter={filter}
555
- search={searchWord}
556
- navigation={navigation.navigate}
557
- data={patientdata}
558
- onRefresh={SearchRefresh}
559
- disabled={index === 3}
560
- />
561
- </View>
562
- )}
563
- </CDetailView>
564
-
565
- <CFooterView style={styles.footerContainer}>
566
- {FooterArr &&
567
- FooterArr.map((item, i) => {
568
- return item.visibility && (
569
- <HShadowButton
570
- key={item.keyid || i}
571
- useicon={true}
572
- usetext={true}
573
- disabled={false}
574
- buttonstyle={[styles.footerButton, CShadowDynamic(-3, 3, 5, 0, Global.AppTheme.primary_color)]}
575
- iconcolor={Global.AppTheme.primary_color}
576
- icongroup={item.icongroup || 5}
577
- iconname={item.iconname}
578
- iconsize={normalize(24)}
579
- displaytext={item.displaytext}
580
- buttonCallback={() => getFunctions(item)}
581
- textstyle={styles.optionText}
582
- />
583
- )
584
- })}
585
- </CFooterView>
586
-
587
- {backHandlerLogOut ?
588
- <CBackHandler
589
- type={6} // 2 for exit/logout
590
- callBack={val =>
591
- val == undefined
592
- ? null
593
- : (setBackHandlerLogOut(val), navigation.goBack())
594
- }
595
- close={val => (val == undefined ? null : setBackHandlerLogOut(val))}
596
- /> : null}
597
- {isLoading && <Loader displaytext={true} />}
598
- </CContainerView>
599
- );
600
- }
601
-
602
- const styles = StyleSheet.create({
603
- detailContainer: {
604
- borderWidth: 0,
605
- },
606
- progressCircleContainer: {
607
- alignItems: 'center',
608
- justifyContent: 'center',
609
- },
610
- progressCircleText: {
611
- fontSize: normalize(10),
612
- fontWeight: 'bold',
613
- paddingVertical: normalize(4),
614
- },
615
- dashboardColumnWrapper: {
616
- justifyContent: 'space-evenly',
617
- },
618
- dateSearchContainer: {
619
- marginTop: normalize(7),
620
- },
621
- datePickerRow: {
622
- flexDirection: 'row',
623
- width: '100%',
624
- justifyContent: 'space-evenly',
625
- marginTop: normalize(7),
626
- },
627
- datePickerContainer: {
628
- borderWidth: 0,
629
- width: '47%',
630
- },
631
- datePickerIcon: {
632
- marginHorizontal: normalize(5),
633
- },
634
- datePickerLabel: {
635
- position: 'absolute',
636
- top: normalize(-5),
637
- left: normalize(7),
638
- backgroundColor: 'white',
639
- flexDirection: 'row',
640
- alignItems: 'center',
641
- },
642
- datePickerLabelText: {
643
- color: Global.AppTheme.primary_color,
644
- fontSize: normalize(10),
645
- textAlign: 'left',
646
- fontWeight: 'normal',
647
- },
648
- datePicker: {
649
- flexDirection: 'row',
650
- backgroundColor: '#fff',
651
- width: '100%',
652
- borderColor: 'grey',
653
- borderWidth: 0.5,
654
- borderRadius: 5,
655
- alignItems: 'center',
656
- height: normalize(30),
657
- elevation: 2,
658
- justifyContent: 'center',
659
- marginVertical: normalize(3),
660
- },
661
- datePickerText: {
662
- fontSize: normalize(12),
663
- color: 'black',
664
- fontWeight: 'bold',
665
- },
666
- refreshContainer: {
667
- borderWidth: 0,
668
- width: '100%',
669
- justifyContent: 'center',
670
- alignItems: 'center',
671
- },
672
- refreshButton: {
673
- margin: normalize(5),
674
- borderLeftWidth: 0,
675
- borderBottomWidth: 0,
676
- borderRadius: 5,
677
- borderWidth: 0,
678
- borderColor: Global.AppTheme.primary_color,
679
- justifyContent: 'center',
680
- alignItems: 'center',
681
- backgroundColor: 'white',
682
- height: normalize(30),
683
- width: normalize(60),
684
- shadowColor: '#000',
685
- shadowOffset: {
686
- width: 0,
687
- height: 2,
688
- },
689
- shadowOpacity: 0.25,
690
- shadowRadius: 3.84,
691
- elevation: 5,
692
- },
693
- refreshIcon: {
694
- textAlign: 'center',
695
- borderWidth: 0,
696
- },
697
- refreshText: {
698
- color: '#B8621B',
699
- fontSize: normalize(6),
700
- textAlign: 'center',
701
- fontWeight: 'normal',
702
- lineHeight: normalize(6),
703
- },
704
- patientListContainer: {
705
- flex: 1,
706
- },
707
- footerContainer: {
708
- flexDirection: 'row',
709
- alignItems: 'center',
710
- justifyContent: 'space-between',
711
- paddingHorizontal: 2,
712
- },
713
- footerButton: {
714
- borderRadius: 10,
715
- borderWidth: 0.5,
716
- height: Dimensions.get('screen').height * 0.054,
717
- width: Dimensions.get('screen').height * 0.07,
718
- backgroundColor: '#fff',
719
- paddingHorizontal: 0,
720
- paddingBottom: 0,
721
- paddingTop: 0,
722
- borderColor: Global.AppTheme.primary_color,
723
- justifyContent: 'center',
724
- alignItems: 'center',
725
- marginHorizontal: normalize(3),
726
- elevation: 4, // raiseLevel equivalent for Android
727
- shadowColor: '#ffe5e5', // optional for iOS shadow
728
- shadowOffset: { width: 0, height: 2 },
729
- shadowOpacity: 0.2,
730
- shadowRadius: 2,
731
- },
732
- footerButtonText: {
733
- fontSize: normalize(9),
734
- textAlign: 'center',
735
- alignSelf: 'center',
736
- },
737
- moreButtonContainer: {
738
- borderWidth: 0,
739
- },
740
- menuOptions: {
741
- marginTop: normalize(-52),
742
- },
743
- moreOptionsContainer: {
744
- flexDirection: 'row',
745
- flexWrap: 'wrap-reverse',
746
- justifyContent: 'flex-end',
747
- borderWidth: 0,
748
- },
749
- menuOption: {
750
- marginHorizontal: normalize(3),
751
- },
752
- subFooterButton: {
753
- shadowColor: '#000',
754
- shadowOffset: {
755
- width: 0,
756
- height: 2,
757
- },
758
- shadowOpacity: 0.25,
759
- shadowRadius: 3.84,
760
- elevation: 5,
761
- alignItems: 'center',
762
- justifyContent: 'center',
763
- borderWidth: 1,
764
- borderColor: 'lightblue',
765
- borderRadius: 10,
766
- height: normalize(40),
767
- width: normalize(50),
768
- marginVertical: normalize(7),
769
- backgroundColor: 'white',
770
- },
771
- optionText: {
772
- fontSize: normalize(8),
773
- color: Global.AppTheme.primary_color,
774
- fontWeight: 'bold',
775
- textAlign: 'center',
776
- maxWidth: normalize(60),
777
- }
778
- });