|
@@ -3,6 +3,7 @@ package com.dbs.mplus.knuh.consent;
|
|
|
import android.content.Context;
|
|
|
import android.content.Intent;
|
|
|
import android.util.Log;
|
|
|
+import android.view.View;
|
|
|
|
|
|
import com.dbs.mplus.knuh.BuildConfig;
|
|
|
import com.dbs.mplus.knuh.R;
|
|
@@ -13,6 +14,7 @@ import com.dbs.mplus.knuh.httpTask.HttpSoapConnection;
|
|
|
import com.dbs.mplus.knuh.httpTask.SoapParser;
|
|
|
import com.dbs.mplus.knuh.model.ConsentFormListVO;
|
|
|
import com.dbs.mplus.knuh.model.ConsentImageVO;
|
|
|
+import com.dbs.mplus.knuh.model.DataPiexVO;
|
|
|
import com.dbs.mplus.knuh.model.PatientInfoVO;
|
|
|
import com.dbs.mplus.knuh.util.ConsentConfig;
|
|
|
import com.dbs.mplus.knuh.util.Util;
|
|
@@ -139,16 +141,52 @@ public class ConsentEvent {
|
|
|
instance.showSingButtonDialog(mContext.getString(R.string.writeConsnet));
|
|
|
} else {
|
|
|
ConsentCreateParam consentCreateParam = new ConsentCreateParam(mContext, userDrFlag, consentState, consentStateEng);
|
|
|
- HashMap<String, String> globalParam = consentCreateParam.setGlobalParam(patientInfoVO, consentMstRid, consentFormListVO);
|
|
|
+ final HashMap<String, String> globalParam = consentCreateParam.setGlobalParam(patientInfoVO, consentMstRid, consentFormListVO);
|
|
|
ArrayList<HashMap<String, String>> mapArrayList = consentCreateParam.setFormParam(consentMstRid, formRid, guid, formPrntNm, formCd, linkCd, ocrTag, drOnly, formName);
|
|
|
|
|
|
Util.deleteEpt();
|
|
|
|
|
|
- HashMap map = new HashMap();
|
|
|
+ final HashMap map = new HashMap();
|
|
|
map.put("globalParam", globalParam);
|
|
|
map.put("formListParam", mapArrayList);
|
|
|
- ConsentFacade consentFacade = new ConsentFacade(mContext, consentStateEng);
|
|
|
- consentFacade.startConsent(map, certPass, apiType);
|
|
|
+ final ConsentFacade consentFacade = new ConsentFacade(mContext, consentStateEng);
|
|
|
+
|
|
|
+ if (apiType.equals("")) {
|
|
|
+ final ArrayList<DataPiexVO> dataPiexVOArrayList = getDataPiex(patientInfoVO.getPid(), patientInfoVO.getInDd());
|
|
|
+ final int dataPiexSize = dataPiexVOArrayList.size();
|
|
|
+ if (dataPiexSize > 0) {
|
|
|
+ String message = String.format(instance.getString(R.string.piexMessage), dataPiexVOArrayList.get(0).getCreateDateTime());
|
|
|
+ instance.csAlert.show();
|
|
|
+ instance.csAlert.setContent(message, "");
|
|
|
+ instance.csAlert.btnConfirm.setText(instance.getString(R.string.yes));
|
|
|
+ instance.csAlert.btnCancel.setText(instance.getString(R.string.no));
|
|
|
+ instance.csAlert.btnConfirm.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ instance.csAlert.dismiss();
|
|
|
+ for (int i = 0; i < dataPiexSize; i++) {
|
|
|
+ String connParm = dataPiexVOArrayList.get(i).getConnParm();
|
|
|
+ String itemVal = dataPiexVOArrayList.get(i).getItemVal();
|
|
|
+
|
|
|
+ globalParam.put(connParm, itemVal);
|
|
|
+ consentFacade.startConsent(map, certPass, apiType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ instance.csAlert.btnCancel.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ instance.csAlert.dismiss();
|
|
|
+ consentFacade.startConsent(map, certPass, apiType);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ consentFacade.startConsent(map, certPass, apiType);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ consentFacade.startConsent(map, certPass, apiType);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -180,4 +218,36 @@ public class ConsentEvent {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 현병력 맵핑
|
|
|
+ * @author jksong
|
|
|
+ * @since 2021/09/03 9:25 오전
|
|
|
+ * @param
|
|
|
+ **/
|
|
|
+ private ArrayList<DataPiexVO> getDataPiex(String pid, String clnDate) {
|
|
|
+ ArrayList<DataPiexVO> result = new ArrayList<>();
|
|
|
+ HashMap<String, String> mData = new HashMap<String, String>();
|
|
|
+ mData.put("instCd", BuildConfig.INST_CD);
|
|
|
+ mData.put("pid", pid);
|
|
|
+ mData.put("clnDate", clnDate);
|
|
|
+ Log.e(TAG, "getDataPiex mData -- > " + mData);
|
|
|
+
|
|
|
+ HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_DATA_PIEX, mData);
|
|
|
+ try {
|
|
|
+ SoapObject object = connection.execute().get();
|
|
|
+ Log.e(TAG, "getDataPiex object -- > " + object);
|
|
|
+
|
|
|
+ result = SoapParser.getDataPiex(object);
|
|
|
+ Log.e(TAG, "getDataPiex result -- > " + result.size());
|
|
|
+
|
|
|
+ } catch (ExecutionException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ } catch (InterruptedException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
}
|