@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,81 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Dimensions,
|
|
5
|
+
TouchableOpacity,
|
|
6
|
+
Modal,
|
|
7
|
+
Pressable,
|
|
8
|
+
StyleSheet,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
|
|
11
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
12
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
13
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
14
|
+
|
|
15
|
+
const COverlay = (WrapComponent) => {
|
|
16
|
+
return function (props) {
|
|
17
|
+
const [overlay, setOverlay] = useState(true);
|
|
18
|
+
|
|
19
|
+
const closeOverlay = () => {
|
|
20
|
+
setOverlay(false);
|
|
21
|
+
props?.visibility?.(false);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const getPopupContainerStyle = () => ({
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
bottom: 0,
|
|
27
|
+
top: Dimensions.get('screen').height * 0.1,
|
|
28
|
+
width: Dimensions.get('screen').width,
|
|
29
|
+
backgroundColor: '#fff',
|
|
30
|
+
borderTopLeftRadius: 20,
|
|
31
|
+
borderTopRightRadius: 20,
|
|
32
|
+
borderWidth: 2,
|
|
33
|
+
borderColor: '#e0e0e0',
|
|
34
|
+
paddingHorizontal: normalize(5),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Modal
|
|
39
|
+
visible={overlay}
|
|
40
|
+
transparent
|
|
41
|
+
animationType="slide"
|
|
42
|
+
onRequestClose={closeOverlay}
|
|
43
|
+
>
|
|
44
|
+
{/* Background overlay (tap outside to close) */}
|
|
45
|
+
<Pressable style={styles.backdrop} onPress={closeOverlay} />
|
|
46
|
+
|
|
47
|
+
{/* Modal Content */}
|
|
48
|
+
<View style={getPopupContainerStyle()}>
|
|
49
|
+
{/* Close Button */}
|
|
50
|
+
<View style={styles.closeButton}>
|
|
51
|
+
<TouchableOpacity onPress={closeOverlay}>
|
|
52
|
+
<Icons.FontAwesome5
|
|
53
|
+
name="angle-double-down"
|
|
54
|
+
size={normalize(20)}
|
|
55
|
+
color={Global.AppTheme.primary_color}
|
|
56
|
+
/>
|
|
57
|
+
</TouchableOpacity>
|
|
58
|
+
</View>
|
|
59
|
+
|
|
60
|
+
{/* Wrapped Component */}
|
|
61
|
+
<WrapComponent {...props} />
|
|
62
|
+
</View>
|
|
63
|
+
</Modal>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default COverlay;
|
|
69
|
+
|
|
70
|
+
const styles = StyleSheet.create({
|
|
71
|
+
backdrop: {
|
|
72
|
+
flex: 1,
|
|
73
|
+
backgroundColor: 'rgba(0, 0, 0, 0.20)',
|
|
74
|
+
},
|
|
75
|
+
closeButton: {
|
|
76
|
+
position: 'absolute',
|
|
77
|
+
right: 10,
|
|
78
|
+
top: 10,
|
|
79
|
+
zIndex: 10,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import React, { useState, useEffect, memo, useContext } from 'react';
|
|
2
|
+
import { Text, View, Image, TouchableOpacity, TextInput, Dimensions } from 'react-native';
|
|
3
|
+
// import {
|
|
4
|
+
// useDimensions,
|
|
5
|
+
// } from '@react-native-community/hooks';
|
|
6
|
+
import { colors } from '../CommonStyle/commonStyle';
|
|
7
|
+
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
8
|
+
import popupStyles, {
|
|
9
|
+
getPopupContainerStyle,
|
|
10
|
+
getPopupTextAreaContainer,
|
|
11
|
+
getPopupTextAreaChildContainer,
|
|
12
|
+
getPopupTextAreaStyle,
|
|
13
|
+
} from '../CommonStyle/PopupStyle';
|
|
14
|
+
import Entypo from 'react-native-vector-icons/Entypo';
|
|
15
|
+
import SCheckbox from '../StaticComponents/SCheckBox';
|
|
16
|
+
import CAwesomeButton from './CAwesomeButton';
|
|
17
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
18
|
+
import EmrResponseComponentContext from '../Handlers/emrResponseComponentContext';
|
|
19
|
+
import { ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
20
|
+
|
|
21
|
+
function CRemarks(props) {
|
|
22
|
+
const { width, height } = Dimensions.get('window');
|
|
23
|
+
const [data, setData] = useState(props.data);
|
|
24
|
+
const [isShow, setIsShow] = useState(false);
|
|
25
|
+
const [comment, setComment] = useState('');
|
|
26
|
+
const [infectioncontrol, setInfectioncontrol] = useState('');
|
|
27
|
+
const { responseJSON, setResponseJSON } = useContext(EmrResponseComponentContext);
|
|
28
|
+
var test = [];
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
setData(props.data);
|
|
31
|
+
data.functionname == 'comments' ?
|
|
32
|
+
(data.comments != null && data.comments != undefined ?
|
|
33
|
+
setComment(data.comments)
|
|
34
|
+
: null)
|
|
35
|
+
:
|
|
36
|
+
null;
|
|
37
|
+
}, []);
|
|
38
|
+
|
|
39
|
+
console.log('PROPSSSSSSS CREMARKSSSSSSSSSSSSS', JSON.stringify(data));
|
|
40
|
+
|
|
41
|
+
const FooterArray = [
|
|
42
|
+
{
|
|
43
|
+
key: 1,
|
|
44
|
+
display: 'Patient',
|
|
45
|
+
checked: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
key: 2,
|
|
49
|
+
display: 'Doctor',
|
|
50
|
+
checked: false,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: 3,
|
|
54
|
+
display: 'Nurse',
|
|
55
|
+
checked: false,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: 4,
|
|
59
|
+
display: 'Staff',
|
|
60
|
+
checked: false,
|
|
61
|
+
},
|
|
62
|
+
];
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
function saveRemarks() {
|
|
66
|
+
if (data.functionname == 'comments') {
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
setData({ ...data, ['comments']: comment });
|
|
70
|
+
props.visibility(false);
|
|
71
|
+
responseJSON.consultationEdit.CommentsString = comment;
|
|
72
|
+
Global.EditStatus = 1;
|
|
73
|
+
responseJSON.consultationEdit.editStatus = true;
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
let dataset = {
|
|
80
|
+
|
|
81
|
+
};
|
|
82
|
+
NetworkServiceCall('post', buttonapi, output)
|
|
83
|
+
.then(function (response) {
|
|
84
|
+
if (response.httpstatus == 200) {
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
alert('Comment Not Saved');
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function ChangeValue(changevalue) {
|
|
93
|
+
if (data.functionname == 'comments') {
|
|
94
|
+
setComment(changevalue);
|
|
95
|
+
data.comments = changevalue;
|
|
96
|
+
} else {
|
|
97
|
+
setInfectioncontrol(changevalue);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function getAllTabFunctions(key) {
|
|
102
|
+
switch (key) {
|
|
103
|
+
case 'CNI01': saveRemarks();
|
|
104
|
+
break;
|
|
105
|
+
case 'CNI02': data.comments && data.comments != null && data.comments.length > 0 || infectioncontrol != null && infectioncontrol != undefined && infectioncontrol.length > 0 ? ChangeValue('') : null;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return (
|
|
110
|
+
<View style={{ flex: 1, width: '100%' }}>
|
|
111
|
+
<Text style={[ComponentStyles.popup_heading, { alignSelf: 'center' }]}>{ValueCheck(responseJSON) && ValueCheck(responseJSON.consultationEdit) && ValueCheck(responseJSON.consultationEdit.heading) ? responseJSON.consultationEdit.heading : ''} {'COMMENTS'} </Text>
|
|
112
|
+
<View
|
|
113
|
+
style={{
|
|
114
|
+
flex: 1,
|
|
115
|
+
alignItems: 'center',
|
|
116
|
+
marginTop: height * 0.01,
|
|
117
|
+
}}
|
|
118
|
+
>
|
|
119
|
+
<View style={getPopupTextAreaChildContainer(width, height, data.hasOwnProperty('itemedited') && data.itemedited ? colors.color_editedindication_Border : colors.color_componentBordercolor)}>
|
|
120
|
+
<TextInput
|
|
121
|
+
editable={true} // To scroll data , Editable is checked in onChangeText props
|
|
122
|
+
keyboardType={data.hasOwnProperty('keyboardtype') ? data.keyboardtype : 'default'}
|
|
123
|
+
placeholder={data.hasOwnProperty('iseditable') && data.iseditable ?
|
|
124
|
+
data.hasOwnProperty('placeholder') && data.placeholder != null && data.placeholder.length > 2 ? data.placeholder : 'Type Here'
|
|
125
|
+
: ''
|
|
126
|
+
}
|
|
127
|
+
placeholderTextColor={'lightgray'}
|
|
128
|
+
// onChangeText={changevalue => data.hasOwnProperty('iseditable') && data.iseditable ? ChangeValue(changevalue) : null}
|
|
129
|
+
onChangeText={changevalue => ChangeValue(changevalue)}
|
|
130
|
+
// value={data.value}
|
|
131
|
+
value={data.functionname == 'comments' ? comment : infectioncontrol}
|
|
132
|
+
numberOfLines={5}
|
|
133
|
+
multiline={true}
|
|
134
|
+
scrollEnabled
|
|
135
|
+
style={getPopupTextAreaStyle(width, height)}
|
|
136
|
+
|
|
137
|
+
/>
|
|
138
|
+
</View>
|
|
139
|
+
|
|
140
|
+
{data.functionname == 'infectioncontrol' ?
|
|
141
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-around', width: '100%' }}>
|
|
142
|
+
{FooterArray.map((data, i) => {
|
|
143
|
+
return (
|
|
144
|
+
<View>
|
|
145
|
+
<Text>{data.display}</Text>
|
|
146
|
+
<SCheckbox
|
|
147
|
+
onChangeData={val =>
|
|
148
|
+
val == undefined
|
|
149
|
+
? null
|
|
150
|
+
: data.checked = val
|
|
151
|
+
}
|
|
152
|
+
value={data.checked}
|
|
153
|
+
/>
|
|
154
|
+
</View>
|
|
155
|
+
);
|
|
156
|
+
})}
|
|
157
|
+
</View> : null}
|
|
158
|
+
</View>
|
|
159
|
+
|
|
160
|
+
<View style={{ flexDirection: 'row' }}>
|
|
161
|
+
{[{ 'displaytext': 'Insert', 'fontcolor': Global.AppTheme.primary_color, 'shadowcolor': '#eaf2ff', 'size': 10, 'iconname': 'save', 'iconcolor': Global.AppTheme.primary_color, 'selected': false, 'visibility': true, 'iconsize': 20, 'functionid': 'CNI01' },
|
|
162
|
+
{ 'displaytext': 'Clear', 'fontcolor': '#fc6c6c', 'shadowcolor': '#eaf2ff', 'size': 10, 'iconname': 'eraser', 'iconcolor': '#fc6c6c', 'selected': false, 'visibility': true, 'iconsize': 20, 'functionid': 'CNI02' }]
|
|
163
|
+
.map((item, i) => {
|
|
164
|
+
return (
|
|
165
|
+
<View key={i} style={{ borderRadius: normalize(10), paddingLeft: normalize(10) }}>
|
|
166
|
+
<CAwesomeButton
|
|
167
|
+
data={item}
|
|
168
|
+
callBack={val => val == undefined ? null : getAllTabFunctions(item.functionid)}
|
|
169
|
+
/>
|
|
170
|
+
</View>);
|
|
171
|
+
})}
|
|
172
|
+
</View>
|
|
173
|
+
</View>
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
export default memo(CRemarks);
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React, { useState, useEffect, useContext } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Text,
|
|
4
|
+
TextInput,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View,
|
|
7
|
+
Image,
|
|
8
|
+
TouchableOpacity,
|
|
9
|
+
ScrollView,
|
|
10
|
+
Dimensions,
|
|
11
|
+
FlatList,
|
|
12
|
+
TouchableWithoutFeedback,
|
|
13
|
+
Switch,
|
|
14
|
+
} from 'react-native';
|
|
15
|
+
import { colors } from '../CommonStyle/commonStyle';
|
|
16
|
+
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
17
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
18
|
+
import STimingSwitch from '../StaticComponents/STimingSwitch';
|
|
19
|
+
import { notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
20
|
+
import EmrResponseComponentContext from '../Handlers/emrResponseComponentContext';
|
|
21
|
+
|
|
22
|
+
function CRowAdd(props) {
|
|
23
|
+
const { responseJSON, setResponseJSON } = useContext(EmrResponseComponentContext);
|
|
24
|
+
const [componentAccess, setComponentAccess] = useState(0);
|
|
25
|
+
const [parameterName, setParameterName] = useState('');
|
|
26
|
+
const [description, setDescription] = useState('');
|
|
27
|
+
return (
|
|
28
|
+
<View style={{ flex: 1, width: '97%' }}>
|
|
29
|
+
<Text style={{ alignSelf: 'center', fontSize: normalize(12), fontWeight: 'bold', marginBottom: normalize(5), marginTop: normalize(-5),color:'darkblue' }}>{ValueCheck(responseJSON) && ValueCheck(responseJSON.consultationEdit) && ValueCheck(responseJSON.consultationEdit.heading) ? responseJSON.consultationEdit.heading + ' PARAMETER' : 'PARAMETER'}</Text>
|
|
30
|
+
|
|
31
|
+
<View style={{ flex: 1, marginVertical: 0 }}>
|
|
32
|
+
<Text style={{ fontSize: normalize(11), paddingHorizontal: normalize(10) }}>Parameter name :</Text>
|
|
33
|
+
|
|
34
|
+
<View style={{ borderWidth: 1, height: normalize(35), borderRadius: 7, borderColor: 'lightgrey', backgroundColor: '#fff', elevation: 3 }}>
|
|
35
|
+
<TextInput
|
|
36
|
+
numberOfLines={1}
|
|
37
|
+
keyboardType={'default'}
|
|
38
|
+
onChangeText={changevalue => setParameterName(changevalue)}
|
|
39
|
+
value={parameterName} />
|
|
40
|
+
</View>
|
|
41
|
+
|
|
42
|
+
<View>
|
|
43
|
+
<Text style={{ fontSize: normalize(11), paddingHorizontal: normalize(10) }}>Description:</Text>
|
|
44
|
+
<View style={{ borderWidth: 1, height: normalize(35), borderRadius: 7, borderColor: 'lightgrey', backgroundColor: '#fff', elevation: 3 }}
|
|
45
|
+
>
|
|
46
|
+
<TextInput
|
|
47
|
+
numberOfLines={4}
|
|
48
|
+
keyboardType={'default'}
|
|
49
|
+
placeholder="optional"
|
|
50
|
+
onChangeText={changevalue => setDescription(changevalue)}
|
|
51
|
+
value={description} />
|
|
52
|
+
</View>
|
|
53
|
+
</View>
|
|
54
|
+
|
|
55
|
+
<View style={{ borderWidth: 1, borderRadius: 7, borderColor: 'lightgrey', backgroundColor: '#fff', elevation: 3, paddingVertical: normalize(5), marginTop: normalize(5) }}>
|
|
56
|
+
<Text style={{ fontSize: normalize(11), paddingHorizontal: normalize(10) }}>Type of data:</Text>
|
|
57
|
+
<STimingSwitch
|
|
58
|
+
data={[{
|
|
59
|
+
'timingslot': 1,
|
|
60
|
+
'slotname': 'Date',
|
|
61
|
+
'selected': false,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
'timingslot': 2,
|
|
65
|
+
'slotname': 'Value',
|
|
66
|
+
'selected': false,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
'timingslot': 3,
|
|
70
|
+
'slotname': 'Question',
|
|
71
|
+
'selected': false,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
'timingslot': 4,
|
|
75
|
+
'slotname': 'Remarks',
|
|
76
|
+
'selected': false,
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
'timingslot': 5,
|
|
80
|
+
'slotname': 'Image',
|
|
81
|
+
'selected': false,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
'timingslot': 6,
|
|
85
|
+
'slotname': 'Duration',
|
|
86
|
+
'selected': false,
|
|
87
|
+
},
|
|
88
|
+
]}
|
|
89
|
+
callBack={val =>
|
|
90
|
+
val == undefined ? null :
|
|
91
|
+
setComponentAccess(val)} />
|
|
92
|
+
</View>
|
|
93
|
+
|
|
94
|
+
<View
|
|
95
|
+
style={{
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
bottom: normalize(0),
|
|
98
|
+
width: '100%',
|
|
99
|
+
}}>
|
|
100
|
+
<TouchableOpacity
|
|
101
|
+
onPress={() => getAddColumn()}
|
|
102
|
+
style={{
|
|
103
|
+
borderRadius: 10,
|
|
104
|
+
borderWidth: 1,
|
|
105
|
+
height: normalize(40),
|
|
106
|
+
width: normalize(55),
|
|
107
|
+
backgroundColor: '#eaf2ff',
|
|
108
|
+
borderColor: 'white',
|
|
109
|
+
alignItems: 'center',
|
|
110
|
+
justifyContent: 'center',
|
|
111
|
+
elevation: 5,
|
|
112
|
+
shadowColor: '#000',
|
|
113
|
+
shadowOffset: { width: 0, height: 3 },
|
|
114
|
+
shadowOpacity: 0.3,
|
|
115
|
+
shadowRadius: 5,
|
|
116
|
+
}}>
|
|
117
|
+
<View style={{ alignItems: 'center', width: normalize(50) }} >
|
|
118
|
+
<Icons.FontAwesome5 name="save" color={'#094485'} size={normalize(20)} />
|
|
119
|
+
<Text numberOfLines={1} style={{ color: '#094485', fontSize: normalize(10) }}>Select</Text>
|
|
120
|
+
</View>
|
|
121
|
+
</TouchableOpacity>
|
|
122
|
+
</View>
|
|
123
|
+
</View>
|
|
124
|
+
|
|
125
|
+
</View>
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
function getAddColumn(params) {
|
|
129
|
+
if (parameterName != '' && parameterName != undefined && componentAccess != 0) {
|
|
130
|
+
var call = {
|
|
131
|
+
'parametername': (parameterName).toUpperCase(),
|
|
132
|
+
'parameterdescription': description,
|
|
133
|
+
'columntype': componentAccess.timingslot,
|
|
134
|
+
};
|
|
135
|
+
props.callBack(call);
|
|
136
|
+
props.visibility(false);
|
|
137
|
+
} else {
|
|
138
|
+
notifyMessage('Please fill required coulmns',3);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export default CRowAdd;
|