Browse Source

환자 검색 및 상세 정보 조회, 동의서 찾기, 즐겨찾기 추가/삭제 추가

3cooking 5 years ago
parent
commit
3a40a231b6

+ 5 - 1
app/src/main/java/com/dbs/dbsec/activity/ConsentActivity.java

@@ -368,6 +368,10 @@ public class ConsentActivity extends AppCompatActivity {
     tvRightSearch  = (TextView) findViewById(R.id.tvSearch);
     viewPager      = (ViewPager) findViewById(R.id.viewPager);
 
+    historyLayout.setOnClickListener(rightMenu.onClickListener);
+    markerLayout.setOnClickListener(rightMenu.onClickListener);
+    searchLayout.setOnClickListener(rightMenu.onClickListener);
+
     setViewPager();
     rightMenu.rightMenuStartColor();
   }
@@ -399,7 +403,7 @@ public class ConsentActivity extends AppCompatActivity {
 //        changedColorTab(position);
         rightMenu.rightMenuColorChange(position);
         if (position == 1) {
-//          marker.getConsentSetList();
+          marker.getUserFormSetList();
         }
       }
 

+ 1 - 0
app/src/main/java/com/dbs/dbsec/activity/activityEvent/CenterMenu.java

@@ -38,6 +38,7 @@ public class CenterMenu {
     CallBack callBack = new CallBack() {
       @Override
       public void result(final String result) {
+        Log.e(TAG, "getPatientInfo -- > " + result);
         mActivity.runOnUiThread(new Runnable() {
           @Override
           public void run() {

+ 228 - 0
app/src/main/java/com/dbs/dbsec/activity/adapter/ConsentListAdapter.java

@@ -0,0 +1,228 @@
+package com.dbs.dbsec.activity.adapter;
+
+import android.content.Context;
+import android.graphics.drawable.GradientDrawable;
+import android.os.Build;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.dbs.dbsec.BuildConfig;
+import com.dbs.dbsec.R;
+import com.dbs.dbsec.activity.ConsentActivity;
+import com.dbs.dbsec.activity.fragment.MarkerFragment;
+import com.dbs.dbsec.httpTask.CallBack;
+import com.dbs.dbsec.model.ConsentFormListVO;
+import com.dbs.dbsec.util.Common;
+import com.dbs.dbsec.util.ConsentConfig;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.ViewHolder> {
+
+  private static final String TAG = "ConsentListAdapter";
+  private AppCompatActivity mActivity;
+  private Context mContext;
+  private ConsentActivity instance;
+  public ArrayList<ConsentFormListVO> arrayList;
+//  private ConsentEvent consentEvent;
+
+  private String apiType = "";
+
+  public ConsentListAdapter(AppCompatActivity mActivity, Context mContext, ArrayList<ConsentFormListVO> arrayList,  String apiType) {
+    this.mActivity = mActivity;
+    this.mContext  = mContext;
+    this.instance  = (ConsentActivity) mContext;
+    this.arrayList = arrayList;
+    this.apiType   = apiType;
+  }
+
+  @Override
+  public int getItemCount() {
+    return arrayList.size();
+  }
+
+  public class ViewHolder extends RecyclerView.ViewHolder {
+
+    public RelativeLayout listLayer;
+    public TextView tvConsentName;
+    public TextView tvPatientName;
+    public TextView tvTemp;
+    public TextView tvSubText;
+
+    public int position = 0;
+
+    public ViewHolder(@NonNull View itemView) {
+      super(itemView);
+    }
+  }
+  @NonNull
+  @Override
+  public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+
+    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.consent_list_item, parent, false);
+    ViewHolder holder = new ViewHolder(view);
+
+    holder.listLayer     = (RelativeLayout) view.findViewById(R.id.listLayer);
+    holder.tvConsentName = (TextView) view.findViewById(R.id.tvConsentName);
+    holder.tvPatientName = (TextView) view.findViewById(R.id.tvPatientName);
+    holder.tvTemp        = (TextView) view.findViewById(R.id.tvTemp);
+    holder.tvSubText     = (TextView) view.findViewById(R.id.tvSubText);
+
+    GradientDrawable tvSubBg = (GradientDrawable) holder.tvSubText.getBackground().getCurrent();
+    tvSubBg.setColor(ContextCompat.getColor(mActivity, R.color.typeRightColor));
+
+    holder.listLayer.setTag(holder);
+    holder.tvSubText.setTag(holder);
+    return holder;
+  }
+
+  @Override
+  public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+
+    ConsentFormListVO consentFormListVO = arrayList.get(position);
+
+    String formName = consentFormListVO.getFormName();
+    holder.tvConsentName.setText(formName);
+
+    holder.tvPatientName.setVisibility(View.GONE);
+    holder.tvTemp.setVisibility(View.GONE);
+
+    String subText = "";
+    if (apiType.equals(ConsentConfig.GET_USER_FORM_SET)) {
+      subText = mContext.getString(R.string.delete);
+    } else if (apiType.equals(ConsentConfig.GET_CONSENT_BY_SEARCH)) {
+      subText = mContext.getString(R.string.add);
+    }
+
+    holder.tvSubText.setText(subText);
+
+    holder.listLayer.setOnClickListener(onClickListener);
+    holder.tvSubText.setOnClickListener(onClickListener);
+
+    holder.position = position;
+  }
+
+  private View.OnClickListener onClickListener = new View.OnClickListener() {
+    @Override
+    public void onClick(View v) {
+      ViewHolder holder = (ViewHolder) v.getTag();
+      final int position = holder.getLayoutPosition();
+      final ConsentFormListVO consentFormListVO = arrayList.get(position);
+      String formCd = consentFormListVO.getFormCode();
+
+      if (v == holder.tvSubText) {
+        String httpUrl = "";
+        String alertMsg = "";
+
+        if (apiType.equals(ConsentConfig.GET_CONSENT_BY_SEARCH)) {
+          httpUrl = ConsentConfig.SET_USER_FORM_SET;
+          alertMsg = mContext.getString(R.string.addMaker);
+        } else {
+          httpUrl = ConsentConfig.DEL_USER_FORM_SET;
+          alertMsg = mContext.getString(R.string.deleteMaker);
+        }
+
+        instance.csAlert.show();
+        instance.csAlert.setContent(alertMsg, "");
+
+        final String finalUrl = httpUrl;
+        final String finalFormCd = formCd;
+        final String idx = consentFormListVO.getIdx();
+
+        instance.csAlert.btnConfirm.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View v) {
+            CallBack callBack = new CallBack() {
+              @Override
+              public void result(final String result) {
+                mActivity.runOnUiThread(new Runnable() {
+                  @Override
+                  public void run() {
+                    instance.dismissProgress();
+                    Log.e(TAG, "setOrDelUserFormSet -- > " + result);
+
+                    ArrayList<HashMap<String, String>> resultArr = Common.parseJSON(mContext, result);
+                    String code = resultArr.get(0).get("code");
+//
+                    if (!code.equals("00")) {
+                      stop();
+                    } else {
+                      String rts = resultArr.get(0).get("data");
+                      int res = Integer.parseInt(rts);
+                      if (res == 0) {
+                        stop();
+                      } else {
+                        if (apiType.equals(ConsentConfig.GET_USER_FORM_SET)) {
+                          Log.e(TAG, "position -- > " + position);
+                          arrayList.remove(position);
+                          notifyItemRemoved(position);
+                        }
+                      }
+                    }
+                  }
+                });
+
+              }
+              @Override
+              public void stop() {
+                String message = "";
+                if (apiType.equals(ConsentConfig.GET_CONSENT_BY_SEARCH)) {
+                  message = String.format(mContext.getString(R.string.failMakerEvent), mContext.getString(R.string.add));
+                } else {
+                  message= String.format(mContext.getString(R.string.failMakerEvent), mContext.getString(R.string.delete));
+                }
+                instance.showSingButtonDialog(message);
+              }
+
+              @Override
+              public void error() {
+
+              }
+            };
+
+            HashMap<String, String> mData = new HashMap<String, String>();
+            mData.put("instCd", BuildConfig.INST_CD);
+            mData.put("userId", Common.getStringPreference(mContext, "userInfo", "userId"));
+            mData.put("formCd", finalFormCd);
+
+            if (apiType.equals(ConsentConfig.GET_USER_FORM_SET)) {
+              mData.put("idx", idx);
+            }
+            Log.e(TAG, "mData -- > " + mData);
+
+            if (Common.checkNetwork(mContext) == true) {
+              instance.showProgress();
+              Common.callHttp(mContext, finalUrl, mData, callBack);
+            } else {
+              Common.networkErrorAlert(mActivity);
+            }
+            instance.csAlert.dismiss();
+          }
+        });
+
+        instance.csAlert.btnCancel.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View v) {
+            instance.csAlert.dismiss();
+          }
+        });
+
+      }
+
+
+
+    }
+  };
+
+
+}

