@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,122 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { Text, View, FlatList, TouchableOpacity, Dimensions, ActivityIndicator, ScrollView, Switch, TextInput, RefreshControl } from 'react-native';
3
+ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
4
+ import { normalize } from '../CommonStyle/componentStyle';
5
+ import { APIURL } from '../../../../../src/Common/apiConstants';
6
+ import { ArrayCheck, getLoading, isBNUL, isNU, isNUQ, isNUQZ, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
7
+ import { Global } from '../../../../../src/Common/Global';
8
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
9
+ import { Icons } from '@jescon-technologies/react-native-ui-kit';;
10
+ import CTextHeader from './TableComponent/CTextHeader';
11
+ import CTextBody from './TableComponent/CTextBody';
12
+ import HHeading from '../HOC/HHeading';
13
+ import STimePicker from '../StaticComponents/STimePicker';
14
+ import Loader from './Loader';
15
+ import moment from 'moment';
16
+ import SDropDownNew from '../Components/SDropDownNew';
17
+
18
+ import HOCIcons from '../HOC/HOCIcons';
19
+ import SDatePickerNew from '../StaticComponents/SDatePickerNew';
20
+ import { Menu, MenuOptions, MenuTrigger } from 'react-native-popup-menu';
21
+ import CCommentOverlay from '../CustomComponents/CCommentOverlay';
22
+ import {
23
+ MenuOption,
24
+ } from 'react-native-popup-menu';
25
+
26
+
27
+ export default function CTokenListOverlay(props) {
28
+
29
+ const [refresh, setRefresh] = useState(0);
30
+ const [dataarray, setDataArray] = useState([]);
31
+
32
+
33
+
34
+ useEffect(() => {
35
+ getTokenList2(props.footerData, props.postponedate, props.item);
36
+ }, []);
37
+
38
+ function getTokenList2(footerdata, pdate, item) {
39
+
40
+ setDataArray([]);
41
+ let buttonapi = APIURL + 'emr/emrcommonget/rnhopaptientbookingpostponedetails ' + props.consultant + ',' + JSON.stringify(footerdata.date) + ',' + '"' + pdate + '"' + ',' + item.bookingtypes + ',' + '1';
42
+ console.log('Ctokenlistoverlay', buttonapi);
43
+ NetworkServiceCall('get', buttonapi, '')
44
+ .then(function (response) {
45
+ if (response.httpstatus == 200) {
46
+ if (isNU(response.data) && isBNUL(response.data.tokenArr)) {
47
+ setDataArray(response.data.tokenArr);
48
+ }
49
+ }
50
+ else {
51
+ notifyMessage('Day wise data not available.', 4);
52
+ }
53
+ });
54
+ }
55
+
56
+
57
+ return (
58
+ <View>
59
+ {isBNUL(dataarray) ?
60
+ <FlatList
61
+ data={dataarray}
62
+ horizontal={true}
63
+ renderItem={(val) => {
64
+ return (
65
+ <MenuOption
66
+ onSelect={() => {
67
+ val.item.selected = true,
68
+ setRefresh(refresh + 1),
69
+ props.callback(val.item);
70
+ }}
71
+ style={{
72
+ margin : normalize(5),
73
+ elevation : 5,
74
+ flexDirection : 'row',
75
+ alignItems : 'center',
76
+ backgroundColor : 'white',
77
+ borderTopWidth : 0.5,
78
+ borderRightWidth : 0.5,
79
+ borderLeftWidth : 2,
80
+ borderBottomWidth : 2,
81
+ borderRadius : 5,
82
+ height : normalize(35),
83
+ borderColor : props.item.color,
84
+ }}>
85
+ <View style={{
86
+ backgroundColor: props.item.color,
87
+ borderRadius: 5,
88
+ padding: 5,
89
+ width: normalize(25),
90
+ height: normalize(20),
91
+ justifyContent: 'center',
92
+ alignItems: 'center',
93
+ margin: 5,
94
+ }}>
95
+ <Text style={{ color : 'white', fontSize: normalize(10), fontWeight: 'bold' }}>{val.item.tokenno}</Text>
96
+ </View>
97
+ <View style={{ flexDirection: 'row', alignItems: 'center' }}>
98
+ <HOCIcons.FontAwesome5
99
+ name={'calendar-alt'}
100
+ size={normalize(8)}
101
+ color={props.item.color}
102
+ style={{
103
+ paddingHorizontal: normalize(3),
104
+ }}
105
+ />
106
+ <Text style={{ fontSize: normalize(8), color: 'black', fontWeight: 'bold' }}>{isNU(val.item.postponedate) ? moment(val.item.postponedate).format('DD-MM-YYYY') : null}{' '}{isNU(val.item.postponeconsultationtime) ? val.item.postponeconsultationtime : null}</Text>
107
+ </View>
108
+ </MenuOption>
109
+ );
110
+ }}
111
+ />
112
+ :
113
+ <View>
114
+ <Text style={{ fontSize: normalize(10), color : 'black' }}>Token not found</Text>
115
+ </View>
116
+ }
117
+ </View>
118
+ );
119
+
120
+
121
+
122
+ }
@@ -0,0 +1,444 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { Text, View, TextInput, Dimensions, FlatList, StyleSheet, ScrollView, ActivityIndicator, TouchableOpacity } from 'react-native';
3
+ import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
4
+ import { useIsFocused, useNavigation } from '@react-navigation/native';
5
+ import CPiechart from '../Custom/Charts/CPieChart';
6
+ import { Global } from '../../../../../src/Common/Global';
7
+ import { ArrayCheck, getLoading, isBNUL, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
8
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
9
+ import { APIURL } from '../../../../../src/Common/apiConstants';
10
+ import CText from '../CustomComponents/CText';
11
+ import { Icons } from '@jescon-technologies/react-native-ui-kit';;
12
+ import HHeading from '../HOC/HHeading';
13
+ import Loader from './Loader';
14
+ import CCard from './CCard';
15
+ import ABlink from '../Alerts/ABlink';
16
+ import SSearch from '../StaticComponents/SSearch';
17
+
18
+ const CWardStatus = (props) => {
19
+
20
+ const navigation = useNavigation();
21
+ const [isLoading, setIsLoading] = useState(false);
22
+ const [refresh, setRefresh] = useState(0);
23
+ const [filter, setFilter] = useState('');
24
+ const [chip, setChip] = useState(ValueCheck(Global.userData.hosuconsultant) && Global.userData.hosuconsultant > 0 ? false : true);
25
+ const [searchData, setSearchData] = useState('');
26
+ const [data, setData] = useState();
27
+ const sumArray = [];
28
+ const occupiedArray = [];
29
+ const TotalBeds = [];
30
+ const isFocused = useIsFocused();
31
+
32
+ useEffect(() => {
33
+ if (isFocused == true) {
34
+ Global.PatientDetails = null;
35
+ Global.ChartDataLeft = null;
36
+ Global.ChartDataAll = null;
37
+ Global.ChartDataLeft = null;
38
+ }
39
+ }, [isFocused]);
40
+
41
+ useEffect(() => {
42
+ getBedStatus();
43
+ }, []);
44
+
45
+ function getBedStatus() {
46
+ //Total Bed Status..............
47
+ let buttonapi = APIURL + 'emr/emrcommonget/rnhopabed';
48
+ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
49
+ setIsLoading(true);
50
+ NetworkServiceCall('get', buttonapi, '')
51
+ .then(function (response) {
52
+ if (response.httpstatus == 200 && response.data != null && response.data != undefined) {
53
+ setIsLoading(false);
54
+ setData(ArrayCheck(response.data.patientinformation) ? response.data.patientinformation.map((item) => ({ ...item, 'expand': true })) : []);
55
+ }
56
+ else {
57
+ setIsLoading(false);
58
+ notifyMessage('Occupancy not available,Please try again later', 4);
59
+ }
60
+ });
61
+
62
+ getLoading(v => setIsLoading(false));
63
+ }
64
+ var OccupiedData;
65
+ var DrNameFilter;
66
+ var HelperFun;
67
+ var arrayWith;
68
+ var piechartsearch;
69
+
70
+ if (data != undefined) {
71
+ DrNameFilter = data.map((element) => {
72
+ return {
73
+ ...element,
74
+ beddetails: element.beddetails.filter((subElement) => {
75
+ return subElement.hosuconsultant == Global.userData.hosuconsultant;
76
+ }),
77
+ };
78
+ });
79
+ OccupiedData = data.map((element) => {
80
+ return {
81
+ ...element,
82
+ beddetails: element.beddetails.filter((subElement) => {
83
+ return subElement.bedstatus == 1 || subElement.bedstatus == 0;
84
+ }),
85
+ };
86
+ });
87
+
88
+ arrayWith = DrNameFilter.filter(function (el) {
89
+ return el.beddetails.length > 0;
90
+ });
91
+
92
+ if (OccupiedData) {
93
+ OccupiedData.map((item, i) => {
94
+ TotalBeds.push(item.totalbeds);
95
+ occupiedArray.push(item.beddetails.length);
96
+ });
97
+ }
98
+
99
+ if (DrNameFilter) {
100
+ DrNameFilter.map((item, i) => {
101
+ sumArray.push(item.beddetails.length);
102
+ });
103
+ }
104
+
105
+ HelperFun = data.map((element) => {
106
+ return {
107
+ ...element,
108
+ beddetails: filter == 'WARD' ? element.beddetails : element.beddetails.filter(function (item) {
109
+ var badge = ValueCheck(item[getFilter(filter)]) ? item[getFilter(filter)] : '';
110
+ const dataItem = ' ' + badge + ' ';
111
+ const textData = searchData.toUpperCase();
112
+ return dataItem.indexOf(textData) > -1;
113
+ }),
114
+ };
115
+ });
116
+
117
+ piechartsearch = HelperFun.filter(function (el) {
118
+ return el.beddetails.length > 0;
119
+ });
120
+
121
+ var xxx = data.map((element) => {
122
+ return {
123
+ ...element,
124
+ beddetails: filter == 'WARD' ? element.beddetails : element.beddetails.filter(function (item) {
125
+ var patientname = ValueCheck(item.patientname) ? item.patientname : '';
126
+ var patientId = ValueCheck(item.patientno) ? item.patientno : '';
127
+ var badge = ValueCheck(item[getFilter(filter)]) ? item[getFilter(filter)] : '';
128
+ const dataItem = ' ' + badge + ' ' + patientname + ' ' + patientId;
129
+ const textData = searchData.toUpperCase();
130
+ return dataItem.indexOf(textData) > -1;
131
+ }),
132
+ };
133
+ }).filter(function (el) {
134
+ return el.beddetails.length > 0;
135
+ });
136
+ }
137
+
138
+ function getFilter(key) {
139
+ switch (key) {
140
+ case 'badgenumber':
141
+ return 'bedno';
142
+ case 'consultantname':
143
+ return 'admitteddoctor';
144
+ default:
145
+ return key;
146
+ }
147
+ }
148
+
149
+ function filterData() {
150
+ if (chip == true) {
151
+ setSearchData((Global.userData.hosuconsultant).toString());
152
+ setChip(!chip);
153
+ } else {
154
+ setSearchData('');
155
+ setChip(!chip);
156
+ }
157
+ }
158
+
159
+ function getExpand(params) {
160
+ params.expand = !params.expand;
161
+ setRefresh(refresh + 1);
162
+ }
163
+
164
+ function renderItem({ item }) {
165
+ TotalBeds.push(item.totalbeds);
166
+ return (
167
+ <View>
168
+ <HHeading
169
+ styles={{
170
+ 'iconname': 'bed',
171
+ 'bgcolor': '#f2efef',
172
+ 'iconsize': 14,
173
+ 'iconcolor': Global.AppTheme.primary_color,
174
+ 'displaytext': item.wardname,
175
+ 'textsize': 13,
176
+ 'textcolor': Global.AppTheme.primary_color,
177
+ }}
178
+ callBack={val => (val == undefined ? null : getExpand(item))}
179
+ />
180
+
181
+ {ArrayCheck(item.beddetails) && item.expand ?
182
+ <View style={{}}>
183
+ <View style={{ marginLeft: 10, flex: 1 }}>
184
+ <CCard
185
+ disabled={true}
186
+ filter={filter == 'consultantname' ? 'admitteddoctor' : filter}
187
+ search={filter == 'WARD' ? '' : searchData}
188
+ noscroll={true}
189
+ navigation={navigation}
190
+ data={(item.beddetails.map((Pdata, i) => ({
191
+ 'datalistid': i + 1,
192
+ 'bordercolor': '#143A81',
193
+ 'hopapatient': ValueCheck(Pdata.hopapatient) ? Pdata.hopapatient : 0,
194
+ 'verified': false,
195
+ 'homrpatientchartdetailstatus': 0,
196
+ 'homrpatientchart': 0,
197
+ 'profilecontent': [
198
+ {
199
+ 'patientno': ValueCheck(Pdata.patientno) ? (Pdata.patientno).toString() : '',
200
+ 'patientname': ValueCheck(Pdata.patientname) ? Pdata.patientname : '',
201
+ 'heading3': '',
202
+ 'patienttype': 'IP',
203
+ 'gender': Pdata.gender == 'F' ? 'FEMALE' : 'MALE',
204
+ 'age': ValueCheck(Pdata.age) ? Pdata.age : '',
205
+ 'mobileno': ValueCheck(Pdata.mobileno) ? Pdata.mobileno : '',
206
+ 'badgecolor': 'rgb(255,255,255)',
207
+ 'badgenumber': ValueCheck(Pdata.bedno) ? Pdata.bedno : '',
208
+ 'logo1': '',
209
+ 'place': ValueCheck(Pdata.place) ? Pdata.place : '',
210
+ 'clinicalunit': ValueCheck(Pdata.clinicalunit) ? Pdata.clinicalunit : '',
211
+ 'admitteddoctor': ValueCheck(Pdata.admitteddoctor) ? Pdata.admitteddoctor : '',
212
+ },
213
+ ],
214
+ 'centercontent': [
215
+ {
216
+ 'id': 1,
217
+ 'displaytext': ValueCheck(Pdata.place) ? Pdata.place : '',
218
+ 'iconname': 'home',
219
+ 'iconcolor': '#000000',
220
+ },
221
+ {
222
+ 'id': 3,
223
+ 'displaytext': ValueCheck(Pdata.clinicalunit) ? Pdata.clinicalunit : '',
224
+ 'iconname': 'hospital',
225
+ 'iconcolor': '#000000',
226
+ },
227
+ ],
228
+ 'rightcontent': [
229
+ {
230
+ 'contentid': 1,
231
+ 'displaytext': 'Last Visited',
232
+ 'value': ValueCheck(Pdata.lastvisited) ? Pdata.lastvisited : '',
233
+ },
234
+ ],
235
+ 'leftcontent': [
236
+ {
237
+ 'contentid': 1,
238
+ 'displaytext': 'Last Visited',
239
+ 'value': '',
240
+ },
241
+ ],
242
+ })))}
243
+ />
244
+ </View>
245
+ </View> : null}
246
+
247
+ {item.totalbeds != undefined && item.vaccant != undefined && item.filled != undefined && chip ?
248
+ <View style={{ flexDirection: 'row' }}>
249
+ <CPiechart
250
+ data={[{ 'value': item.totalbeds },
251
+ { 'value': item.totalbeds - (item.beddetails).length },
252
+ { 'value': (item.beddetails).length },
253
+ { 'value': item.display }]}
254
+ style={{ 'innerRadius': 30, 'outerRadius': 60, 'labelRadius': 80, 'height': 0.25 }} />
255
+ <View style={{ flex: 1, justifyContent: 'center' }}>
256
+ {['Total Beds', 'Vaccant Beds', 'Occupied Beds'].map((display, p) => {
257
+ return (
258
+ <View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
259
+ <View style={{ width: normalize(15), height: normalize(15), backgroundColor: getPieColor(p), borderRadius: 5, marginHorizontal: 10 }} />
260
+ <Text style={{ fontSize: normalize(12) }}>{ValueCheck(display) ? display.toUpperCase() : ''}</Text>
261
+ <CText style={{ fontSize: normalize(12), color: 'black', fontWeight: 'bold', color: 'white' }}>{ValueCheck(display) ? display.toUpperCase() : ''}</CText>
262
+ </View>);
263
+ })}
264
+ </View>
265
+ </View> : null}
266
+ </View>
267
+ );
268
+ }
269
+
270
+ function getPieColor(params) {
271
+ switch (params) {
272
+ case 0: return 'blue';
273
+ case 2: return '#cf0404';
274
+ case 1: return 'green';
275
+ default: return 'black';
276
+ }
277
+ }
278
+
279
+ function fnData() {
280
+
281
+ if (chip) {
282
+ if (chip && filter == 'WARD') {
283
+ return data.filter(function (item) {
284
+ var wardname = ValueCheck(item.wardname) ? item.wardname : '';
285
+ const dataItem = wardname;
286
+ const textData = searchData.toUpperCase();
287
+ return dataItem.indexOf(textData) > -1;
288
+ });
289
+ }
290
+ else {
291
+ return xxx;
292
+ }
293
+ }
294
+ else {
295
+ return arrayWith;
296
+ }
297
+
298
+ }
299
+
300
+ return (
301
+ <View style={{ flex: 1, marginTop: normalize(-2) }}>
302
+
303
+ <HHeading
304
+ styles={{
305
+ 'iconname': 'bed',
306
+ 'bgcolor': '#f2efef',
307
+ 'iconsize': 16,
308
+ 'iconcolor': Global.AppTheme.primary_color,
309
+ 'displaytext': 'Occupancy',
310
+ 'textsize': 15,
311
+ 'textcolor': Global.AppTheme.primary_color,
312
+ }}
313
+ callBack={val => (val == undefined ? null : console.log(val))} />
314
+
315
+ {isLoading ? <Loader displaytext={true} /> : null}
316
+
317
+ <View style={{ marginTop: 5, justifyContent: 'space-evenly', paddingHorizontal: normalize(5), flexDirection: 'row-reverse', alignItems: 'center' }}>
318
+
319
+
320
+ <TouchableOpacity
321
+ onPress={() => filterData()}
322
+ style={{ alignItems: 'center' }}>
323
+ <Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: 'black' }}>{'ALL'}</Text>
324
+ <View style={{
325
+ width: normalize(50), height: normalize(45), alignItems: 'center', borderColor: 'black',
326
+ borderRadius: normalize(45) / 2, justifyContent: 'center', borderWidth: 3, backgroundColor: chip ? '#eae5e5' : '#fff',
327
+ }}>
328
+ <View style={{ alignItems: 'center' }}>
329
+ <ABlink>
330
+ <Icons.FontAwesome5 name="hand-point-down" color={Global.AppTheme.primary_color} size={normalize(13)} />
331
+ </ABlink>
332
+ <Text style={{ fontWeight: '700', color: 'black', fontSize: normalize(15) }}>{TotalBeds.reduce((partial_sum, a) => partial_sum + a, 0)}</Text>
333
+ </View>
334
+ </View>
335
+ </TouchableOpacity>
336
+
337
+ {/* {chip ? */}
338
+ <View style={{ alignItems: 'center' }}>
339
+ <Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: 'black' }}>{'VACCANT'}</Text>
340
+ <View style={{
341
+ width: normalize(50), height: normalize(45), alignItems: 'center', borderColor: 'green',
342
+ borderRadius: normalize(45) / 2, justifyContent: 'center', borderWidth: 3,
343
+ }}>
344
+ <Icons.FontAwesome5 name="bed" color={Global.AppTheme.primary_color} size={normalize(13)} />
345
+ <Text style={{ fontWeight: '700' }}>{(TotalBeds.reduce((partial_sum, a) => partial_sum + a, 0)) -
346
+ (occupiedArray.reduce((partial_sum, a) => partial_sum + a, 0))}</Text>
347
+ </View>
348
+ </View>
349
+ {/* : null} */}
350
+
351
+ {!chip ?
352
+ <View style={{ alignItems: 'center' }}>
353
+ <Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: 'black' }}>{chip ? 'TOTAL BEDS' : 'IP ' + '[' + Global.userData.username + ']'}</Text>
354
+ <View style={{
355
+ width: normalize(50), height: normalize(45), alignItems: 'center', borderColor: chip ? 'blue' : Global.AppTheme.primary_color,
356
+ borderRadius: normalize(45) / 2, justifyContent: 'center', borderWidth: 3, backgroundColor: chip ? '#fff' : '#eae5e5',
357
+ }}>
358
+ <Icons.FontAwesome5 name="bed" color={Global.AppTheme.primary_color} size={normalize(13)} />
359
+ <Text style={{ fontWeight: '700', color: chip ? 'black' : Global.AppTheme.primary_color, fontSize: normalize(15) }}>{chip ? TotalBeds.reduce((partial_sum, a) => partial_sum + a, 0) : sumArray.reduce((partial_sum, a) => partial_sum + a, 0)}</Text>
360
+ </View>
361
+ </View> : null}
362
+
363
+ {chip ?
364
+ <View style={{ alignItems: 'center' }}>
365
+ <Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: 'black' }}>{'OCCUPIED'}</Text>
366
+ <View style={{
367
+ width: normalize(50), height: normalize(45), alignItems: 'center', borderColor: '#cf0404',
368
+ borderRadius: normalize(45) / 2, justifyContent: 'center', borderWidth: 3,
369
+ }}>
370
+ <Icons.FontAwesome5 name="bed" color={Global.AppTheme.primary_color} size={normalize(13)} />
371
+ <Text style={{ fontWeight: '700' }}>{occupiedArray.reduce((partial_sum, a) => partial_sum + a, 0)}</Text>
372
+ </View>
373
+ </View> : null}
374
+ </View>
375
+
376
+ <SSearch
377
+ editable={true}
378
+ dropdownapi={'emr/emrcommonget/rnlasearchdropdown 2'}
379
+ value={searchData}
380
+ dropdownarray={[
381
+ {
382
+ 'datavalue': 2,
383
+ 'iconname': 'hospital-o',
384
+ 'displayvalue': 'WARD',
385
+ 'searchparam': 'WARD',
386
+ 'selected': false,
387
+ },
388
+ {
389
+ 'datavalue': 9,
390
+ 'iconname': 'user-md',
391
+ 'displayvalue': 'DOCTOR',
392
+ 'searchparam': 'admitteddoctor',
393
+ 'selected': false,
394
+ },
395
+ {
396
+ 'datavalue': 1,
397
+ 'iconname': 'bed',
398
+ 'displayvalue': 'BED NO.',
399
+ 'searchparam': 'badgenumber',
400
+ 'selected': false,
401
+ },
402
+ {
403
+ 'datavalue': 3,
404
+ 'iconname': 'location-arrow',
405
+ 'displayvalue': 'PLACE',
406
+ 'searchparam': 'place',
407
+ 'selected': false,
408
+ },
409
+ {
410
+ 'datavalue': 4,
411
+ 'iconname': 'mobile',
412
+ 'displayvalue': 'MOBILE NO.',
413
+ 'searchparam': 'mobileno',
414
+ 'selected': false,
415
+ },
416
+ {
417
+ 'datavalue': 5,
418
+ 'iconname': 'th-list',
419
+ 'displayvalue': 'CLINIC',
420
+ 'searchparam': 'clinicalunit',
421
+ 'selected': false,
422
+ }]}
423
+ onChangeText={text => (
424
+ console.log('onChangeText.......'),
425
+ setSearchData(text)
426
+ )}
427
+ onChangeData={val => val == undefined ? null : (
428
+ console.log('onChangeData............', val.searchparam),
429
+ setFilter(val.searchparam)
430
+ )}
431
+ />
432
+ {isBNUL(fnData()) ?
433
+ <FlatList
434
+ data={fnData()}
435
+ style={{ width: '100%' }}
436
+ renderItem={renderItem}
437
+ keyExtractor={(item, index) => 'key' + index}
438
+ initialNumToRender={3}
439
+ />
440
+ : null}
441
+ </View>
442
+ );
443
+ };
444
+ export default CWardStatus;