Ver código fonte

동의서 찾기 서식 리스트 추가

3cooking 5 anos atrás
pai
commit
65d63092e4

+ 38 - 7
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentListAdapter.java

@@ -1,8 +1,15 @@
 package com.dbs.mplus.knuh.adapter;
 
+import android.content.Context;
+import android.graphics.PorterDuff;
+import android.graphics.PorterDuffColorFilter;
+import android.graphics.drawable.GradientDrawable;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.Button;
+import android.widget.TextView;
 
 import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.model.ConsentFormListVO;
@@ -11,20 +18,35 @@ import java.util.ArrayList;
 
 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;
   public  ArrayList<ConsentFormListVO> arrayList;
 
+
   public ConsentListAdapter(AppCompatActivity mActivity, ArrayList<ConsentFormListVO> arrayList) {
     this.mActivity = mActivity;
     this.arrayList = arrayList;
+    Log.e(TAG, "arrayList -- > " + arrayList.size());
+  }
 
+  @Override
+  public int getItemCount() {
+    return arrayList.size();
   }
 
   public class ViewHolder extends RecyclerView.ViewHolder {
+
+    public TextView tvConsentName;
+    public TextView tvPatientName;
+    public TextView tvTemp;
+    public TextView tvSubText;
+
     public ViewHolder(@NonNull View itemView) {
       super(itemView);
     }
@@ -36,19 +58,28 @@ public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.
     View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.consent_list_item, parent, false);
     ViewHolder holder = new ViewHolder(view);
 
+    holder.tvConsentName = view.findViewById(R.id.tvConsentName);
+    holder.tvPatientName = view.findViewById(R.id.tvPatientName);
+    holder.tvTemp        = view.findViewById(R.id.tvTemp);
+    holder.tvSubText     = view.findViewById(R.id.tvSubText);
 
-    return null;
-  }
+    holder.tvPatientName.setVisibility(View.GONE);
+    holder.tvTemp.setVisibility(View.GONE);
+    holder.tvSubText.setText(R.string.add);
 
-  @Override
-  public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+    GradientDrawable tvSubBg = (GradientDrawable) holder.tvSubText.getBackground().getCurrent();
+    tvSubBg.setColor(ContextCompat.getColor(mActivity, R.color.typeRightColor));
 
+    return holder;
   }
 
   @Override
-  public int getItemCount() {
-    return 0;
-  }
+  public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+
+    ConsentFormListVO consentFormListVO = arrayList.get(position);
 
+    String formName = consentFormListVO.getFormName();
+    holder.tvConsentName.setText(formName);
 
+  }
 }

+ 21 - 12
app/src/main/java/com/dbs/mplus/knuh/fragment/SearchFragment.java

@@ -4,6 +4,7 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.fragment.app.Fragment;
+import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
 import android.content.Context;
@@ -21,6 +22,8 @@ import android.widget.TextView;
 import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.adapter.CategoryAdapter;
+import com.dbs.mplus.knuh.adapter.ConsentListAdapter;
+import com.dbs.mplus.knuh.customView.LoadingProgress;
 import com.dbs.mplus.knuh.httpTask.CallBack;
 import com.dbs.mplus.knuh.httpTask.SoapParser;
 import com.dbs.mplus.knuh.model.CategoryVO;
