@jescon-technologies/react-native-ui-kit 0.0.4 → 0.0.5
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 +0 -4
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +3 -3
- 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/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,467 @@
|
|
|
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
|
+
}
|