헬스케어 레몬 5 anos atrás
pai
commit
8532ceac56

BIN
app/dev/debug/app-dev-debug.apk


+ 1 - 0
app/dev/debug/output.json

@@ -0,0 +1 @@
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":4,"versionName":"4","enabled":true,"outputFile":"app-dev-debug.apk","fullName":"devDebug","baseName":"dev-debug","dirName":""},"path":"app-dev-debug.apk","properties":{}}]

+ 0 - 37
app/src/main/java/com/dbs/mplus/fatima/MainActivity.java

@@ -50,43 +50,6 @@ public class MainActivity extends AppCompatActivity {
     super.onCreate(savedInstanceState);
     setContentView(R.layout.activity_main);
 
-//    try {
-//      HashMap<String, String> mData = new HashMap<>();
-//      mData.put("userid", "105435");
-//      mData.put("pwd", Util.md5("1812312"));
-//      HttpCon con = new HttpCon("http://172.16.10.192/HospitalSvc.asmx", mData);
-////      HttpCon con = new HttpCon("http://172.16.10.192/ConsentSvc.asmx", mData);
-//      String result = con.execute().get();
-//      Log.e(TAG, "result -- > " + result);
-//
-//      JSONObject object = new JSONObject(result);
-//      JSONObject object1 = new JSONObject(object.get("soap:Envelope").toString());
-//      JSONObject object2 = new JSONObject(object1.get("soap:Body").toString());
-//
-//      String a = Util.xmlToJsonString(object2);
-//
-//
-//      Log.e(TAG, "a - > " + a);
-//      ArrayList<HashMap<String, String>> aaa = Util.parseJSON(mContext, a);
-//      Log.e(TAG, "aaaaa -- > " + aaa);
-//
-//      for (int i = 0; i < aaa.size(); i++) {
-//        HashMap<String, String> mm = aaa.get(i);
-//        Log.e(TAG, "mmm -- > " + mm);
-//      }
-//
-//    } catch (ExecutionException e) {
-//      e.printStackTrace();
-//    } catch (InterruptedException e) {
-//      e.printStackTrace();
-//    } catch (NoSuchAlgorithmException e) {
-//      e.printStackTrace();
-//    } catch (UnsupportedEncodingException e) {
-//      e.printStackTrace();
-//    } catch (JSONException e) {
-//      e.printStackTrace();
-//    }
-
     init();
   }
 

+ 6 - 1
app/src/main/java/com/dbs/mplus/fatima/activity/LoginActivity.java

