@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.8

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 (191) hide show
  1. package/index.d.ts +2 -66
  2. package/index.js +1 -66
  3. package/package.json +1 -1
  4. package/src/Alerts/AAlert.js +0 -137
  5. package/src/Alerts/AAlertIOS.js +0 -97
  6. package/src/Alerts/ABlink.js +0 -40
  7. package/src/Common/Icons.js +0 -49
  8. package/src/Common/NetworkServiceCall.js +0 -265
  9. package/src/CommonStyle/CommonTheme.js +0 -11
  10. package/src/CommonStyle/ComponentFunctions.js +0 -632
  11. package/src/CommonStyle/PopupStyle.js +0 -146
  12. package/src/CommonStyle/commonStyle.js +0 -93
  13. package/src/CommonStyle/componentStyle.js +0 -545
  14. package/src/CommonStyle/optionListStyles.js +0 -175
  15. package/src/Components/ByProductPage.js +0 -200
  16. package/src/Components/CDropDownListNew.js +0 -153
  17. package/src/Components/CSupplierList.js +0 -88
  18. package/src/Components/CVerificationCard.js +0 -2822
  19. package/src/Components/CustomButton.js +0 -67
  20. package/src/Components/CustomCard.js +0 -127
  21. package/src/Components/CustomTextInput.js +0 -47
  22. package/src/Components/EquipmentPage.js +0 -313
  23. package/src/Components/FilterInput.Copy.js +0 -723
  24. package/src/Components/FilterInput.js +0 -569
  25. package/src/Components/HSubHeading.js +0 -68
  26. package/src/Components/HeaderCard.js +0 -40
  27. package/src/Components/MoreOptionsScreen.js +0 -251
  28. package/src/Components/NonSwipableProductCard.js +0 -226
  29. package/src/Components/NonSwipableSupplierCard.js +0 -348
  30. package/src/Components/ProductCard.js +0 -1336
  31. package/src/Components/QualityProductCard.js +0 -1059
  32. package/src/Components/RateProductCard.js +0 -1452
  33. package/src/Components/RawMaterial.js +0 -261
  34. package/src/Components/SDropDownEdited.js +0 -549
  35. package/src/Components/SDropDownNew.js +0 -529
  36. package/src/Components/SHelpDescription.js +0 -147
  37. package/src/Components/STextInputNew.js +0 -510
  38. package/src/Components/SearchProductCard.js +0 -470
  39. package/src/Components/StageByProduct.js +0 -199
  40. package/src/Components/SupplierCard.js +0 -243
  41. package/src/Components/SupplierInvoiceCard.js +0 -405
  42. package/src/Components/SwipableSupplierCard.js +0 -136
  43. package/src/Components/TagTemplate.js +0 -74
  44. package/src/Components/WrappedComponent.js +0 -25
  45. package/src/Custom/CBooking.js +0 -944
  46. package/src/Custom/CBookingPostpone.js +0 -1822
  47. package/src/Custom/CCalendar.js +0 -560
  48. package/src/Custom/CCard.js +0 -880
  49. package/src/Custom/CDetailCard.js +0 -205
  50. package/src/Custom/CHelpImage.js +0 -52
  51. package/src/Custom/CReport.js +0 -569
  52. package/src/Custom/CScrollView.js +0 -73
  53. package/src/Custom/CSignature.js +0 -112
  54. package/src/Custom/CSliderMenu.js +0 -339
  55. package/src/Custom/CSupplierCard.js +0 -99
  56. package/src/Custom/CTemplateCard.js +0 -438
  57. package/src/Custom/CTokenAllocation.js +0 -1402
  58. package/src/Custom/CTokenListOverlay.js +0 -122
  59. package/src/Custom/CWardStatus.js +0 -444
  60. package/src/Custom/Charts/CBarChart.js +0 -218
  61. package/src/Custom/Charts/CDashBoardList.js +0 -133
  62. package/src/Custom/Charts/CDashBoardTable.js +0 -172
  63. package/src/Custom/Charts/CLineChart.js +0 -193
  64. package/src/Custom/Charts/CPieChart.js +0 -186
  65. package/src/Custom/Loader.js +0 -182
  66. package/src/Custom/OUserView.js +0 -1121
  67. package/src/Custom/PreviewDosage.js +0 -115
  68. package/src/Custom/SearchLoader.js +0 -32
  69. package/src/Custom/TableComponent/CActivityTable.js +0 -707
  70. package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
  71. package/src/Custom/TableComponent/CTable.js +0 -185
  72. package/src/Custom/TableComponent/CTextBody.js +0 -40
  73. package/src/Custom/TableComponent/CTextHeader.js +0 -17
  74. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
  75. package/src/Custom/TableComponent/SDropdownTable.js +0 -491
  76. package/src/Custom/TableComponent/TagTable.js +0 -1200
  77. package/src/CustomComponents/CAddColumn.js +0 -140
  78. package/src/CustomComponents/CAssessmentDelete.js +0 -307
  79. package/src/CustomComponents/CAwesomeButton.js +0 -83
  80. package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
  81. package/src/CustomComponents/CBackHandler.js +0 -273
  82. package/src/CustomComponents/CCalendar.js +0 -243
  83. package/src/CustomComponents/CCommentOverlay.js +0 -202
  84. package/src/CustomComponents/CComments.js +0 -162
  85. package/src/CustomComponents/CContainerView.js +0 -24
  86. package/src/CustomComponents/CCustomTextInput.js +0 -336
  87. package/src/CustomComponents/CDetailView.js +0 -40
  88. package/src/CustomComponents/CDropDownList.js +0 -153
  89. package/src/CustomComponents/CDropdownSelect.js +0 -555
  90. package/src/CustomComponents/CFooterView.js +0 -42
  91. package/src/CustomComponents/CImagePickerSave.js +0 -316
  92. package/src/CustomComponents/CModalOverlay.js +0 -91
  93. package/src/CustomComponents/CNetworkStatus.js +0 -327
  94. package/src/CustomComponents/CNotesInstructions.js +0 -1000
  95. package/src/CustomComponents/COverlay.js +0 -81
  96. package/src/CustomComponents/CRemarks.js +0 -176
  97. package/src/CustomComponents/CRowAdd.js +0 -143
  98. package/src/CustomComponents/CSummaryDropDown.js +0 -327
  99. package/src/CustomComponents/CText.js +0 -9
  100. package/src/CustomComponents/CVectorIcon.js +0 -34
  101. package/src/CustomComponents/HtmlContentViewer.js +0 -65
  102. package/src/CustomComponents/PdfContentViewer.js +0 -90
  103. package/src/CustomComponents/SDropDownDosage.js +0 -1087
  104. package/src/CustomComponents/SwipableProductCard.js +0 -246
  105. package/src/CustomComponents/SwipableProductImageCard.js +0 -254
  106. package/src/CustomComponents/WorkOrderDetails.js +0 -1216
  107. package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
  108. package/src/HOC/ConfirmOverlay.js +0 -192
  109. package/src/HOC/HHeading.js +0 -70
  110. package/src/HOC/HMoreButton.js +0 -88
  111. package/src/HOC/HNatureHeading.js +0 -402
  112. package/src/HOC/HOCIcons.js +0 -80
  113. package/src/HOC/HOverlayCentered.js +0 -140
  114. package/src/HOC/HShadowButton.js +0 -45
  115. package/src/HOC/HShadowCountButton.js +0 -82
  116. package/src/HOC/OptionOverlay.js +0 -48
  117. package/src/Json/Chart.json +0 -818
  118. package/src/Json/Consultation.json +0 -622
  119. package/src/Json/CreditBill.json +0 -490
  120. package/src/Json/Dropdown.json +0 -216
  121. package/src/Json/DropdownConsultation.json +0 -228
  122. package/src/Json/DynamicReports.json +0 -623
  123. package/src/Json/Footer.json +0 -79
  124. package/src/Media/AudioScreen.js +0 -342
  125. package/src/Media/BarcodeScan.js +0 -145
  126. package/src/Media/CAudioPlay.js +0 -228
  127. package/src/Media/CCaptureImageWithoutEdit.js +0 -330
  128. package/src/Media/CImageGallery.js +0 -289
  129. package/src/Media/CImageZoom.js +0 -82
  130. package/src/Media/CSingleImage.js +0 -391
  131. package/src/Media/CSketchCanvas.js +0 -76
  132. package/src/Media/CVideoPlay.js +0 -31
  133. package/src/Media/DocumentScreen.js +0 -362
  134. package/src/Media/DrawingScreen.js +0 -578
  135. package/src/Media/ImageScreen.js +0 -309
  136. package/src/Media/RecordAudio.js +0 -250
  137. package/src/Media/RecordVideo.js +0 -223
  138. package/src/Media/VideoScreen.js +0 -378
  139. package/src/Navigation/PageNavigation.js +0 -224
  140. package/src/Navigation/useFocusEffect.js +0 -2
  141. package/src/Navigation/useFocusEffect.native.js +0 -1
  142. package/src/Navigation/useFocusEffect.web.js +0 -1
  143. package/src/Navigation/useIsFocused.js +0 -1
  144. package/src/Navigation/useIsFocused.native.js +0 -1
  145. package/src/Navigation/useIsFocused.web.js +0 -1
  146. package/src/Navigation/useNavigation.js +0 -2
  147. package/src/Navigation/useNavigation.native.js +0 -1
  148. package/src/Navigation/useNavigation.web.js +0 -1
  149. package/src/Screens/CMedications.js +0 -528
  150. package/src/Screens/CWebViewGallery.js +0 -203
  151. package/src/Screens/ChartScan.js +0 -279
  152. package/src/Screens/ChartScreenNew.js +0 -1579
  153. package/src/Screens/Consultation.js +0 -1500
  154. package/src/Screens/Dashboard.js +0 -778
  155. package/src/Screens/FileExplorer.js +0 -288
  156. package/src/Screens/Footer.js +0 -340
  157. package/src/Screens/ForgotPassword.js +0 -288
  158. package/src/Screens/HeaderBlock.js +0 -353
  159. package/src/Screens/Login.js +0 -328
  160. package/src/Screens/Notification.js +0 -149
  161. package/src/Screens/OcrScreen.js +0 -20
  162. package/src/Screens/PdfPreview.js +0 -507
  163. package/src/Screens/RegistrationDetails.js +0 -467
  164. package/src/Screens/SearchScreen.js +0 -582
  165. package/src/Screens/Splash.js +0 -788
  166. package/src/Screens/SwipeLeftView.js +0 -1867
  167. package/src/StaticComponents/SAlphabet.js +0 -47
  168. package/src/StaticComponents/SCheckBox.js +0 -42
  169. package/src/StaticComponents/SDatePicker.js +0 -208
  170. package/src/StaticComponents/SDatePickerLabel.js +0 -253
  171. package/src/StaticComponents/SDatePickerNew.js +0 -258
  172. package/src/StaticComponents/SDateTimePickerNew.js +0 -381
  173. package/src/StaticComponents/SDropDownGenerate.js +0 -450
  174. package/src/StaticComponents/SDropDownHoc.js +0 -636
  175. package/src/StaticComponents/SDropDownIcon.js +0 -500
  176. package/src/StaticComponents/SMenuBox.js +0 -131
  177. package/src/StaticComponents/SOverlay.js +0 -177
  178. package/src/StaticComponents/SOverlayTextInput.js +0 -109
  179. package/src/StaticComponents/SSearch.js +0 -438
  180. package/src/StaticComponents/SSearchBar.js +0 -53
  181. package/src/StaticComponents/SSpeedDial.js +0 -303
  182. package/src/StaticComponents/STextInput.js +0 -289
  183. package/src/StaticComponents/STextInputProps.js +0 -36
  184. package/src/StaticComponents/STimePicker.js +0 -171
  185. package/src/StaticComponents/STimingDropDownNew.js +0 -1585
  186. package/src/StaticComponents/STimingSwitch.js +0 -34
  187. package/src/layout/CContainerView.js +0 -21
  188. package/src/layout/CDetailView.js +0 -81
  189. package/src/layout/HeaderBlock.js +0 -353
  190. package/src/layout/INVLoginLayout.js +0 -657
  191. package/src/layout/Loader.js +0 -176
