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