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

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 (178) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +3 -7
  3. package/package.json +3 -2
  4. package/src/Alerts/AAlert.js +4 -4
  5. package/src/Alerts/AAlertIOS.js +3 -3
  6. package/src/{common → Common}/NetworkServiceCall.js +1 -1
  7. package/src/CommonStyle/CommonTheme.js +11 -0
  8. package/src/CommonStyle/ComponentFunctions.js +632 -0
  9. package/src/CommonStyle/PopupStyle.js +146 -0
  10. package/src/CommonStyle/commonStyle.js +93 -0
  11. package/src/CommonStyle/componentStyle.js +545 -0
  12. package/src/CommonStyle/optionListStyles.js +175 -0
  13. package/src/Components/ByProductPage.js +200 -0
  14. package/src/Components/CDropDownListNew.js +153 -0
  15. package/src/Components/CSupplierList.js +88 -0
  16. package/src/Components/CVerificationCard.js +2822 -0
  17. package/src/Components/CustomButton.js +67 -0
  18. package/src/Components/CustomCard.js +127 -0
  19. package/src/Components/CustomTextInput.js +47 -0
  20. package/src/Components/EquipmentPage.js +313 -0
  21. package/src/Components/FilterInput.Copy.js +723 -0
  22. package/src/Components/FilterInput.js +569 -0
  23. package/src/Components/HSubHeading.js +68 -0
  24. package/src/Components/HeaderCard.js +40 -0
  25. package/src/Components/MoreOptionsScreen.js +251 -0
  26. package/src/Components/NonSwipableProductCard.js +226 -0
  27. package/src/Components/NonSwipableSupplierCard.js +348 -0
  28. package/src/Components/ProductCard.js +1336 -0
  29. package/src/Components/QualityProductCard.js +1059 -0
  30. package/src/Components/RateProductCard.js +1452 -0
  31. package/src/Components/RawMaterial.js +261 -0
  32. package/src/Components/SDropDownEdited.js +549 -0
  33. package/src/Components/SDropDownNew.js +529 -0
  34. package/src/Components/SHelpDescription.js +147 -0
  35. package/src/Components/STextInputNew.js +510 -0
  36. package/src/Components/SearchProductCard.js +470 -0
  37. package/src/Components/StageByProduct.js +199 -0
  38. package/src/Components/SupplierCard.js +243 -0
  39. package/src/Components/SupplierInvoiceCard.js +405 -0
  40. package/src/Components/SwipableSupplierCard.js +136 -0
  41. package/src/Components/TagTemplate.js +74 -0
  42. package/src/Components/WrappedComponent.js +25 -0
  43. package/src/Custom/CBooking.js +944 -0
  44. package/src/Custom/CBookingPostpone.js +1822 -0
  45. package/src/Custom/CCalendar.js +560 -0
  46. package/src/Custom/CCard.js +880 -0
  47. package/src/Custom/CDetailCard.js +205 -0
  48. package/src/Custom/CHelpImage.js +52 -0
  49. package/src/Custom/CReport.js +569 -0
  50. package/src/Custom/CScrollView.js +73 -0
  51. package/src/Custom/CSignature.js +112 -0
  52. package/src/Custom/CSliderMenu.js +339 -0
  53. package/src/Custom/CSupplierCard.js +99 -0
  54. package/src/Custom/CTemplateCard.js +438 -0
  55. package/src/Custom/CTokenAllocation.js +1402 -0
  56. package/src/Custom/CTokenListOverlay.js +122 -0
  57. package/src/Custom/CWardStatus.js +444 -0
  58. package/src/Custom/Charts/CBarChart.js +218 -0
  59. package/src/Custom/Charts/CDashBoardList.js +133 -0
  60. package/src/Custom/Charts/CDashBoardTable.js +172 -0
  61. package/src/Custom/Charts/CLineChart.js +193 -0
  62. package/src/Custom/Charts/CPieChart.js +186 -0
  63. package/src/Custom/Loader.js +182 -0
  64. package/src/Custom/OUserView.js +1121 -0
  65. package/src/Custom/PreviewDosage.js +115 -0
  66. package/src/Custom/SearchLoader.js +32 -0
  67. package/src/Custom/TableComponent/CActivityTable.js +707 -0
  68. package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
  69. package/src/Custom/TableComponent/CTable.js +185 -0
  70. package/src/Custom/TableComponent/CTextBody.js +40 -0
  71. package/src/Custom/TableComponent/CTextHeader.js +17 -0
  72. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
  73. package/src/Custom/TableComponent/SDropdownTable.js +491 -0
  74. package/src/Custom/TableComponent/TagTable.js +1200 -0
  75. package/src/CustomComponents/CAddColumn.js +140 -0
  76. package/src/CustomComponents/CAssessmentDelete.js +307 -0
  77. package/src/CustomComponents/CAwesomeButton.js +83 -0
  78. package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
  79. package/src/CustomComponents/CBackHandler.js +273 -0
  80. package/src/CustomComponents/CCalendar.js +243 -0
  81. package/src/CustomComponents/CCommentOverlay.js +202 -0
  82. package/src/CustomComponents/CComments.js +162 -0
  83. package/src/CustomComponents/CContainerView.js +24 -0
  84. package/src/CustomComponents/CCustomTextInput.js +336 -0
  85. package/src/CustomComponents/CDetailView.js +40 -0
  86. package/src/CustomComponents/CDropDownList.js +153 -0
  87. package/src/CustomComponents/CDropdownSelect.js +555 -0
  88. package/src/CustomComponents/CFooterView.js +42 -0
  89. package/src/CustomComponents/CImagePickerSave.js +316 -0
  90. package/src/CustomComponents/CModalOverlay.js +91 -0
  91. package/src/CustomComponents/CNetworkStatus.js +327 -0
  92. package/src/CustomComponents/CNotesInstructions.js +1000 -0
  93. package/src/CustomComponents/COverlay.js +81 -0
  94. package/src/CustomComponents/CRemarks.js +176 -0
  95. package/src/CustomComponents/CRowAdd.js +143 -0
  96. package/src/CustomComponents/CSummaryDropDown.js +327 -0
  97. package/src/CustomComponents/CText.js +9 -0
  98. package/src/CustomComponents/CVectorIcon.js +34 -0
  99. package/src/CustomComponents/HtmlContentViewer.js +65 -0
  100. package/src/CustomComponents/PdfContentViewer.js +90 -0
  101. package/src/CustomComponents/SDropDownDosage.js +1087 -0
  102. package/src/CustomComponents/SwipableProductCard.js +246 -0
  103. package/src/CustomComponents/SwipableProductImageCard.js +254 -0
  104. package/src/CustomComponents/WorkOrderDetails.js +1216 -0
  105. package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
  106. package/src/HOC/ConfirmOverlay.js +2 -2
  107. package/src/HOC/HMoreButton.js +1 -1
  108. package/src/HOC/HNatureHeading.js +1 -1
  109. package/src/HOC/HShadowButton.js +1 -1
  110. package/src/HOC/HShadowCountButton.js +1 -1
  111. package/src/Json/Chart.json +818 -0
  112. package/src/Json/Consultation.json +622 -0
  113. package/src/Json/CreditBill.json +490 -0
  114. package/src/Json/Dropdown.json +216 -0
  115. package/src/Json/DropdownConsultation.json +228 -0
  116. package/src/Json/DynamicReports.json +623 -0
  117. package/src/Json/Footer.json +79 -0
  118. package/src/Media/AudioScreen.js +2 -7
  119. package/src/Media/CCaptureImageWithoutEdit.js +1 -1
  120. package/src/Media/CImageGallery.js +2 -2
  121. package/src/Media/CSingleImage.js +2 -2
  122. package/src/Media/CVideoPlay.js +1 -1
  123. package/src/Media/DocumentScreen.js +2 -7
  124. package/src/Media/DrawingScreen.js +2 -6
  125. package/src/Media/ImageScreen.js +2 -6
  126. package/src/Media/RecordAudio.js +1 -1
  127. package/src/Media/VideoScreen.js +2 -7
  128. package/src/Navigation/PageNavigation.js +224 -0
  129. package/src/Navigation/useFocusEffect.js +2 -0
  130. package/src/Navigation/useFocusEffect.native.js +1 -0
  131. package/src/Navigation/useFocusEffect.web.js +1 -0
  132. package/src/Navigation/useIsFocused.js +1 -0
  133. package/src/Navigation/useIsFocused.native.js +1 -0
  134. package/src/Navigation/useIsFocused.web.js +1 -0
  135. package/src/Navigation/useNavigation.js +2 -0
  136. package/src/Navigation/useNavigation.native.js +1 -0
  137. package/src/Navigation/useNavigation.web.js +1 -0
  138. package/src/Screens/CMedications.js +528 -0
  139. package/src/Screens/CWebViewGallery.js +203 -0
  140. package/src/Screens/ChartScan.js +279 -0
  141. package/src/Screens/ChartScreenNew.js +1579 -0
  142. package/src/Screens/Consultation.js +1500 -0
  143. package/src/Screens/Dashboard.js +778 -0
  144. package/src/Screens/FileExplorer.js +288 -0
  145. package/src/Screens/Footer.js +340 -0
  146. package/src/Screens/ForgotPassword.js +288 -0
  147. package/src/Screens/HeaderBlock.js +353 -0
  148. package/src/Screens/Login.js +328 -0
  149. package/src/Screens/Notification.js +149 -0
  150. package/src/Screens/OcrScreen.js +20 -0
  151. package/src/Screens/PdfPreview.js +507 -0
  152. package/src/Screens/RegistrationDetails.js +467 -0
  153. package/src/Screens/SearchScreen.js +582 -0
  154. package/src/Screens/Splash.js +788 -0
  155. package/src/Screens/SwipeLeftView.js +1867 -0
  156. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  157. package/src/StaticComponents/SDatePickerNew.js +1 -1
  158. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  159. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  160. package/src/StaticComponents/SDropDownHoc.js +4 -4
  161. package/src/StaticComponents/SDropDownIcon.js +1 -1
  162. package/src/StaticComponents/SMenuBox.js +2 -2
  163. package/src/StaticComponents/SSearch.js +2 -2
  164. package/src/StaticComponents/STextInput.js +1 -1
  165. package/src/StaticComponents/STimePicker.js +1 -1
  166. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  167. package/src/StaticComponents/STimingSwitch.js +1 -1
  168. package/src/layout/CContainerView.js +1 -1
  169. package/src/layout/CDetailView.js +3 -3
  170. package/src/layout/HeaderBlock.js +5 -5
  171. package/src/layout/INVLoginLayout.js +3 -4
  172. package/src/layout/Loader.js +2 -2
  173. package/src/HOC/HAbsolute.js +0 -56
  174. package/src/HOC/HDiscontinue.js +0 -105
  175. package/src/HOC/HOverlay.js +0 -99
  176. package/src/layout/FooterBlock.js +0 -821
  177. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  178. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,707 @@