@@ -66,9 +66,14 @@ public class LoginActivity extends AppCompatActivity {
     etPasswd = (TextView) findViewById(R.id.etPasswd);
     btnLogin = (Button) findViewById(R.id.btnLogin);
 
+
+//    etId.setText("104287");
+//    //33213321
+//    etPasswd.setText("sysedps!@#");
+
     //의사
 //    etId.setText("105435");
-//    etPasswd.setText("1812312");
+//    etPasswd.setText("sysedps!@#");
 
     // 산부인과 의사
 //    etId.setText("104012");

+ 2 - 0
app/src/main/java/com/dbs/mplus/fatima/activity/activityEvent/CenterMenu.java

@@ -102,6 +102,8 @@ public class CenterMenu {
     instance.tvChargeDoctor.setText(mainDrName);
     instance.tvDiagnosisName.setText(dxNm);
 //    instance.tvPatientAlert.setText(alert);
+
+    instance.history.changeLeftDate(Util.addSlashDate(adDate));
   }
 
   public void clearPatientInfo() {

+ 15 - 30
app/src/main/java/com/dbs/mplus/fatima/adapter/ConsentWriteAdapter.java

@@ -161,7 +161,7 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
     holder.chkConsent.setOnCheckedChangeListener(onCheckedChangeListener);
     holder.listLayer.setOnClickListener(onClickListener);
 
-    if (checkMap.containsKey(holder.position) == true) {
+    if (checkMap.containsKey(holder.getLayoutPosition()) == true) {
       holder.chkConsent.setChecked(true);
     } else {
       holder.chkConsent.setChecked(false);
@@ -184,29 +184,6 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
           checkMap.clear();
           HashMap<String, String> mData = new HashMap<String, String>();
           mData.put("consentMstRid", consentMstRid);
-//          HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_IMAGE, mData);
-//          try {
-//            SoapObject object = connection.execute().get();
-//            ArrayList<ConsentImageListVO> arrayList = SoapParser.getConsetImageList(object);
-//            if (arrayList.size() == 0) {
-//              instance.csAlert.show();
-//              instance.csAlert.setContent(mContext.getString(R.string.imageLoadFailed), ConsentConfig.ALERT_BTN_TYPE);
-//              instance.csAlert.btnConfirm2.setOnClickListener(new View.OnClickListener() {
-//                @Override
-//                public void onClick(View view) {
-//                  instance.csAlert.dismiss();
-//                }
-//              });
-//            } else {
-//              Intent intent = new Intent(mContext, ImageActivity.class);
-//              intent.putExtra("imageArray", arrayList);
-//              instance.startActivity(intent);
-//            }
-//          } catch (ExecutionException e) {
-//            e.printStackTrace();
-//          } catch (InterruptedException e) {
-//            e.printStackTrace();
-//          }
 
           HttpCon con = new HttpCon(ConsentConfig.HOST_CONSENT, mData, ConsentConfig.GET_CONSENT_IMAGE);
           try {
@@ -251,6 +228,7 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
         final ArrayList<ConsentWriteListVO> selectConsentList = new ArrayList<>();
         String patientId = "";
         int cnt = 0;
+        int index = 0;
         for (int key : checkMap.keySet()) {
           ConsentWriteListVO _consentWriteListVO = arrayList.get(key);
           String _consentMstRid = _consentWriteListVO.getConsentMstRid();
@@ -281,7 +259,9 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
 
           patientId = _patientId;
 
-          if (consentState.equals(ConsentConfig.PAPER_OUT) ||  consentState.equals(ConsentConfig.FNU_PRINT)) {
+          index = key;
+
+          if (consentState.equals(ConsentConfig.PAPER_OUT) || consentState.equals(ConsentConfig.FNU_PRINT)) {
             printOnly.add("[" + _consentName + "] - "  + (_consentState.equals(ConsentConfig.PAPER_OUT) ? mContext.getString(R.string.print) : mContext.getString(R.string.fnuPrint)));
           } else {
             HashMap<String, String> mData = new HashMap<>();
@@ -316,8 +296,9 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
           cnt = cnt + 1;
         }
 
-        if (selectConsentList.size() > 0) {
-          ConsentWriteListVO selectConsentVO = arrayList.get(0);
+        if (checkMap.size() > 0) {
+
+          ConsentWriteListVO selectConsentVO = arrayList.get(index);
           String pid = selectConsentVO.getPid();
           String ordDd = selectConsentVO.getOrdDd();
           String ordType = selectConsentVO.getOrdType();
@@ -331,11 +312,13 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
           mData.put("orddeptcd", ordDeptCd);
           mData.put("cretno", cretNo);
 
+          Log.e(TAG, "mData -- > " + mData);
 //          HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_PATIENT_INFO, mData);
           HttpCon connection = new HttpCon(ConsentConfig.HOST_HOSPITAL, mData, ConsentConfig.GET_PATIENT_INFO);
           PatientInfoVO patientInfoVO = null;
           try {
             String result = connection.execute().get();
+            Log.e(TAG, "result -- > " + result);
             patientInfoVO = DataParser.getPatientInfo(mContext, result);
             if (patientInfoVO == null) {
               instance.showSingButtonDialog(mContext.getString(R.string.failedPatientInfo));
@@ -368,7 +351,9 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
 
             String printOnlyAlertMsg = "";
             if (printOnly.size() > 0) {
-              printOnlyAlertMsg = printOnly.get(printOnly.size() - 1) + "\n";
+              for (int i = 0; i < printOnly.size(); i++) {
+                printOnlyAlertMsg += printOnly.get(printOnly.size() - 1) + "\n";
+              }
             }
 
             final PatientInfoVO finalPatientInfoVO = patientInfoVO;
@@ -395,7 +380,7 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
                     ConsentFacade consentFacade = new ConsentFacade(mContext);
                     consentFacade.startConsent(param, apiType, finalCertUserId);
 
-                    instance.centerMenu.clearPatientInfo();
+//                    instance.centerMenu.clearPatientInfo();
                   }
                 }
               });
@@ -418,7 +403,7 @@ public class ConsentWriteAdapter extends RecyclerView.Adapter<ConsentWriteAdapte
 
               ConsentFacade consentFacade = new ConsentFacade(mContext);
               consentFacade.startConsent(param, apiType, certUserId);
-              instance.centerMenu.clearPatientInfo();
+//              instance.centerMenu.clearPatientInfo();
             }
 
           } catch (ExecutionException e) {

+ 6 - 0
app/src/main/java/com/dbs/mplus/fatima/adapter/PatientListAdapter.java

@@ -159,6 +159,12 @@ public class PatientListAdapter extends RecyclerView.Adapter<PatientListAdapter.
         mData.put("cretno", cretNo);
         instance.centerMenu.getPatientInfo(mData);
         instance.centerMenu.getConsentList(pid, Util.removeSlashStr(inDd));
+
+        if (instance.consentHistoryAdapter != null) {
+          instance.consentHistoryAdapter.arrayList.clear();
+          instance.consentHistoryAdapter.notifyDataSetChanged();
+        }
+
       }
     }
   };

+ 0 - 2
app/src/main/java/com/dbs/mplus/fatima/consent/EFormSaveHandler.java

@@ -290,9 +290,7 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs> {
               if (!apiType.equals("write")) {
                 instance.centerMenu.getConsentList(pid, indd);
               }
-
             }
-
           }
 
         }

+ 56 - 55
app/src/main/java/com/dbs/mplus/fatima/fragment/HistoryFragment.java

@@ -347,7 +347,8 @@ public class HistoryFragment extends Fragment {
           checkPrint.setChecked(false);
           consentStateData.put(checkAll, ConsentConfig.ALL);
         } else {
-          consentStateData.remove(checkAll);
+//          consentStateData.remove(checkAll);
+          consentStateData.clear();
         }
 
       } else if (v == checkNowrite) {
@@ -399,34 +400,34 @@ public class HistoryFragment extends Fragment {
       }
 
 
-      if (checkNowrite.isChecked() && checkTemp.isChecked() && checkGudu.isChecked() && checkPateintSign.isChecked() && checkCert.isChecked() && checkPrint.isChecked()) {
-        checkAll.setChecked(true);
-        checkNowrite.setChecked(false);
-        checkTemp.setChecked(false);
-        checkGudu.setChecked(false);
-        checkPateintSign.setChecked(false);
-        checkCert.setChecked(false);
-        checkPrint.setChecked(false);
-        consentStateData.put(checkAll, ConsentConfig.ALL);
-
-        consentStateData.remove(checkNowrite);
-        consentStateData.remove(checkTemp);
-        consentStateData.remove(checkGudu);
-        consentStateData.remove(checkPateintSign);
-        consentStateData.remove(checkCert);
-        consentStateData.remove(checkPrint);
-      }
-
-      if (!checkAll.isChecked() && !checkNowrite.isChecked() && !checkTemp.isChecked() && !checkGudu.isChecked() && !checkPateintSign.isChecked() && !checkCert.isChecked() && !checkPrint.isChecked()) {
-        checkAll.setChecked(true);
-        consentStateData.put(checkAll, ConsentConfig.ALL);
-        consentStateData.remove(checkNowrite);
-        consentStateData.remove(checkTemp);
-        consentStateData.remove(checkGudu);
-        consentStateData.remove(checkPateintSign);
-        consentStateData.remove(checkCert);
-        consentStateData.remove(checkPrint);
-      }
+//      if (checkNowrite.isChecked() && checkTemp.isChecked() && checkGudu.isChecked() && checkPateintSign.isChecked() && checkCert.isChecked() && checkPrint.isChecked()) {
+//        checkAll.setChecked(true);
+//        checkNowrite.setChecked(false);
+//        checkTemp.setChecked(false);
+//        checkGudu.setChecked(false);
+//        checkPateintSign.setChecked(false);
+//        checkCert.setChecked(false);
+//        checkPrint.setChecked(false);
+//        consentStateData.put(checkAll, ConsentConfig.ALL);
+//
+//        consentStateData.remove(checkNowrite);
+//        consentStateData.remove(checkTemp);
+//        consentStateData.remove(checkGudu);
+//        consentStateData.remove(checkPateintSign);
+//        consentStateData.remove(checkCert);
+//        consentStateData.remove(checkPrint);
+//      }
+//
+//      if (!checkAll.isChecked() && !checkNowrite.isChecked() && !checkTemp.isChecked() && !checkGudu.isChecked() && !checkPateintSign.isChecked() && !checkCert.isChecked() && !checkPrint.isChecked()) {
+//        checkAll.setChecked(true);
+//        consentStateData.put(checkAll, ConsentConfig.ALL);
+//        consentStateData.remove(checkNowrite);
+//        consentStateData.remove(checkTemp);
+//        consentStateData.remove(checkGudu);
+//        consentStateData.remove(checkPateintSign);
+//        consentStateData.remove(checkCert);
+//        consentStateData.remove(checkPrint);
+//      }
     }
   };
 