+ 65 - 111
app/src/main/java/com/dbs/dbsec/activity/fragment/HistoryFragment.java

@@ -17,11 +17,13 @@ import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.dbs.dbsec.BuildConfig;
 import com.dbs.dbsec.R;
 import com.dbs.dbsec.activity.ConsentActivity;
 import com.dbs.dbsec.activity.activityEvent.CenterMenu;
 import com.dbs.dbsec.customView.CustomAlertDialog;
 import com.dbs.dbsec.httpTask.CallBack;
+import com.dbs.dbsec.httpTask.ParseJsonData;
 import com.dbs.dbsec.util.Common;
 import com.dbs.dbsec.util.ConsentConfig;
 
@@ -308,7 +310,7 @@ public class HistoryFragment extends Fragment {
       } else if (v == rightDateLayout) {
         rightDateDialog.show();
       } else if (btnHistorySearch == v) {
-//        getHistoryConsentList(searchType);
+        getHistoryConsentList(searchType);
       }
 
     }
@@ -386,116 +388,68 @@ public class HistoryFragment extends Fragment {
     }
   };
 
-//  public void getHistoryConsentList(final String type) {
-//    Log.e(TAG, "type -- > " + type);
-//
-//    CallBack callBack = new CallBack() {
-//      @Override
-//      public void result(String result) {
-//        ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
-//        setHistoryConsentList(arrayList, type);
-//      }
-//
-//      @Override
-//      public void stop() {
-//
-//      }
-//
-//      @Override
-//      public void error() {
-//
-//      }
-//    };
-//
-//    if (centerMenu.patientInfoVO == null && type.equals("patient")) {
-//      instance.showSingButtonDialog(mContext.getString(R.string.emptyPatientInfo));
-//    } else {
-//
-//      instance.showProgress();
-//
-//      String instCd = BuildConfig.INST_CD;
-//      String consentState = "";
-//
-//      int count = 0;
-//      for (View key : consentStateData.keySet()) {
-//
-//        String state = consentStateData.get(key);
-//
-//        if (state.equals("ALL")) {
-//          consentState = state;
-//        } else {
-//          consentState += state;
-//          if (consentStateData.size() - 1 > count) {
-//            consentState = consentState + ", ";
-//          }
-//        }
-//
-//        count = count + 1;
-//      }
-//
-//      HashMap<String, String> mData = new HashMap<>();
-//      if (type.equals("write")) {
-//        mData.put("userId", Util.getStringPreference(mContext, "userInfo", "userId"));
-//      } else {
-//        mData.put("patientCode", centerMenu.patientInfoVO.getPid());
-//      }
-//      mData.put("startDt", getLeftDate());
-//      mData.put("endDt", getRightDate());
-//      mData.put("instCd", instCd);
-//      mData.put("consentState", consentState);
-//
-//      if (Util.checkNetwork(mContext) == true) {
-//        Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_LIST, mData, callBack);
-//      } else {
-//        instance.dismissProgress();
-//        Util.networkErrorAlert(mActivity);
-//      }
-//    }
-//
-//  }
-
-//  private void setHistoryConsentList(final ArrayList<ConsentFormListVO> arrayList, final String apiType) {
-//
-//    mActivity.runOnUiThread(new Runnable() {
-//      @Override
-//      public void run() {
-//
-//        instance.dismissProgress();
-//        if (arrayList.size() > 0) {
-//          tvEmptyMsg.setVisibility(View.GONE);
-//        } else {
-//          tvEmptyMsg.setVisibility(View.VISIBLE);
-//        }
-//
-//        instance.consentHistoryAdapter = new ConsentHistoryAdapter(mActivity, mContext, arrayList, apiType);
-//        linearLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
-//
-//        if (apiType.equals("patient")) {
-//          historyPatientRecyclerView.setLayoutManager(linearLayoutManager);
-//          historyPatientRecyclerView.setAdapter(instance.consentHistoryAdapter);
-//        } else {
-//          historyWriteRecyclerView.setLayoutManager(linearLayoutManager);
-//          historyWriteRecyclerView.setAdapter(instance.consentHistoryAdapter);
-//        }
-//
-////        if (instance.consentHistoryAdapter == null) {
-////          instance.consentHistoryAdapter = new ConsentHistoryAdapter(mActivity, mContext, arrayList, apiType);
-////          linearLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
-////          historyPatientRecyclerView.setLayoutManager(linearLayoutManager);
-////          historyPatientRecyclerView.setAdapter(instance.consentHistoryAdapter);
-////        } else {
-////          instance.consentHistoryAdapter.arrayList.clear();
-////          instance.consentHistoryAdapter.arrayList = arrayList;
-////          instance.consentHistoryAdapter.apiType = apiType;
-////          instance.consentHistoryAdapter.notifyDataSetChanged();
-////        }
-//
-//
-//      }
-//    });
-//
-//
-//  }
+  private void getHistoryConsentList(final String type) {
+    Log.e(TAG, "type -- > " + type);
+
+    CallBack callBack = new CallBack() {
+      @Override
+      public void result(String result) {
+        Log.e(TAG, "getHistoryConsentList -- > " + result);
+      }
+
+      @Override
+      public void stop() {
+
+      }
+
+      @Override
+      public void error() {
+
+      }
+    };
+
+    if (centerMenu.patientInfoVO == null && type.equals("patient")) {
+      instance.showSingButtonDialog(mContext.getString(R.string.emptyPatientInfo));
+    } else {
+      String instCd = BuildConfig.INST_CD;
+      String consentState = "";
+
+      int count = 0;
+      for (View key : consentStateData.keySet()) {
+        String state = consentStateData.get(key);
+
+        if (state.equals("ALL")) {
+          consentState = state;
+        } else {
+          consentState += state;
+          if (consentStateData.size() - 1 > count) {
+            consentState = consentState + ", ";
+          }
+        }
+        count = count + 1;
+      }
+
+      HashMap<String, String> mData = new HashMap<String, String>();
+
+      if (type.equals("write")) {
+        mData.put("userId", Common.getStringPreference(mContext, "userInfo", "userId"));
+      } else {
+        mData.put("patientCode", centerMenu.patientInfoVO.getPid());
+      }
+      mData.put("startDt", getLeftDate());
+      mData.put("endDt", getRightDate());
+      mData.put("instCd", instCd);
+      mData.put("consentState", consentState);
+
+      if (Common.checkNetwork(mContext) == true) {
+        instance.showProgress();
+        Common.callHttp(mContext, ConsentConfig.GET_CONSENT_LIST, mData, callBack);
+      } else {
+        Common.networkErrorAlert(mActivity);
+      }
+
+    }
+  }
 
   private String getLeftDate() {
     return Common.removeSlashStr(tvLeftDate.getText().toString());

+ 68 - 66
app/src/main/java/com/dbs/dbsec/activity/fragment/MarkerFragment.java

@@ -2,13 +2,21 @@ package com.dbs.dbsec.activity.fragment;
 
 import android.content.Context;
 import android.os.Bundle;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
 import android.widget.TextView;
 
+import com.dbs.dbsec.BuildConfig;
 import com.dbs.dbsec.R;
 import com.dbs.dbsec.activity.ConsentActivity;
+import com.dbs.dbsec.activity.adapter.ConsentListAdapter;
+import com.dbs.dbsec.httpTask.CallBack;
+import com.dbs.dbsec.httpTask.ParseJsonData;
+import com.dbs.dbsec.model.ConsentFormListVO;
+import com.dbs.dbsec.util.Common;
+import com.dbs.dbsec.util.ConsentConfig;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -26,7 +34,7 @@ public class MarkerFragment extends Fragment {
   private AppCompatActivity mActivity;
   private Context mContext;
   private ConsentActivity instance;
-//  private ConsentListAdapter consentListAdapter;
+  private ConsentListAdapter consentListAdapter;
 
   private LinearLayoutManager linearLayoutManager;
   private RecyclerView markerRecyclerView;
@@ -54,7 +62,7 @@ public class MarkerFragment extends Fragment {
     markerRecyclerView = (RecyclerView) view.findViewById(R.id.markerRecyclerView);
     tvEmptyMarker      = (TextView) view.findViewById(R.id.tvEmptyMarker);
 
-//    getConsentSetList();
+    getUserFormSetList();
     return view;
   }
 
@@ -63,70 +71,64 @@ public class MarkerFragment extends Fragment {
    * @author jksong
    * @since 2020-01-28 오후 5:02
    **/
-//  public void getConsentSetList() {
-//    instance.showProgress();
-//    CallBack callBack = new CallBack() {
-//      @Override
-//      public void result(final SoapObject result) {
-//
-//        mActivity.runOnUiThread(new Runnable() {
-//          @Override
-//          public void run() {
-//            if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
-//              stop();
-//              tvEmptyMarker.setVisibility(View.VISIBLE);
-//            } else {
-//              stop();
-//              tvEmptyMarker.setVisibility(View.GONE);
-//              ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
-//              setConsentSetAdapter(arrayList);
-//            }
-//          }
-//        });
-//
-//      }
-//
-//      @Override
-//      public void stop() {
-//        instance.dismissProgress();
-//      }
-//
-//      @Override
-//      public void error() {
-//
-//      }
-//    };
-//
-//    HashMap<String, String> mData = new HashMap<String, String>();
-//    mData.put("userId", Util.getStringPreference(mContext, "userInfo", "userId"));
-////    mData.put("userId", "123123");
-//    mData.put("instCd", BuildConfig.INST_CD);
-//
-//    if (Util.checkNetwork(mContext) == true) {
-//      Util.callHttp(mContext, ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_CONSENT_SET_LIST, mData, callBack);
-//    } else {
-//      instance.dismissProgress();
-//      Util.networkErrorAlert(mActivity);
-//    }
-//  }
-//
-//  /**
-//   * 즐겨찾기 목록 데이터를 어댑터에 연결해준다
-//   * @author jksong
-//   * @since 2020-01-28 오후 5:03
-//   **/
-//  private void setConsentSetAdapter(final ArrayList<ConsentFormListVO> arrayList) {
-//
-//    if (consentListAdapter == null) {
-//      linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
-//      markerRecyclerView.setLayoutManager(linearLayoutManager);
-//      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_SET_LIST);
-//      markerRecyclerView.setAdapter(consentListAdapter);
-//    } else {
-//      consentListAdapter.arrayList = arrayList;
-//      consentListAdapter.notifyDataSetChanged();
-//    }
-//  }
+  public void getUserFormSetList() {
+    CallBack callBack = new CallBack() {
+      @Override
+      public void result(final String result) {
+        Log.e(TAG, "getUserFormSet -- > " + result);
+        mActivity.runOnUiThread(new Runnable() {
+          @Override
+          public void run() {
+            instance.dismissProgress();
+            ArrayList<HashMap<String, String>> arrayList = Common.parseJSON(mContext, result);
+            String code = arrayList.get(0).get("code");
+
+            if (!code.equals("00")) {
+              stop();
+            } else {
+              tvEmptyMarker.setVisibility(View.GONE);
+              ArrayList<ConsentFormListVO> consentArr = ParseJsonData.getInstance(mContext).getConsentFormList(arrayList);
+              setConsentSetAdapter(consentArr);
+            }
+          }
+        });
+      }
+
+      @Override
+      public void stop() {
+        tvEmptyMarker.setVisibility(View.VISIBLE);
+      }
+
+      @Override
+      public void error() {
+
+      }
+    };
+
+    HashMap<String, String> mData = new HashMap<String, String>();
+    mData.put("userId", Common.getStringPreference(mContext, "userInfo", "userId"));
+    mData.put("instCd", BuildConfig.INST_CD);
+
+    if (Common.checkNetwork(mContext) == true) {
+      instance.showProgress();
+      Common.callHttp(mContext, ConsentConfig.GET_USER_FORM_SET, mData, callBack);
+    } else {
+      Common.networkErrorAlert(mActivity);
+    }
+  }
+
+  private void setConsentSetAdapter(final ArrayList<ConsentFormListVO> arrayList) {
+    if (consentListAdapter == null) {
+      linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
+      markerRecyclerView.setLayoutManager(linearLayoutManager);
+      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_USER_FORM_SET);
+      markerRecyclerView.setAdapter(consentListAdapter);
+    } else {
+      consentListAdapter.arrayList = arrayList;
+      consentListAdapter.notifyDataSetChanged();
+    }
+  }
+
 
 }
 

+ 99 - 96
app/src/main/java/com/dbs/dbsec/activity/fragment/SearchFragment.java

@@ -2,7 +2,6 @@ package com.dbs.dbsec.activity.fragment;
 
 import android.content.Context;
 import android.os.Bundle;
-import android.telecom.Call;
 import android.util.Log;
 import android.view.KeyEvent;
 import android.view.LayoutInflater;
@@ -19,9 +18,11 @@ import com.dbs.dbsec.BuildConfig;
 import com.dbs.dbsec.R;
 import com.dbs.dbsec.activity.ConsentActivity;
 import com.dbs.dbsec.activity.adapter.CategoryAdapter;
+import com.dbs.dbsec.activity.adapter.ConsentListAdapter;
 import com.dbs.dbsec.httpTask.CallBack;
 import com.dbs.dbsec.httpTask.ParseJsonData;
 import com.dbs.dbsec.model.CategoryVO;
+import com.dbs.dbsec.model.ConsentFormListVO;
 import com.dbs.dbsec.util.Common;
 import com.dbs.dbsec.util.ConsentConfig;
 
@@ -44,7 +45,7 @@ public class SearchFragment extends Fragment {
   private ConsentActivity instance;
 
   private CategoryAdapter categoryAdapter;
-//  private ConsentListAdapter consentListAdapter;
+  private ConsentListAdapter consentListAdapter;
 
   private LinearLayoutManager linearLayoutManager;
   private LinearLayout searchClickLayout;
@@ -52,7 +53,7 @@ public class SearchFragment extends Fragment {
 
   private Spinner  searchDeptSpinner;
   private TextView tvHospitalName;
-  private EditText etPatientId;
+  private EditText etKeyWord;
   private TextView tvEmptySearchConsent;
 
   private String categoryId = "";
@@ -81,43 +82,43 @@ public class SearchFragment extends Fragment {
 
     searchDeptSpinner    = (Spinner) view.findViewById(R.id.searchDeptSpinner);
     tvHospitalName       = (TextView) view.findViewById(R.id.tvHospitalName);
-    etPatientId          = (EditText) view.findViewById(R.id.etPatientId);
+    etKeyWord            = (EditText) view.findViewById(R.id.etKeyWord);
     searchClickLayout    = (LinearLayout) view.findViewById(R.id.searchClickLayout);
     searchRecyclerView   = (RecyclerView) view.findViewById(R.id.searchRecyclerView);
     tvEmptySearchConsent = (TextView) view.findViewById(R.id.tvEmptySearchConsent);
 
     getCategoryList(BuildConfig.INST_CD);
 
-//    setEvent();
+    setEvent();
 
     return view;
   }
 
-//  private void setEvent() {
-//    searchClickLayout.setOnClickListener(onClickListener);
-//    etPatientId.setOnEditorActionListener(onEditorActionListener);
-//  }
-
-//  private View.OnClickListener onClickListener = new View.OnClickListener() {
-//    @Override
-//    public void onClick(View v) {
-//      if (v == searchClickLayout) {
-//        getConsentList(categoryId);
-//      }
-//    }
-//  };
-//
-//  public EditText.OnEditorActionListener onEditorActionListener = new EditText.OnEditorActionListener() {
-//    @Override
-//    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-//      if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
-//        if (v == etPatientId) {
-//          getConsentList(categoryId);
-//        }
-//      }
-//      return false;
-//    }
-//  };
+  private void setEvent() {
+    searchClickLayout.setOnClickListener(onClickListener);
+    etKeyWord.setOnEditorActionListener(onEditorActionListener);
+  }
+
+  private View.OnClickListener onClickListener = new View.OnClickListener() {
+    @Override
+    public void onClick(View v) {
+      if (v == searchClickLayout) {
+        getConsentBySearch(categoryId);
+      }
+    }
+  };
+
+  public EditText.OnEditorActionListener onEditorActionListener = new EditText.OnEditorActionListener() {
+    @Override
+    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+      if (actionId == EditorInfo.IME_ACTION_DONE || actionId == EditorInfo.IME_ACTION_NEXT) {
+        if (v == etKeyWord) {
+          getConsentBySearch(categoryId);
+        }
+      }
+      return false;
+    }
+  };
 
   /** Spinner List API **/
   /**
@@ -173,7 +174,6 @@ public class SearchFragment extends Fragment {
       instance.showProgress();
       Common.callHttp(mContext, ConsentConfig.GET_CATEGORY_LIST, mData, callBack);
     } else {
-      instance.dismissProgress();
       Common.networkErrorAlert(mActivity);
     }
   }
@@ -207,70 +207,73 @@ public class SearchFragment extends Fragment {
    * @author jksong
    * @since 2020-01-28 오후 5:03
    **/
-//  private void getConsentList(String categoryId) {
-//    CallBack callBack = new CallBack() {
-//      @Override
-//      public void result(final SoapObject result) {
-//
-//        mActivity.runOnUiThread(new Runnable() {
-//          @Override
-//          public void run() {
-//            instance.dismissProgress();
-//            if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
-//              tvEmptySearchConsent.setVisibility(View.VISIBLE);
-//
-//              if (consentListAdapter != null) {
-//                consentListAdapter.arrayList.clear();
-//                consentListAdapter.notifyDataSetChanged();
-//              }
-//
-//            } else {
-//              tvEmptySearchConsent.setVisibility(View.GONE);
-//              ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
-//              setConsentAdapter(arrayList);
-//            }
-//          }
-//        });
-//
-//      }
-//      @Override
-//      public void stop() {
-//      }
-//      @Override
-//      public void error() {
-//
-//      }
-//    };
-//
-//    if ((categoryId.equals("EMA_031") || categoryId.equals("EMA_032")) && etPatientId.getText().toString().trim().equals("")) {
-////      categoryNotSelected
-//      instance.showSingButtonDialog(mContext.getString(R.string.categoryNotSelected));
-//    } else {
-//      instance.showProgress();
-//      HashMap<String, String> mData = new HashMap<String, String>();
-//      mData.put("instCd", BuildConfig.INST_CD);
-//      mData.put("keyWord", etPatientId.getText().toString().trim());
-//      mData.put("categoryId", categoryId);
-//
-//      if (Util.checkNetwork(mContext) == true) {
-//        Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_SEARCH, mData, callBack);
-//      } else {
-//        instance.dismissProgress();
-//        Util.networkErrorAlert(mActivity);
-//      }
-//    }
-//  }
-//
-//  private void setConsentAdapter(final ArrayList<ConsentFormListVO> arrayList) {
-//    if (consentListAdapter == null) {
-//      linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
-//      searchRecyclerView.setLayoutManager(linearLayoutManager);
-//      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_SEARCH);
-//      searchRecyclerView.setAdapter(consentListAdapter);
-//    } else {
-//      consentListAdapter.arrayList = arrayList;
-//      consentListAdapter.notifyDataSetChanged();
-//    }
-//  }
+  private void getConsentBySearch(String categoryId) {
+    CallBack callBack = new CallBack() {
+      @Override
+      public void result(final String result) {
+        Log.e(TAG, "getConsentBySearch -- > " + result);
+        mActivity.runOnUiThread(new Runnable() {
+          @Override
+          public void run() {
+            instance.dismissProgress();
+            ArrayList<HashMap<String, String>> arrayList = Common.parseJSON(mContext, result);
+            String code = arrayList.get(0).get("code");
+
+            if (!code.equals("00")) {
+              stop();
+            } else {
+              tvEmptySearchConsent.setVisibility(View.GONE);
+              ArrayList<ConsentFormListVO> consentArr = ParseJsonData.getInstance(mContext).getConsentFormList(arrayList);
+              setConsentAdapter(consentArr);
+            }
+          }
+        });
+
+      }
+      @Override
+      public void stop() {
+        tvEmptySearchConsent.setVisibility(View.VISIBLE);
+
+        if (consentListAdapter != null) {
+          consentListAdapter.arrayList.clear();
+          consentListAdapter.notifyDataSetChanged();
+        }
+      }
+      @Override
+      public void error() {
+
+      }
+    };
+
+    if (categoryId.equals("1") && etKeyWord.getText().toString().trim().equals("")) {
+//      categoryNotSelected
+      instance.showSingButtonDialog(mContext.getString(R.string.categoryNotSelected));
+    } else {
+      instance.showProgress();
+      HashMap<String, String> mData = new HashMap<String, String>();
+      mData.put("instCd", BuildConfig.INST_CD);
+      mData.put("keyWord", etKeyWord.getText().toString().trim());
+      mData.put("categoryId", categoryId);
+
+      if (Common.checkNetwork(mContext) == true) {
+        Common.callHttp(mContext, ConsentConfig.GET_CONSENT_BY_SEARCH, mData, callBack);
+      } else {
+        instance.dismissProgress();
+        Common.networkErrorAlert(mActivity);
+      }
+    }
+  }
+
+  private void setConsentAdapter(final ArrayList<ConsentFormListVO> arrayList) {
+    if (consentListAdapter == null) {
+      linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
+      searchRecyclerView.setLayoutManager(linearLayoutManager);
+      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_BY_SEARCH);
+      searchRecyclerView.setAdapter(consentListAdapter);
+    } else {
+      consentListAdapter.arrayList = arrayList;
+      consentListAdapter.notifyDataSetChanged();
+    }
+  }
 
 }

