@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.
- package/index.d.ts +66 -0
- package/index.js +3 -7
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +4 -4
- package/src/Alerts/AAlertIOS.js +3 -3
- package/src/{common → Common}/NetworkServiceCall.js +1 -1
- package/src/CommonStyle/CommonTheme.js +11 -0
- package/src/CommonStyle/ComponentFunctions.js +632 -0
- package/src/CommonStyle/PopupStyle.js +146 -0
- package/src/CommonStyle/commonStyle.js +93 -0
- package/src/CommonStyle/componentStyle.js +545 -0
- package/src/CommonStyle/optionListStyles.js +175 -0
- package/src/Components/ByProductPage.js +200 -0
- package/src/Components/CDropDownListNew.js +153 -0
- package/src/Components/CSupplierList.js +88 -0
- package/src/Components/CVerificationCard.js +2822 -0
- package/src/Components/CustomButton.js +67 -0
- package/src/Components/CustomCard.js +127 -0
- package/src/Components/CustomTextInput.js +47 -0
- package/src/Components/EquipmentPage.js +313 -0
- package/src/Components/FilterInput.Copy.js +723 -0
- package/src/Components/FilterInput.js +569 -0
- package/src/Components/HSubHeading.js +68 -0
- package/src/Components/HeaderCard.js +40 -0
- package/src/Components/MoreOptionsScreen.js +251 -0
- package/src/Components/NonSwipableProductCard.js +226 -0
- package/src/Components/NonSwipableSupplierCard.js +348 -0
- package/src/Components/ProductCard.js +1336 -0
- package/src/Components/QualityProductCard.js +1059 -0
- package/src/Components/RateProductCard.js +1452 -0
- package/src/Components/RawMaterial.js +261 -0
- package/src/Components/SDropDownEdited.js +549 -0
- package/src/Components/SDropDownNew.js +529 -0
- package/src/Components/SHelpDescription.js +147 -0
- package/src/Components/STextInputNew.js +510 -0
- package/src/Components/SearchProductCard.js +470 -0
- package/src/Components/StageByProduct.js +199 -0
- package/src/Components/SupplierCard.js +243 -0
- package/src/Components/SupplierInvoiceCard.js +405 -0
- package/src/Components/SwipableSupplierCard.js +136 -0
- package/src/Components/TagTemplate.js +74 -0
- package/src/Components/WrappedComponent.js +25 -0
- package/src/Custom/CBooking.js +944 -0
- package/src/Custom/CBookingPostpone.js +1822 -0
- package/src/Custom/CCalendar.js +560 -0
- package/src/Custom/CCard.js +880 -0
- package/src/Custom/CDetailCard.js +205 -0
- package/src/Custom/CHelpImage.js +52 -0
- package/src/Custom/CReport.js +569 -0
- package/src/Custom/CScrollView.js +73 -0
- package/src/Custom/CSignature.js +112 -0
- package/src/Custom/CSliderMenu.js +339 -0
- package/src/Custom/CSupplierCard.js +99 -0
- package/src/Custom/CTemplateCard.js +438 -0
- package/src/Custom/CTokenAllocation.js +1402 -0
- package/src/Custom/CTokenListOverlay.js +122 -0
- package/src/Custom/CWardStatus.js +444 -0
- package/src/Custom/Charts/CBarChart.js +218 -0
- package/src/Custom/Charts/CDashBoardList.js +133 -0
- package/src/Custom/Charts/CDashBoardTable.js +172 -0
- package/src/Custom/Charts/CLineChart.js +193 -0
- package/src/Custom/Charts/CPieChart.js +186 -0
- package/src/Custom/Loader.js +182 -0
- package/src/Custom/OUserView.js +1121 -0
- package/src/Custom/PreviewDosage.js +115 -0
- package/src/Custom/SearchLoader.js +32 -0
- package/src/Custom/TableComponent/CActivityTable.js +707 -0
- package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
- package/src/Custom/TableComponent/CTable.js +185 -0
- package/src/Custom/TableComponent/CTextBody.js +40 -0
- package/src/Custom/TableComponent/CTextHeader.js +17 -0
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
- package/src/Custom/TableComponent/SDropdownTable.js +491 -0
- package/src/Custom/TableComponent/TagTable.js +1200 -0
- package/src/CustomComponents/CAddColumn.js +140 -0
- package/src/CustomComponents/CAssessmentDelete.js +307 -0
- package/src/CustomComponents/CAwesomeButton.js +83 -0
- package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
- package/src/CustomComponents/CBackHandler.js +273 -0
- package/src/CustomComponents/CCalendar.js +243 -0
- package/src/CustomComponents/CCommentOverlay.js +202 -0
- package/src/CustomComponents/CComments.js +162 -0
- package/src/CustomComponents/CContainerView.js +24 -0
- package/src/CustomComponents/CCustomTextInput.js +336 -0
- package/src/CustomComponents/CDetailView.js +40 -0
- package/src/CustomComponents/CDropDownList.js +153 -0
- package/src/CustomComponents/CDropdownSelect.js +555 -0
- package/src/CustomComponents/CFooterView.js +42 -0
- package/src/CustomComponents/CImagePickerSave.js +316 -0
- package/src/CustomComponents/CModalOverlay.js +91 -0
- package/src/CustomComponents/CNetworkStatus.js +327 -0
- package/src/CustomComponents/CNotesInstructions.js +1000 -0
- package/src/CustomComponents/COverlay.js +81 -0
- package/src/CustomComponents/CRemarks.js +176 -0
- package/src/CustomComponents/CRowAdd.js +143 -0
- package/src/CustomComponents/CSummaryDropDown.js +327 -0
- package/src/CustomComponents/CText.js +9 -0
- package/src/CustomComponents/CVectorIcon.js +34 -0
- package/src/CustomComponents/HtmlContentViewer.js +65 -0
- package/src/CustomComponents/PdfContentViewer.js +90 -0
- package/src/CustomComponents/SDropDownDosage.js +1087 -0
- package/src/CustomComponents/SwipableProductCard.js +246 -0
- package/src/CustomComponents/SwipableProductImageCard.js +254 -0
- package/src/CustomComponents/WorkOrderDetails.js +1216 -0
- package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
- package/src/HOC/ConfirmOverlay.js +2 -2
- package/src/HOC/HMoreButton.js +1 -1
- package/src/HOC/HNatureHeading.js +1 -1
- package/src/HOC/HShadowButton.js +1 -1
- package/src/HOC/HShadowCountButton.js +1 -1
- package/src/Json/Chart.json +818 -0
- package/src/Json/Consultation.json +622 -0
- package/src/Json/CreditBill.json +490 -0
- package/src/Json/Dropdown.json +216 -0
- package/src/Json/DropdownConsultation.json +228 -0
- package/src/Json/DynamicReports.json +623 -0
- package/src/Json/Footer.json +79 -0
- package/src/Media/AudioScreen.js +2 -7
- package/src/Media/CCaptureImageWithoutEdit.js +1 -1
- package/src/Media/CImageGallery.js +2 -2
- package/src/Media/CSingleImage.js +2 -2
- package/src/Media/CVideoPlay.js +1 -1
- package/src/Media/DocumentScreen.js +2 -7
- package/src/Media/DrawingScreen.js +2 -6
- package/src/Media/ImageScreen.js +2 -6
- package/src/Media/RecordAudio.js +1 -1
- package/src/Media/VideoScreen.js +2 -7
- package/src/Navigation/PageNavigation.js +224 -0
- package/src/Navigation/useFocusEffect.js +2 -0
- package/src/Navigation/useFocusEffect.native.js +1 -0
- package/src/Navigation/useFocusEffect.web.js +1 -0
- package/src/Navigation/useIsFocused.js +1 -0
- package/src/Navigation/useIsFocused.native.js +1 -0
- package/src/Navigation/useIsFocused.web.js +1 -0
- package/src/Navigation/useNavigation.js +2 -0
- package/src/Navigation/useNavigation.native.js +1 -0
- package/src/Navigation/useNavigation.web.js +1 -0
- package/src/Screens/CMedications.js +528 -0
- package/src/Screens/CWebViewGallery.js +203 -0
- package/src/Screens/ChartScan.js +279 -0
- package/src/Screens/ChartScreenNew.js +1579 -0
- package/src/Screens/Consultation.js +1500 -0
- package/src/Screens/Dashboard.js +778 -0
- package/src/Screens/FileExplorer.js +288 -0
- package/src/Screens/Footer.js +340 -0
- package/src/Screens/ForgotPassword.js +288 -0
- package/src/Screens/HeaderBlock.js +353 -0
- package/src/Screens/Login.js +328 -0
- package/src/Screens/Notification.js +149 -0
- package/src/Screens/OcrScreen.js +20 -0
- package/src/Screens/PdfPreview.js +507 -0
- package/src/Screens/RegistrationDetails.js +467 -0
- package/src/Screens/SearchScreen.js +582 -0
- package/src/Screens/Splash.js +788 -0
- package/src/Screens/SwipeLeftView.js +1867 -0
- package/src/StaticComponents/SDatePickerLabel.js +1 -1
- package/src/StaticComponents/SDatePickerNew.js +1 -1
- package/src/StaticComponents/SDateTimePickerNew.js +2 -2
- package/src/StaticComponents/SDropDownGenerate.js +3 -3
- package/src/StaticComponents/SDropDownHoc.js +4 -4
- package/src/StaticComponents/SDropDownIcon.js +1 -1
- package/src/StaticComponents/SMenuBox.js +2 -2
- package/src/StaticComponents/SSearch.js +2 -2
- package/src/StaticComponents/STextInput.js +1 -1
- package/src/StaticComponents/STimePicker.js +1 -1
- package/src/StaticComponents/STimingDropDownNew.js +2 -6
- package/src/StaticComponents/STimingSwitch.js +1 -1
- package/src/layout/CContainerView.js +1 -1
- package/src/layout/CDetailView.js +3 -3
- package/src/layout/HeaderBlock.js +5 -5
- package/src/layout/INVLoginLayout.js +3 -4
- package/src/layout/Loader.js +2 -2
- package/src/HOC/HAbsolute.js +0 -56
- package/src/HOC/HDiscontinue.js +0 -105
- package/src/HOC/HOverlay.js +0 -99
- package/src/layout/FooterBlock.js +0 -821
- /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
- /package/src/{common → Common}/Icons.js +0 -0
|
@@ -0,0 +1,560 @@
|
|
|
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;
|