@@ -436,6 +437,7 @@ public class HistoryFragment extends Fragment {
     HttpCallBack callBack = new HttpCallBack() {
       @Override
       public void result(String result) {
+        Log.e(TAG, "getHistoryConsentList -- > " + result);
         if (result.equals("")) {
         } else {
           if (type.equals("patient")) {
@@ -460,37 +462,26 @@ public class HistoryFragment extends Fragment {
       }
     };
 
-//    CallBack callBack = new CallBack() {
-//      @Override
-//      public void result(SoapObject result) {
-//        Log.e(TAG, "getHistoryConsentList result -- > " + result);
-//        if (type.equals("patient")) {
-//          ArrayList<ConsentListVO> arrayList = SoapParser.getConsentList(result);
-//          setHistoryConsentList(arrayList);
-//        } else {
-//          ArrayList<ConsentWriteListVO> arrayList = SoapParser.getUnfinishedListPerDoctor(result);
-//          setWirteConsentList(arrayList);
-//        }
-//
-//      }
-//
-//      @Override
-//      public void stop() {
-//
-//      }
-//
-//      @Override
-//      public void error() {
-//
-//      }
-//    };
-
-    if (centerMenu.patientInfoVO == null && type.equals("patient")) {
+    if (centerMenu.patientInfoVO == null) {
       instance.showSingButtonDialog(mContext.getString(R.string.emptyPatientInfo));
     } else {
 
       instance.showProgress();
 
+      if (consentStateData == null || consentStateData.size() == 0) {
+        csAlert.show();
+        csAlert.setContent(mContext.getString(R.string.emptyCheckConsentState), ConsentConfig.ALERT_BTN_TYPE);
+        csAlert.btnConfirm2.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View view) {
+            instance.dismissProgress();
+            csAlert.dismiss();
+          }
+        });
+
+        return;
+      }
+
       String consentState = "";
       int count = 0;
       for (View key : consentStateData.keySet()) {
@@ -560,6 +551,7 @@ public class HistoryFragment extends Fragment {
           historyPatientRecyclerView.setLayoutManager(linearLayoutManager);
           historyPatientRecyclerView.setAdapter(instance.consentHistoryAdapter);
         } else {
+          instance.consentWriteAdapter.checkMap.clear();
           instance.consentHistoryAdapter.arrayList.clear();
           instance.consentHistoryAdapter.arrayList = arrayList;
           instance.consentHistoryAdapter.notifyDataSetChanged();
@@ -590,6 +582,7 @@ public class HistoryFragment extends Fragment {
           historyWriteRecyclerView.setLayoutManager(linearLayoutManager);
           historyWriteRecyclerView.setAdapter(instance.consentWriteAdapter);
         } else {
+          instance.consentWriteAdapter.checkMap.clear();
           instance.consentWriteAdapter.arrayList.clear();
           instance.consentWriteAdapter.arrayList = arrayList;
           instance.consentWriteAdapter.notifyDataSetChanged();
@@ -601,6 +594,14 @@ public class HistoryFragment extends Fragment {
     });
   }
 
+  public void changeLeftDate(String date) {
+    int year = Integer.parseInt(date.split("/")[0]);
+    int month = Integer.parseInt(date.split("/")[1]);
+    int day = Integer.parseInt(date.split("/")[2]);
+    leftDateDialog  = new DatePickerDialog(mContext, R.style.DatePickerDialogTheme , leftDateListener, year, month -1, day);
+    tvLeftDate.setText(date);
+  }
+
   private String getLeftDate() {
     return Util.removeSlashStr(tvLeftDate.getText().toString());
   }

+ 1 - 0
app/src/main/java/com/dbs/mplus/fatima/fragment/SearchFragment.java

@@ -298,6 +298,7 @@ public class SearchFragment extends Fragment {
       consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_SEARCH);
       searchRecyclerView.setAdapter(consentListAdapter);
     } else {
+      consentListAdapter.checkMap.clear();
       consentListAdapter.arrayList = arrayList;
       consentListAdapter.notifyDataSetChanged();
     }

+ 11 - 3
app/src/main/java/com/dbs/mplus/fatima/httpTask/DataParser.java

@@ -862,11 +862,19 @@ public class DataParser {
 
     ArrayList<HashMap<String, String>> mapArrayList = Util.parseJSON(mContext, res);
     ArrayList<HashMap<String, String>> mapArrayList1 = null;
-    for (String key : mapArrayList.get(0).keySet()) {
-      mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get(key));
+
+    if (mapArrayList.get(0).get("UnFinishedListVO") != null) {
+      mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get("UnFinishedListVO"));
+    } else if (mapArrayList.get(0).get("GetUnfinishedListPerDoctorResult") != null) {
+    } else {
+      mapArrayList1 = mapArrayList;
     }
 
-    if (mapArrayList1 == null && mapArrayList1.size() == 0) {
+//    for (String key : mapArrayList.get(0).keySet()) {
+//      mapArrayList1 = Util.parseJSON(mContext, mapArrayList.get(0).get(key));
+//    }
+
+    if (mapArrayList1 == null) {
     } else {
       for (int i = 0; i < mapArrayList1.size(); i++) {
         HashMap<String, String> mm = mapArrayList1.get(i);

+ 2 - 2
app/src/main/res/layout/custom_alert.xml

@@ -64,7 +64,7 @@
                     android:gravity="center"
                     android:text="asdfasdfa"
                     android:textColor="@color/black"
-                    android:textSize="20dp" />
+                    android:textSize="16dp" />
 
             </LinearLayout>
 
@@ -72,7 +72,7 @@
                 android:layout_width="match_parent"
                 android:layout_height="match_parent"
                 android:background="@xml/border_top"
-                android:layout_weight="1.1">
+                android:layout_weight="1.2">
 
                 <Button
                     android:id="@+id/btnConfirm2"

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

@@ -113,7 +113,8 @@
     <string name="deleteMaker">삭제하시겠습니까?</string>
     <string name="addMaker">즐겨찾기로 추가하시겠습니까?</string>
     <string name="failMakerEvent">즐겨찾기 %1s에 실패하였습니다. \n 다시 시도해주세요.</string>
-    <string name="emptyPatientInfo">환자를 선택해주세요.</string>
+    <string name="emptyPatientInfo">조회할 환자를 선택해주세요.</string>
+    <string name="emptyCheckConsentState">동의서 상태 조건을 선택하세요!</string>
     <string name="printOnlyAlertMsg">\n 출력전용 동의서입니다. \nPC에서 출력하세요.</string>
 
     <string name="networkError">네트워크에 연결되어 있지 않습니다</string>