+ 38 - 0
app/src/main/java/com/dbs/dbsec/httpTask/ParseJsonData.java

@@ -5,6 +5,7 @@ import android.util.Log;
 
 import com.dbs.dbsec.R;
 import com.dbs.dbsec.model.CategoryVO;
+import com.dbs.dbsec.model.ConsentFormListVO;
 import com.dbs.dbsec.model.DeptListVO;
 import com.dbs.dbsec.model.DoctorListVO;
 import com.dbs.dbsec.model.PatientInfoVO;
@@ -280,4 +281,41 @@ public class ParseJsonData {
     }
     return arrayList;
   }
+
+  public ArrayList<ConsentFormListVO> getConsentFormList(ArrayList<HashMap<String, String>> result) {
+    String data = result.get(0).get("data");
+    ArrayList<HashMap<String, String>> rts = Common.parseJSON(mContext, data);
+    ArrayList<ConsentFormListVO> arrayList = new ArrayList<ConsentFormListVO>();
+
+    for (int i = 0; i < rts.size(); i++) {
+      HashMap<String, String> mm = rts.get(i);
+
+      String idx = mm.get("idx");
+      String formId = mm.get("formId");
+      String formCode = mm.get("formCode");
+      String formName = mm.get("formName");
+      String formPrntNm = mm.get("formPrntNm");
+      String printCnt = mm.get("printCnt");
+      String certPass = mm.get("certPass");
+      String pid = mm.get("pid");
+      String deptEngAggr = mm.get("deptEngAggr");
+      String consentState = mm.get("consentState");
+      String consentMstRid = mm.get("consentMstRid");
+      String ocrTag = mm.get("ocrTag");
+      String modifyUserId = mm.get("modifyUserId");
+      String modifyUserNm = mm.get("modifyUserNm");
+      String modifyDateTime = mm.get("modifyDateTime");
+      String create_dateTime = mm.get("create_dateTime");
+      String clnDate = mm.get("clnDate");
+      String cretNo = mm.get("cretNo");
+      String ordType = mm.get("ordType");
+      String deptCd = mm.get("deptCd");
+      String mainDrId = mm.get("mainDrId");
+      String patientName = mm.get("patientName");
+
+      arrayList.add(new ConsentFormListVO(idx, formId, formCode, formName, formPrntNm, printCnt, certPass, pid, deptEngAggr, consentState, consentMstRid, ocrTag, modifyUserId, modifyUserNm, modifyDateTime, create_dateTime, clnDate, cretNo, ordType, deptCd, mainDrId, patientName));
+    }
+    return arrayList;
+  }
+
 }