@@ -1,1500 +0,0 @@
1
- import React, { useState, useEffect, useRef, useContext, useCallback } from 'react';
2
- import { Text, View, TouchableOpacity, Dimensions, BackHandler, Alert, FlatList, RefreshControl, DeviceEventEmitter } from 'react-native';
3
- import Loader from '../Custom/Loader';
4
- import HeaderBlock from './HeaderBlock';
5
- // import CContainerView from '../CustomComponents/CContainerView';
6
- import CDetailView from '../CustomComponents/CDetailView';
7
- import CFooterView from '../CustomComponents/CFooterView';
8
- // import { useIsFocused } from '@react-navigation/native';
9
- import InsureResponseComponentContext from '../Handlers/insureResponseComponentContext';
10
- import NetworkServiceCall from '../Common/NetworkServiceCall';
11
- import { ArrayCheck, getLoading, getSound, isBNUL, isNU, isNUQ, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
12
- import HHeading from '../HOC/HHeading';
13
- import { normalize } from '../CommonStyle/componentStyle';
14
- import HMoreButton from '../HOC/HMoreButton';
15
- import HView from '../HOC/HView';
16
- import { APIURL } from '../../../../../src/Common/apiConstants';
17
- import NotesInstructionComments from '../CustomComponents/NotesInstructionComments';
18
- import Icons from '../Common/Icons';
19
- import HOverlay from '../HOC/HOverlay';
20
- import CConfirmation from '../CustomComponents/CConfirmation';
21
- import Footer from './Footer';
22
- import FooterJSON from '../Json/Footer.json';
23
- import { Global } from '../../../../../src/Common/Global';
24
- import CBackHandler from '../CustomComponents/CBackHandler';
25
- import HAbsolute from '../HOC/HAbsolute';
26
-
27
- import { FlashList } from '@shopify/flash-list';
28
- import HNatureHeading from '../HOC/HNatureHeading';
29
- import { Menu, MenuOptions, MenuTrigger } from 'react-native-popup-menu';
30
- import HOCIcons from '../HOC/HOCIcons';
31
- import CDropDownList from '../CustomComponents/CDropDownList';
32
- import CDetailCard from '../Custom/CDetailCard';
33
- import FileExplorer from './FileExplorer';
34
-
35
- var deletearg = {};
36
- export default function Consultation(props) {
37
-
38
- const [footer, setFooter] = useState();
39
- // const navigation = useNavigation();
40
- const [visibility, setVisibility] = useState(true)
41
- const [backHandler, setBackHandler] = useState(false)
42
- const [exitbackHandler, setExitBackHandler] = useState(false)
43
- const [pulltorefresh] = useState(false)
44
- const [overlay, setOverlay] = useState(false)
45
- const [data, setData] = useState()
46
- const [overlayData, setOverlayData] = useState()
47
- const [isLoading, setIsLoading] = useState(false)
48
- const { responseJSON, setResponseJSON } = useContext(InsureResponseComponentContext);
49
- const [refresh, setRefresh] = useState(0);
50
- const [deleteConfirmation, setDeleteConfirmation] = useState(false);
51
- const [deleteClassificationNature, setDeleteClassificationNature] = useState();
52
- // const isFocused = useIsFocused();
53
-
54
- // useEffect(() => {
55
- // BackHandler.addEventListener('hardwareBackPress2', backAction);
56
- // return () =>
57
- // BackHandler.removeEventListener('hardwareBackPress2', backAction);
58
- // }, []);
59
-
60
- useEffect(() => {
61
- const backAction = () => {
62
- if (!navigation.isFocused()) {
63
- return false;
64
- }
65
- else {
66
- if (isNU(responseJSON) && isBNUL(responseJSON.consultation) && CheckIfEdited(responseJSON.consultation)) {
67
- setExitBackHandler(true)
68
- }
69
- else {
70
- navigation.goBack();
71
- }
72
- }
73
- return true;
74
- };
75
-
76
- const backHandler = BackHandler.addEventListener(
77
- "hardwareBackPress",
78
- backAction
79
- );
80
-
81
- return () => backHandler.remove();
82
- }, [navigation, responseJSON]);
83
-
84
- useEffect(() => {
85
- getConsultation()
86
- }, [])
87
-
88
- // useEffect(() => {
89
- // if (props?.route?.params?.chartscan) {
90
-
91
- // {
92
- // isNU(data) && isBNUL(data.consultation) ?
93
-
94
- // data.consultation.map((fileEx, i) => {
95
- // fileEx.customcomponent == 'FileExplorer' ? setResponseJSON({ ...responseJSON, "consultationEdit": fileEx }) : null;
96
- // })
97
- // : null
98
- // }
99
- // }
100
- // }, [])
101
-
102
-
103
- // const backAction = () => {
104
- // if (navigation.isFocused() && isNU(responseJSON) && responseJSON.editStatus) {
105
- // getSound('datanotsaved.mp3')
106
- // setExitBackHandler(true)
107
- // return true;
108
- // }
109
- // // else{
110
- // // setExitBackHandler(false)
111
- // // }
112
- // };
113
-
114
- function getExpand(params) {
115
- params.expand = !params.expand
116
- setRefresh(refresh + 1)
117
- }
118
-
119
- function getSelection(val, item, index) {
120
-
121
- // if (ValueCheck(data) && ArrayCheck(data.consultation)) {
122
- // data.consultation.map((forSelect) => forSelect.selected = false)
123
- // item.selected = true
124
- // setRefresh(refresh + 1)
125
- // }
126
-
127
- getHeaderMoreButtonPress(val, item, index)
128
- }
129
-
130
- function DeleteNotesOrInstructions(val, index, arrayname) {
131
-
132
- const keysToRemove = [val.datavalue]
133
-
134
- console.log('DeleteNotesOrInstructions', keysToRemove)
135
-
136
- const updatedResponseJSON = {
137
- ...responseJSON,
138
- editStatus: true,
139
- consultation: [...responseJSON.consultation], // Clone the consultation array
140
- };
141
-
142
- const natureindex = index;
143
-
144
- const name = arrayname;
145
-
146
- updatedResponseJSON.consultation[natureindex] = {
147
- ...updatedResponseJSON.consultation[natureindex],
148
- editStatus: true,
149
- moreButton: [...updatedResponseJSON.consultation[natureindex].moreButton]
150
- }
151
-
152
- const indexOfSelected = isBNUL(updatedResponseJSON.consultation[natureindex].moreButton) ? updatedResponseJSON.consultation[natureindex].moreButton.findIndex(item => item.name === name) : 0;
153
-
154
-
155
- if (name == 'Notes') {
156
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected] = {
157
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected],
158
- NotesArray: [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray]
159
- };
160
-
161
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray = [
162
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray.filter(item => !keysToRemove.includes(item.datavalue))
163
- ]
164
- }
165
-
166
- if (name == 'Instructions') {
167
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected] = {
168
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected],
169
- InstructionsArray: [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray]
170
- };
171
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray = [
172
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray.filter(item => !keysToRemove.includes(item.datavalue))
173
- ]
174
- }
175
-
176
- setResponseJSON(updatedResponseJSON);
177
-
178
- }
179
-
180
- function renderItem({ item, index }) {
181
-
182
- return (
183
- <View>
184
- {item.visibility ?
185
- <View style={{
186
- marginVertical: normalize(4),
187
- alignSelf: 'center',
188
- elevation: 5,
189
- borderWidth: 0.5,
190
- borderColor: 'lightgrey',
191
- width: '98%',
192
- backgroundColor: '#f2efef', //'#f2efef',
193
- }}>
194
- <HNatureHeading
195
- styles={{
196
- "iconname": item.iconname,
197
- "bgcolor": "#f2efef",
198
- "iconsize": 16,
199
- "iconcolor": item.editStatus != undefined && item.editStatus ? "#2085ec" : Global.AppTheme.primary_color,
200
- "displaytext": item.heading,
201
- "textsize": 14,
202
- "textcolor": Global.AppTheme.primary_color
203
- }}
204
- callBack={val => (val == undefined ? null :
205
- getHeaderClick(item, index)
206
- )}
207
- Expand={val => (val == undefined ? null :
208
- {}
209
- // getExpand(item)
210
- )}
211
- moreButtonArray={item.moreButton}
212
- moreCallBack={val => (val == undefined ? null : getSelection(val, item, index))}
213
- >
214
-
215
- </HNatureHeading>
216
- {/* <HHeading
217
- styles={{
218
- "iconname": item.iconname,
219
- "bgcolor": "#f2efef",
220
- "iconsize": 16,
221
- "iconcolor": item.editStatus != undefined && item.editStatus ? "#2085ec" : Global.AppTheme.primary_color,
222
- "displaytext": item.heading,
223
- "textsize": 14,
224
- "textcolor": Global.AppTheme.primary_color
225
- }}
226
- callBack={val => (val == undefined ? null :
227
- getHeaderClick(item, index)
228
- )}
229
- Expand={val => (val == undefined ? null :
230
- {}
231
- )}>
232
-
233
- <HMoreButton
234
- styles={{
235
- "iconname": 'dots-vertical',
236
- "iconsize": 23,
237
- "iconcolor": Global.AppTheme.primary_color,
238
- "textsize": 9,
239
- "textcolor": Global.AppTheme.primary_color
240
- }}
241
- moreButtonArray={item.moreButton}
242
- // callBack={val => (val == undefined ? null : getHeaderMoreButtonPress(val, item))} />
243
- callBack={val => (val == undefined ? null : getSelection(val, item, index))}
244
- />
245
- </HHeading> */}
246
-
247
- {isBNUL(item.moreButton) &&
248
- item.moreButton.map((Subitem, i) => {
249
- return (
250
- <View style={{ borderWidth: 0 }}>
251
- {Subitem.name == 'Notes' && Subitem.NotesArray != undefined ? (
252
- <NotesInstructionComments
253
- key={i}
254
- disabled={false}
255
- data={Subitem.NotesArray}
256
- icon={'notes'}
257
- verification={true}
258
- more={Subitem}
259
- buttonFunction={(val) => buttonFunctionality(Subitem, i, Subitem.nature, item, index, val)}
260
- deletebutton={true}
261
- deleteCallback={(val) => {
262
- DeleteNotesOrInstructions(val, index, 'Notes')
263
- }}
264
- />
265
- ) : Subitem.name == 'Instructions' && Subitem.InstructionsArray != undefined ? (
266
- <NotesInstructionComments
267
- key={i}
268
- disabled={true}
269
- data={Subitem.InstructionsArray}
270
- icon={'instruction'}
271
- verification={true}
272
- more={Subitem}
273
- buttonFunction={() => buttonFunctionality(Subitem, i, Subitem.nature, item, index)}
274
- deletebutton={true}
275
- deleteCallback={(val) => {
276
- DeleteNotesOrInstructions(val, index, 'Instructions')
277
- }}
278
- />
279
- ) : Subitem.name == 'Comments' ? (
280
- ValueCheck(Subitem.comments) ? (
281
- <TouchableOpacity key={i}
282
- onPress={() => buttonFunctionality(Subitem, i, Subitem.nature, item, index)}
283
- style={{
284
- paddingLeft: normalize(5),
285
- padding: normalize(5),
286
- borderWidth: 0.34,
287
- borderColor: 'lightgrey',
288
- backgroundColor: '#fff',
289
- marginLeft: normalize(10),
290
- borderRadius: normalize(10),
291
- flexDirection: 'row',
292
- alignItems: 'center',
293
- justifyContent: 'flex-start',
294
- marginTop: normalize(1),
295
- elevation: 3,
296
- }}>
297
- <Icons.FontAwesome5
298
- name={'comments'}
299
- size={normalize(13)}
300
- />
301
- <Text
302
- adjustsFontSizeToFit
303
- style={{
304
- fontSize: normalize(13),
305
- paddingLeft: normalize(5),
306
- }}>
307
- {Subitem.comments}
308
- </Text>
309
- </TouchableOpacity>
310
- ) : null
311
- ) : null}
312
- </View>
313
- )
314
- })}
315
-
316
- {item.expand ?
317
- <View>
318
- {item.NewData != null && item.NewData != undefined && item.NewData.length > 0 ?
319
- <FlatList
320
- data={item.details}
321
- renderItem={(k) => renderView(k, item, index)}
322
- keyExtractor={(item, index) => 'keyq' + index}
323
- listKey={(item, index) => 'keys' + index}
324
- />
325
- : null}
326
- </View> : null}
327
- </View>
328
- : null}
329
- </View>
330
- )
331
-
332
- }
333
-
334
- function getConsultation() {
335
-
336
- Global.EditStatus = null;
337
- setIsLoading(true);
338
- setResponseJSON({});
339
- setData();
340
- let buttonapi = props?.route?.params?.customlink ? props?.route?.params?.customlink : APIURL + Global.PatientDetails.detailapi;
341
- console.log("getConsultation...................", buttonapi);
342
-
343
- NetworkServiceCall("get", buttonapi, "", false)
344
- .then(function (response) {
345
- if (response.httpstatus == 200) {
346
- if (response.data != undefined
347
- && response.data.consultationdata != undefined) {
348
- Global.ParameterInfo = response.data.consultationdata
349
- }
350
- setResponseJSON(response.data)
351
- setData(response.data)
352
- setFooter(response.data.componentFooter)
353
- setIsLoading(false)
354
- } else {
355
- notifyMessage(response.data.subtitle, 2)
356
- setIsLoading(false)
357
- navigation.goBack()
358
- }
359
- })
360
- getLoading(v => setIsLoading(false))
361
-
362
- }
363
-
364
- const renderView = ({ item, index }, parent, natureindex) => {
365
-
366
- console.log('renderView', item.componentname);
367
-
368
- return (
369
- <View>
370
- <HView
371
- component={item.componentname}
372
- data={parent.data}
373
- index={index}
374
- natureindex={natureindex}
375
- parentClass={parent}
376
- />
377
- </View>
378
- )
379
- }
380
-
381
- function getAddNature(params) {
382
-
383
- isBNUL(params) ?
384
- params.map((item) => { responseJSON.consultation.push({ ...item, "editStatus": true }) })
385
- : null;
386
-
387
- // ArrayCheck(params) ? params.map((item) => {
388
- // responseJSON.consultation.unshift({
389
- // ...item,
390
- // "editStatus": true
391
- // })
392
- // }) : null
393
-
394
- // console.log('hii...............', JSON.stringify(responseJSON));
395
- }
396
-
397
- function getAddTemplate(params) {
398
- const Template = params.filter(({ hosumrclassificationnature: id1 }) => !responseJSON.consultation.some(({ hosumrclassificationnature: id2 }) => id2 === id1));
399
- if (isBNUL(Template)) {
400
- Template.map((item) => { responseJSON.consultation.push({ ...item, "editStatus": true }) });
401
- setRefresh(refresh + 1);
402
- }
403
- else {
404
- }
405
- }
406
-
407
- function getOverWriteTemplate(params) {
408
-
409
- const Template = params.filter(function (item) { return item });
410
-
411
- if (isBNUL(Template)) {
412
-
413
- responseJSON.consultation.splice(0, responseJSON.consultation.length)
414
- setVisibility(false);
415
- setTimeout(() => {
416
- Template.map((subItems) => {
417
- responseJSON.consultation.push({ ...subItems, "editStatus": true })
418
- });
419
- setVisibility(true);
420
- });
421
- }
422
-
423
- // if (data.consultation != undefined) {
424
- // data.consultation.splice(0, data.consultation.length)
425
- // setVisibility(false)
426
- // setTimeout(() => {
427
- // params.map((subItems) => {
428
- // data.consultation.push({ ...subItems, "editStatus": true })
429
- // })
430
- // setVisibility(true)
431
- // });
432
- // }
433
- }
434
-
435
- function getVerify() {
436
-
437
- var groups = {
438
- "consultationdata": responseJSON.consultationdata,
439
- "consultation": responseJSON.consultation.map(function (itemclassification) {
440
- if (itemclassification.hosumrclassificationnature) {
441
- switch (itemclassification.hosumrclassificationnature) {
442
- case 17:
443
- case 20:
444
-
445
- // const Validatation = itemclassification.NewData[0].editArray.map(item =>
446
- // !item.multitiming ?
447
- // item.timingdata[0].hosumrprescriptiontiming : item.timingdata.map(xxx => xxx.hosumrprescriptiontiming))
448
- // const merged = [].concat.apply([], Validatation).includes(0)
449
- // merged ? notifyMessage("Please fill out mandatory fields on Prescription") : null
450
-
451
- return ({
452
- ...itemclassification,
453
- "moreButton": itemclassification.moreButton != undefined ? getMoreButton(itemclassification) : []
454
- })
455
- case 0: return ({
456
- ...itemclassification,
457
- "NewData": itemclassification.NewData != undefined
458
- && itemclassification.NewData[0].editArray != undefined &&
459
- itemclassification.NewData[0].editArray != undefined ? getSavedFiles(itemclassification) : []
460
- })
461
- default: return ({
462
- ...itemclassification,
463
- "moreButton": itemclassification.moreButton != undefined ? getMoreButton(itemclassification) : [],
464
- "NewData": itemclassification.NewData != undefined && itemclassification.NewData.length > 0 ? getNewDataArray(itemclassification) : []
465
- })
466
- }
467
- }
468
- }).filter(n => n)
469
- }
470
-
471
- var dataset = { groups }
472
- console.log("GRopsssssssss", groups.consultation)
473
- console.log('------------------VERIFY----------------------------', JSON.stringify(dataset));
474
- let buttonapi = APIURL + "commonsave/getpatientchartverify";
475
- console.log('output-----------------------------', buttonapi);
476
- setIsLoading(true);
477
- NetworkServiceCall('post', buttonapi, dataset).then(function (response) {
478
- console.log("REPOSNEEEEEEEEEEEEEEEEEE", JSON.stringify(response))
479
- if (response.httpstatus == 200 && response.data != undefined &&
480
- response.data != null && response.data.Code == 200) {
481
- getSound('https://www.mboxdrive.com/datasaved.mp3');
482
- notifyMessage('Data Verified!!!!!', 1);
483
- setIsLoading(false)
484
- setBackHandler(false)
485
- props.navigation.goBack()
486
- } else {
487
- getSound('https://www.mboxdrive.com/datanotsaved.mp3');
488
- notifyMessage('Data Not Verified!!!!!', 2);
489
- setIsLoading(false);
490
- setBackHandler(false)
491
- }
492
- });
493
- getLoading(v => setIsLoading(false))
494
- }
495
-
496
- function getDataForPreview(data) {
497
-
498
- const jsonremovedquotes = isNU(data) && isBNUL(data.consultation) ? data.consultation.map((val) => {
499
- return ({
500
- ...val,
501
- "currentreportbuttonapi": ""
502
- })
503
- }) : [];
504
-
505
- const jsonBody = {
506
- "groups": {
507
- ...data,
508
- "consultation": jsonremovedquotes
509
- }
510
- }
511
- return jsonBody
512
- }
513
-
514
- function getCheckSave(params) {
515
- if (params) {
516
- getSave()
517
- }
518
- else {
519
- notifyMessage('No data to save.')
520
- }
521
- }
522
-
523
- function getEditFlag(params) {
524
- // console.log("PARAMS INSIDE PRESCRIPTIONNNNNNN", JSON.stringify(params))
525
- if (params.EditFlag == 1) {
526
- return params.EditFlag = 2
527
- } else if (params.EditFlag == 3) {
528
- return params.EditFlag = 4
529
- }
530
- else {
531
- return params.EditFlag
532
- }
533
- // Global.EditStatus = 1
534
- // responseJSON.consultationEdit.editStatus = true
535
- }
536
-
537
- function CheckIfEdited(array) {
538
-
539
- let prevcodearray = array.filter((i, k) => { return i.editStatus ? { ...i } : undefined });
540
- let prevcode = isBNUL(prevcodearray) ? true : false;
541
- return prevcode;
542
-
543
- }
544
-
545
- function getFooterFunctions(val) {
546
-
547
- switch (val.heading) {
548
- case "Save":
549
-
550
- if (CheckIfEdited(responseJSON.consultation)) {
551
-
552
- if (Global.PatientDetails.profilecontent[0].patienttype == 'IP') {
553
-
554
- navigate('PdfUnSavedViewer', {
555
- 'headerblockstyle': {
556
- marginBottom: normalize(35)
557
- },
558
- 'data': getDataForPreview(responseJSON),
559
- 'link': APIURL + "jrinsurance/jrcommonjreport/" + "/rnhomrNatureChartPreview/0/ClassificationNatureDetails",
560
- 'savebutton': true,
561
- savecallback: (val) => { getCheckSave(val) }
562
- })
563
- }
564
- else {
565
- getSave()
566
- }
567
-
568
- }
569
- else {
570
- notifyMessage("No data to save.", 3)
571
- }
572
-
573
-
574
- break;
575
- case "Chart Download":
576
- navigate('PdfPreview', { 'headerblockstyle': { marginBottom: normalize(35) }, 'link': APIURL + "jrinsurance/jrcommonreport/" + val.buttonapi })
577
- break;
578
- case "Chart Preview":
579
- navigate('PdfUnSavedViewer', {
580
- 'headerblockstyle': {
581
- marginBottom: normalize(35)
582
- },
583
- 'data': getDataForPreview(data),
584
- 'link': APIURL + "jrinsurance/jrcommonjreport/" + val.buttonapi
585
- // 'rnhomrNatureChartPreview/0/ClassificationNatureDetails'
586
- })
587
- break;
588
- case "Registration Preview":
589
- // console.log('Registration Preview');
590
- navigate('RegistrationDetails', {
591
- 'headerblockstyle': {
592
- marginBottom: normalize(35)
593
- },
594
- // 'data': getDataForPreview(data),
595
- // 'link': APIURL + "jrinsurance/jrcommonjreport/" + val.buttonapi
596
- // 'rnhomrNatureChartPreview/0/ClassificationNatureDetails'
597
- })
598
- break;
599
- case "Verify":
600
- var x = ValueCheck(responseJSON.consultation) ? responseJSON.consultation.filter((item) => item.editStatus == true ? item.editStatus : false) : []
601
- console.log("VARIABLE ARRAYYYYYYYYYYYYYYY", JSON.stringify(x))
602
- if (x.length == 0) {
603
- setBackHandler(true)
604
- } else {
605
- notifyMessage("Please save patient data before verification", 5)
606
- setIsLoading(false);
607
- }
608
- break;
609
- case "SaveAs Template":
610
- navigate('SaveTemplate', {
611
- type: 0
612
- // data: responseJSON.consultation
613
- })
614
- break;
615
- case "Template":
616
- // setResponseJSON({
617
- // ...data,
618
- // })
619
- setOverlayData({
620
- "displaytext": "Template",
621
- "iconcolor": '#a30e0e',
622
- "fontcolor": '#a30e0e',
623
- "shadowcolor": '#ffe5e5',
624
- "iconname": "list-ul",
625
- "selected": false,
626
- "visibility": true,
627
- "iconsize": 22,
628
- "functionid": "C02",
629
- "componentname": "AddTemplate"
630
- })
631
- setOverlay(true)
632
- break;
633
- case "MicroTemplate":
634
- case "Add Nature":
635
- console.log('Add Nature jjj.........', JSON.stringify(val))
636
- setOverlayData(val)
637
- setOverlay(true)
638
- break;
639
- case "Lab Results":
640
- navigate('CValueSummary')
641
- break;
642
- case "Diagnosis":
643
- const sampledata = {
644
- "itemid": 7,
645
- "heading": "Diagnosis",
646
- "functionname": "overlay",
647
- "buttonapi": "insuranceadvanceget/emrcommonget/exec rndddaaddclassificationnature 6215896,7,176,3,1,",
648
- "name": "Diagnosis",
649
- "componentname": "CIcdView",
650
- "iconname": "file-text-o"
651
- };
652
- setOverlayData(sampledata);
653
- setOverlay(true);
654
- break;
655
- case "Files":
656
- data.consultation.map((fileEx, i) => {
657
- fileEx.customcomponent == 'FileExplorer'
658
- ?
659
- (navigate(fileEx.customcomponent, {
660
- data: fileEx.NewData[0].editArray[0],
661
- entireData: fileEx,
662
- eventData: fileEx,
663
- onselect: () => editStatus(fileEx),
664
- }),
665
- setResponseJSON({
666
- ...responseJSON,
667
- // "consultation": ValueCheck(data) && ValueCheck(data.consultation) ? data.consultation : [],
668
- "consultationEdit": fileEx
669
- }))
670
- : console.log('files null', fileEx.customcomponent);
671
- })
672
- break;
673
- case "Medications":
674
- navigate('CalendarMedications')
675
- break;
676
- }
677
- }
678
-
679
- function selectProps(...props) {
680
- return function (obj) {
681
- const newObj = {};
682
- props.forEach(name => {
683
- newObj[name] = obj[name];
684
- });
685
-
686
- return newObj;
687
- }
688
- }
689
-
690
- function getSavedFiles(obj) {
691
- for (const [key, value] of Object.entries(obj.NewData[0].editArray[0])) {
692
- switch (key) {
693
- case "savedimages": var ImagesString = value.map((images) => images.filename).toString()
694
- obj.FilesImagesString = ImagesString
695
- break;
696
- case "savedvideo": var VideosString = value.map((videos) => videos.filename).toString()
697
- obj.FilesVideosString = VideosString
698
- break;
699
- case "savedaudio": var AudiosString = value.map((audios) => audios.filename).toString()
700
- obj.FilesAudiosString = AudiosString
701
- break;
702
- case "saveddoc": var DocumentString = value.map((docs) => docs.filename).toString()
703
- obj.FilesDocumentString = DocumentString
704
- break;
705
- case "savedpdf": var PdfString = value.map((pdf) => pdf.filename).toString()
706
- obj.FilesPdfString = PdfString
707
- break;
708
- }
709
- }
710
- return obj
711
- }
712
-
713
- function getMoreButton(itemclassification) {
714
- itemclassification.moreButton.map(function (x) {
715
-
716
- switch (x.name) {
717
- // case "Notes": var stringNotes = ArrayCheck(x.NotesArray) ? x.NotesArray.map((notes) => notes.datavalue).toString() : ""
718
- // itemclassification.NotesString = stringNotes
719
- // break;
720
- case "Notes":
721
- var stringNotes = ArrayCheck(x.NotesArray) ? x.NotesArray.map((notes) => notes.displayvalue).toString() : ""
722
- itemclassification.NotesString = stringNotes
723
- break;
724
- case "Instructions": var InstructionsString = ArrayCheck(x.InstructionsArray) ? x.InstructionsArray.map((notes) => notes.datavalue).toString() : ""
725
- itemclassification.InstructionsString = InstructionsString
726
- break;
727
- case "Images": var ImagesString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedimages) ? x.dataapi[0].savedimages.map((images) => images.filename).toString() : ""
728
- itemclassification.ImagesString = ImagesString
729
- break;
730
- case "Videos": var VideosString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedvideo) ? x.dataapi[0].savedvideo.map((videos) => videos.filename).toString() : ""
731
- itemclassification.VideosString = VideosString
732
- break;
733
- case "Audios": var AudiosString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedaudio) ? x.dataapi[0].savedaudio.map((audio) => audio.filename).toString() : ""
734
- itemclassification.AudiosString = AudiosString
735
- break;
736
- case "Documents": var PdfString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedpdf) ? x.dataapi[0].savedpdf.map((audio) => audio.filename).toString() : ""
737
- itemclassification.PdfString = PdfString
738
- break;
739
- case "Draw": var DrawString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].saveddoc) ? x.dataapi[0].saveddoc.map((audio) => audio.filename).toString() : ""
740
- itemclassification.DocumentString = DrawString
741
- break;
742
- case "Files":
743
- var VideosString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedvideo) ? x.dataapi[0].savedvideo.map((videos) => videos.filename).toString() : ""
744
- itemclassification.FilesVideosString = VideosString
745
- var ImagesString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedimages) ? x.dataapi[0].savedimages.map((images) => images.filename).toString() : ""
746
- itemclassification.FilesImagesString = ImagesString
747
- var AudiosString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedaudio) ? x.dataapi[0].savedaudio.map((audio) => audio.filename).toString() : ""
748
- itemclassification.FilesAudiosString = AudiosString
749
- var DocumentString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].saveddoc) ? x.dataapi[0].saveddoc.map((docs) => docs.filename).toString() : ""
750
- itemclassification.FilesDocumentString = DocumentString
751
- var PdfString = ArrayCheck(x.dataapi) && ArrayCheck(x.dataapi[0].savedpdf) ? x.dataapi[0].savedpdf.map((docs) => docs.filename).toString() : ""
752
- itemclassification.FilesPdfString = PdfString
753
- break;
754
- default: return x
755
- }
756
- })
757
- return itemclassification.moreButton
758
- }
759
-
760
- function getNewDataArray(itemclassification) {
761
- itemclassification.NewData != undefined &&
762
- itemclassification.NewData.length > 0
763
- ? itemclassification.NewData.map(function (x) {
764
- switch (x.componentname) {
765
- case "CustomVitalSign":
766
- return ({
767
- ...x,
768
- "editArray": x.editArray != undefined && x.editArray.length > 0 ? x.editArray.map(function (y) {
769
-
770
-
771
- if (y.notesStatus != undefined && y.notesStatus == true) {
772
- var stringNotes = y.NotesArray != undefined && typeof y.NotesArray != 'string' && y.NotesArray.length > 0 ? y.NotesArray.map((notes) => notes.displayvalue).toString() : ""
773
- y.NotesString = stringNotes
774
- }
775
-
776
- if (y.instructionStatus != undefined && y.instructionStatus == true) {
777
- var InstructionsString = y.InstructionsArray != undefined && typeof y.InstructionsArray != 'string' && y.InstructionsArray.length > 0 ? y.InstructionsArray.map((notes) => notes.datavalue).toString() : ""
778
- y.InstructionsString = InstructionsString
779
- }
780
-
781
- // if (y.notesStatus != undefined && y.notesStatus == true) {
782
- // var stringNotes = y.NotesArray != undefined && typeof y.NotesArray != 'string' && y.NotesArray.length > 0 ? y.NotesArray.map((notes) => notes.datavalue).toString() : ""
783
- // y.NotesString = stringNotes
784
- // }
785
- }) : []
786
- })
787
-
788
- case "CAssessment":
789
- return ({
790
- ...x,
791
- "editArray": x.editArray != undefined && x.editArray.length > 0 ? x.editArray.map(function (y) {
792
- var stringNotes = y.NotesArray != undefined && y.NotesArray.length > 0 ? y.NotesArray.map((notes) => notes.datavalue).toString() : ""
793
- y.NotesString = stringNotes
794
- var savedString = y.savedtypes != undefined && y.savedtypes.length > 0 ? y.savedtypes.map((notes) => notes.datavalue).toString() : ""
795
- y.DataString = savedString
796
- }) : []
797
- })
798
- default: return x
799
- }
800
- }) : []
801
- return itemclassification.NewData
802
- }
803
-
804
- function getSave() {
805
-
806
- const newgroup = {
807
- "groups": {
808
- "procedurename": "homrcommonsave1",
809
- "consultationdata": responseJSON.consultationdata,
810
- consultation: [...responseJSON.consultation].map(function (itemclassification) {
811
- if (itemclassification.editStatus == true) {
812
- switch (itemclassification.hosumrclassificationnature) {
813
- case 20:
814
- const PostPrescription = Global.PatientDetails.profilecontent[0].patienttype == 'IP' && isBNUL(itemclassification.NewData[0].editArray) ? itemclassification.NewData[0].editArray.map((subItem) => ({
815
- ...subItem,
816
- "EditFlag": getEditFlag(subItem)
817
- })) : [];
818
- return ({
819
- ...itemclassification,
820
- "postflag": Global.PatientDetails.profilecontent[0].patienttype == 'IP' ? true : itemclassification.postflag,
821
- "NewData": [
822
- {
823
- ...itemclassification.NewData[0],
824
- 'editArray': Global.PatientDetails.profilecontent[0].patienttype == 'IP' ? PostPrescription : itemclassification.NewData[0].editArray,
825
- }
826
- ],
827
- "moreButton": itemclassification.moreButton != undefined ? getMoreButton(itemclassification) : []
828
- })
829
- case 0: return ({
830
- ...itemclassification,
831
- "NewData": itemclassification.NewData != undefined
832
- && itemclassification.NewData[0].editArray != undefined &&
833
- itemclassification.NewData[0].editArray != undefined ? getSavedFiles(itemclassification) : []
834
- })
835
- default: return ({
836
- ...itemclassification,
837
- "moreButton": itemclassification.moreButton != undefined ? getMoreButton(itemclassification) : [],
838
- "NewData": itemclassification.NewData != undefined && itemclassification.NewData.length > 0 ? getNewDataArray(itemclassification) : []
839
- })
840
- }
841
- }
842
- }).filter(n => n)
843
- }
844
- };
845
- SaveApi(newgroup);
846
- }
847
-
848
- function SaveApi(dataset) {
849
-
850
-
851
- let buttonapi = APIURL + 'commonsave/PatientChartSave';
852
- console.log('SaveApi buttonapi-----------------------------', buttonapi);
853
- console.log('SaveApi JSON----------------------------------------------', JSON.stringify(dataset));
854
-
855
- setIsLoading(true);
856
- NetworkServiceCall('post', buttonapi, dataset).then(function (response) {
857
- if (response.httpstatus == 200) {
858
- if (response.data && response.data.Code == 200) {
859
- // getSound('https://www.mboxdrive.com/datasaved.mp3');
860
- setIsLoading(false);
861
- Global.ChartDataAll = null;
862
- if (Global.PatientDetails.profilecontent[0].patienttype == 'IP') {
863
- navigation.goBack()
864
- }
865
- else {
866
- getConsultation()
867
- }
868
- notifyMessage('Data Saved.', 1);
869
- } else {
870
- setIsLoading(false);
871
- notifyMessage(response.data.message, 2);
872
- }
873
- } else {
874
- // getSound('https://www.mboxdrive.com/datanotsaved.mp3');
875
- setIsLoading(false);
876
- notifyMessage('Data Not Saved. Network Error.', 4);
877
- }
878
- });
879
-
880
-
881
-
882
- }
883
-
884
- function buttonFunctionality(item, key, nature, classification, index, editnote) {
885
-
886
- var x = {
887
- ...item,
888
- "key": key,
889
- "nature": nature != undefined ? nature : "G",
890
- "classification": classification != undefined ? classification : null,
891
- "natureindex": index,
892
- "editnote": isNU(editnote) && isNUQ(editnote.displayvalue) ? editnote.displayvalue : null
893
- };
894
- console.log('buttonFunctionality.............', JSON.stringify(x));
895
- setOverlay(true);
896
- setOverlayData(x);
897
- }
898
-
899
- function getComments(item, index) {
900
-
901
- setResponseJSON({
902
- ...responseJSON,
903
- natureindex: index
904
- });
905
- setOverlayData({
906
- ...item,
907
- "natureindex": index,
908
- });
909
- setOverlay(true);
910
-
911
- var x = {
912
- ...item,
913
- "key": key,
914
- "nature": nature != undefined ? nature : "G",
915
- "classification": classification != undefined ? classification : null,
916
- "natureindex": index,
917
- };
918
- setOverlay(true);
919
- setOverlayData(x);
920
- }
921
-
922
- function getHeaderMoreButtonPress(val, item, index) {
923
-
924
- if (val.keyid == 3441) { // Vital Sign Early Warning Setup
925
- setResponseJSON({
926
- ...responseJSON,
927
- natureindex: index,
928
- "consultationEdit": item
929
- });
930
- navigate('CTprOverall');
931
- }
932
- else {
933
-
934
- switch (val.name) {
935
- case 'Add Parameter':
936
- setResponseJSON({
937
- ...responseJSON,
938
- natureindex: index,
939
- "consultationEdit": item
940
- })
941
- buttonFunctionality(val)
942
- break;
943
- case 'Delete':
944
- deletearg.homrpatientchart = item.homrpatientchart;
945
- deletearg.homrpatientchartdetail = item.homrpatientchartdetail ? item.homrpatientchartdetail : 0;
946
- deletearg.hosumrclassificationnature = item.hosumrclassificationnature;
947
- deletearg.nature = item.nature;
948
- deletearg.keyid = item.keyid;
949
- setDeleteClassificationNature(deletearg);
950
- setDeleteConfirmation(true);
951
- break;
952
- case 'Comments':
953
- // getComments(val, index);
954
- buttonFunctionality(val, index, item.nature, item, index)
955
- break;
956
- case 'Instructions':
957
- case 'Notes':
958
- buttonFunctionality(val, 1, item.nature, item, index)
959
- if (val.name != "Delete") {
960
- setResponseJSON({
961
- ...responseJSON,
962
- "consultationEdit": item
963
- })
964
- }
965
- break;
966
- case 'Files':
967
- navigate(val.componentname, {
968
- data: val && val.dataapi ? val.dataapi[0] : null,
969
- entireData: val,
970
- eventData: item,
971
- onselect: editStatus,
972
- });
973
- if (val.name != "Delete") {
974
- setResponseJSON({
975
- ...responseJSON,
976
- "consultationEdit": item
977
- })
978
- }
979
- break;
980
- case 'Images':
981
- console.log('Images', val.componentname, val.dataapi[0], '@@@@@@@@@@@@', val, '@@@@@@@@@@@@@@', item, '@@@@@@@@@@@@@@', editStatus)
982
- navigate(val.componentname, {
983
- data: val && val.dataapi ? val.dataapi[0] : null,
984
- entireData: val,
985
- eventData: item,
986
- visibility: 1,
987
- onselect: editStatus,
988
- });
989
- if (val.name != "Delete") {
990
- setResponseJSON({
991
- ...responseJSON,
992
- "consultationEdit": item
993
- })
994
- }
995
- break;
996
- case 'Videos':
997
- navigate(val.componentname, {
998
- data: val && val.dataapi ? val.dataapi[0] : null,
999
- entireData: val,
1000
- eventData: item,
1001
- visibility: 3,
1002
- onselect: editStatus,
1003
- });
1004
- if (val.name != "Delete") {
1005
- setResponseJSON({
1006
- ...responseJSON,
1007
- "consultationEdit": item
1008
- })
1009
- }
1010
- break;
1011
- case 'Audios':
1012
- navigate(val.componentname, {
1013
- data: val && val.dataapi ? val.dataapi[0] : null,
1014
- entireData: val,
1015
- eventData: item,
1016
- visibility: 2,
1017
- onselect: editStatus,
1018
- });
1019
- if (val.name != "Delete") {
1020
- setResponseJSON({
1021
- ...responseJSON,
1022
- "consultationEdit": item
1023
- })
1024
- }
1025
- break;
1026
- case 'Documents':
1027
- navigate(val.componentname, {
1028
- data: val && val.dataapi ? val.dataapi[0] : null,
1029
- entireData: val,
1030
- eventData: item,
1031
- visibility: 4,
1032
- onselect: editStatus,
1033
- });
1034
- if (val.name != "Delete") {
1035
- setResponseJSON({
1036
- ...responseJSON,
1037
- "consultationEdit": item
1038
- })
1039
- }
1040
- break;
1041
- case 'Draw':
1042
- navigate(val.componentname, {
1043
- data: val && val.dataapi ? val.dataapi[0] : null,
1044
- entireData: val,
1045
- eventData: item,
1046
- visibility: 5,
1047
- onselect: editStatus,
1048
- });
1049
- if (val.name != "Delete") {
1050
- setResponseJSON({
1051
- ...responseJSON,
1052
- "consultationEdit": item
1053
- })
1054
- }
1055
- break;
1056
- case 'Medication Chart':
1057
- notifyMessage("Incorporate Soon")
1058
- break;
1059
- default:
1060
- buttonFunctionality(val)
1061
- if (val.name != "Delete") {
1062
- setResponseJSON({
1063
- ...responseJSON,
1064
- "consultationEdit": item
1065
- })
1066
- }
1067
- break;
1068
- }
1069
-
1070
- }
1071
-
1072
-
1073
-
1074
-
1075
-
1076
- }
1077
-
1078
- function editStatus(item) {
1079
- Global.EditStatus = 1;
1080
- if (item) {
1081
- item.editStatus = true
1082
- console.log("FILE", JSON.stringify(item))
1083
- }
1084
- setRefresh(refresh + 1);
1085
- }
1086
-
1087
- function getHeaderClick(item, index) {
1088
- // console.log("response jsonnnnnnnnnnnnnnnnnnnnnnn", JSON.stringify(responseJSON))
1089
- // console.log("response jsonnnnnnnnnnnnnnnnnnnnnnn", JSON.stringify(data))
1090
- switch (item.hosumrclassificationnature) {
1091
- default:
1092
-
1093
- const updateContext = {
1094
- ...responseJSON,
1095
- natureindex: index
1096
- };
1097
- setResponseJSON(updateContext);
1098
-
1099
- // setResponseJSON({
1100
- // ...responseJSON,
1101
- // "natureindex": index
1102
- // // "consultation": ValueCheck(data) && ValueCheck(data.consultation) ? data.consultation : responseJSON.consultation,
1103
- // // "consultationEdit": item
1104
- // })
1105
- navigate('ConsultationEdit', {
1106
- data: props.data,
1107
- parent: item
1108
- })
1109
- break;
1110
- }
1111
- }
1112
-
1113
- function renderFlashList(array) {
1114
-
1115
- let newdata = isBNUL(array) ? array.filter(function (item) { return item }) : [];
1116
-
1117
- return (
1118
- isBNUL(newdata) ?
1119
- <FlashList
1120
- data={newdata}
1121
- renderItem={(val) => renderItem(val)}
1122
- keyExtractor={(item, index) => 'key' + index}
1123
- estimatedItemSize={normalize(160)}
1124
- />
1125
- : null
1126
- )
1127
-
1128
- }
1129
-
1130
- const [optionsArray, setOptionsArray] = useState({
1131
- "success": true,
1132
- "httpstatus": 200,
1133
- "message": "SUCCESS",
1134
- "data": {
1135
- "data": [
1136
- {
1137
- "datavalue": 1,
1138
- "displayvalue": "PRESCIPTION",
1139
- "selected": false
1140
- },
1141
- {
1142
- "datavalue": 2,
1143
- "displayvalue": "SUMMARY",
1144
- "selected": false
1145
- },
1146
- {
1147
- "datavalue": 2,
1148
- "displayvalue": "VITAL SIGNS",
1149
- "selected": false
1150
- }
1151
- ]
1152
- }
1153
- });
1154
-
1155
- function fnstring(i) {
1156
- return isNU(i) ? i.toString() : null
1157
- }
1158
-
1159
- function fnarray(i) {
1160
- let array = [];
1161
- isBNUL(i) ? i.map(data => { data.selected ? array.push(data.displayvalue) : null }) : null
1162
- return array
1163
- }
1164
-
1165
- function fnGetDiagnosis(array) {
1166
- return fnstring(fnarray(array));
1167
- }
1168
-
1169
- function newFunction(val) {
1170
- setOptionsArray(prevState => {
1171
-
1172
- const updatedData = prevState.data.data.map(item => {
1173
- if (item.datavalue == val) {
1174
- return {
1175
- ...item,
1176
- selected: true // Toggle the selected value
1177
- };
1178
- }
1179
- return item; // Keep other items unchanged
1180
- });
1181
-
1182
- return {
1183
- ...prevState,
1184
- data: {
1185
- ...prevState.data,
1186
- data: updatedData
1187
- }
1188
- };
1189
- })
1190
- }
1191
-
1192
- return (
1193
- <CContainerView>
1194
- <HeaderBlock
1195
- style={{ marginBottom: normalize(30) }}
1196
- navigation={navigation}
1197
- backhandler={true}
1198
- consultation={true}
1199
- callback={(val) => {
1200
- if (isNU(responseJSON) && isBNUL(responseJSON.consultation) && CheckIfEdited(responseJSON.consultation)) {
1201
- setExitBackHandler(true)
1202
- }
1203
- else {
1204
- navigation.goBack();
1205
- }
1206
- }}
1207
- />
1208
- <CDetailView>
1209
- {/* <PanGestureHandler onGestureEvent={handleGesture}> */}
1210
- <View style={{ flex: 1 }}>
1211
- {props?.route?.params?.chartscan ?
1212
- <View style={{ flex: 1 }}>
1213
- <HHeading
1214
- styles={{
1215
- "icongroup": 3,
1216
- "iconname": 'scanner',
1217
- "bgcolor": "#f2efef",
1218
- "iconsize": 16,
1219
- "iconcolor": Global.AppTheme.primary_color,
1220
- "displaytext": 'CHART SCAN',
1221
- "textsize": 14,
1222
- "textcolor": Global.AppTheme.primary_color,
1223
- }}
1224
- callBack={val => (val == undefined ? null : console.log(val))}>
1225
- </HHeading>
1226
- {isNU(props.route.params.detailinfo) ?
1227
- <CDetailCard
1228
- val={props?.route?.params?.detailinfo ? props?.route?.params?.detailinfo : null}
1229
- // blockData={blockData}
1230
- admissiontype={props?.route?.params?.admissiontype ? props.route.params.admissiontype : null}
1231
- NavigateToPatientChart={() => { }}
1232
- getXRay={() => { }}
1233
- getLabResults={() => { }}
1234
- chartscancallback={(blockData1, detailcardinfo) => { }}
1235
- chartscanfilescallback={(blockData, detailcardinfo) => { }}
1236
- hidefilebutton={true}
1237
- hidechartscanbutton={true}
1238
- />
1239
- : null}
1240
- {/* <View>
1241
- <Menu>
1242
- <MenuTrigger
1243
- // onPress={()=>{
1244
- // getTokenList2(footerData, moment(item.postponedate).format('YYYY-MM-DD'),item)
1245
- // }}
1246
- customStyles={{
1247
- triggerWrapper: {
1248
- borderWidth: 0,
1249
- justifyContent: 'flex-start',
1250
- alignItems: 'flex-start'
1251
- }
1252
- }}
1253
- >
1254
- <View style={{ flexDirection: 'row', justifyContent: 'flex-start', alignItems: 'center', borderWidth: 0.5, borderRadius: 5, margin: normalize(5), backgroundColor: 'white', elevation: 5, borderColor: 'lightgrey', height: normalize(35) }}>
1255
- <HOCIcons.Icons
1256
- icongroup={3}
1257
- name={'view-list'}
1258
- size={normalize(18)}
1259
- color={Global.AppTheme.primary_color}
1260
- style={{ textAlign: 'center', marginHorizontal: normalize(5) }}
1261
- />
1262
- <Text adjustsFontSizeToFit style={{ flex: 1, color: 'black', fontSize: normalize(10), fontWeight: 'bold', paddingHorizontal: normalize(3) }}>
1263
- {isNU(optionsArray) && isNU(optionsArray.data) && isBNUL(optionsArray.data.data) ?
1264
- fnGetDiagnosis(optionsArray.data.data)
1265
- : null}
1266
- </Text>
1267
- <Text style={{
1268
- position: 'absolute',
1269
- // backgroundColor: 'white',
1270
- top: normalize(0),
1271
- left: normalize(10),
1272
- fontSize: normalize(10),
1273
- color: Global.AppTheme.primary_color
1274
- }}>{" Select Nature "}</Text>
1275
- </View>
1276
- </MenuTrigger>
1277
- <MenuOptions
1278
- optionsContainerStyle={{ marginTop: normalize(40), backgroundColor: '#ffffff00' }}
1279
- customStyles={{
1280
- optionsContainer: {
1281
- shadowColor: '#000000d8',
1282
- shadowRadius: 0,
1283
- borderRadius: 5,
1284
- borderWidth: 0.5,
1285
- padding: normalize(5),
1286
- borderColor: 'lightgrey',
1287
- elevation: 3,
1288
- width: Dimensions.get('screen').width * 0.5,
1289
- backgroundColor: 'white'
1290
- },
1291
- optionText: {},
1292
- }}>
1293
- <CDropDownList
1294
- // dropdownapi={EMRAPI.getDropDown1}
1295
- dropdownarray={optionsArray}
1296
- callback={val => { newFunction(val.datavalue) }}
1297
- />
1298
- </MenuOptions>
1299
- </Menu>
1300
- </View> */}
1301
- {/* <View style={{ flex: 1 }}>
1302
- {isNU(data) && isBNUL(data.consultation) ? data.consultation.map((fileEx, i) => {
1303
- return (
1304
- fileEx.customcomponent == 'FileExplorer'
1305
- ?
1306
- <View style={{ borderWidth: 0, flex: 1 }}>
1307
- <FileExplorer
1308
- route={{
1309
- 'params': {
1310
- 'data': fileEx.NewData[0].editArray[0],
1311
- 'entireData': fileEx,
1312
- 'eventData': fileEx,
1313
- 'componenttype': true,
1314
- onselect: () => editStatus(fileEx)
1315
- }
1316
- }}
1317
- />
1318
- </View>
1319
- // (navigate(fileEx.customcomponent, {
1320
- // data: fileEx.NewData[0].editArray[0],
1321
- // entireData: fileEx,
1322
- // eventData: fileEx,
1323
- // onselect: () => editStatus(fileEx),
1324
- // }))
1325
- : null
1326
- )
1327
- }) : null}
1328
- </View> */}
1329
- </View>
1330
- : null}
1331
-
1332
- {backHandler ?
1333
- <CBackHandler
1334
- type={2} // 2 for confirmation
1335
- callBack={(val) => (val == undefined ? null : getVerify())}
1336
- close={(val) => (val == undefined ? null : setBackHandler(val))}
1337
- /> : null}
1338
-
1339
- {exitbackHandler ?
1340
- <CBackHandler
1341
- type={5} // 2 for confirmation
1342
- callBack={(val) => (val == undefined ? null : props.navigation.goBack())}
1343
- close={(val) => (val == undefined ? null : setExitBackHandler(val))}
1344
- /> : null}
1345
-
1346
- {/* <HAbsolute
1347
- callBack={val => (val == undefined ? null : getHeaderMoreButtonPress(val, responseJSON.consultationEdit))}
1348
- /> */}
1349
-
1350
- {!props?.route?.params?.chartscan && isNU(responseJSON) && isBNUL(responseJSON.consultation) && visibility ?
1351
- // <FlatList
1352
- // data={responseJSON.consultation}
1353
- // renderItem={(val) => renderItem(val)}
1354
- // initialNumToRender={5}
1355
- // maxToRenderPerBatch={10}
1356
- // keyExtractor={(item, index) => 'keyh' + index}
1357
- // />
1358
- renderFlashList(responseJSON.consultation)
1359
- : null}
1360
- </View>
1361
- {/* </PanGestureHandler> */}
1362
- </CDetailView>
1363
-
1364
- {isBNUL(footer) ?
1365
- <Footer
1366
- footerIcon={footer}
1367
- buttonFunction={val => val == undefined ? null : getFooterFunctions(val)}
1368
- /> : null}
1369
-
1370
- {isLoading ?
1371
- <Loader
1372
- displaytext={true}
1373
- />
1374
- : null}
1375
-
1376
- {deleteConfirmation ? (
1377
- <CConfirmation
1378
- type={4}
1379
- confirmation={val => val == undefined ? null : setDeleteConfirmation(val)}
1380
- flag={0}
1381
- deleteapi={APIURL + 'emrdeleteclassificationnature/deleteclassificationnature/' + deletearg.homrpatientchartdetail + '/' + deletearg.homrpatientchart + '/' + deletearg.hosumrclassificationnature + '/' + deletearg.nature}
1382
- keyid={deletearg.hosumrclassificationnature}
1383
- navigation={navigation}
1384
- data={responseJSON}
1385
- responseJSON={responseJSON.consultation}
1386
- refreshCount={val => val == undefined ? null : setRefresh(refresh + val)}
1387
- />
1388
- ) : null}
1389
-
1390
- {overlay ?
1391
- (console.log('overlayData.componentname........', overlayData.componentname),
1392
- <HOverlay
1393
- data={overlayData}
1394
- component={overlayData.componentname}
1395
- visibility={val => (val == undefined ? null : (setOverlay(val), console.log('visibility is false now')))}
1396
- addNature={val => (val == undefined ? null : getAddNature(val))}
1397
- loading={val => val == undefined ? null : setIsLoading(val)}
1398
- callBack={val => (val == undefined ? null : getAddTemplate(val))}
1399
- overwrite={val => (val == undefined ? null : getOverWriteTemplate(val))}
1400
- notesSelectCallBack={(val) => {
1401
-
1402
- const newItem = isBNUL(val) ? val.filter((i, k) => { return i.selected ? { ...i } : undefined }) : [];
1403
-
1404
- const updatedResponseJSON = {
1405
- ...responseJSON,
1406
- editStatus: true,
1407
- consultation: [...responseJSON.consultation], // Clone the consultation array
1408
- };
1409
-
1410
- const natureindex = overlayData.natureindex ?? 0;
1411
-
1412
- const name = overlayData.name ?? null;
1413
-
1414
- updatedResponseJSON.consultation[natureindex] = {
1415
- ...updatedResponseJSON.consultation[natureindex],
1416
- editStatus: true,
1417
- moreButton: [...updatedResponseJSON.consultation[natureindex].moreButton]
1418
- }
1419
-
1420
- const indexOfSelected = isBNUL(updatedResponseJSON.consultation[natureindex].moreButton) ? updatedResponseJSON.consultation[natureindex].moreButton.findIndex(item => item.name === name) : 0;
1421
-
1422
-
1423
- if (name == 'Notes') {
1424
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected] = {
1425
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected],
1426
- NotesArray: [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray]
1427
- };
1428
- const combinedArray = [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray, ...newItem];
1429
- // const seenHosumrcodes = new Set();
1430
- // const uniqueItems = combinedArray.filter(item => {
1431
- // if (seenHosumrcodes.has(item.datavalue)) {
1432
- // return false;
1433
- // }
1434
- // seenHosumrcodes.add(item.datavalue);
1435
- // return true;
1436
- // });
1437
- // updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray = uniqueItems;
1438
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].NotesArray = combinedArray;
1439
- }
1440
-
1441
- if (name == 'Instructions') {
1442
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected] = {
1443
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected],
1444
- InstructionsArray: [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray]
1445
- };
1446
- const combinedArray = [...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray, ...newItem];
1447
- const seenHosumrcodes = new Set();
1448
- const uniqueItems = combinedArray.filter(item => {
1449
- if (seenHosumrcodes.has(item.datavalue)) {
1450
- return false;
1451
- }
1452
- seenHosumrcodes.add(item.datavalue);
1453
- return true;
1454
- });
1455
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected].InstructionsArray = uniqueItems;
1456
- }
1457
-
1458
- setResponseJSON(updatedResponseJSON);
1459
- }}
1460
- commentsCallback={(val) => {
1461
-
1462
- console.log('commentsCallbackcommentsCallback', val)
1463
-
1464
- const updatedResponseJSON = {
1465
- ...responseJSON,
1466
- editStatus: true,
1467
- consultation: [...responseJSON.consultation], // Clone the consultation array
1468
- };
1469
-
1470
- const natureindex = overlayData.natureindex ?? 0;
1471
-
1472
- const name = overlayData.name ?? null;
1473
-
1474
- updatedResponseJSON.consultation[natureindex] = {
1475
- ...updatedResponseJSON.consultation[natureindex],
1476
- editStatus: true,
1477
- CommentsString: val,
1478
- moreButton: [...updatedResponseJSON.consultation[natureindex].moreButton]
1479
- }
1480
-
1481
- const indexOfSelected = isBNUL(updatedResponseJSON.consultation[natureindex].moreButton) ? updatedResponseJSON.consultation[natureindex].moreButton.findIndex(item => item.name === name) : 0;
1482
-
1483
- console.log('indexOfSelected', indexOfSelected);
1484
-
1485
- updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected] = {
1486
- ...updatedResponseJSON.consultation[natureindex].moreButton[indexOfSelected],
1487
- comments: val
1488
- };
1489
-
1490
- console.log('commentsupdate', JSON.stringify(updatedResponseJSON))
1491
-
1492
- setResponseJSON(updatedResponseJSON);
1493
-
1494
- }}
1495
- // flag={2}
1496
- />
1497
- ) : null}
1498
- </CContainerView>
1499
- )
1500
- }