Browse Source

환자 선택시 동명이인 메시지 출력 부분 추가

songjungeun 4 years ago
parent
commit
bd8f396362

+ 2 - 2
app/build.gradle

@@ -8,8 +8,8 @@ android {
         applicationId "com.dbs.mplus.knuh"
         minSdkVersion 24
         targetSdkVersion 28
-        versionCode 21
-        versionName "1.1.0.21"
+        versionCode 22
+        versionName "1.1.0.22"
         multiDexEnabled true
 //        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }

+ 1 - 0
app/src/main/java/com/dbs/mplus/knuh/MainActivity.java

@@ -11,6 +11,7 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.PowerManager;
 import android.provider.Settings;
+import android.telecom.Call;
 import android.util.Log;
 import android.view.View;
 

+ 80 - 17
app/src/main/java/com/dbs/mplus/knuh/adapter/PatientListAdapter.java

@@ -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);
+  }
 }

+ 1 - 0
app/src/main/java/com/dbs/mplus/knuh/util/ConsentConfig.java

@@ -27,6 +27,7 @@ public class ConsentConfig {
   public static final String GET_USER_SIGN_DATA_INFO = "getUserSignDataInfo"; // 서명이미지 설정을 위한 기초정보 호출
   public static final String SET_SIGN_IMAGE          = "setSignImage";        // 사용자 서명이미지 설정
   public static final String GET_EMR_DATA_STRING     = "getEmrDataString";
+  public static final String GET_PATIENT_SAFETY_MSG  = "checkPatientSafetyMessage"; // 동명이인 주의 메시지
 
   public static final String HOST_CONSENT = BuildConfig.CONSENT_SERVER_URL + "ConsentSvc.asmx";
   public static final String GET_CONSENT_CATEGORYY   = "GetCategoryForDropdown";  // 동의서 찾기시 카테고리 리스트