Browse Source

Merge branch 'master' of https://bitbucket.org/songjunekeun/knuhconsent

3cooking 5 years ago
parent
commit
6d591635fe

+ 1 - 1
.idea/misc.xml

@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="JDK" project-jdk-type="JavaSDK" />
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK" />
 </project>

+ 28 - 0
app/src/main/java/com/dbs/mplus/knuh/activity/ConsentActivity.java

@@ -127,6 +127,13 @@ public class ConsentActivity extends AppCompatActivity {
   public RecyclerView patientRecyclerView;
   public TextView patientEmpty;
   public CheckBox chkMyPatient;
+  public LinearLayout llPatientSort;
+  public LinearLayout llPatientNmSort;
+  public LinearLayout llRoomSort;
+  public TextView column1;
+  public TextView column4;
+  public TextView column6;
+
   /** left Menu **/
 
   /** Center Menu **/
@@ -311,12 +318,29 @@ public class ConsentActivity extends AppCompatActivity {
     patientEmpty = (TextView) findViewById(R.id.patientEmpty);
     chkMyPatient = (CheckBox) findViewById(R.id.chkMyPatient);
 
+    llPatientSort = (LinearLayout) findViewById(R.id.llPatientSort);
+    llPatientNmSort = (LinearLayout) findViewById(R.id.llPatientNmSort);
+    llRoomSort = (LinearLayout) findViewById(R.id.llRoomSort);
+
+    column1 = (TextView) findViewById(R.id.column1);
+    column4 = (TextView) findViewById(R.id.column4);
+    column6 = (TextView) findViewById(R.id.column6);
+
     leftMenu.setRadioGroupDraw(indexPage);
 
     if (!indexPage.equals("I")) {
       wardLayout.setVisibility(View.INVISIBLE);
       chkMyPatient.setVisibility(View.GONE);
+
+      column6.setText("");
+      if (indexPage.equals("OP")) {
+        column6.setText(getString(R.string.opRoom));
+      } else if (indexPage.equals("SR")) {
+        column6.setText(getString(R.string.medicalTreatmentDate));
+      }
+
     } else if (indexPage.equals("I")) {
+      column6.setText(getString(R.string.wardRoom));
       if (ConsentConfig.SETTING_DATA.get("MY_PATIENT").equals("Y")) {
         chkMyPatient.setVisibility(View.VISIBLE);
       } else {
@@ -335,6 +359,10 @@ public class ConsentActivity extends AppCompatActivity {
     patientSearchLayout.setOnClickListener(leftMenu.onClickListener);
     etPatientId.setOnEditorActionListener(leftMenu.onEditorActionListener);
 
+    llPatientSort.setOnClickListener(leftMenu.sortOnClickListener);
+    llPatientNmSort.setOnClickListener(leftMenu.sortOnClickListener);
+    llRoomSort.setOnClickListener(leftMenu.sortOnClickListener);
+
     leftMenu.getWardList();
     leftMenu.getDeptList();
     leftMenu.getInitPatientList();

+ 1 - 5
app/src/main/java/com/dbs/mplus/knuh/activity/activityEvent/CenterMenu.java

@@ -133,11 +133,7 @@ public class CenterMenu {
       public void result(SoapObject result) {
         Log.e(TAG, "getConsentList result -- > " + result);
         ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
-        if (arrayList.size() > 0) {
-
-          setConsentAdapter(arrayList);
-        }
-
+        setConsentAdapter(arrayList);
       }
 
       @Override

+ 97 - 1
app/src/main/java/com/dbs/mplus/knuh/activity/activityEvent/LeftMenu.java

@@ -41,6 +41,9 @@ import com.dbs.mplus.knuh.util.Util;
 import org.ksoap2.serialization.SoapObject;
 
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 
 import javax.security.auth.callback.Callback;
@@ -61,6 +64,10 @@ public class LeftMenu {
 
   public String patientState = "";
 
+  private boolean pidSortFlag         = false;
+  private boolean patientNameSortFlag = false;
+  private boolean wardSortFlag        = false;
+
   public LeftMenu(Context context, AppCompatActivity activity) {
     this.mContext   = context;
     this.mActivity  = activity;
@@ -235,6 +242,93 @@ public class LeftMenu {
     }
   };
 
+  public View.OnClickListener sortOnClickListener = new View.OnClickListener() {
+    @Override
+    public void onClick(View v) {
+      if (patientListAdapter != null) {
+
+        if (instance.llPatientSort == v) {
+          Collections.sort(patientListAdapter.arrayList, new Comparator<PatientListVO>() {
+            @Override
+            public int compare(PatientListVO o1, PatientListVO o2) {
+              if (pidSortFlag == false) {
+                return (int) (Double.parseDouble(o1.getPid()) - Double.parseDouble(o2.getPid()));
+              } else {
+                return (int) (Double.parseDouble(o2.getPid()) - Double.parseDouble(o1.getPid()));
+              }
+            }
+          });
+
+          if (pidSortFlag == false) {
+            instance.column1.setText(mContext.getString(R.string.patientId) + " ▲");
+            pidSortFlag = true;
+          } else {
+            instance.column1.setText(mContext.getString(R.string.patientId) + " ▼");
+            pidSortFlag = false;
+          }
+
+          instance.column4.setText(mContext.getString(R.string.patientName));
+          if (instance.indexPage.equals("I")) {
+            instance.column6.setText(mContext.getString(R.string.wardRoom));
+          }
+        } else if (instance.llPatientNmSort == v) {
+          Collections.sort(patientListAdapter.arrayList, new Comparator<PatientListVO>() {
+            @Override
+            public int compare(PatientListVO o1, PatientListVO o2) {
+              if (patientNameSortFlag == false) {
+                return o1.getHngNm().compareTo(o2.getHngNm());
+              } else {
+                return o2.getHngNm().compareTo(o1.getHngNm());
+              }
+            }
+          });
+
+          if (patientNameSortFlag == false) {
+            instance.column4.setText(mContext.getString(R.string.patientName) + " ▲");
+            patientNameSortFlag = true;
+          } else {
+            instance.column4.setText(mContext.getString(R.string.patientName) + " ▼");
+            patientNameSortFlag = false;
+          }
+
+          instance.column1.setText(mContext.getString(R.string.patientId));
+          if (instance.indexPage.equals("I")) {
+            instance.column6.setText(mContext.getString(R.string.wardRoom));
+          }
+        } else if (instance.llRoomSort == v) {
+          if (instance.indexPage.equals("I")) {
+            Collections.sort(patientListAdapter.arrayList, new Comparator<PatientListVO>() {
+              @Override
+              public int compare(PatientListVO o1, PatientListVO o2) {
+                if (wardSortFlag == false) {
+                  return o1.getRoomCd().compareTo(o2.getRoomCd());
+                } else {
+                  return o2.getRoomCd().compareTo(o1.getRoomCd());
+                }
+              }
+            });
+
+            if (wardSortFlag == false) {
+              instance.column6.setText(mContext.getString(R.string.wardRoom) + " ▲");
+              wardSortFlag = true;
+            } else {
+              instance.column6.setText(mContext.getString(R.string.wardRoom) + " ▼");
+              wardSortFlag = false;
+            }
+
+            instance.column1.setText(mContext.getString(R.string.patientId));
+            instance.column4.setText(mContext.getString(R.string.patientName));
+          }
+        }
+
+
+
+        linearLayoutManager.scrollToPositionWithOffset(0, 0);
+        patientListAdapter.notifyDataSetChanged();
+      }
+    }
+  };
+
   public EditText.OnEditorActionListener onEditorActionListener = new EditText.OnEditorActionListener() {
     @Override
     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
@@ -527,7 +621,9 @@ public class LeftMenu {
       @Override
       public void result(SoapObject result) {
         ArrayList<PatientListVO> arrayList = SoapParser.getPatientList(result);
-        setPatientListAdapter(arrayList);
+        if (arrayList.size() > 0) {
+          setPatientListAdapter(arrayList);
+        }
       }
 
       @Override

+ 11 - 1
app/src/main/java/com/dbs/mplus/knuh/adapter/PatientListAdapter.java

@@ -87,13 +87,23 @@ public class PatientListAdapter extends RecyclerView.Adapter<PatientListAdapter.
     String patientNm = patientListVO.getHngNm();
     String doctorNm  = patientListVO.getDoctorNm();
     String roomCd    = patientListVO.getRoomCd();
+    String opRoom    = patientListVO.getOpRoomNm();
+    String inDd      = patientListVO.getInDd();
 
     holder.tvPid.setText(pid);
     holder.tvFsex.setText(sa);
     holder.tvDept.setText(deptNm);
     holder.tvPatient.setText(patientNm);
     holder.tvPract.setText(doctorNm);
-    holder.tvWard.setText(roomCd);
+    if (instance.indexPage.equals("I")) {
+      holder.tvWard.setText(roomCd);
+    } else if (instance.indexPage.equals("OP")) {
+      holder.tvWard.setText(opRoom);
+    } else if (instance.indexPage.equals("SR")) {
+      holder.tvWard.setText(inDd);
+    }
+
+
 
     if (rowIndex == holder.position && click == true) {
       holder.listLayer.setBackgroundColor(mActivity.getColor(R.color.commonColor));

+ 0 - 10
app/src/main/java/com/dbs/mplus/knuh/consent/EFormSaveHandler.java

@@ -62,8 +62,6 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs>, CallBac
 
   @Override
   public void eventReceived(Object o, ResultEventArgs resultEventArgs) {
-
-    eFormToolkit.sendEFormViewerOkEvent();
     saveMapData = createSaveData(resultEventArgs, consentData);
     saveProcess(saveMapData, resultEventArgs);
 
@@ -177,7 +175,6 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs>, CallBac
           saveData.put("actKind", "T");
           saveData.put("consentState", "TEMP");
           Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.SAVE_TEMP, saveData, callBack);
-          eFormToolkit.sendEFormViewerOkEvent();
           break;
         case TEMP_SAVE2: // 확인저장
           saveData.putAll(imageUpload(eventArgs));
@@ -278,13 +275,6 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs>, CallBac
           }
         }
 
-
-
-
-//        if (instance.consentHistoryAdapter != null) {
-//          instance.history.getHistoryConsentList(instance.history.searchType);
-//        }
-
         eFormToolkit.sendEFormViewerOkEvent();
       }
     }

+ 1 - 0
app/src/main/res/layout/activity_department_list.xml

@@ -4,6 +4,7 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
+    android:background="@color/black1"
     tools:context=".activity.DepartmentList">
 
     <LinearLayout

+ 5 - 0
app/src/main/res/layout/activity_left.xml

@@ -382,6 +382,7 @@
             android:layout_marginHorizontal="8dp">
 
             <LinearLayout
+                android:id="@+id/llPatientSort"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:orientation="vertical"
@@ -405,7 +406,9 @@
                     android:paddingBottom="4dp"
                     android:paddingRight="4dp" />
             </LinearLayout>
+
             <LinearLayout
+                android:id="@+id/llPatientNmSort"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:orientation="vertical"
@@ -429,7 +432,9 @@
                     android:paddingBottom="4dp"
                     android:paddingRight="4dp"/>
             </LinearLayout>
+
             <LinearLayout
+                android:id="@+id/llRoomSort"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:orientation="vertical"