@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.
- package/index.d.ts +2 -66
- package/index.js +1 -66
- package/package.json +1 -1
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- 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,467 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import React, { useState, useEffect, useContext } from 'react';
|
|
3
|
-
import { StyleSheet, Dimensions, View, Platform, BackHandler } from 'react-native';
|
|
4
|
-
// import { useNavigation } from '@react-navigation/native';
|
|
5
|
-
import CFooterView from '../CustomComponents/CFooterView';
|
|
6
|
-
import CContainerView from '../CustomComponents/CContainerView';
|
|
7
|
-
import CDetailView from '../CustomComponents/CDetailView';
|
|
8
|
-
import HeaderBlock from './HeaderBlock';
|
|
9
|
-
import CAwesomeButton from '../CustomComponents/CAwesomeButton';
|
|
10
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
11
|
-
import ReactNativeBlobUtil from 'react-native-blob-util';
|
|
12
|
-
import { isBNUL, isNU, isNUQ, isNUQZ, isPermitted, Loader, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
13
|
-
import RNFetchBlob from 'rn-fetch-blob';
|
|
14
|
-
import moment from 'moment';
|
|
15
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
16
|
-
import HHeading from '../HOC/HHeading';
|
|
17
|
-
import { APIURL, EMRAPI, PORT } from '../../../../../src/Common/apiConstants';
|
|
18
|
-
import NetworkServiceCall from '../Common/NetworkServiceCall';
|
|
19
|
-
import { API } from '../Common/api_Lab';
|
|
20
|
-
import RNFS from 'react-native-fs';
|
|
21
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
22
|
-
|
|
23
|
-
import PDFContentViewer from '../CustomComponents/PDFContentViewer';
|
|
24
|
-
|
|
25
|
-
export default function RegistrationDetails(props) {
|
|
26
|
-
|
|
27
|
-
const [pdfviewdata, setPdfViewData] = useState();
|
|
28
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
29
|
-
const navigation = useNavigation();
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
const backAction = () => {
|
|
32
|
-
if (!navigation.isFocused()) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
navigation.goBack();
|
|
37
|
-
}
|
|
38
|
-
return true;
|
|
39
|
-
};
|
|
40
|
-
const backHandler = BackHandler.addEventListener(
|
|
41
|
-
'hardwareBackPress',
|
|
42
|
-
backAction,
|
|
43
|
-
);
|
|
44
|
-
return () => backHandler.remove();
|
|
45
|
-
}, []);
|
|
46
|
-
|
|
47
|
-
useEffect(() => {
|
|
48
|
-
getRegistrationData();
|
|
49
|
-
}, []);
|
|
50
|
-
|
|
51
|
-
// console.log('patientdetails...', JSON.stringify(Global.PatientDetails))
|
|
52
|
-
|
|
53
|
-
const blobToBase64 = (blob) => {
|
|
54
|
-
return new Promise((resolve, reject) => {
|
|
55
|
-
const reader = new FileReader();
|
|
56
|
-
reader.onloadend = () => resolve(reader.result.split(',')[1]); // Get base64 part
|
|
57
|
-
reader.onerror = reject;
|
|
58
|
-
reader.readAsDataURL(blob);
|
|
59
|
-
});
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const sanitizeJSON = (data) => {
|
|
63
|
-
const sanitizedData = JSON.parse(
|
|
64
|
-
JSON.stringify(data, (key, value) => {
|
|
65
|
-
if (typeof value === 'string') {
|
|
66
|
-
// Replace single quotes with double quotes and remove backslashes
|
|
67
|
-
return value.replace(/'/g, '"').replace(/\\/g, '');
|
|
68
|
-
}
|
|
69
|
-
return value;
|
|
70
|
-
})
|
|
71
|
-
);
|
|
72
|
-
return sanitizedData;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
const downloadFirstPdfPreview = async (body, link) => {
|
|
76
|
-
|
|
77
|
-
setIsLoading(true);
|
|
78
|
-
let buttonapi = link;
|
|
79
|
-
const jsonBody = body;
|
|
80
|
-
const sanitizedData = sanitizeJSON(jsonBody);
|
|
81
|
-
|
|
82
|
-
// {"group":{"firstname":"REJUL","lastname":null,"hopapatient":0,"hoparegistrationform":1,"dateofbirth":"2025-04-28","mobilenumber":"7994378855","landphone":"","housename":"house","houseno":"","pin":"","country":1,"countryname":"INDIA","parishname":0,"street":"","postoffice":"post office","district":1,"districtname":"","state":1,"statename":"","religion":1,"individualstatus":1,"hrsuqualification":1,"occupation":0,"nominee":"","relation":0,"aadharno":"","rationcard":"","anualincome":"","bloodgroup":"","insurance":0,"foreginpatient":0,"imageurl":"http://localhost:9393/ppfile/getFile/image/whitebackground.jpg","email":"","srfno":"","passportno":"","abhaid":"","uhid":"","whatsappno":"7994378855","mcrregistrationno":"","gender":"M","editflag":1,"imagefiles":"","pdffiles":"","imagefilesarray":[],"pdffilesarray":[],"signurl":"http://localhost:9393/ppfile/getFile/image/whitebackground.jpg"}}
|
|
83
|
-
|
|
84
|
-
console.log('downloadFirstPdfPreview buttonapi', buttonapi);
|
|
85
|
-
console.log('downloadFirstPdfPreview', JSON.stringify(sanitizedData));
|
|
86
|
-
|
|
87
|
-
try {
|
|
88
|
-
const response = await fetch(buttonapi, {
|
|
89
|
-
method: 'POST',
|
|
90
|
-
headers: {
|
|
91
|
-
'Content-Type': 'application/json',
|
|
92
|
-
},
|
|
93
|
-
body: JSON.stringify(sanitizedData),
|
|
94
|
-
});
|
|
95
|
-
if (!response.ok) {
|
|
96
|
-
setIsLoading(false);
|
|
97
|
-
console.log('111')
|
|
98
|
-
throw new Error('Failed to fetch file');
|
|
99
|
-
}
|
|
100
|
-
const fileData = await response.blob();
|
|
101
|
-
const fileName = moment().format('DD-MM-YYYY hmmssSSS') + '.pdf';
|
|
102
|
-
const cachePath = `${RNFS.CachesDirectoryPath}/${fileName}`;
|
|
103
|
-
const base64Data = await blobToBase64(fileData);
|
|
104
|
-
await RNFS.writeFile(cachePath, base64Data, 'base64');
|
|
105
|
-
setPdfViewData({
|
|
106
|
-
'linknew': cachePath
|
|
107
|
-
})
|
|
108
|
-
setIsLoading(false);
|
|
109
|
-
|
|
110
|
-
let dataset = {
|
|
111
|
-
fileid: 1,
|
|
112
|
-
uri: 'file://' + cachePath,
|
|
113
|
-
filename: fileName + Date(),
|
|
114
|
-
uritype: false
|
|
115
|
-
};
|
|
116
|
-
saveSecondPdf(dataset);
|
|
117
|
-
|
|
118
|
-
} catch (error) {
|
|
119
|
-
setIsLoading(false);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
async function saveSecondPdf(image) {
|
|
124
|
-
|
|
125
|
-
console.log('saveSecondPdf')
|
|
126
|
-
|
|
127
|
-
let pdftype = `.pdf`;
|
|
128
|
-
let fileid_autogenerate = 0;
|
|
129
|
-
let dataset2 = {
|
|
130
|
-
fileid: fileid_autogenerate + 1,
|
|
131
|
-
filename: pdftype,
|
|
132
|
-
filetype: 'application/pdf',
|
|
133
|
-
uri: image.uri,
|
|
134
|
-
uritype: false,
|
|
135
|
-
};
|
|
136
|
-
// let buttonapi = API.savePdf;
|
|
137
|
-
let buttonapi = APIURL + 'insurancefile/fileupload/emr/document';
|
|
138
|
-
|
|
139
|
-
console.log('saveSecondPdf buttonapi', buttonapi);
|
|
140
|
-
if (!dataset2.uritype) {
|
|
141
|
-
if (dataset2.uri) {
|
|
142
|
-
var formData = new FormData();
|
|
143
|
-
formData.append('file', {
|
|
144
|
-
uri: dataset2.uri,
|
|
145
|
-
type: 'document/pdf',
|
|
146
|
-
name: dataset2.filename,
|
|
147
|
-
});
|
|
148
|
-
NetworkServiceCall('multiform', buttonapi, formData)
|
|
149
|
-
.then(function (responsedata) {
|
|
150
|
-
console.log('response', JSON.stringify(responsedata))
|
|
151
|
-
if (responsedata.httpstatus == 200) {
|
|
152
|
-
// responsedata.data.fileuri;
|
|
153
|
-
savePdfToPatient(responsedata.data.fileuri)
|
|
154
|
-
}
|
|
155
|
-
})
|
|
156
|
-
.catch(error => {
|
|
157
|
-
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function savePdfToPatient(fileuri) {
|
|
164
|
-
|
|
165
|
-
let output = {
|
|
166
|
-
"groups": {
|
|
167
|
-
"procedurename": "rnhopaeditformpdf1",
|
|
168
|
-
"suuser": Global.userData.suuser,
|
|
169
|
-
"hopapatient": Global.PatientDetails.hopapatient,
|
|
170
|
-
"registrationformurl": fileuri
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
let buttonapi = EMRAPI.saveCommon;
|
|
175
|
-
console.log('savePdfToPatient buttonapi', buttonapi);
|
|
176
|
-
console.log('savePdfToPatient', JSON.stringify(output));
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
NetworkServiceCall("post", buttonapi, output)
|
|
180
|
-
.then(function (response) {
|
|
181
|
-
console.log('savePdfToPatient response', JSON.stringify(response))
|
|
182
|
-
if (response.httpstatus == 200) {
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
})
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const DownloadPdf = async (params) => {
|
|
193
|
-
console.log('jjjjj')
|
|
194
|
-
if (await isPermitted()) {
|
|
195
|
-
setIsLoading(true);
|
|
196
|
-
const fileBase64 = await ReactNativeBlobUtil.fs.readFile(params, 'base64');
|
|
197
|
-
const filePath = RNFetchBlob.fs.dirs.DownloadDir + '/' + moment().format('DD-MM-YYYY hmmssSSS') + '.pdf';
|
|
198
|
-
RNFetchBlob.fs.writeFile(filePath, fileBase64, 'base64').then(response => {
|
|
199
|
-
notifyMessage(filePath);
|
|
200
|
-
setIsLoading(false);
|
|
201
|
-
}).catch(errors => {
|
|
202
|
-
console.log('catch', errors);
|
|
203
|
-
notifyMessage("Download Failed");
|
|
204
|
-
setIsLoading(false);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
function getRegistrationData() {
|
|
210
|
-
|
|
211
|
-
setPdfViewData();
|
|
212
|
-
setIsLoading(true);
|
|
213
|
-
|
|
214
|
-
let buttonapi = APIURL + 'insuranceadvanceget/emrcommonget/rnhomrpatientregistration ' + Global.PatientDetails.hopapatient;
|
|
215
|
-
console.log('buttonapi', buttonapi);
|
|
216
|
-
|
|
217
|
-
NetworkServiceCall("get", buttonapi, "")
|
|
218
|
-
.then(function (response) {
|
|
219
|
-
if (response.httpstatus == 200 && isNU(response.data) && isBNUL(response.data.data) && isNU(response.data.data[0])) {
|
|
220
|
-
if (isNUQ(response.data.data[0].registrationformurl)) {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
setPdfViewData({
|
|
224
|
-
// 'linknew':'https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf',
|
|
225
|
-
'linknew': response.data.data[0].registrationformurl,
|
|
226
|
-
'registrationhistory': isBNUL(response.data.history) ? response.data.history : [],
|
|
227
|
-
'savedimages': isBNUL(response.data.data[0].savedimages) ? response.data.data[0].savedimages : [],
|
|
228
|
-
'savedfile': isBNUL(response.data.data[0].savedfile) ? response.data.data[0].savedfile : [],
|
|
229
|
-
})
|
|
230
|
-
}
|
|
231
|
-
else {
|
|
232
|
-
|
|
233
|
-
const jsonBody = {
|
|
234
|
-
"group": {
|
|
235
|
-
...response.data.data[0],
|
|
236
|
-
"imagefilesarray": [],
|
|
237
|
-
"pdffilesarray": [],
|
|
238
|
-
"imageurl": isNUQ(response.data.data[0].imageurl) ? response.data.data[0].imageurl : "http://localhost:" + PORT + "/insurancefile/getCommonFile/image/whitebackground.jpg",
|
|
239
|
-
"signurl": "http://localhost:" + PORT + "/insurancefile/getCommonFile/image/whitebackground.jpg"
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
const jsonlink = APIURL + 'jrinsurance/jrcommonpreport/jrhoparegistrationform/0/PatientRegForm';
|
|
243
|
-
downloadFirstPdfPreview(jsonBody, jsonlink);
|
|
244
|
-
// 2512308
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
setIsLoading(false);
|
|
248
|
-
}
|
|
249
|
-
else {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
setIsLoading(false);
|
|
253
|
-
notifyMessage("Data not found", 2);
|
|
254
|
-
}
|
|
255
|
-
})
|
|
256
|
-
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
// "firstname": "REJUL",
|
|
260
|
-
// "lastname": null,
|
|
261
|
-
// "hopapatient": 0,
|
|
262
|
-
// "hoparegistrationform": 1,
|
|
263
|
-
// "dateofbirth": "2025-04-28",
|
|
264
|
-
// "mobilenumber": "7994378855",
|
|
265
|
-
// "landphone": "",
|
|
266
|
-
// "housename": "house",
|
|
267
|
-
// "houseno": "",
|
|
268
|
-
// "pin": "",
|
|
269
|
-
// "countryname": "INDIA",
|
|
270
|
-
// "street": "",
|
|
271
|
-
// "postoffice": "post office",
|
|
272
|
-
// "districtname": "",
|
|
273
|
-
// "statename": "",
|
|
274
|
-
// "aadharno": "",
|
|
275
|
-
// "bloodgroup": "",
|
|
276
|
-
// "email": "",
|
|
277
|
-
// "srfno": "",
|
|
278
|
-
// "passportno": "",
|
|
279
|
-
// "abhaid": "",
|
|
280
|
-
// "uhid": "",
|
|
281
|
-
// "whatsappno": "7994378855",
|
|
282
|
-
// "mcrregistrationno": "",
|
|
283
|
-
// "gender": "M",
|
|
284
|
-
// "imagefiles": "",
|
|
285
|
-
// "pdffiles": "",
|
|
286
|
-
|
|
287
|
-
const transformJson = (input) => {
|
|
288
|
-
return {
|
|
289
|
-
data: input.map(({ uploaddate, filename }) => ({
|
|
290
|
-
filename: ' ',
|
|
291
|
-
filelink: filename
|
|
292
|
-
})).filter(item => isNUQ(item.filename) && isNUQ(item.filelink))
|
|
293
|
-
};
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const [buttonConfigs, setButtonConfigs] = useState([
|
|
297
|
-
// {
|
|
298
|
-
// displayText: 'DOWNLOAD PDF',
|
|
299
|
-
// iconGroup: 5,
|
|
300
|
-
// iconName: 'file-pdf',
|
|
301
|
-
// visibility: true
|
|
302
|
-
// },
|
|
303
|
-
{
|
|
304
|
-
displayText: 'REGISTRATION HISTORY',
|
|
305
|
-
iconGroup: 3,
|
|
306
|
-
iconName: 'history',
|
|
307
|
-
visibility: isNU(pdfviewdata) && isBNUL(pdfviewdata.registrationhistory) ? true : false
|
|
308
|
-
},
|
|
309
|
-
// {
|
|
310
|
-
// displayText: 'DOCUMENTS',
|
|
311
|
-
// iconGroup: 3,
|
|
312
|
-
// iconName: 'file-document',
|
|
313
|
-
// visibility: true
|
|
314
|
-
// },
|
|
315
|
-
// {
|
|
316
|
-
// displayText: 'IMAGES',
|
|
317
|
-
// iconGroup: 4,
|
|
318
|
-
// iconName: 'file-image-o',
|
|
319
|
-
// visibility: true
|
|
320
|
-
// }
|
|
321
|
-
]);
|
|
322
|
-
|
|
323
|
-
function getFooterFunctions(val) {
|
|
324
|
-
|
|
325
|
-
switch (val.displayText) {
|
|
326
|
-
case "DOWNLOAD PDF":
|
|
327
|
-
console.log("registrationnnnnnnnnnnnnnnnn", pdfviewdata.registrationhistory)
|
|
328
|
-
break;
|
|
329
|
-
case "REGISTRATION HISTORY":
|
|
330
|
-
navigation.navigate('CPdfGallery', {
|
|
331
|
-
index: 5,
|
|
332
|
-
displayarray: transformJson(pdfviewdata.registrationhistory).data
|
|
333
|
-
})
|
|
334
|
-
break;
|
|
335
|
-
case "DOCUMENTS":
|
|
336
|
-
navigation.navigate('CPdfGallery', {
|
|
337
|
-
index: 0,
|
|
338
|
-
displayarray: transformJson(pdfviewdata.savedfile).data
|
|
339
|
-
})
|
|
340
|
-
|
|
341
|
-
break;
|
|
342
|
-
case "IMAGES":
|
|
343
|
-
|
|
344
|
-
navigation.navigate('CPhotoGallery', {
|
|
345
|
-
index: 0,
|
|
346
|
-
displayarray:
|
|
347
|
-
transformJson(pdfviewdata.savedimages).data
|
|
348
|
-
})
|
|
349
|
-
break;
|
|
350
|
-
default:
|
|
351
|
-
break;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
const renderButton = (config, index) => {
|
|
358
|
-
|
|
359
|
-
return (
|
|
360
|
-
config.visibility ?
|
|
361
|
-
<CAwesomeButton
|
|
362
|
-
key={index}
|
|
363
|
-
callback={() => { getFooterFunctions(config) }}
|
|
364
|
-
buttonstyle={{
|
|
365
|
-
borderRadius: 10,
|
|
366
|
-
borderWidth: 0.5,
|
|
367
|
-
height: Dimensions.get('screen').height * 0.055,
|
|
368
|
-
width: Dimensions.get('screen').height * 0.06,
|
|
369
|
-
backgroundColor: '#f2f3ff',
|
|
370
|
-
paddingHorizontal: 0,
|
|
371
|
-
raiseLevel: 4,
|
|
372
|
-
paddingBottom: 0,
|
|
373
|
-
borderColor: 'white',
|
|
374
|
-
paddingTop: 0,
|
|
375
|
-
style: {
|
|
376
|
-
padding: 0,
|
|
377
|
-
marginHorizontal: normalize(5),
|
|
378
|
-
marginVertical: normalize(5)
|
|
379
|
-
}
|
|
380
|
-
}}
|
|
381
|
-
viewstyle={{
|
|
382
|
-
borderWidth: 0,
|
|
383
|
-
borderRadius: 0,
|
|
384
|
-
justifyContent: 'center',
|
|
385
|
-
alignItems: 'center'
|
|
386
|
-
}}
|
|
387
|
-
icon={{
|
|
388
|
-
icongroup: config.iconGroup,
|
|
389
|
-
name: config.iconName,
|
|
390
|
-
color: Global.AppTheme.primary_color,
|
|
391
|
-
size: normalize(25),
|
|
392
|
-
style: {
|
|
393
|
-
textAlign: 'center'
|
|
394
|
-
}
|
|
395
|
-
}}
|
|
396
|
-
text={{
|
|
397
|
-
fontSize: normalize(6),
|
|
398
|
-
fontWeight: 'bold',
|
|
399
|
-
color: Global.AppTheme.primary_color,
|
|
400
|
-
textAlign: 'center'
|
|
401
|
-
}}
|
|
402
|
-
displaytext={config.displayText}
|
|
403
|
-
/>
|
|
404
|
-
: null
|
|
405
|
-
)
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
return (
|
|
409
|
-
<CContainerView>
|
|
410
|
-
<HeaderBlock />
|
|
411
|
-
<CDetailView>
|
|
412
|
-
<HHeading
|
|
413
|
-
styles={{
|
|
414
|
-
"iconname": 'user-alt',
|
|
415
|
-
"bgcolor": "#f2efef",
|
|
416
|
-
"iconsize": 16,
|
|
417
|
-
"iconcolor": Global.AppTheme.primary_color,
|
|
418
|
-
"displaytext": "REGISTRATION DETAILS",
|
|
419
|
-
"textsize": 14,
|
|
420
|
-
"textcolor": Global.AppTheme.primary_color
|
|
421
|
-
}}
|
|
422
|
-
callBack={val => (val == undefined ? null : console.log(val))}
|
|
423
|
-
>
|
|
424
|
-
</HHeading>
|
|
425
|
-
{isLoading ? <Loader /> : null}
|
|
426
|
-
{pdfviewdata && pdfviewdata.linknew ?
|
|
427
|
-
<PDFContentViewer
|
|
428
|
-
link={pdfviewdata.linknew}
|
|
429
|
-
style={{ flex: 1, backgroundColor: 'white' }}
|
|
430
|
-
onLoadComplete={() => {
|
|
431
|
-
setIsLoading(false);
|
|
432
|
-
}}
|
|
433
|
-
onError={(error) => {
|
|
434
|
-
console.log('onError', error);
|
|
435
|
-
setIsLoading(false);
|
|
436
|
-
}}
|
|
437
|
-
/>
|
|
438
|
-
: null}
|
|
439
|
-
</CDetailView>
|
|
440
|
-
<CFooterView>
|
|
441
|
-
{isNU(pdfviewdata) && isNUQ(pdfviewdata.linknew) ?
|
|
442
|
-
<View style={{ flexDirection: 'row', alignItems: 'center', width: '100%' }}>
|
|
443
|
-
{[{
|
|
444
|
-
displayText: 'REGISTRATION HISTORY',
|
|
445
|
-
iconGroup: 3,
|
|
446
|
-
iconName: 'history',
|
|
447
|
-
visibility: isNU(pdfviewdata) && isBNUL(pdfviewdata.registrationhistory) ? true : false
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
displayText: 'DOCUMENTS',
|
|
451
|
-
iconGroup: 3,
|
|
452
|
-
iconName: 'file-document',
|
|
453
|
-
visibility: isNU(pdfviewdata) && isBNUL(pdfviewdata.savedfile) ? true : false
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
displayText: 'IMAGES',
|
|
457
|
-
iconGroup: 4,
|
|
458
|
-
iconName: 'file-image-o',
|
|
459
|
-
visibility: isNU(pdfviewdata) && isBNUL(pdfviewdata.savedimages) ? true : false
|
|
460
|
-
}
|
|
461
|
-
].map(renderButton)}
|
|
462
|
-
</View>
|
|
463
|
-
: null}
|
|
464
|
-
</CFooterView>
|
|
465
|
-
</CContainerView>
|
|
466
|
-
);
|
|
467
|
-
}
|