+ 227 - 0
app/src/main/java/com/dbs/dbsec/model/ConsentFormListVO.java

@@ -0,0 +1,227 @@
+package com.dbs.dbsec.model;
+
+public class ConsentFormListVO {
+  private String idx = "";
+  private String formId = "";
+  private String formCode = "";
+  private String formName = "";
+  private String formPrntNm = "";
+  private String printCnt = "";
+  private String certPass = "";
+  private String pid = "";
+  private String deptEngAggr = "";
+  private String consentState = "";
+  private String consentMstRid = "";
+  private String ocrTag = "";
+  private String modifyUserId = "";
+  private String modifyUserNm = "";
+  private String modifyDateTime = "";
+  private String create_dateTime = "";
+  private String clnDate = "";
+  private String cretNo = "";
+  private String ordType = "";
+  private String deptCd = "";
+  private String mainDrId = "";
+  private String patientName = "";
+
+  public ConsentFormListVO(String idx, String formId, String formCode, String formName, String formPrntNm, String printCnt, String certPass, String pid, String deptEngAggr, String consentState, String consentMstRid, String ocrTag, String modifyUserId, String modifyUserNm, String modifyDateTime, String create_dateTime, String clnDate, String cretNo, String ordType, String deptCd, String mainDrId, String patientName) {
+    this.idx = idx;
+    this.formId = formId;
+    this.formCode = formCode;
+    this.formName = formName;
+    this.formPrntNm = formPrntNm;
+    this.printCnt = printCnt;
+    this.certPass = certPass;
+    this.pid = pid;
+    this.deptEngAggr = deptEngAggr;
+    this.consentState = consentState;
+    this.consentMstRid = consentMstRid;
+    this.ocrTag = ocrTag;
+    this.modifyUserId = modifyUserId;
+    this.modifyUserNm = modifyUserNm;
+    this.modifyDateTime = modifyDateTime;
+    this.create_dateTime = create_dateTime;
+    this.clnDate = clnDate;
+    this.cretNo = cretNo;
+    this.ordType = ordType;
+    this.deptCd = deptCd;
+    this.mainDrId = mainDrId;
+    this.patientName = patientName;
+  }
+
+  public String getIdx() {
+    return idx;
+  }
+
+  public void setIdx(String idx) {
+    this.idx = idx;
+  }
+
+  public String getFormId() {
+    return formId;
+  }
+
+  public void setFormId(String formId) {
+    this.formId = formId;
+  }
+
+  public String getFormCode() {
+    return formCode;
+  }
+
+  public void setFormCode(String formCode) {
+    this.formCode = formCode;
+  }
+
+  public String getFormName() {
+    return formName;
+  }
+
+  public void setFormName(String formName) {
+    this.formName = formName;
+  }
+
+  public String getFormPrntNm() {
+    return formPrntNm;
+  }
+
+  public void setFormPrntNm(String formPrntNm) {
+    this.formPrntNm = formPrntNm;
+  }
+
+  public String getPrintCnt() {
+    return printCnt;
+  }
+
+  public void setPrintCnt(String printCnt) {
+    this.printCnt = printCnt;
+  }
+
+  public String getCertPass() {
+    return certPass;
+  }
+
+  public void setCertPass(String certPass) {
+    this.certPass = certPass;
+  }
+
+  public String getPid() {
+    return pid;
+  }
+
+  public void setPid(String pid) {
+    this.pid = pid;
+  }
+
+  public String getDeptEngAggr() {
+    return deptEngAggr;
+  }
+
+  public void setDeptEngAggr(String deptEngAggr) {
+    this.deptEngAggr = deptEngAggr;
+  }
+
+  public String getConsentState() {
+    return consentState;
+  }
+
+  public void setConsentState(String consentState) {
+    this.consentState = consentState;
+  }
+
+  public String getConsentMstRid() {
+    return consentMstRid;
+  }
+
+  public void setConsentMstRid(String consentMstRid) {
+    this.consentMstRid = consentMstRid;
+  }
+
+  public String getOcrTag() {
+    return ocrTag;
+  }
+
+  public void setOcrTag(String ocrTag) {
+    this.ocrTag = ocrTag;
+  }
+
+  public String getModifyUserId() {
+    return modifyUserId;
+  }
+
+  public void setModifyUserId(String modifyUserId) {
+    this.modifyUserId = modifyUserId;
+  }
+
+  public String getModifyUserNm() {
+    return modifyUserNm;
+  }
+
+  public void setModifyUserNm(String modifyUserNm) {
+    this.modifyUserNm = modifyUserNm;
+  }
+
+  public String getModifyDateTime() {
+    return modifyDateTime;
+  }
+
+  public void setModifyDateTime(String modifyDateTime) {
+    this.modifyDateTime = modifyDateTime;
+  }
+
+  public String getCreate_dateTime() {
+    return create_dateTime;
+  }
+
+  public void setCreate_dateTime(String create_dateTime) {
+    this.create_dateTime = create_dateTime;
+  }
+
+  public String getClnDate() {
+    return clnDate;
+  }
+
+  public void setClnDate(String clnDate) {
+    this.clnDate = clnDate;
+  }
+
+  public String getCretNo() {
+    return cretNo;
+  }
+
+  public void setCretNo(String cretNo) {
+    this.cretNo = cretNo;
+  }
+
+  public String getOrdType() {
+    return ordType;
+  }
+
+  public void setOrdType(String ordType) {
+    this.ordType = ordType;
+  }
+
+  public String getDeptCd() {
+    return deptCd;
+  }
+
+  public void setDeptCd(String deptCd) {
+    this.deptCd = deptCd;
+  }
+
+  public String getMainDrId() {
+    return mainDrId;
+  }
+
+  public void setMainDrId(String mainDrId) {
+    this.mainDrId = mainDrId;
+  }
+
+  public String getPatientName() {
+    return patientName;
+  }
+
+  public void setPatientName(String patientName) {
+    this.patientName = patientName;
+  }
+}

