|
@@ -15,7 +15,12 @@ import androidx.recyclerview.widget.RecyclerView;
|
|
|
|
|
|
import com.dbs.mplus.knuh.R;
|
|
|
import com.dbs.mplus.knuh.activity.ConsentActivity;
|
|
|
+import com.dbs.mplus.knuh.httpTask.CallBack;
|
|
|
+import com.dbs.mplus.knuh.httpTask.HttpRunnable;
|
|
|
import com.dbs.mplus.knuh.model.PatientListVO;
|
|
|
+import com.dbs.mplus.knuh.util.ConsentConfig;
|
|
|
+
|
|
|
+import org.ksoap2.serialization.SoapObject;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
@@ -132,13 +137,13 @@ public class PatientListAdapter extends RecyclerView.Adapter<PatientListAdapter.
|
|
|
ViewHolder holder = (ViewHolder) v.getTag();
|
|
|
int position = holder.getLayoutPosition();
|
|
|
PatientListVO patientListVO = arrayList.get(position);
|
|
|
- String pid = patientListVO.getPid();
|
|
|
- String inDd = patientListVO.getInDd();
|
|
|
- String ordType = patientListVO.getOrdType();
|
|
|
- String ordDeptCd = patientListVO.getOrdDeptCd();
|
|
|
- String cretNo = patientListVO.getCretNo();
|
|
|
- String instCd = patientListVO.getInstCd();
|
|
|
- String opRsrvNo = patientListVO.getOprsRvNo ();
|
|
|
+ final String pid = patientListVO.getPid();
|
|
|
+ final String inDd = patientListVO.getInDd();
|
|
|
+ final String ordType = patientListVO.getOrdType();
|
|
|
+ final String ordDeptCd = patientListVO.getOrdDeptCd();
|
|
|
+ final String cretNo = patientListVO.getCretNo();
|
|
|
+ final String instCd = patientListVO.getInstCd();
|
|
|
+ final String opRsrvNo = patientListVO.getOprsRvNo ();
|
|
|
|
|
|
Log.e(TAG, "pid -- > " + pid );
|
|
|
Log.e(TAG, "inDd -- > " + inDd );
|
|
@@ -152,17 +157,75 @@ public class PatientListAdapter extends RecyclerView.Adapter<PatientListAdapter.
|
|
|
rowIndex = position;
|
|
|
click = true;
|
|
|
notifyDataSetChanged();
|
|
|
- HashMap<String, String> mData = new HashMap<String, String>();
|
|
|
- mData.put("pid", pid);
|
|
|
- mData.put("inDd", inDd);
|
|
|
- mData.put("ordType", ordType);
|
|
|
- mData.put("ordDeptCd", ordDeptCd);
|
|
|
- mData.put("cretNo", cretNo);
|
|
|
- mData.put("instCd", instCd);
|
|
|
- mData.put("opRsrvNo", opRsrvNo);
|
|
|
- instance.centerMenu.getPatientInfo(mData);
|
|
|
- instance.centerMenu.getConsentList(pid, inDd);
|
|
|
+
|
|
|
+ CallBack callBack = new CallBack() {
|
|
|
+ @Override
|
|
|
+ public void result(final SoapObject result) {
|
|
|
+
|
|
|
+ instance.runOnUiThread(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ if (result == null) {
|
|
|
+ stop();
|
|
|
+ } else {
|
|
|
+ int cnt = result.getPropertyCount();
|
|
|
+ if (cnt == 0) {
|
|
|
+ stop();
|
|
|
+ } else {
|
|
|
+ String rslt = result.getProperty(0).toString().trim();
|
|
|
+ if (rslt.indexOf(":") > 0) {
|
|
|
+ String[] ar = rslt.split(":");
|
|
|
+ final String message = ar[1].trim();
|
|
|
+
|
|
|
+ instance.csAlert.show();
|
|
|
+ instance.csAlert.setContent(message, ConsentConfig.ALERT_BTN_TYPE);
|
|
|
+ instance.csAlert.btnConfirm2.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ instance.csAlert.dismiss();
|
|
|
+ patientClickAction(pid, inDd, ordType, ordDeptCd, cretNo, instCd, opRsrvNo);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ stop();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void stop() {
|
|
|
+ patientClickAction(pid, inDd, ordType, ordDeptCd, cretNo, instCd, opRsrvNo);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void error() {
|
|
|
+
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ HashMap<String, String> mData = new HashMap<>();
|
|
|
+ HttpRunnable runnable = new HttpRunnable(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_PATIENT_SAFETY_MSG, mData, callBack);
|
|
|
+ Thread thread = new Thread(runnable);
|
|
|
+ thread.start();
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+ private void patientClickAction(String pid, String inDd, String ordType, String ordDeptCd, String cretNo, String instCd, String opRsrvNo) {
|
|
|
+ HashMap<String, String> mData = new HashMap<String, String>();
|
|
|
+ mData.put("pid", pid);
|
|
|
+ mData.put("inDd", inDd);
|
|
|
+ mData.put("ordType", ordType);
|
|
|
+ mData.put("ordDeptCd", ordDeptCd);
|
|
|
+ mData.put("cretNo", cretNo);
|
|
|
+ mData.put("instCd", instCd);
|
|
|
+ mData.put("opRsrvNo", opRsrvNo);
|
|
|
+ instance.centerMenu.getPatientInfo(mData);
|
|
|
+ instance.centerMenu.getConsentList(pid, inDd);
|
|
|
+ }
|
|
|
}
|