@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.
- package/dist/Common/ErrorBoundary.d.ts +15 -0
- package/dist/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/Common/ErrorBoundary.js +64 -0
- package/dist/Common/ErrorBoundary.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Common/ErrorBoundary.d.ts +15 -0
- package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/Common/ErrorBoundary.js +64 -0
- package/dist/src/Common/ErrorBoundary.js.map +1 -0
- package/package.json +17 -5
- package/.gitattributes +0 -2
- package/index.d.ts +0 -66
- package/index.js +0 -66
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/ErrorBoundary.tsx +0 -73
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,528 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
|
2
|
-
import { Text, View, TouchableOpacity, FlatList, StyleSheet, ActivityIndicator, TextInput, TouchableWithoutFeedback, Dimensions, } from 'react-native';
|
|
3
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
4
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
-
import SCheckBox from '../StaticComponents/SCheckBox';
|
|
6
|
-
import { debounce } from 'lodash';
|
|
7
|
-
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
8
|
-
import NetworkServiceCall from '../Common/NetworkServiceCall';
|
|
9
|
-
import HOCIcons from '../HOC/HOCIcons';
|
|
10
|
-
import CCommentOverlay from '../CustomComponents/CCommentOverlay';
|
|
11
|
-
import { isBNU, isBNUL, isNU } from '../CommonStyle/ComponentFunctions';
|
|
12
|
-
import moment from 'moment';
|
|
13
|
-
import CTextHeader from '../Custom/TableComponent/CTextHeader';
|
|
14
|
-
|
|
15
|
-
const CMedications = ({ data: initialData, callback }) => {
|
|
16
|
-
|
|
17
|
-
const navigation = useNavigation();
|
|
18
|
-
const [data, setData] = useState(initialData); // Tab state
|
|
19
|
-
const [medicationData, setMedicationData] = useState([]); // Fetched data
|
|
20
|
-
const [loading, setLoading] = useState(true); // Loading state
|
|
21
|
-
const [refresh, setRefresh] = useState(0)
|
|
22
|
-
|
|
23
|
-
useEffect(() => {
|
|
24
|
-
|
|
25
|
-
const fetchData = async () => {
|
|
26
|
-
|
|
27
|
-
setLoading(true);
|
|
28
|
-
try {
|
|
29
|
-
const buttonapi = initialData.item.profilecontent[0].prescriptionmedicationurl;
|
|
30
|
-
console.log('useeffect buttonapi', buttonapi);
|
|
31
|
-
const response = await NetworkServiceCall('get', buttonapi, '');
|
|
32
|
-
if (response.httpstatus === 200 && response.data?.medicationdata) {
|
|
33
|
-
// console.log('response', JSON.stringify(response));
|
|
34
|
-
setMedicationData(response.data.medicationdata);
|
|
35
|
-
}
|
|
36
|
-
} catch (error) {
|
|
37
|
-
console.error('Error fetching medication data:', error);
|
|
38
|
-
} finally {
|
|
39
|
-
setLoading(false);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
fetchData();
|
|
44
|
-
}, []);
|
|
45
|
-
|
|
46
|
-
const handleCheckboxChange = (checked, sectionIndex, category, itemIndex) => {
|
|
47
|
-
|
|
48
|
-
setMedicationData(prevData => {
|
|
49
|
-
const updatedData = prevData.map((section, secIndex) => {
|
|
50
|
-
if (secIndex !== sectionIndex) return section;
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
...section,
|
|
54
|
-
[category]: section[category].map((item, idx) =>
|
|
55
|
-
idx === itemIndex ? { ...item, status: checked } : item,
|
|
56
|
-
),
|
|
57
|
-
};
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Group selected items and send back via callback
|
|
61
|
-
const groupedSelectedItems = updatedData.map(section => {
|
|
62
|
-
const grouped = {};
|
|
63
|
-
Object.keys(section).forEach(cat => {
|
|
64
|
-
if (Array.isArray(section[cat])) {
|
|
65
|
-
const selectedItems = section[cat].filter(item => item.status);
|
|
66
|
-
if (selectedItems.length > 0) {
|
|
67
|
-
grouped[cat] = selectedItems;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
return grouped;
|
|
72
|
-
}).filter(group => Object.keys(group).length > 0);
|
|
73
|
-
|
|
74
|
-
callback?.({
|
|
75
|
-
'savetype': category,
|
|
76
|
-
'array': groupedSelectedItems
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
return updatedData;
|
|
80
|
-
});
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const handleRemarkChange = useMemo(() => debounce((remark, sectionIndex, category, itemIndex) => {
|
|
84
|
-
setMedicationData(prevData =>
|
|
85
|
-
prevData.map((section, secIndex) => {
|
|
86
|
-
if (secIndex !== sectionIndex) return section;
|
|
87
|
-
return {
|
|
88
|
-
...section,
|
|
89
|
-
[category]: section[category].map((item, idx) =>
|
|
90
|
-
idx === itemIndex ?
|
|
91
|
-
{
|
|
92
|
-
...item,
|
|
93
|
-
remark
|
|
94
|
-
}
|
|
95
|
-
: item,
|
|
96
|
-
),
|
|
97
|
-
};
|
|
98
|
-
}),
|
|
99
|
-
);
|
|
100
|
-
}, 500),
|
|
101
|
-
[],
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
const handleTabChange = async index => {
|
|
105
|
-
|
|
106
|
-
setLoading(true);
|
|
107
|
-
setData(prevData => {
|
|
108
|
-
const updatedata = {
|
|
109
|
-
...prevData,
|
|
110
|
-
item: {
|
|
111
|
-
...prevData.item,
|
|
112
|
-
medication: prevData.item.medication.map((val, i) => ({
|
|
113
|
-
...val,
|
|
114
|
-
selected: i === index,
|
|
115
|
-
})),
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
return updatedata
|
|
119
|
-
});
|
|
120
|
-
callback?.([]);
|
|
121
|
-
|
|
122
|
-
const buttonapi = index == 0 /* PRESCRIPTION */ ? data.item.profilecontent[0].prescriptionmedicationurl : index == 1 /* PATIENT SERVICE */ ? data.item.profilecontent[0].psmedicationurl : index == 2 /* DIET */ ? data.item.profilecontent[0].dietmedicationurl : '';
|
|
123
|
-
console.log('handleTabChange', index, buttonapi);
|
|
124
|
-
const response = await NetworkServiceCall('get', buttonapi, '');
|
|
125
|
-
if (response.httpstatus === 200 && response.data?.medicationdata) {
|
|
126
|
-
setMedicationData(response.data.medicationdata);
|
|
127
|
-
}
|
|
128
|
-
setLoading(false);
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
const renderEachMedication = useCallback(({ item, category, sectionIndex, itemIndex }) => (
|
|
132
|
-
|
|
133
|
-
// console.log(' prescription PatientService diet', JSON.stringify(category)),
|
|
134
|
-
|
|
135
|
-
<SwipeRow
|
|
136
|
-
key={`swipe-row-${sectionIndex}-${itemIndex}`}
|
|
137
|
-
swipeToOpenPercent={1}
|
|
138
|
-
swipeToClosePercent={1}
|
|
139
|
-
leftOpenValue={normalize(190)}
|
|
140
|
-
rightOpenValue={- normalize(100)}
|
|
141
|
-
>
|
|
142
|
-
|
|
143
|
-
{/* Swipe back (hidden) view */}
|
|
144
|
-
<View style={{
|
|
145
|
-
borderWidth: 0.5,
|
|
146
|
-
borderColor: 'lightgrey',
|
|
147
|
-
flexDirection: 'row',
|
|
148
|
-
backgroundColor: 'white',
|
|
149
|
-
justifyContent: 'space-between'
|
|
150
|
-
}}>
|
|
151
|
-
<TouchableOpacity
|
|
152
|
-
style={{
|
|
153
|
-
justifyContent: 'center',
|
|
154
|
-
alignItems: 'center',
|
|
155
|
-
height: '100%',
|
|
156
|
-
backgroundColor: Global.AppTheme.primary_color
|
|
157
|
-
}}
|
|
158
|
-
onPress={() => (
|
|
159
|
-
navigation.navigate('CHistoryScreen', {
|
|
160
|
-
data: item,
|
|
161
|
-
screentype: 1,
|
|
162
|
-
link: item.historyurl
|
|
163
|
-
}),
|
|
164
|
-
(Global.PatientDetails = {
|
|
165
|
-
...data.item,
|
|
166
|
-
medication: null
|
|
167
|
-
})
|
|
168
|
-
)}>
|
|
169
|
-
<HOCIcons.Icons
|
|
170
|
-
icongroup={5}
|
|
171
|
-
size={normalize(25)}
|
|
172
|
-
name={'notes-medical'}
|
|
173
|
-
color={'white'}
|
|
174
|
-
style={{ paddingHorizontal: normalize(3) }}
|
|
175
|
-
/>
|
|
176
|
-
<Text style={{ color: 'white', fontWeight: 'normal', fontSize: normalize(8), textAlign: 'center', paddingHorizontal: normalize(4) }}>{category}{" History"}</Text>
|
|
177
|
-
</TouchableOpacity>
|
|
178
|
-
<TouchableOpacity
|
|
179
|
-
style={{
|
|
180
|
-
justifyContent: 'center',
|
|
181
|
-
alignItems: 'center',
|
|
182
|
-
height: '100%',
|
|
183
|
-
backgroundColor: Global.AppTheme.primary_color
|
|
184
|
-
}}
|
|
185
|
-
onPress={() => {
|
|
186
|
-
(navigation.navigate('CHistoryScreen', {
|
|
187
|
-
data: item,
|
|
188
|
-
screentype: 2,
|
|
189
|
-
link: item.medicationhistoryurl
|
|
190
|
-
}),
|
|
191
|
-
(Global.PatientDetails = {
|
|
192
|
-
...data.item,
|
|
193
|
-
medication: null
|
|
194
|
-
}))
|
|
195
|
-
}}
|
|
196
|
-
>
|
|
197
|
-
<HOCIcons.Icons
|
|
198
|
-
icongroup={3}
|
|
199
|
-
size={normalize(25)}
|
|
200
|
-
name={'text-box-check-outline'}
|
|
201
|
-
color={'white'}
|
|
202
|
-
style={{ paddingHorizontal: normalize(3) }}
|
|
203
|
-
/>
|
|
204
|
-
<Text style={{ color: 'white', fontWeight: 'normal', fontSize: normalize(8), textAlign: 'center', paddingHorizontal: normalize(4) }}>{"Medication History"}</Text>
|
|
205
|
-
</TouchableOpacity>
|
|
206
|
-
</View >
|
|
207
|
-
|
|
208
|
-
{/* Visible medication item */}
|
|
209
|
-
< TouchableWithoutFeedback >
|
|
210
|
-
<View style={styles.medicationContainer}>
|
|
211
|
-
<View style={{ flexDirection: 'row', width: '100%', }}>
|
|
212
|
-
<View style={{ borderWidth: 0.5, borderColor: 'grey', width: '55%', justifyContent: 'center', alignItems: 'flex-start' }}>
|
|
213
|
-
<View style={{ flexDirection: 'row' }}>
|
|
214
|
-
<SCheckBox
|
|
215
|
-
data={{ value: item.status }}
|
|
216
|
-
callBack={value => handleCheckboxChange(value, sectionIndex, category, itemIndex)}
|
|
217
|
-
/>
|
|
218
|
-
<View style={{ flex: 1, borderWidth: 0, justifyContent: 'center', alignItems: 'center' }}>
|
|
219
|
-
<Text adjustsFontSizeToFit numberOfLines={3} style={{ fontSize: normalize(10), textAlign: 'left', fontWeight: 'bold', color: Global.AppTheme.primary_color }}>
|
|
220
|
-
{item.product || 'N/A'}
|
|
221
|
-
</Text>
|
|
222
|
-
</View>
|
|
223
|
-
</View>
|
|
224
|
-
<View style={{ borderTopWidth: 0, borderColor: 'grey', width: '100%', flexDirection: 'row', alignItems: 'center', marginVertical: normalize(5) }}>
|
|
225
|
-
<HOCIcons.Icons
|
|
226
|
-
icongroup={10}
|
|
227
|
-
size={normalize(10)}
|
|
228
|
-
name={'info'}
|
|
229
|
-
color={'grey'}
|
|
230
|
-
style={{ paddingHorizontal: normalize(3) }}
|
|
231
|
-
/>
|
|
232
|
-
<Text adjustsFontSizeToFit numberOfLines={3} style={{ fontSize: normalize(9), color: 'black', fontWeight: 'bold' }}>
|
|
233
|
-
{" "}{item.description || 'No description'}
|
|
234
|
-
</Text>
|
|
235
|
-
</View>
|
|
236
|
-
</View>
|
|
237
|
-
<View style={{ borderWidth: 0.5, borderColor: 'grey', width: '25%', justifyContent: 'center', alignItems: 'flex-start' }}>
|
|
238
|
-
<Text style={{ fontSize: normalize(10), color: 'black', fontWeight: 'bold', textAlign: 'left', paddingLeft: normalize(5) }}>{" "}{item.medicationdate || ' '}</Text>
|
|
239
|
-
<Text style={{ fontSize: normalize(10), color: 'black', fontWeight: 'bold', textAlign: 'left', paddingLeft: normalize(5) }}>{" "}{moment(item.medicinetime, 'HH:mm:ss').format('h:mm A') || ' '}</Text>
|
|
240
|
-
</View>
|
|
241
|
-
<View style={{ borderWidth: 0.5, borderColor: 'grey', width: '20%', justifyContent: 'center', alignItems: 'center' }}>
|
|
242
|
-
<View style={{
|
|
243
|
-
width: '100%',
|
|
244
|
-
height: 'auto',
|
|
245
|
-
justifyContent: 'center',
|
|
246
|
-
alignItems: 'center',
|
|
247
|
-
borderWidth: 0
|
|
248
|
-
}}>
|
|
249
|
-
<TouchableOpacity
|
|
250
|
-
onPress={() => {
|
|
251
|
-
item.remarksoverlay = !item.remarksoverlay;
|
|
252
|
-
setRefresh(refresh + 1);
|
|
253
|
-
}}
|
|
254
|
-
style={{
|
|
255
|
-
backgroundColor: 'white',
|
|
256
|
-
elevation: 0,
|
|
257
|
-
borderWidth: 0,
|
|
258
|
-
borderRadius: 0,
|
|
259
|
-
borderColor: 'lightgrey',
|
|
260
|
-
flexDirection: 'row',
|
|
261
|
-
alignItems: 'center',
|
|
262
|
-
justifyContent: 'flex-start',
|
|
263
|
-
width: '100%',
|
|
264
|
-
height: 'auto'
|
|
265
|
-
}}>
|
|
266
|
-
<HOCIcons.MaterialCommunityIcons
|
|
267
|
-
name={'comment'}
|
|
268
|
-
size={normalize(10)}
|
|
269
|
-
color={Global.AppTheme.primary_color}
|
|
270
|
-
style={{
|
|
271
|
-
paddingHorizontal: normalize(3)
|
|
272
|
-
}}
|
|
273
|
-
/>
|
|
274
|
-
<Text adjustsFontSizeToFit numberOfLines={1} style={{ paddingRight: normalize(3), fontSize: normalize(8), color: 'black', fontWeight: 'bold' }}>{isNU(item.remark) ? item.remark : null}</Text>
|
|
275
|
-
</TouchableOpacity>
|
|
276
|
-
{item.remarksoverlay ?
|
|
277
|
-
<CCommentOverlay
|
|
278
|
-
disabled={false}
|
|
279
|
-
icon={{
|
|
280
|
-
'name': 'badge-account',
|
|
281
|
-
'icongroup': 3,
|
|
282
|
-
'size': normalize(15),
|
|
283
|
-
'style': {
|
|
284
|
-
marginHorizontal: normalize(10)
|
|
285
|
-
}
|
|
286
|
-
}}
|
|
287
|
-
footericon={{
|
|
288
|
-
'name': 'select1',
|
|
289
|
-
'icongroup': 1,
|
|
290
|
-
'color': Global.AppTheme.primary_color,
|
|
291
|
-
'size': normalize(25),
|
|
292
|
-
'style': {
|
|
293
|
-
marginHorizontal: normalize(10)
|
|
294
|
-
}
|
|
295
|
-
}}
|
|
296
|
-
footerbuttontext={'Select'}
|
|
297
|
-
heading={'REMARKS'}
|
|
298
|
-
overlaystyle={{
|
|
299
|
-
borderRadius: 10,
|
|
300
|
-
height: Dimensions.get('window').height * 0.38,
|
|
301
|
-
borderWidth: 0,
|
|
302
|
-
borderColor: 'darkblue',
|
|
303
|
-
alignSelf: 'center',
|
|
304
|
-
width: Dimensions.get('screen').width * 1,
|
|
305
|
-
alignItems: 'center',
|
|
306
|
-
justifyContent: 'flex-start',
|
|
307
|
-
padding: 0,
|
|
308
|
-
backgroundColor: 'transparent',
|
|
309
|
-
position: 'absolute',
|
|
310
|
-
bottom: 0
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}}
|
|
314
|
-
data={isNU(item.remark) ? item.remark : null}
|
|
315
|
-
callback={val => {
|
|
316
|
-
// console.log('callback from overlay');
|
|
317
|
-
}}
|
|
318
|
-
onsavecallback={val => {
|
|
319
|
-
handleRemarkChange(val, sectionIndex, category, itemIndex)
|
|
320
|
-
// item.remark = val;
|
|
321
|
-
item.remarksoverlay = false;
|
|
322
|
-
setRefresh(refresh + 1);
|
|
323
|
-
}}
|
|
324
|
-
OverlayClose={val => {
|
|
325
|
-
item.remarksoverlay = !item.remarksoverlay;
|
|
326
|
-
// item.remarksoverlay = false;
|
|
327
|
-
setRefresh(refresh + 1);
|
|
328
|
-
}}
|
|
329
|
-
/>
|
|
330
|
-
: null}
|
|
331
|
-
</View>
|
|
332
|
-
</View>
|
|
333
|
-
</View>
|
|
334
|
-
</View>
|
|
335
|
-
</TouchableWithoutFeedback >
|
|
336
|
-
</SwipeRow >
|
|
337
|
-
),
|
|
338
|
-
[],
|
|
339
|
-
);
|
|
340
|
-
|
|
341
|
-
const renderMedicationList = useCallback((sectionIndex, category, medications) => (
|
|
342
|
-
|
|
343
|
-
<View key={category}>
|
|
344
|
-
{/* {isBNUL(medicationData) ? */}
|
|
345
|
-
<View style={{ flexDirection: 'row', width: '100%' }}>
|
|
346
|
-
<View style={{ width: '55%' }}>
|
|
347
|
-
<CTextHeader
|
|
348
|
-
text={'Medication'}
|
|
349
|
-
widthArr={'100%'}
|
|
350
|
-
bgColor={"lightgrey"}
|
|
351
|
-
color={Global.AppTheme.primary_color}
|
|
352
|
-
borderColor={'lightgrey'}
|
|
353
|
-
marginHorizontal={normalize(2)}
|
|
354
|
-
borderRadius={1}
|
|
355
|
-
elevation={2}
|
|
356
|
-
/>
|
|
357
|
-
</View>
|
|
358
|
-
<View style={{ width: '25%' }}>
|
|
359
|
-
<CTextHeader
|
|
360
|
-
text={'Date & Time'}
|
|
361
|
-
widthArr={'100%'}
|
|
362
|
-
bgColor={"lightgrey"}
|
|
363
|
-
color={Global.AppTheme.primary_color}
|
|
364
|
-
borderColor={'lightgrey'}
|
|
365
|
-
marginHorizontal={normalize(2)}
|
|
366
|
-
borderRadius={1}
|
|
367
|
-
elevation={2}
|
|
368
|
-
/>
|
|
369
|
-
</View>
|
|
370
|
-
<View style={{ width: '20%' }}>
|
|
371
|
-
<CTextHeader
|
|
372
|
-
text={'Remarks'}
|
|
373
|
-
widthArr={'100%'}
|
|
374
|
-
bgColor={"lightgrey"}
|
|
375
|
-
color={Global.AppTheme.primary_color}
|
|
376
|
-
borderColor={'lightgrey'}
|
|
377
|
-
marginHorizontal={normalize(2)}
|
|
378
|
-
borderRadius={1}
|
|
379
|
-
elevation={2}
|
|
380
|
-
/>
|
|
381
|
-
</View>
|
|
382
|
-
</View>
|
|
383
|
-
{/* : null} */}
|
|
384
|
-
{medications.map((item, itemIndex) =>
|
|
385
|
-
renderEachMedication({ item, category, sectionIndex, itemIndex }),
|
|
386
|
-
)}
|
|
387
|
-
</View>
|
|
388
|
-
),
|
|
389
|
-
[],
|
|
390
|
-
);
|
|
391
|
-
|
|
392
|
-
return (
|
|
393
|
-
<View style={styles.container}>
|
|
394
|
-
<View style={styles.card}>
|
|
395
|
-
|
|
396
|
-
<View style={styles.tabContainer}>
|
|
397
|
-
{data?.item?.medication?.map((val, i) => (
|
|
398
|
-
<TouchableOpacity
|
|
399
|
-
key={i}
|
|
400
|
-
onPress={() => handleTabChange(i)}
|
|
401
|
-
style={[styles.tab, val.selected && styles.selectedTab]}>
|
|
402
|
-
<Text style={styles.tabText}>{" "}{val.name}</Text>
|
|
403
|
-
</TouchableOpacity>
|
|
404
|
-
))}
|
|
405
|
-
</View>
|
|
406
|
-
|
|
407
|
-
{loading ? (
|
|
408
|
-
<View style={styles.loadingContainer}>
|
|
409
|
-
<ActivityIndicator
|
|
410
|
-
size="large"
|
|
411
|
-
color={Global.AppTheme.primary_color}
|
|
412
|
-
/>
|
|
413
|
-
</View>
|
|
414
|
-
) : (
|
|
415
|
-
<View>
|
|
416
|
-
{isBNUL(medicationData) ?
|
|
417
|
-
<FlatList
|
|
418
|
-
data={medicationData}
|
|
419
|
-
keyExtractor={(item, index) => `section-${item.id || index}`}
|
|
420
|
-
contentContainerStyle={styles.contentContainer}
|
|
421
|
-
showsVerticalScrollIndicator={true}
|
|
422
|
-
renderItem={({ item, index }) => {
|
|
423
|
-
// if (!data?.item?.medication?.[0]?.selected) return null;
|
|
424
|
-
return (
|
|
425
|
-
<View>
|
|
426
|
-
{Object.keys(item).map(category =>
|
|
427
|
-
renderMedicationList(index, category, item[category]),
|
|
428
|
-
)}
|
|
429
|
-
</View>
|
|
430
|
-
);
|
|
431
|
-
}}
|
|
432
|
-
/>
|
|
433
|
-
: null}
|
|
434
|
-
</View>
|
|
435
|
-
|
|
436
|
-
)}
|
|
437
|
-
</View>
|
|
438
|
-
</View>
|
|
439
|
-
);
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
const styles = StyleSheet.create({
|
|
443
|
-
container: { padding: 5 },
|
|
444
|
-
card: {
|
|
445
|
-
backgroundColor: 'white',
|
|
446
|
-
borderRadius: normalize(5),
|
|
447
|
-
borderWidth: 1,
|
|
448
|
-
borderColor: '#ddd',
|
|
449
|
-
shadowColor: '#000',
|
|
450
|
-
shadowOffset: { width: 0, height: 2 },
|
|
451
|
-
shadowOpacity: 0.05,
|
|
452
|
-
shadowRadius: 4,
|
|
453
|
-
elevation: 2,
|
|
454
|
-
},
|
|
455
|
-
tabContainer: {
|
|
456
|
-
flexDirection: 'row',
|
|
457
|
-
justifyContent: 'space-around',
|
|
458
|
-
borderWidth: 0
|
|
459
|
-
},
|
|
460
|
-
tab: {
|
|
461
|
-
borderWidth: 0.5,
|
|
462
|
-
borderColor: 'lightgrey',
|
|
463
|
-
flex: 1,
|
|
464
|
-
paddingVertical: normalize(5),
|
|
465
|
-
// paddingHorizontal: normalize(15)
|
|
466
|
-
},
|
|
467
|
-
selectedTab: {
|
|
468
|
-
backgroundColor: '#e6f0ff',
|
|
469
|
-
borderBottomWidth: 3,
|
|
470
|
-
borderColor: Global.AppTheme.primary_color,
|
|
471
|
-
},
|
|
472
|
-
tabText: {
|
|
473
|
-
fontSize: 10,
|
|
474
|
-
fontWeight: '600',
|
|
475
|
-
color: '#444'
|
|
476
|
-
},
|
|
477
|
-
contentContainer: { padding: 5 },
|
|
478
|
-
medicationContainer: {
|
|
479
|
-
// padding: ,
|
|
480
|
-
// marginVertical: 1,
|
|
481
|
-
backgroundColor: '#ffffff',
|
|
482
|
-
borderWidth: 0,
|
|
483
|
-
borderColor: 'lightgrey',
|
|
484
|
-
// margin: normalize(4)
|
|
485
|
-
},
|
|
486
|
-
medicationRow: {
|
|
487
|
-
flexDirection: 'row',
|
|
488
|
-
justifyContent: 'space-between',
|
|
489
|
-
marginBottom: 1,
|
|
490
|
-
},
|
|
491
|
-
highlightedText: { fontWeight: '600' },
|
|
492
|
-
highlightedValue: { fontWeight: 'bold', color: Global.AppTheme.primary_color },
|
|
493
|
-
remarkInput: { borderColor: '#ddd', borderWidth: 1, padding: 5 },
|
|
494
|
-
swipeRowBack: {
|
|
495
|
-
borderWidth: 0.5,
|
|
496
|
-
borderColor: 'lightgrey',
|
|
497
|
-
// margin: normalize(4),
|
|
498
|
-
flexDirection: 'row',
|
|
499
|
-
justifyContent: 'space-between',
|
|
500
|
-
backgroundColor: '#f8f8f8',
|
|
501
|
-
// height: 80,
|
|
502
|
-
alignItems: 'center',
|
|
503
|
-
// paddingHorizontal: 15,
|
|
504
|
-
},
|
|
505
|
-
swipeButton: {
|
|
506
|
-
justifyContent: 'center',
|
|
507
|
-
alignItems: 'center',
|
|
508
|
-
width: 75,
|
|
509
|
-
height: '100%',
|
|
510
|
-
},
|
|
511
|
-
completeButton: {
|
|
512
|
-
backgroundColor: Global.AppTheme.primary_color,
|
|
513
|
-
},
|
|
514
|
-
deleteButton: {
|
|
515
|
-
backgroundColor: Global.AppTheme.primary_color,
|
|
516
|
-
},
|
|
517
|
-
swipeButtonText: {
|
|
518
|
-
color: '#fff',
|
|
519
|
-
fontWeight: 'bold',
|
|
520
|
-
},
|
|
521
|
-
loadingContainer: {
|
|
522
|
-
flex: 1,
|
|
523
|
-
justifyContent: 'center',
|
|
524
|
-
alignItems: 'center',
|
|
525
|
-
},
|
|
526
|
-
});
|
|
527
|
-
|
|
528
|
-
export default CMedications;
|