+ 20 - 9
app/src/main/java/com/dbs/dbsec/util/ConsentConfig.java

@@ -6,16 +6,27 @@ import java.util.HashMap;
 
 public class ConsentConfig {
   public static final String ALERT_BTN_TYPE   = "SINGLE";
+
   public static final String URL = BuildConfig.CONSENT_SERVER_URL;
-  public static final String HOSPITAL_SVC = URL + "hospitalSvc/";
-  public static final String GET_BASE_DATA = HOSPITAL_SVC + "GetBaseData";
-  public static final String DO_LOGIN = HOSPITAL_SVC + "doLogin";
-  public static final String GET_WARD_LIST = HOSPITAL_SVC + "getWardList";
-  public static final String GET_DEPT_LIST = HOSPITAL_SVC + "getDeptList";
-  public static final String GET_DOCTOR_LIST = HOSPITAL_SVC + "getDoctorList";
-  public static final String GET_PATIENT_LIST = HOSPITAL_SVC + "getPatientList";
-  public static final String GET_PATIENT_INFO = HOSPITAL_SVC + "getPatientInfo";
-  public static final String GET_CATEGORY_LIST = HOSPITAL_SVC + "getConsentFormCategory";
+
+  // HOSPITAL_SVC
+  public static final String HOSPITAL_SVC          = URL + "hospitalSvc/";
+  public static final String GET_BASE_DATA         = HOSPITAL_SVC + "GetBaseData";
+  public static final String DO_LOGIN              = HOSPITAL_SVC + "doLogin";
+  public static final String GET_WARD_LIST         = HOSPITAL_SVC + "getWardList";
+  public static final String GET_DEPT_LIST         = HOSPITAL_SVC + "getDeptList";
+  public static final String GET_DOCTOR_LIST       = HOSPITAL_SVC + "getDoctorList";
+  public static final String GET_PATIENT_LIST      = HOSPITAL_SVC + "getPatientList";
+  public static final String GET_PATIENT_INFO      = HOSPITAL_SVC + "getPatientInfo";
+  public static final String GET_CATEGORY_LIST     = HOSPITAL_SVC + "getConsentFormCategory";
+  public static final String SET_USER_FORM_SET     = HOSPITAL_SVC + "setUserFormSetList";
+  public static final String DEL_USER_FORM_SET     = HOSPITAL_SVC + "delUserFormSet";
+
+  // CONSENT_SVC
+  public static final String CONSENT_SVC           = URL + "ConsentSvc/";
+  public static final String GET_CONSENT_BY_SEARCH = CONSENT_SVC + "getConsentBySearch";
+  public static final String GET_USER_FORM_SET     = CONSENT_SVC + "getUserFormSetList";
+  public static final String GET_CONSENT_LIST      = CONSENT_SVC + "getConsentList";
 
 
   public final static int CONNECT_TIMEOUT   = 10000;

+ 1 - 1
app/src/main/res/layout/activity_search_fragment.xml

@@ -64,7 +64,7 @@
             android:orientation="horizontal">
 
             <EditText
-                android:id="@+id/etPatientId"
+                android:id="@+id/etKeyWord"
                 app:theme="@style/EditTextStyle"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"

+ 1 - 1
app/src/main/res/values/strings.xml

@@ -109,7 +109,7 @@
     <string name="myPatient">내 환자</string>
     <string name="inPateintSearchEmptyData">병동, 진료과, 등록번호 중 1가지 이상 입력해주세요.</string>
     <string name="patientsearchEmptyData">진료과, 등록번호 중 1가지 이상 입력해주세요.</string>
-    <string name="categoryNotSelected">과 또는 검색어를 입력해주세요.</string>
+    <string name="categoryNotSelected">검색어를 입력해주세요.</string>
     <string name="emptySign">서명이 누락되었습니다.</string>
     <string name="emptySearchConsent">조회된 동의서가 없습니다.</string>