@@ -49,7 +52,9 @@ public class SearchFragment extends Fragment {
   private TextView tvHospitalName;
   private TextView etPatientId;
 
-  private String keyWord = "";
+  private String keyWord    = "";
+  private String categoryId = "";
+
 
   public SearchFragment() {
   }
@@ -61,6 +66,8 @@ public class SearchFragment extends Fragment {
 
     mContext  = getActivity();
     mActivity = (AppCompatActivity) getActivity();
+
+    progress = new LoadingProgress(mActivity);
   }
 
   @Nullable
@@ -90,8 +97,9 @@ public class SearchFragment extends Fragment {
     @Override
     public void onClick(View v) {
       if (v == searchClickLayout) {
+        progress.show();
         keyWord = etPatientId.getText().toString();
-        getConsentList(BuildConfig.INST_CD, keyWord);
+        getConsentList(BuildConfig.INST_CD, keyWord, categoryId);
       }
     }
   };
@@ -105,8 +113,8 @@ public class SearchFragment extends Fragment {
         if (result == null || result.toString().indexOf("null") > 0) {
           stop();
         } else {
-          ArrayList<CategoryVO> arrayList = SoapParser.getHospitalList(result);
-          setSpinnerAdapter(arrayList);
+          categoryArray = SoapParser.getHospitalList(result);
+          setSpinnerAdapter(categoryArray);
         }
       }
 
@@ -147,8 +155,13 @@ public class SearchFragment extends Fragment {
     @Override
     public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
 
+      CategoryVO categoryVO = categoryArray.get(position);
+      categoryId = categoryVO.getCategoryId();
+      Log.e(TAG, "categoryId -- > " + categoryId);
     }
 
+
+
     @Override
     public void onNothingSelected(AdapterView<?> parent) {
 
@@ -161,31 +174,27 @@ public class SearchFragment extends Fragment {
     CallBack callBack = new CallBack() {
       @Override
       public void result(SoapObject result) {
-        Log.e(TAG, "consentResult -- > " + result);
-
+        progress.dismiss();
         if (result == null || result.toString().indexOf("null") > 0 ) {
+        } else {
           ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
+          setConsentAdapter(arrayList);
         }
 
       }
-
       @Override
       public void stop() {
 
       }
-
       @Override
       public void error() {
 
       }
-
-
     };
-
     HashMap<String, String> mData = new HashMap<String, String>();
     mData.put("instCd", instCd);
     mData.put("keyWord", keyWord);
-    mData.put("categoryId", "");
+    mData.put("categoryId", categoryId);
 
     Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_SEARCH, mData, callBack);
   }

+ 44 - 2
app/src/main/java/com/dbs/mplus/knuh/httpTask/SoapParser.java

@@ -2,6 +2,7 @@ package com.dbs.mplus.knuh.httpTask;
 
 import android.util.Log;
 
+import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.model.CategoryVO;
 import com.dbs.mplus.knuh.model.ConsentFormListVO;
 import com.dbs.mplus.knuh.model.DeptListVO;
@@ -118,6 +119,11 @@ public class SoapParser {
         String doctorKind = so.getProperty("doctorKind").toString().trim();
         String drKind     = so.getProperty("drKind").toString().trim();
 
+        doctorId   = doctorId.equals(ConsentConfig.RETURN_NULL) ? "" : doctorId;
+        doctorNm   = doctorNm.equals(ConsentConfig.RETURN_NULL) ? "" : doctorNm;
+        doctorKind = doctorKind.equals(ConsentConfig.RETURN_NULL) ? "" : doctorKind;
+        drKind     = drKind.equals(ConsentConfig.RETURN_NULL) ? "" : drKind;
+
         arrayList.add(new DoctorListVO(doctorId, doctorNm, doctorKind, drKind));
       }
     }
@@ -156,6 +162,22 @@ public class SoapParser {
         String opRoomNm  = so.getProperty("opRoomNm").toString().trim();
         String oprsRvNo  = so.getProperty("oprsRvNo").toString().trim();
 
+        pid       = pid.equals(ConsentConfig.RETURN_NULL) ? "" : pid;
+        inDd      = inDd.equals(ConsentConfig.RETURN_NULL) ? "" : inDd;
+        cretNo    = cretNo.equals(ConsentConfig.RETURN_NULL) ? "" : cretNo;
+        instCd    = instCd.equals(ConsentConfig.RETURN_NULL) ? "" : instCd;
+        hngNm     = hngNm.equals(ConsentConfig.RETURN_NULL) ? "" : hngNm;
+        ordDeptCd = ordDeptCd.equals(ConsentConfig.RETURN_NULL) ? "" : ordDeptCd;
+        doctorId  = doctorId.equals(ConsentConfig.RETURN_NULL) ? "" : doctorId;
+        sa        = sa.equals(ConsentConfig.RETURN_NULL) ? "" : sa;
+        deptNm    = deptNm.equals(ConsentConfig.RETURN_NULL) ? "" : deptNm;
+        doctorNm  = doctorNm.equals(ConsentConfig.RETURN_NULL) ? "" : doctorNm;
+        roomCd    = roomCd.equals(ConsentConfig.RETURN_NULL) ? "" : roomCd;
+        opRoomNm  = opRoomNm.equals(ConsentConfig.RETURN_NULL) ? "" : opRoomNm;
+        oprsRvNo  = oprsRvNo.equals(ConsentConfig.RETURN_NULL) ? "" : oprsRvNo;
+
+
+
         arrayList.add(new PatientListVO(pid, inDd, cretNo, instCd, hngNm, ordDeptCd, doctorId, sa, deptNm, doctorNm, roomCd, opRoomNm, oprsRvNo));
       }
     }