1
+ import moment from 'moment';
2
+ import React, { useEffect, useState } from 'react';
3
+ import { View, Text, ScrollView, TouchableOpacity, Dimensions, Platform } from 'react-native';
4
+ import { APIURL } from '../../Common/apiConstants';
5
+ import { Global } from '../../Common/Global';
6
+ import Icons from '../../Common/Icons';
7
+ import NetworkServiceCall from '../../Common/NetworkServiceCall';
8
+ import { ArrayCheck, getLoading, isPermitted, notifyMessage, ValueCheck } from '../../CommonStyle/ComponentFunctions';
9
+ import { normalize } from '../../CommonStyle/componentStyle';
10
+ import Loader from '../Loader';
11
+ import CTextHeader from './CTextHeader';
12
+ import ProgressCircle from 'react-native-progress-circle';
13
+ import HHeading from '../../HOC/HHeading';
14
+ import RNHTMLtoPDF from 'react-native-html-to-pdf';
15
+ import RNPrint from 'react-native-print';
16
+ import HReportHeader from '../../Html/HReportHeader';
17
+ import HReportFooter from '../../Html/HReportFooter';
18
+ import HReportFormat from '../../Html/HReportFormat';
19
+
20
+
21
+ export default function CActivityTable(props) {
22
+ var ReportData = {
23
+ 'title': 'Report Investigation',
24
+ 'username': 'DR MATHEW',
25
+ 'suuser': 1,
26
+ 'investigation': 'Investigation',
27
+ 'activity': 'Activity 1',
28
+ 'hopapatient': 0,
29
+ 'patientid': '12356',
30
+ 'patientname': 'NAME',
31
+ 'dataArr': [
32
+ {
33
+ 'columnid': 1,
34
+ 'width': 0.3,
35
+ 'displayheader': 'Investigation',
36
+ 'columntype': 1,
37
+ 'rows': [
38
+ {
39
+ 'value': 'Investigation 1',
40
+ },
41
+ {
42
+ 'value': 'Investigation 2',
43
+ },
44
+ {
45
+ 'value': 'Investigation 3',
46
+ },
47
+ ],
48
+ },
49
+ {
50
+ 'columnid': 2,
51
+ 'width': 0.9,
52
+ 'displayheader': 'Activity 1',
53
+ 'columntype': 2,
54
+ 'rows': [
55
+ {
56
+ 'starttime': '2023-11-21T07:02:39.200Z',
57
+ 'endtime': '2023-11-21T07:12:56.200Z',
58
+ 'userstart': 'User 1',
59
+ 'userend': 'User 2',
60
+ 'benchmarktime': 20,
61
+ 'unit': 'min',
62
+ 'totaltime': 0,
63
+ },
64
+ {
65
+ 'starttime': '2023-11-21T07:02:39.200Z',
66
+ 'endtime': '2023-11-21T07:12:56.200Z',
67
+ 'userstart': 'User 1',
68
+ 'userend': 'User 2',
69
+ 'benchmarktime': 15,
70
+ 'unit': 'min',
71
+ 'totaltime': 0,
72
+ },
73
+ {
74
+ 'starttime': '2023-11-21T07:02:39.200Z',
75
+ 'endtime': '2023-11-21T07:12:56.200Z',
76
+ 'userstart': 'User 1',
77
+ 'userend': 'User 2',
78
+ 'benchmarktime': 15,
79
+ 'unit': 'min',
80
+ 'totaltime': 0,
81
+ },
82
+ ],
83
+ },
84
+ {
85
+ 'columnid': 3,
86
+ 'width': 0.8,
87
+ 'displayheader': 'Activity 2',
88
+ 'columntype': 2,
89
+ 'rows': [
90
+ {
91
+ 'starttime': '2023-11-21T07:02:39.200Z',
92
+ 'endtime': '2023-11-21T07:12:56.200Z',
93
+ 'userstart': 'User 1',
94
+ 'userend': 'User 2',
95
+ 'benchmarktime': 20,
96
+ 'unit': 'min',
97
+ 'totaltime': 0,
98
+ },
99
+ {
100
+ 'starttime': '2023-11-21T07:02:39.200Z',
101
+ 'endtime': '2023-11-21T07:12:56.200Z',
102
+ 'userstart': 'User 1',
103
+ 'userend': 'User 2',
104
+ 'benchmarktime': 15,
105
+ 'unit': 'min',
106
+ 'totaltime': 0,
107
+ },
108
+ {
109
+ 'starttime': '2023-11-21T07:02:39.200Z',
110
+ 'endtime': '2023-11-21T07:12:56.200Z',
111
+ 'userstart': 'User 1',
112
+ 'userend': 'User 2',
113
+ 'benchmarktime': 15,
114
+ 'unit': 'min',
115
+ 'totaltime': 0,
116
+ },
117
+ ],
118
+ },
119
+ {
120
+ 'columnid': 5,
121
+ 'width': 0.8,
122
+ 'displayheader': 'Activity 3',
123
+ 'columntype': 2,
124
+ 'rows': [
125
+ {
126
+ 'starttime': '2023-11-21T07:02:39.200Z',
127
+ 'endtime': '2023-11-21T07:12:56.200Z',
128
+ 'userstart': 'User 1',
129
+ 'userend': 'User 2',
130
+ 'benchmarktime': 9,
131
+ 'unit': 'min',
132
+ 'totaltime': 0,
133
+ },
134
+ {
135
+ 'starttime': '2023-11-21T07:02:39.200Z',
136
+ 'endtime': '2023-11-21T08:12:56.200Z',
137
+ 'userstart': 'User 1',
138
+ 'userend': 'User 2',
139
+ 'benchmarktime': 15,
140
+ 'unit': 'min',
141
+ 'totaltime': 0,
142
+ },
143
+ {
144
+ 'starttime': '2023-11-21T07:02:39.200Z',
145
+ 'endtime': '2023-11-21T07:12:56.200Z',
146
+ 'userstart': 'User 1',
147
+ 'userend': 'User 2',
148
+ 'benchmarktime': 15,
149
+ 'unit': 'min',
150
+ 'totaltime': 0,
151
+ },
152
+ ],
153
+ },
154
+ {
155
+ 'columnid': 3,
156
+ 'width': 0.8,
157
+ 'displayheader': 'Activity 2',
158
+ 'columntype': 2,
159
+ 'rows': [
160
+ {
161
+ 'starttime': '2023-11-21T07:02:39.200Z',
162
+ 'endtime': '2023-11-21T07:12:56.200Z',
163
+ 'userstart': 'User 1',
164
+ 'userend': 'User 2',
165
+ 'benchmarktime': 20,
166
+ 'unit': 'min',
167
+ 'totaltime': 0,
168
+ },
169
+ {
170
+ 'starttime': '2023-11-21T07:02:39.200Z',
171
+ 'endtime': '2023-11-21T07:12:56.200Z',
172
+ 'userstart': 'User 1',
173
+ 'userend': 'User 2',
174
+ 'benchmarktime': 15,
175
+ 'unit': 'min',
176
+ 'totaltime': 0,
177
+ },
178
+ {
179
+ 'starttime': '2023-11-21T07:02:39.200Z',
180
+ 'endtime': '2023-11-21T07:12:56.200Z',
181
+ 'userstart': 'User 1',
182
+ 'userend': 'User 2',
183
+ 'benchmarktime': 15,
184
+ 'unit': 'min',
185
+ 'totaltime': 0,
186
+ },
187
+ ],
188
+ },
189
+ {
190
+ 'columnid': 5,
191
+ 'width': 0.8,
192
+ 'displayheader': 'Activity 3',
193
+ 'columntype': 2,
194
+ 'rows': [
195
+ {
196
+ 'starttime': '2023-11-21T07:02:39.200Z',
197
+ 'endtime': '2023-11-21T07:12:56.200Z',
198
+ 'userstart': 'User 1',
199
+ 'userend': 'User 2',
200
+ 'benchmarktime': 9,
201
+ 'unit': 'min',
202
+ 'totaltime': 0,
203
+ },
204
+ {
205
+ 'starttime': '2023-11-21T07:02:39.200Z',
206
+ 'endtime': '2023-11-21T07:12:56.200Z',
207
+ 'userstart': 'User 1',
208
+ 'userend': 'User 2',
209
+ 'benchmarktime': 15,
210
+ 'unit': 'min',
211
+ 'totaltime': 0,
212
+ },
213
+ {
214
+ 'starttime': '2023-11-21T07:02:39.200Z',
215
+ 'endtime': '2023-11-21T07:12:56.200Z',
216
+ 'userstart': 'User 1',
217
+ 'userend': 'User 2',
218
+ 'benchmarktime': 15,
219
+ 'unit': 'min',
220
+ 'totaltime': 0,
221
+ },
222
+ ],
223
+ },
224
+ {
225
+ 'columnid': 4,
226
+ 'width': 0.4,
227
+ 'displayheader': 'Total [Min]',
228
+ 'columntype': 3,
229
+ 'rows': [
230
+ {
231
+ 'totaltime': '',
232
+ 'benchmarktime': '',
233
+ },
234
+ {
235
+ 'totaltime': '',
236
+ 'benchmarktime': '',
237
+ },
238
+ {
239
+ 'totaltime': '',
240
+ 'benchmarktime': '',
241
+ },
242
+ ],
243
+ },
244
+ ],
245
+ };
246
+
247
+ const [data, setData] = useState();
248
+ const [isLoading, setIsLoading] = useState(false);
249
+ const [refresh, setRefresh] = useState(0);
250
+ var d = new Date();
251
+
252
+ useEffect(() => {
253
+ getReportApi();
254
+ }, []);
255
+
256
+ function getReportApi() {
257
+ // let buttonapi = APIURL + 'emr/emrcommonget/procedurename ' + Global.userData.hopapatient + ',' + specimenid + ',' + investigation + ',' + activity + ',' + Global.userData.suuser
258
+ let buttonapi = APIURL + 'emr/emrcommonget/rnladropdown 17';
259
+ console.log('>>>>>>>><<<<<<<<<<KKKKKK>>>>>>>>><<<<<<<<<<<<<', buttonapi);
260
+ setIsLoading(true);
261
+ NetworkServiceCall('get', buttonapi, '')
262
+ .then(function (response) {
263
+ if (response.httpstatus == 200) {
264
+ setIsLoading(false);
265
+ setData(ReportData);
266
+ // getReportPDF(ReportData)
267
+ }
268
+ else {
269
+ setIsLoading(false);
270
+ notifyMessage('Report not available , please try again later', 4);
271
+ }
272
+ });
273
+ getLoading(v => setIsLoading(false));
274
+ }
275
+
276
+ const getReportPDF = async (data) => {
277
+ if (Platform.OS === 'web') {
278
+ window.electronAPI.savePDF(data);
279
+ return;
280
+ }
281
+ if (await isPermitted()) {
282
+ const htmlresult = await RNHTMLtoPDF.convert({
283
+ html: HReportFormat(contentdata(data), HReportHeader(), HReportFooter()),
284
+ fileName: 'pdf',
285
+ base64: true,
286
+ });
287
+ setIsLoading(false);
288
+ await RNPrint.print({ filePath: htmlresult.filePath });
289
+ }
290
+
291
+ };
292
+
293
+ return (
294
+ <View style={{ backgroundColor: '#fff' }}>
295
+
296
+ {isLoading ?
297
+ <Loader displaytext={true} /> : null}
298
+
299
+ <HHeading
300
+ styles={{
301
+ 'iconname': 'stack-overflow',
302
+ 'bgcolor': '#f2efef',
303
+ 'iconsize': 16,
304
+ 'iconcolor': Global.AppTheme.primary_color,
305
+ 'displaytext': 'REPORT',
306
+ 'textsize': 14,
307
+ 'textcolor': Global.AppTheme.primary_color,
308
+ }}
309
+ callBack={val => (val == undefined ? null : console.log(val))} />
310
+
311
+ <ScrollView horizontal={true}>
312
+ <View style={{ marginTop: normalize(5), marginHorizontal: normalize(5) }}>
313
+ {ValueCheck(data) && ArrayCheck(data.dataArr) ?
314
+ <View style={{ flexDirection: 'row' }}>
315
+ {data.dataArr.map((item, i) => {
316
+ return (
317
+ <View key={i}>
318
+ <View style={{ flexDirection: 'row' }}>
319
+ {[{ 'header': item.displayheader, 'width': item.width }].map((header, j) => {
320
+ return (
321
+ <View key={j} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
322
+ <CTextHeader key={i}
323
+ text={header.header}
324
+ widthArr={Dimensions.get('screen').width * header.width}
325
+ bgColor={'#eae8e8'} color={'black'} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3}
326
+ />
327
+ </View>
328
+ );
329
+ })}
330
+ </View>
331
+
332
+ <View>
333
+ {item.rows.map((details, k) => {
334
+ return (
335
+ <TouchableOpacity key={k}
336
+ style={{
337
+ flexDirection: 'row',
338
+ marginTop: 1,
339
+ backgroundColor: 'white',
340
+ padding: 1,
341
+ }}>
342
+ {getSwitchComponent(item, details, k)}
343
+ </TouchableOpacity>);
344
+ })}
345
+ </View>
346
+
347
+ <View style={{ marginTop: normalize(10) }}>
348
+ {i == 0 ?
349
+ <View
350
+ style={{
351
+ borderWidth: 1, justifyContent: 'center', backgroundColor: '#f7f4f4', borderColor: 'lightgrey',
352
+ borderRadius: 5, elevation: 3, height: normalize(50),
353
+ width: Dimensions.get('screen').width * item.width,
354
+ }}>
355
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{
356
+ fontSize: normalize(13), fontWeight: 'bold',
357
+ color: 'black', paddingLeft: normalize(10),
358
+ }}>{'TOTAL'}</Text>
359
+ </View>
360
+ :
361
+ <View
362
+ style={{
363
+ borderWidth: 1, justifyContent: 'center', backgroundColor: '#f7f4f4', borderColor: 'lightgrey',
364
+ borderRadius: 5, elevation: 3, height: normalize(50),
365
+ width: Dimensions.get('screen').width * item.width,
366
+ }}>
367
+ <View style={{ flexDirection: 'row', justifyContent: 'space-around', borderBottomWidth: 0 }}>
368
+ <View>
369
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
370
+ <ProgressCircle
371
+ percent={((10 / 10) * 100)}
372
+ radius={normalize(16)}
373
+ borderWidth={normalize(3)}
374
+ color={'green'}
375
+ shadowColor="lightgrey"
376
+ bgColor={'#fff'}
377
+ >
378
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{getBenchmarkTotal(item)}</Text>
379
+ </ProgressCircle>
380
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(8), color: 'black' }}>{'BENCHMARK'}</Text>
381
+ </View>
382
+ </View>
383
+
384
+ <View>
385
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
386
+ <ProgressCircle
387
+ percent={((getTotalTime(item) / getBenchmarkTotal(item)) * 100)}
388
+ radius={normalize(16)}
389
+ borderWidth={normalize(3)}
390
+ color={getTotalTime(item) > getBenchmarkTotal(item) ? 'red' : 'green'}
391
+ shadowColor="lightgrey"
392
+ bgColor={'#fff'}
393
+ >
394
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{getTotalTime(item)}</Text>
395
+ </ProgressCircle>
396
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(8), color: 'black' }}>{'TOTAL'}</Text>
397
+ </View>
398
+ </View>
399
+ </View>
400
+ </View>}
401
+ </View>
402
+
403
+
404
+ </View>
405
+ );
406
+ })}
407
+ </View> : null}
408
+ </View>
409
+ </ScrollView>
410
+
411
+ {/* <TouchableOpacity onPress={() => getReportPDF(data)}>
412
+ <Text>REPORT</Text>
413
+ </TouchableOpacity> */}
414
+ </View>
415
+ );
416
+
417
+ function getTimeDiffernece(start, end, item) {
418
+ var now = moment(start);
419
+ var end = moment(end);
420
+ var duration = moment.duration(end.diff(now));
421
+ var days = duration.asDays();
422
+ var hours = parseInt(duration.asHours());
423
+ var minutes = parseInt(duration.asMinutes());
424
+ // console.log(hours + ' hr and ' + minutes + ' min');
425
+ // console.log(days)
426
+ item.totaltime = minutes;
427
+ return item.totaltime;
428
+ }
429
+
430
+ function getBenchmarkTotal(item) {
431
+ // console.log("ITEMMMMMMMMMMMMMMM", JSON.stringify(item))
432
+ var x = item.rows.map(subitem => ValueCheck(subitem.benchmarktime) ? subitem.benchmarktime : 0).reduce((prev, next) => prev + next);
433
+ return x;
434
+ }
435
+
436
+ function getTotalTime(item) {
437
+ // console.log("ITEMMMMMMMMMMMMMMM", JSON.stringify(item))
438
+ var x = item.rows.map(subitem => ValueCheck(subitem.totaltime) ? subitem.totaltime : 0).reduce((prev, next) => prev + next);
439
+ return x;
440
+ }
441
+
442
+ function getRowTotalBench(rowkey, details) {
443
+ var x = data.dataArr.map((kkk) => kkk.rows[rowkey]);
444
+ var y = x.map(subitem => ValueCheck(subitem.benchmarktime) ? subitem.benchmarktime : 0).reduce((prev, next) => prev + next);
445
+ var z = x.map(subitem => ValueCheck(subitem.totaltime) ? subitem.totaltime : 0).reduce((prev, next) => prev + next);
446
+ details.benchmarktime = y;
447
+ details.totaltime = z;
448
+ return details.benchmarktime;
449
+ }
450
+
451
+ function getSwitchComponent(item, details, rowkey) {
452
+ switch (item.columntype) {
453
+ case 1:
454
+ return (
455
+ <View
456
+ style={{
457
+ borderWidth: 1, justifyContent: 'center', backgroundColor: '#fff', borderColor: 'lightgrey',
458
+ borderRadius: 5, elevation: 3, height: normalize(77),
459
+ width: Dimensions.get('screen').width * item.width, alignItems: 'center',
460
+ }}>
461
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{
462
+ fontSize: normalize(13), fontWeight: 'bold',
463
+ color: 'black',
464
+ }}>{details.value}</Text>
465
+ </View>
466
+ );
467
+ case 2:
468
+ return (
469
+ <View
470
+ style={{
471
+ borderWidth: 1, justifyContent: 'center', backgroundColor: '#fff', borderColor: 'lightgrey',
472
+ borderRadius: 5, elevation: 3, height: normalize(77),
473
+ width: Dimensions.get('screen').width * item.width,
474
+ }}>
475
+
476
+ <View style={{ flexDirection: 'row', justifyContent: 'space-around', borderBottomWidth: 0.5, borderBottomColor: 'grey' }}>
477
+ <Text style={{ fontSize: normalize(8) }}>START</Text>
478
+ <Text style={{ fontSize: normalize(8) }}>END</Text>
479
+ </View>
480
+
481
+ <View style={{ flexDirection: 'row' }}>
482
+ <View style={{ width: '50%', borderWidth: 0.5, borderRightWidth: 0.5, marginRight: 0.5, borderRadius: 2, paddingLeft: normalize(5) }}>
483
+ <Text style={{ fontSize: normalize(13), borderBottomWidth: 0.5 }}>{moment(details.starttime).format('DD-MM-YYYY hh:mm A')}</Text>
484
+ <Text style={{ fontSize: normalize(13) }}>{'User 1'}</Text>
485
+ </View>
486
+ <View style={{ width: '50%', borderWidth: 0.5, borderRightWidth: 0.5, marginRight: 0.5, borderRadius: 2, paddingLeft: normalize(5) }}>
487
+ <Text style={{ fontSize: normalize(13), borderBottomWidth: 0.5 }}>{moment(details.endtime).format('DD-MM-YYYY hh:mm A')}</Text>
488
+ <Text style={{ fontSize: normalize(13) }}>{'User 2'}</Text>
489
+ </View>
490
+ </View>
491
+
492
+ <View style={{ flexDirection: 'row', borderBottomWidth: 0 }}>
493
+ <View style={{ width: '50%', borderWidth: 0.5, borderTopWidth: 0, borderBottomLeftRadius: 5, borderBottomRightRadius: 5, marginRight: 0.5 }}>
494
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
495
+ <ProgressCircle
496
+ percent={((10 / 10) * 100)}
497
+ radius={normalize(13)}
498
+ borderWidth={normalize(3)}
499
+ color={'green'}
500
+ shadowColor="lightgrey"
501
+ bgColor={'#fff'}
502
+ >
503
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{details.benchmarktime}</Text>
504
+ </ProgressCircle>
505
+ <Text adjustsFontSizeToFit style={{ fontSize: normalize(8), color: 'black' }}>{'BENCHMARK'}</Text>
506
+ </View>
507
+ </View>
508
+
509
+ <View style={{ width: '50%', borderWidth: 0.5, borderTopWidth: 0, borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }}>
510
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
511
+ <ProgressCircle
512
+ percent={((getTimeDiffernece(details.starttime, details.endtime, details) / details.benchmarktime) * 100)}
513
+ radius={normalize(13)}
514
+ borderWidth={normalize(3)}
515
+ color={details.totaltime > details.benchmarktime ? 'red' : 'green'}
516
+ shadowColor="lightgrey"
517
+ bgColor={'#fff'}
518
+ >
519
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{details.totaltime}</Text>
520
+ </ProgressCircle>
521
+ <Text style={{ fontSize: normalize(8), color: 'black' }}>{'TOTAL'}</Text>
522
+ </View>
523
+ </View>
524
+ </View>
525
+ </View>
526
+ );
527
+
528
+ case 3:
529
+ return (
530
+ <View
531
+ style={{
532
+ borderWidth: 1, justifyContent: 'center', backgroundColor: '#fff', borderColor: 'lightgrey',
533
+ borderRadius: 5, elevation: 3, height: normalize(77),
534
+ width: Dimensions.get('screen').width * 0.4,
535
+ }}>
536
+
537
+ <View style={{ flexDirection: 'row', justifyContent: 'space-around', borderBottomWidth: 0 }}>
538
+ <View>
539
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
540
+ <ProgressCircle
541
+ percent={((10 / 10) * 100)}
542
+ radius={normalize(16)}
543
+ borderWidth={normalize(3)}
544
+ color={'green'}
545
+ shadowColor="lightgrey"
546
+ bgColor={'#fff'}
547
+ >
548
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{getRowTotalBench(rowkey, details)}</Text>
549
+ </ProgressCircle>
550
+ <Text adjustsFontSizeToFit style={{ fontSize: normalize(8), color: 'black' }}>{'BENCHMARK'}</Text>
551
+ </View>
552
+ </View>
553
+
554
+ <View>
555
+ <View style={{ alignItems: 'center', marginLeft: 5, marginRight: 5 }}>
556
+ <ProgressCircle
557
+ percent={((details.totaltime / details.benchmarktime) * 100)}
558
+ radius={normalize(16)}
559
+ borderWidth={normalize(3)}
560
+ color={details.totaltime > details.benchmarktime ? 'red' : 'green'}
561
+ shadowColor="lightgrey"
562
+ bgColor={'#fff'}
563
+ >
564
+ <Text adjustsFontSizeToFit numberOfLines={1} style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'black' }}>{details.totaltime}</Text>
565
+ </ProgressCircle>
566
+ <Text adjustsFontSizeToFit style={{ fontSize: normalize(8), color: 'black' }}>{'TOTAL'}</Text>
567
+ </View>
568
+ </View>
569
+ </View>
570
+ </View>
571
+ );
572
+ }
573
+ }
574
+
575
+ function contentdata(data) {
576
+ return (`
577
+
578
+ <style type="text/css">
579
+ .studentInfo {
580
+ width: 100%;
581
+ border-collapse: collapse;
582
+ border: 0px solid grey;
583
+
584
+ }
585
+
586
+ .studentInfo td {
587
+
588
+ border: 0.5px solid lightgrey;
589
+ }
590
+
591
+ .headerTable td {
592
+ background: aliceblue;font-size:8px;
593
+ border: 0.5px solid lightgrey;
594
+ }
595
+ .DetailData td {
596
+ font-size:14px;text-align: center;
597
+ border: 0.5px solid lightgrey;
598
+ }
599
+ .header {
600
+ text-align: left;
601
+ font-wight:'bold';
602
+ font-size:14px;
603
+ }
604
+ #rcorners1{
605
+ text-align:center;
606
+ align-items:center;
607
+ justify-content: center;
608
+ border-radius: 1500px;
609
+ background: red;
610
+ padding: 2px;
611
+ width: 25px;
612
+ }
613
+
614
+ </style>
615
+
616
+ <div>
617
+ ${`<div style="border: 1px solid #000000; margin-top: 1em;padding:0px;">
618
+ <span style="
619
+ display: inline;
620
+ background: #fff;
621
+ margin-left:0px;
622
+ padding: 0px 2px;
623
+ position: relative;
624
+ top: -0.6em;
625
+ font-size:10px;
626
+ font-weight:normal;"
627
+ >
628
+ Consultant Details
629
+ </span>
630
+
631
+ <div style="display:flex;flex-direction:column;margin:5px;margin-top:0px;">
632
+
633
+ <div style="display:flex;flex-direction:row;">
634
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:50%;">
635
+ <div style="width:30%;font-size:8px;">
636
+ Patient Name :
637
+ </div>
638
+ <div style="width:50%;font-weight:bold;font-size:10px;">
639
+ :&nbsp;${data.patientname}
640
+ </div>
641
+ </div>
642
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:50%;">
643
+ <div style="width:30%;font-size:8px;">
644
+ Investigation :
645
+ </div>
646
+ <div style="width:50%;font-weight:bold;font-size:10px;">
647
+ :&nbsp;${''}
648
+ </div>
649
+ </div>
650
+ </div>
651
+ ${`<div style="display:flex;flex-direction:row;">
652
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:60%;">
653
+ <div style="width:30%;font-size:8px;">
654
+ Investigation :
655
+ </div>
656
+ <div style="width:50%;font-weight:bold;font-size:10px;">
657
+ :&nbsp;${''}
658
+ </div>
659
+ </div>
660
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:60%;">
661
+ <div style="width:30%;font-size:8px;">
662
+ Activity :
663
+ </div>
664
+ <div style="width:50%;font-weight:bold;font-size:10px;">
665
+ :&nbsp;${''}
666
+ </div>
667
+ </div>
668
+ </div>`}
669
+
670
+ </div>
671
+ </div>
672
+ </div>
673
+ `}
674
+
675
+ <div>
676
+ <div style="font-size:10px;text-align: center;padding-top:5px">
677
+ REPORT
678
+ </div>
679
+ <table style="width: 100%;">
680
+ <tbody>
681
+
682
+ <tr class="headerTable">
683
+ ${ValueCheck(data) && ArrayCheck(data.dataArr) ? data.dataArr.map((subArr, i) => {
684
+ return (
685
+ `<td> ${subArr.displayheader} </td>`
686
+ );
687
+ }).join('') : ''}
688
+ </tr>
689
+
690
+ ${ValueCheck(data) && ArrayCheck(data.dataArr) ? data.dataArr.map((subArr, i) => {
691
+ return (
692
+ `<tr class="DetailData">
693
+ ${ValueCheck(subArr.rows) && ArrayCheck(subArr.rows) ? subArr.rows.map((rows, i) => {
694
+ return (
695
+ `<tr><td> ${i + 1} </td></tr>`
696
+ );
697
+ }).join('') : ''}
698
+ </tr>`
699
+ );
700
+ }).join('') : ''}
701
+
702
+ </tbody>
703
+ </div>
704
+ </div>
705
+ `);
706
+ }
707
+ }