@@ -186,6 +208,10 @@ public class SoapParser {
         String categoryId   = so.getProperty("CategoryId").toString().trim();
         String categoryName = so.getProperty("CategoryName").toString().trim();
 
+        categoryType = categoryType.equals(ConsentConfig.RETURN_NULL) ? "" : categoryType;
+        categoryId   = categoryId.equals(ConsentConfig.RETURN_NULL) ? "" : categoryId;
+        categoryName = categoryName.equals(ConsentConfig.RETURN_NULL) ? "" : categoryName;
+
         arrayList.add(new CategoryVO(categoryType, categoryId, categoryName));
 
       }
@@ -218,7 +244,7 @@ public class SoapParser {
         String formCd        = so.getProperty("formCd").toString().trim();
         String formGuid      = so.getProperty("formGuid").toString().trim();
         String formName      = so.getProperty("formName").toString().trim();
-        String formId        = so.getProperty("formId").toString().trim();
+        String formRid       = so.getProperty("formRid").toString().trim();
         String printOnly     = so.getProperty("printOnly").toString().trim();
         String ocrTagPrntYn  = so.getProperty("ocrTagPrntYn").toString().trim();
         String formPrntNm    = so.getProperty("formPrntNm").toString().trim();
@@ -228,7 +254,23 @@ public class SoapParser {
         String userDrFlag    = so.getProperty("userDrFlag").toString().trim();
         String linkFormCd    = so.getProperty("linkFormCd").toString().trim();
 
-        arrayList.add(new ConsentFormListVO(consentMstRid, pid, consentState, formCd, formGuid, formName, formId, printOnly, ocrTagPrntYn, formPrntNm, certUseYn, opDiagNm, opNm, userDrFlag, linkFormCd));
+        consentMstRid = consentMstRid.equals(ConsentConfig.RETURN_NULL) ? "" : consentMstRid;
+        pid           = pid.equals(ConsentConfig.RETURN_NULL) ? "" : pid;
+        consentState  = consentState.equals(ConsentConfig.RETURN_NULL) ? "" : consentState;
+        formCd        = formCd.equals(ConsentConfig.RETURN_NULL) ? "" : formCd;
+        formGuid      = formGuid.equals(ConsentConfig.RETURN_NULL) ? "" : formGuid;
+        formName      = formName.equals(ConsentConfig.RETURN_NULL) ? "" : formName;
+        formRid       = formRid.equals(ConsentConfig.RETURN_NULL) ? "" : formRid;
+        printOnly     = printOnly.equals(ConsentConfig.RETURN_NULL) ? "" : printOnly;
+        ocrTagPrntYn  = ocrTagPrntYn.equals(ConsentConfig.RETURN_NULL) ? "" : ocrTagPrntYn;
+        formPrntNm    = formPrntNm.equals(ConsentConfig.RETURN_NULL) ? "" : formPrntNm;
+        certUseYn     = certUseYn.equals(ConsentConfig.RETURN_NULL) ? "" : certUseYn;
+        opDiagNm      = opDiagNm.equals(ConsentConfig.RETURN_NULL) ? "" : opDiagNm;
+        opNm          = opNm.equals(ConsentConfig.RETURN_NULL) ? "" : opNm;
+        userDrFlag    = userDrFlag.equals(ConsentConfig.RETURN_NULL) ? "" : userDrFlag;
+        linkFormCd    = linkFormCd.equals(ConsentConfig.RETURN_NULL) ? "" : linkFormCd;
+
+        arrayList.add(new ConsentFormListVO(consentMstRid, pid, consentState, formCd, formGuid, formName, formRid, printOnly, ocrTagPrntYn, formPrntNm, certUseYn, opDiagNm, opNm, userDrFlag, linkFormCd));
       }
     }
 

+ 3 - 2
app/src/main/res/layout/activity_search_fragment.xml

@@ -107,16 +107,17 @@
         android:layout_margin="8dp"
         android:background="@color/black" />
 
-    <LinearLayout
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_margin="8dp">
 
+
         <androidx.recyclerview.widget.RecyclerView
             android:id="@+id/searchRecyclerView"
             android:layout_width="match_parent"
             android:layout_height="match_parent" />
-    </LinearLayout>
+    </RelativeLayout>
     <!--    <LinearLayout-->
     <!--        android:layout_width="0dp"-->
     <!--        android:layout_height="0dp"-->

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

@@ -11,6 +11,7 @@
     <string name="certficate">인증적용</string>
     <string name="login">로그인</string>
     <string name="confirm">확인</string>
+    <string name="add">추가</string>
     <string name="print">출력</string>
     <string name="cancel">취소</string>
     <string name="alrim">알림</string>