Parcourir la source

1. 동의서 정보 맵핑
2. FOS 생성 함수 추가
3. 동의서 선택시 인증서 정보 확인 로직 추가
4. 연계서식 열람 기능 추가
5. 환자 선택시 임시, 확인, 연동 서식 리스트 개발

songjunekeun il y a 5 ans
Parent
commit
7d964aa4ed

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

@@ -41,6 +41,7 @@ import com.dbs.mplus.knuh.customView.LoadingProgress;
 import com.dbs.mplus.knuh.fragment.HistoryFragment;
 import com.dbs.mplus.knuh.fragment.MarkerFragment;
 import com.dbs.mplus.knuh.fragment.SearchFragment;
+import com.dbs.mplus.knuh.model.PatientInfoVO;
 import com.dbs.mplus.knuh.util.ConsentConfig;
 import com.dbs.mplus.knuh.util.Util;
 
@@ -56,6 +57,7 @@ public class ConsentActivity extends AppCompatActivity {
   private LeftMenu leftMenu;
   public CenterMenu centerMenu;
   private RightMenu rightMenu;
+  public PatientInfoVO patientInfoVO;
 
   /** 상단 메뉴 **/
   private ImageView ivLogo;
@@ -122,6 +124,7 @@ public class ConsentActivity extends AppCompatActivity {
   public TextView tvChargeDoctor;
   public TextView tvDiagnosisName;
   public TextView tvPatientAlert;
+  public RecyclerView tempRecyclerView;
   /** Center Meny **/
 
   /** Right Menu **/
@@ -314,6 +317,7 @@ public class ConsentActivity extends AppCompatActivity {
     tvChargeDoctor  = (TextView) findViewById(R.id.tvChargeDoctor);
     tvDiagnosisName = (TextView) findViewById(R.id.tvDiagnosisName);
     tvPatientAlert  = (TextView) findViewById(R.id.tvPatientAlert);
+    tempRecyclerView = (RecyclerView) findViewById(R.id.tempRecyclerView);
   }
 
   private void setRightLayout() {

+ 71 - 11
app/src/main/java/com/dbs/mplus/knuh/activity/activityEvent/CenterMenu.java

@@ -1,20 +1,26 @@
 package com.dbs.mplus.knuh.activity.activityEvent;
 
 import android.content.Context;
+import android.telecom.Call;
 import android.util.Log;
 
 import androidx.appcompat.app.AppCompatActivity;
+import androidx.recyclerview.widget.LinearLayoutManager;
 
+import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.adapter.ConsentHistoryAdapter;
 import com.dbs.mplus.knuh.httpTask.CallBack;
 import com.dbs.mplus.knuh.httpTask.HttpRunnable;
 import com.dbs.mplus.knuh.httpTask.SoapParser;
+import com.dbs.mplus.knuh.model.ConsentFormListVO;
 import com.dbs.mplus.knuh.model.PatientInfoVO;
 import com.dbs.mplus.knuh.util.ConsentConfig;
 import com.dbs.mplus.knuh.util.Util;
 
 import org.ksoap2.serialization.SoapObject;
 
+import java.util.ArrayList;
 import java.util.HashMap;
 
 public class CenterMenu {
@@ -23,7 +29,8 @@ public class CenterMenu {
   private AppCompatActivity mActivity;
   private Context mContext;
   private ConsentActivity instance;
-  public PatientInfoVO patientInfoVO;
+  private ConsentHistoryAdapter consentHistoryAdapter;
+  private LinearLayoutManager linearLayoutManager;
 
   public CenterMenu(Context mContext, AppCompatActivity mActivity) {
     this.mActivity = mActivity;
@@ -37,8 +44,8 @@ public class CenterMenu {
       @Override
       public void result(SoapObject result) {
         Log.e(TAG, "result -- > " + result);
-        patientInfoVO = SoapParser.getPatientInfo(result);
-        Log.e(TAG, "patientInfoVO" +  patientInfoVO);
+        instance.patientInfoVO = SoapParser.getPatientInfo(result);
+        Log.e(TAG, "patientInfoVO" +  instance.patientInfoVO);
         setPatientInfo();
       }
 
@@ -60,14 +67,14 @@ public class CenterMenu {
     mActivity.runOnUiThread(new Runnable() {
       @Override
       public void run() {
-        String pid         = patientInfoVO.getPid();
-        String patientName = patientInfoVO.getPatientName();
-        String sa          = patientInfoVO.getSa();
-        String juminNo     = patientInfoVO.getJuminNo();
-        String inDd        = patientInfoVO.getInDd();
-        String mainDrName  = patientInfoVO.getMainDrName();
-        String dxNm        = patientInfoVO.getDxNm();
-        String alert       = patientInfoVO.getGbn();
+        String pid         = instance.patientInfoVO.getPid();
+        String patientName = instance.patientInfoVO.getPatientName();
+        String sa          = instance.patientInfoVO.getSa();
+        String juminNo     = instance.patientInfoVO.getJuminNo();
+        String inDd        = instance.patientInfoVO.getInDd();
+        String mainDrName  = instance.patientInfoVO.getMainDrName();
+        String dxNm        = instance.patientInfoVO.getDxNm();
+        String alert       = instance.patientInfoVO.getGbn();
         String patientInfo = pid + " " + patientName + " " + sa + " " + juminNo.substring(0, 6);
 
         instance.tvPatientInfo.setText(patientInfo);
@@ -80,4 +87,57 @@ public class CenterMenu {
 
   }
 
+  public void getConsentList(String pid, String startDt) {
+//    GET_CONSENT_LIST
+    CallBack callBack = new CallBack() {
+      @Override
+      public void result(SoapObject result) {
+        Log.e(TAG, "getConsentList result -- > " + result);
+        if (result.getPropertyCount() == 0) {
+        } else {
+          ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
+          setConsentAdapter(arrayList);
+        }
+
+      }
+
+      @Override
+      public void stop() {
+
+      }
+
+      @Override
+      public void error() {
+
+      }
+    };
+
+    String consentState = "'TEMP', 'UNFINISHED', 'ELECTR_CMP'";
+    HashMap<String, String> mData = new HashMap<String, String>();
+    mData.put("patientCode", pid);
+    mData.put("startDt", startDt);
+    mData.put("endDt", Util.removeSlashStr(Util.nowDate()));
+    mData.put("consentState", consentState);
+    mData.put("instCd", BuildConfig.INST_CD);
+
+    Util.callHttp(mContext, ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_LIST, mData, callBack);
+  }
+
+  private void setConsentAdapter(final ArrayList<ConsentFormListVO> arrayList) {
+    mActivity.runOnUiThread(new Runnable() {
+      @Override
+      public void run() {
+        if (consentHistoryAdapter == null) {
+          consentHistoryAdapter = new ConsentHistoryAdapter(mContext, arrayList);
+          linearLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
+          instance.tempRecyclerView.setLayoutManager(linearLayoutManager);
+          instance.tempRecyclerView.setAdapter(consentHistoryAdapter);
+        } else {
+          consentHistoryAdapter.arrayList = arrayList;
+          consentHistoryAdapter.notifyDataSetChanged();
+        }
+      }
+    });
+
+  }
 }

+ 142 - 0
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentHistoryAdapter.java

@@ -0,0 +1,142 @@
+package com.dbs.mplus.knuh.adapter;
+
+import android.content.Context;
+import android.graphics.drawable.GradientDrawable;
+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 androidx.annotation.NonNull;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.dbs.mplus.knuh.R;
+import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.consent.ConsentCreateParam;
+import com.dbs.mplus.knuh.consent.ConsentFacade;
+import com.dbs.mplus.knuh.model.ConsentFormListVO;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+public class ConsentHistoryAdapter extends RecyclerView.Adapter<ConsentHistoryAdapter.ViewHolder> {
+
+  private static final String TAG = "ConsentHistoryAdapter";
+  private Context mContext;
+  private ConsentActivity instance;
+  public ArrayList<ConsentFormListVO> arrayList;
+
+  public ConsentHistoryAdapter(Context mContext, ArrayList<ConsentFormListVO> arrayList) {
+    this.mContext  = mContext;
+    this.arrayList = arrayList;
+    this.instance = (ConsentActivity) mContext;
+  }
+
+  @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 ConsentHistoryAdapter.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(mContext, R.color.typeRightColor));
+
+    holder.listLayer.setTag(holder);
+    holder.tvSubText.setTag(holder);
+    return holder;
+  }
+
+  @Override
+  public void onBindViewHolder(@NonNull ConsentHistoryAdapter.ViewHolder holder, int position) {
+    ConsentFormListVO consentFormListVO = arrayList.get(position);
+    String formName = consentFormListVO.getFormName();
+    String consentState = consentFormListVO.getConsentState();
+
+    GradientDrawable tvTempBg = (GradientDrawable) holder.tvTemp.getBackground().getCurrent();
+    if (consentState.equals(mContext.getString(R.string.temp))) {
+      tvTempBg.setColor(ContextCompat.getColor(mContext, R.color.tempColor));
+      holder.tvTemp.setText(mContext.getString(R.string.temp));
+    } else {
+      tvTempBg.setColor(ContextCompat.getColor(mContext, R.color.typeRightColor));
+      holder.tvTemp.setText(mContext.getString(R.string.check));
+    }
+
+    holder.tvPatientName.setVisibility(View.GONE);
+    holder.tvConsentName.setText(formName);
+
+    holder.listLayer.setOnClickListener(onClickListener);
+    holder.tvSubText.setOnClickListener(onClickListener);
+  }
+
+  private View.OnClickListener onClickListener = new View.OnClickListener() {
+    @Override
+    public void onClick(View v) {
+      ViewHolder holder = (ViewHolder) v.getTag();
+      int position = holder.getLayoutPosition();
+      ConsentFormListVO consentFormListVO = arrayList.get(position);
+      String formCd        = consentFormListVO.getFormCd();
+      String userDrFlag    = consentFormListVO.getUserDrFlag();
+      String consentState  = consentFormListVO.getConsentState();
+      String formPrntNm    = consentFormListVO.getFormPrntNm();
+      String certPass      = consentFormListVO.getCertUseYn();
+      String consentMstRid = consentFormListVO.getConsentMstRid();
+      String guid          = consentFormListVO.getFormGuid();
+      String linkFormCd    = consentFormListVO.getLinkFormCd();
+      String ocrTag        = consentFormListVO.getOcrTag();
+
+
+      Log.e(TAG, "formCd       -- > " + formCd      );
+      Log.e(TAG, "userDrFlag   -- > " + userDrFlag  );
+      Log.e(TAG, "consentState -- > " + consentState);
+      Log.e(TAG, "formPrntNm   -- > " + formPrntNm  );
+      Log.e(TAG, "certPass     -- > " + certPass    );
+      Log.e(TAG, "rid          -- > " + consentMstRid);
+      Log.e(TAG, "guid         -- > " + guid        );
+      Log.e(TAG, "linkFormCd   -- > " + linkFormCd  );
+
+      if (holder.listLayer == v) {
+        ConsentCreateParam consentCreateParam = new ConsentCreateParam(mContext, userDrFlag, consentState);
+        HashMap<String, String> globalParam = consentCreateParam.setGlobalParam(instance.patientInfoVO);
+        ArrayList<HashMap<String, String>> mapArrayList = consentCreateParam.setFormParam(consentMstRid, guid, formPrntNm, linkFormCd, ocrTag);
+
+        HashMap map = new HashMap();
+        map.put("globalParam", globalParam);
+        map.put("formListParam", mapArrayList);
+        ConsentFacade consentFacade = new ConsentFacade(mContext);
+        consentFacade.startConsent(map, certPass);
+      } else if (holder.tvSubText == v) {
+        
+      }
+
+
+    }
+  };
+}

+ 25 - 4
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentListAdapter.java

@@ -13,6 +13,8 @@ import android.widget.TextView;
 import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.consent.ConsentCreateParam;
+import com.dbs.mplus.knuh.consent.ConsentFacade;
 import com.dbs.mplus.knuh.httpTask.CallBack;
 import com.dbs.mplus.knuh.model.ConsentFormListVO;
 import com.dbs.mplus.knuh.util.ConsentConfig;
@@ -117,14 +119,33 @@ public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.
     @Override
     public void onClick(View v) {
       ViewHolder holder = (ViewHolder) v.getTag();
-      Log.e(TAG, "position -- > " + holder.getLayoutPosition());
       final int position = holder.getLayoutPosition();
       ConsentFormListVO consentFormListVO = arrayList.get(position);
-      String formCd = consentFormListVO.getFormCd();
-      Log.e(TAG, "formCd -- > " + formCd);
+      String formCd         = consentFormListVO.getFormCd();
+      String userDrFlag     = consentFormListVO.getUserDrFlag();
+      String consentState   = consentFormListVO.getConsentState();
+      String formPrntNm     = consentFormListVO.getFormPrntNm();
+      String certPass       = consentFormListVO.getCertUseYn();
+      String _consentMstRid = consentFormListVO.getConsentMstRid();
+      String guid           = consentFormListVO.getFormGuid();
+      String linkFormCd     = consentFormListVO.getLinkFormCd();
+      String ocrTag         = consentFormListVO.getOcrTag();
 
       if (holder.listLayer == v) {
-        Log.e(TAG, "listLayer");
+        if (instance.patientInfoVO == null) {
+          instance.showSingButtonDialog(mContext.getString(R.string.emptyPatientInfo));
+        } else {
+          ConsentCreateParam consentCreateParam = new ConsentCreateParam(mContext, userDrFlag, consentState);
+          HashMap<String, String> globalParam = consentCreateParam.setGlobalParam(instance.patientInfoVO);
+          ArrayList<HashMap<String, String>> mapArrayList = consentCreateParam.setFormParam(_consentMstRid, guid, formPrntNm, linkFormCd, ocrTag);
+
+          HashMap map = new HashMap();
+          map.put("globalParam", globalParam);
+          map.put("formListParam", mapArrayList);
+          ConsentFacade consentFacade = new ConsentFacade(mContext);
+          consentFacade.startConsent(map, certPass);
+        }
+
       } else if (holder.tvSubText == v) {
 
         String soapAction = "";

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

@@ -151,6 +151,7 @@ public class PatientListAdapter extends RecyclerView.Adapter<PatientListAdapter.
         mData.put("instCd", instCd);
         mData.put("opRsrvNo", opRsrvNo);
         instance.centerMenu.getPatientInfo(mData);
+        instance.centerMenu.getConsentList(pid, inDd);
       }
     }
   };

+ 342 - 0
app/src/main/java/com/dbs/mplus/knuh/consent/ConsentCreateParam.java

@@ -0,0 +1,342 @@
+package com.dbs.mplus.knuh.consent;
+
+import android.content.Context;
+import android.os.Build;
+import android.util.Log;
+
+import com.dbs.mplus.knuh.BuildConfig;
+import com.dbs.mplus.knuh.R;
+import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.httpTask.HttpSoapConnection;
+import com.dbs.mplus.knuh.model.ConsentFormListVO;
+import com.dbs.mplus.knuh.model.PatientInfoVO;
+import com.dbs.mplus.knuh.model.UserVO;
+import com.dbs.mplus.knuh.util.ConsentConfig;
+import com.dbs.mplus.knuh.util.Util;
+
+import org.ksoap2.serialization.SoapObject;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.concurrent.ExecutionException;
+
+public class ConsentCreateParam {
+  private static final String TAG = "ConsentCreateParam";
+  private Context mContext;
+  private String indexPage  = "";
+  private String userDrFlag = "";
+  private String consentState = "";
+
+  public ConsentCreateParam(Context mContext, String userDrFlag, String consentState) {
+    this.mContext   = mContext;
+    this.indexPage  = ((ConsentActivity) mContext).indexPage;
+    this.userDrFlag = userDrFlag;
+    this.consentState = consentState;
+  }
+
+
+  public HashMap<String, String> setGlobalParam(PatientInfoVO patientInfoVO) {
+    HashMap<String, String> map = new HashMap<String, String>();
+    String loginUserId = Util.getStringPreference(mContext, "userInfo", "userId");
+    String loginUserName = Util.getStringPreference(mContext, "userInfo", "userName");
+    String logionUserDeptCd = Util.getStringPreference(mContext, "userInfo", "deptCd");
+    String logionUserJobKindCd = Util.getStringPreference(mContext, "userInfo", "jobKindCd");
+
+    String ordDeptCd   = patientInfoVO.getOrdDeptCd();
+    String deptEngAbbr = patientInfoVO.getDeptEngAbbr();
+    String ordDeptNm   = patientInfoVO.getOrdDeptNm();
+    String pid         = patientInfoVO.getPid();
+    String cretNo      = patientInfoVO.getCretNo();
+    String roomCd      = patientInfoVO.getRoomCd();
+    String inDd        = patientInfoVO.getInDd();
+    String dschDd      = patientInfoVO.getDschDd();
+    String ordType     = patientInfoVO.getOrdType();
+    String instCd      = patientInfoVO.getInstCd();
+    String mainDrId    = patientInfoVO.getMainDrId();
+    String mainDrName  = patientInfoVO.getMainDrName();
+    String erDrNm      = patientInfoVO.getErDrNm();
+    String firstRgstDt = patientInfoVO.getFirstRgstDt();
+    String sa          = patientInfoVO.getSa();
+    String patientName = patientInfoVO.getPatientName();
+    String juminNo     = patientInfoVO.getJuminNo();
+    String zipCdAddr   = patientInfoVO.getZipCdAddr();
+    String telNum      = patientInfoVO.getTelNum();
+    String insuKind    = patientInfoVO.getInsuKind();
+    String ward        = patientInfoVO.getWard();
+    String dxCd        = patientInfoVO.getDxCd();
+    String dxNm        = patientInfoVO.getDxNm();
+    String gbn         = patientInfoVO.getGbn();
+    String opDeptCd    = patientInfoVO.getOpDeptCd();
+    String opDeptNm    = patientInfoVO.getOpDeptNm();
+    String opDrNm      = patientInfoVO.getOpDrNm();
+    String opDrId      = patientInfoVO.getOpDrId();
+    String opCnfmDd    = patientInfoVO.getOpCnfmDd();
+    String perfDrNm    = patientInfoVO.getPerfDrNm();
+    String perfDrFlag  = patientInfoVO.getPerfDrFlag();
+    String perfDrDept  = patientInfoVO.getPerfDrDept();
+    String opDiagNm    = patientInfoVO.getOpDiagNm();
+    String opNm        = patientInfoVO.getOpNm();
+    String anstDrNm1   = patientInfoVO.getAnstDrNm1();
+    String anstDrFlag1 = patientInfoVO.getAnstDrFlag1();
+    String anstDeptNm1 = patientInfoVO.getAnstDeptNm1();
+    String anstDrNm2   = patientInfoVO.getAnstDrNm2();
+    String anstDrFlag2 = patientInfoVO.getAnstDrFlag2();
+    String anstDeptNm2 = patientInfoVO.getAnstDeptNm2();
+    String anstDrNm3   = patientInfoVO.getAnstDrNm3();
+    String anstDrFlag3 = patientInfoVO.getAnstDrFlag3();
+    String anstDeptNm3 = patientInfoVO.getAnstDeptNm3();
+    String opRsrvNo    = patientInfoVO.getOpRsrvNo();
+    String orderNo     = patientInfoVO.getOrderNo();
+    String printTime   = patientInfoVO.getPrintTime();
+    String ocrCd       = patientInfoVO.getOcrCd();
+    String inputId     = patientInfoVO.getInputId();
+    String inputNm     = patientInfoVO.getInputNm();
+    String signImg     = patientInfoVO.getSignImg();
+    String bp          = patientInfoVO.getBp();
+    String dm          = patientInfoVO.getDm();
+    String heart       = patientInfoVO.getHeart();
+    String kidney      = patientInfoVO.getKidney();
+    String respiration = patientInfoVO.getRespiration();
+    String hx          = patientInfoVO.getHx();
+    String allergy     = patientInfoVO.getAllergy();
+    String drug        = patientInfoVO.getDrug();
+    String smoking     = patientInfoVO.getSmoking();
+    String idio        = patientInfoVO.getIdio();
+    String nacrotics   = patientInfoVO.getNacrotics();
+    String airway      = patientInfoVO.getAirway();
+    String hemorrhage  = patientInfoVO.getHemorrhage();
+    String statusEtc   = patientInfoVO.getStatusEtc();
+    String signImage   = "";
+
+    HashMap<String, String> mData = new HashMap<String, String>();
+
+    if (userDrFlag.equals("Y") && ordType.equals("O")) {
+      mData.put("userId", mainDrId);
+      mData.put("deptCd", ordDeptCd);
+    } else {
+      mData.put("userId", loginUserId);
+      mData.put("deptCd", logionUserDeptCd);
+    }
+    mData.put("instCd", BuildConfig.INST_CD);
+
+    HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_SIGN_DATA, mData);
+    try {
+      SoapObject object = connection.execute().get();
+      if (object != null) {
+        signImage = object.getProperty("SignImage").toString().trim();
+        signImage = signImage.equals(ConsentConfig.RETURN_NULL) ? "" : signImage;
+      }
+
+    } catch (ExecutionException e) {
+      e.printStackTrace();
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+
+    UserVO userVO = new UserVO();
+    connection = new HttpSoapConnection(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_USER_INFO, mData);
+    try {
+      SoapObject object = connection.execute().get();
+      String userId       = object.getProperty("userId").toString().trim();
+      String userName     = object.getProperty("userName").toString().trim();
+      String userDeptCode = object.getProperty("userDeptCode").toString().trim();
+      String userDeptName = object.getProperty("userDeptName").toString().trim();
+      String userDeptEngAbbr  = object.getProperty("deptEngAbbr").toString().trim();
+      String jobKindCd    = object.getProperty("jobKindCd").toString().trim();
+      String jobKindNm    = object.getProperty("jobKindNm").toString().trim();
+      String userInstCd   = object.getProperty("instCd").toString().trim();
+      String userTelNo    = object.getProperty("userTelNo").toString().trim();
+      String ioFlag       = object.getProperty("ioFlag").toString().trim();
+
+      userId       = userId.equals(ConsentConfig.RETURN_NULL) ? "" : userId;
+      userName     = userName.equals(ConsentConfig.RETURN_NULL) ? "" : userName;
+      userDeptCode = userDeptCode.equals(ConsentConfig.RETURN_NULL) ? "" : userDeptCode;
+      userDeptName = userDeptName.equals(ConsentConfig.RETURN_NULL) ? "" : userDeptName;
+      userDeptEngAbbr  = deptEngAbbr.equals(ConsentConfig.RETURN_NULL) ? "" : deptEngAbbr;
+      jobKindCd    = jobKindCd.equals(ConsentConfig.RETURN_NULL) ? "" : jobKindCd;
+      jobKindNm    = jobKindNm.equals(ConsentConfig.RETURN_NULL) ? "" : jobKindNm;
+      userInstCd   = userInstCd.equals(ConsentConfig.RETURN_NULL) ? "" : userInstCd;
+      userTelNo    = userTelNo.equals(ConsentConfig.RETURN_NULL) ? "" : userTelNo;
+      ioFlag       = ioFlag.equals(ConsentConfig.RETURN_NULL) ? "" : ioFlag;
+
+      userVO.setUserId(userId);
+      userVO.setUserName(userName);
+      userVO.setUserDeptCode(userDeptCode);
+      userVO.setUserDeptName(userDeptName);
+      userVO.setDeptEngAbbr(userDeptEngAbbr);
+      userVO.setJobKindCd(jobKindCd);
+      userVO.setJobKindNm(jobKindNm);
+      userVO.setUserInstCd(userInstCd);
+      userVO.setUserTelNo(userTelNo);
+      userVO.setIoFlag(ioFlag);
+
+    } catch (ExecutionException e) {
+      e.printStackTrace();
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+
+    map.put("parCMDCFT_device", "M");
+    map.put("parCMDCFT_1PrintIP", "");
+    map.put("parCMDCHD_1PatientNo", pid);
+    map.put("parCMDCHD_1SexAge", sa);
+    map.put("parCMDCHD_1PatientNm", patientName);
+    map.put("parCMDCHD_1SocialSecuNo", juminNo);
+    map.put("parNUR_Fast_HospitalroomNo", roomCd);
+    map.put("parCMDCHD_1VisitDt", inDd);
+    map.put("parCMDCHD_1DepartmentNm", deptEngAbbr);
+    map.put("parCMDCBD_PopupV1_SurgeryDepartment", perfDrFlag.equals("전문의") ? perfDrDept : "");
+    map.put("parCMDCBD_PopupV1_SurgeryDoctor", perfDrNm);
+    map.put("parCMDCBD_PopupV1_DxNm", opDiagNm.equals("") ? dxNm : "");
+    map.put("parCMDCBD_DiseaseBox_bp", bp);
+    map.put("parCMDCBD_DiseaseBox_dm", dm);
+    map.put("parCMDCBD_DiseaseBox_1CardioVascular", heart);
+    map.put("parCMDCBD_DiseaseBox_3Metabolic", kidney);
+    map.put("parCMDCBD_DiseaseBox_2Respiratory", respiration);
+    map.put("parCMDCBD_DiseaseBox_9History1", hx);
+    map.put("parCMDCBD_DiseaseBox_4UnusualConstitution2", allergy);
+    map.put("parCMDCBD_DiseaseBox_6Medicine", drug);
+    map.put("parCMDCBD_DiseaseBox_8HabitSmoking", smoking);
+    map.put("parCMDCBD_DiseaseBox_4UnusualConstitution1", idio);
+    map.put("parCMDCBD_DiseaseBox_9History2", nacrotics);
+    map.put("parCMDCBD_DiseaseBox_7Airway", airway);
+    map.put("parCMDCBD_DiseaseBox_5Blood", hemorrhage);
+    map.put("parCMDCBD_status_etc", statusEtc);
+
+    String opcnfmddStr = "";
+
+    try {
+      opcnfmddStr = String.valueOf(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").parse(opCnfmDd));
+    } catch (ParseException e) {
+      e.printStackTrace();
+      Log.e(TAG, "date error");
+    }
+
+    map.put("parCMDCBD_signdate", opcnfmddStr);
+
+    map.put("parCMDCBD_signtime", "");
+    map.put("parCMDCFT_1PrintDt", "");
+    map.put("parCMDCBD_Doctor_Doctor1Nm", mainDrName); // 담당의사
+
+    map.put("parCMSGBD_INPUTNm", userVO.getUserName());
+//    if (userDrFlag.equals("Y") && ordType.equals("O")) {
+//      map.put("parCMSGBD_INPUTNm", userVO.getUserName());
+//    } else {
+//      map.put("parCMSGBD_INPUTNm", loginUserName);
+//    }
+
+    map.put("parCMSGBD_INPUTSignature", signImage);
+    map.put("parCMSGBD_PT_address", zipCdAddr);
+    map.put("parCMSGBD_PT_tel", telNum);
+    map.put("parCMSGBD_Insukind", insuKind);
+    map.put("parCMSGBD_PT_birthday", juminNo.split("-")[0]);
+    map.put("parCMDCBD_PopupV1_OPNm", opNm);
+    map.put("parCMSGBD_INPUTTelNo", userVO.getUserTelNo());
+    map.put("parDEFAULT_DUTINSTCD", instCd);
+    map.put("parDEFAULT_POPUP_PATH", "https://ema031.knuh.kr:9091");
+//    map.put("parDEFAULT_POPUP_PATH", BuildConfig.CONSENT_SERVER_URL);
+    map.put("parCMDCBD_PopupV1_SurgeryCommonDepartment", perfDrFlag.equals("전공의") ? "" : perfDrDept);
+    map.put("parCMDCBD_Anst1DrNm", anstDrNm1);
+    map.put("parCMDCBD_Anst1DeptNm", anstDrFlag1.equals("전문의") ? anstDeptNm1 : "");
+    map.put("parCMDCBD_Anst1CommonDeptNm", anstDrFlag1.equals("전문의") ? anstDeptNm1 : "");
+    map.put("parCMDCBD_Anst2DrNm", anstDrNm2);
+    map.put("parCMDCBD_Anst2DeptNm", anstDrFlag2.equals("전문의") ? anstDeptNm2 : "");
+    map.put("parCMDCBD_Anst2CommonDeptNm", anstDrFlag2.equals("전문의") ? anstDeptNm2 : "");
+    map.put("parCMDCBD_Anst3DrNm", anstDrNm3);
+    map.put("parCMDCBD_Anst3DeptNm", anstDrFlag3.equals("전문의") ? anstDeptNm3 : "");
+    map.put("parCMDCBD_Anst3CommonDeptNm", anstDrFlag3.equals("전문의") ? anstDeptNm3 : "");
+    map.put("parCMSGBD_INPUTDeptcd", userVO.getUserDeptCode());
+    map.put("parCMSGBD_Cretno", cretNo);
+    map.put("parCMDCBD_OpRsrvNo", opRsrvNo);
+    map.put("parCMDCHD_1PatientNmFix", patientName);
+    map.put("parCMSGBD_PT_birthdayFix", juminNo.split("-")[0]);
+    map.put("parCMSGBD_PT_telFix", telNum);
+
+    map.put("parCMSGBD_ExplDrNm", "");
+    map.put("parCMSGBD_ExplDrSignature", "");
+    map.put("parCMSGBD_ExplDrTelNo", "");
+    if (logionUserJobKindCd.indexOf("03") > 0) {
+      map.put("parCMSGBD_ExplDrNm", userVO.getUserName());
+      map.put("parCMSGBD_ExplDrSignature", signImage);
+      map.put("parCMSGBD_ExplDrTelNo", userVO.getUserTelNo());
+    }
+
+    map.put("parCMDCBD_SpDrYN", "");
+    map.put("parCMDCBD_ContStartDate", "");
+    map.put("parCMDCBD_ContEndDate", "");
+    map.put("parCMDCBD_RoomCapa", "");
+    map.put("parCMDCBD_ContStaff1Name", "");
+    map.put("parCMDCBD_ContStaff2Name", "");
+    map.put("parCMDCBD_ContStaff3Name", "");
+    map.put("parCMDCBD_CardNo", "");
+
+    return map;
+  }
+
+  public ArrayList<HashMap<String, String>> setFormParam(String consentMstRid, String guid, String formPrntNm, String linkFormCd, String ocrTag) {
+    ArrayList<HashMap<String, String>> mapArrayList = new ArrayList<HashMap<String, String>>();
+    HashMap<String, String> map   = new HashMap<String, String>();
+    HashMap<String, String> mData = new HashMap<String, String>();
+
+    map.put("newConsent", consentState.equals(mContext.getString(R.string.temp)) ? "false" : "true");
+    map.put("parCMSGBD_ocr_cd", ocrTag.equals("") ? getOcrTag() : ocrTag);
+    map.put("parCMDCFT_1PrintNm", formPrntNm);
+    map.put("rid", consentMstRid);
+    map.put("guid", guid);
+
+    mapArrayList.add(map);
+
+    if (!linkFormCd.equals("")) {
+      mData.put("formCd", linkFormCd);
+      mData.put("instCd", BuildConfig.INST_CD);
+      Log.e(TAG, "mData -- > + " + mData);
+      HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_CONSENT, ConsentConfig.GET_CONSENT_BY_FORMCD, mData);
+      try {
+        SoapObject object = connection.execute().get();
+
+        if (object.getPropertyCount() > 1) {
+          String _consentMstRid = object.getProperty("consentMstRid").toString().trim();
+          String _formGuid = object.getProperty("formGuid").toString().trim();
+          String _formPrntNm = object.getProperty("formPrntNm").toString().trim();
+
+          HashMap<String, String> linkMap = new HashMap<String, String>();
+          linkMap.put("newConsent", consentState.equals(mContext.getString(R.string.temp)) ? "false" : "true");
+          linkMap.put("parCMSGBD_ocr_cd", ocrTag.equals("") ? getOcrTag() : ocrTag);
+          linkMap.put("rid", _consentMstRid);
+          linkMap.put("guid", _formGuid);
+          linkMap.put("parCMDCFT_1PrintNm", _formPrntNm);
+
+          mapArrayList.add(linkMap);
+        }
+      } catch (ExecutionException e) {
+        e.printStackTrace();
+      } catch (InterruptedException e) {
+        e.printStackTrace();
+      }
+    }
+
+    return mapArrayList;
+  }
+
+  private String getOcrTag() {
+    HashMap<String, String> mData = new HashMap<String, String>();
+    mData.put("instCd", BuildConfig.INST_CD);
+    HttpSoapConnection connection = new HttpSoapConnection(ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_OCR_TAG, mData);
+
+    String ocrTag = "";
+    try {
+      SoapObject object = connection.execute().get();
+      if (object != null) {
+        ocrTag = object.getProperty("responseData").toString().trim();
+      }
+    } catch (ExecutionException e) {
+      e.printStackTrace();
+    } catch (InterruptedException e) {
+      e.printStackTrace();
+    }
+    return ocrTag;
+  }
+}

+ 113 - 14
app/src/main/java/com/dbs/mplus/knuh/consent/ConsentFacade.java

@@ -1,13 +1,27 @@
 package com.dbs.mplus.knuh.consent;
 
+import android.app.AlertDialog;
 import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.net.Uri;
 import android.os.Build;
+import android.text.InputType;
+import android.text.method.PasswordTransformationMethod;
+import android.util.Log;
+import android.view.View;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
 
 import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.consent.sign.SignWrapper;
+import com.dbs.mplus.knuh.util.ConsentConfig;
 import com.dbs.mplus.knuh.util.Util;
 
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -17,6 +31,8 @@ import kr.co.clipsoft.eform.type.enumtype.LogLevel;
 import kr.co.clipsoft.eform.type.enumtype.Position;
 import kr.co.clipsoft.eform.type.enumtype.ScreenOrientation;
 
+import static android.content.Context.INPUT_METHOD_SERVICE;
+
 public class ConsentFacade {
   private static final String TAG = "ConsentFacade";
   private Context mContext;
@@ -69,10 +85,10 @@ public class ConsentFacade {
         + ",'toolbar':{"
         + "        'buttons':{"
         + "              'tempsave2':{'visible':'true','enabled':'true','text':'" + mContext.getString(R.string.check) + "'}"
-        + "              ,'record':{'visible':'true'}"
+        + "              ,'record':{'visible':'false'}"
         + "              ,'information':{'visible':'true'}"
         + "              ,'tempsave':{'visible':'true','enabled':'true','text':'" + mContext.getString(R.string.tempList) + "'}"
-        + "              ,'save':{'visible':'true','enabled':'false','text':'" + mContext.getString(R.string.certifySave) + "'}"
+        + "              ,'save':{'visible':'true','enabled':'true','text':'" + mContext.getString(R.string.certifySave) + "'}"
         + "              ,'exit':{'visible':'true','text':'" + mContext.getString(R.string.exit) + "'}"
         + "              ,'pageattach':{'visible':'true'}"
         + "              ,'page-number':{'current':{'text-color':{'b':116,'g':186,'r':14,'a':255}}"
@@ -92,23 +108,107 @@ public class ConsentFacade {
     return runOption;
   }
 
-  public void startConsent() {
+  public void startConsent(HashMap consentData, String certPass) {
+//    HashMap<String, String> globalParam = (HashMap<String, String>) consentData.get("globalParam");
+//    ArrayList<HashMap<String, String>> formList = (ArrayList<HashMap<String, String>>) consentData.get("formListParam");
+
+    String userId = Util.getStringPreference(mContext, "userInfo", "userId");
+    String fos = createFOS(consentData);
+
+//    Log.e(TAG, "create fos -- > " + fos);
+    Util.DEBUG(ConsentFacade.class, "create fos -- > " + fos);
+
+    eFormToolkit.setExitEventHandler(new EformExitEventHandler());
+    eFormToolkit.setResultEventHandler(new EFormSaveHandler(mContext, eFormToolkit));
+
+    eFormToolkit.setRunOption(createRunOption());
+    if (SignWrapper.getInstance().isCertificate(userId) == true || certPass.equals("Y")) {
+      String result = eFormToolkit.startEFormViewer(fos);
+
+      if (!result.equals("SUCCESS")) {
+        String message = "";
+        if (result.equals("ERROR_000")) {
+          message = mContext.getString(R.string.ERROR_000);
+        } else if (result.equals("ERROR_001")) {
+          message = mContext.getString(R.string.ERROR_001);
+        } else if (result.equals("ERROR_002")) {
+          message = mContext.getString(R.string.ERROR_002);
+        } else if (result.equals("ERROR_006")) {
+          message = String.format(mContext.getString(R.string.permissionDenied), mContext.getString(R.string.viewer));
+        }
+        instance.csAlert.show();
+        instance.csAlert.setContent(message, ConsentConfig.ALERT_BTN_TYPE);
+        String finalResult = result;
+        instance.csAlert.btnConfirm2.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View v) {
+            instance.csAlert.dismiss();
+          }
+        });
+      }
+
+    } else {
+      //공인인증 정보가 없을때
+      startCertificate(mContext, eFormToolkit, fos, userId);
+    }
 
   }
 
-  public String createFOS() {
+  private void startCertificate(final Context context, final EFormToolkit eFormToolkit, final String fos, final String userId) {
+    final EditText passwordEdit = new EditText(context);
+    passwordEdit.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+    passwordEdit.setTransformationMethod(PasswordTransformationMethod.getInstance());
+    Util.setCursorColor(passwordEdit, R.color.black);
+
+    final InputMethodManager imm = (InputMethodManager) context.getSystemService(INPUT_METHOD_SERVICE);
+
+    DialogInterface.OnClickListener okListener = new DialogInterface.OnClickListener() {
+      @Override
+      public void onClick(DialogInterface dialog, int which) {
+        String password = passwordEdit.getText().toString();
+
+        try {
+          // 인증서 인증
+          if (SignWrapper.getInstance().certificate(context, userId, password)) {
+            eFormToolkit.startEFormViewer(fos);
+          } else {
+            Util.getOKDialog(context, context.getString(R.string.emptyCertPw), context.getString(R.string.certAuthFail), null).show();
+          }
+
+          imm.hideSoftInputFromWindow(passwordEdit.getWindowToken(), 0);
+        } catch (Exception e) {
+          e.printStackTrace();
+          Util.getOKDialog(context, context.getString(R.string.emptyCertPw), e.getMessage(), null).show();
+        }
+      }
+    };
+
+    DialogInterface.OnClickListener cancelListener = new DialogInterface.OnClickListener() {
+      @Override
+      public void onClick(DialogInterface dialog, int which) {
+        imm.hideSoftInputFromWindow(passwordEdit.getWindowToken(), 0);
+      }
+    };
+
+    AlertDialog dialog = Util.getPasswordInputDialog(context, context.getString(R.string.emptyCertPw), context.getString(R.string.certAuthFail), okListener, cancelListener);
+    dialog.setView(passwordEdit);
+    dialog.show();
+  }
+
+  public String createFOS(HashMap consentData) {
     String fos = "";
     fos = "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
     fos += "<fos version='1.0'>";
     fos += "  <global>";
-//    fos += this.createFosPageTemplate();
+    fos += this.createFosPageTemplate();
     fos += "    <parameters>"; // form-list의 모든 서식에 적용될 파라미터
-    fos += "            <param key='UrlParam'>" + BuildConfig.CONSENT_SERVER_URL + "</param>";
-//    fos += this.createParamString(msg.getParamMap());
+//    fos += "            <param key='UrlParam'>" + BuildConfig.CONSENT_SERVER_URL + "</param>";
+    fos += "            <param key='UrlParam'>" + "https://ema031.knuh.kr:9091" + "</param>";
+    fos += this.createParamString((HashMap<String, String>) consentData.get("globalParam"));
     fos += "    </parameters>";
     fos += "   </global>";
     fos += "  <form-list>";
-//    fos += this.createFormString(msg.getFormParamMapList());
+    fos += this.createFormString((List<Map<String, String>>) consentData.get("formListParam"));
     fos += "  </form-list>";
     fos += "</fos>";
     return fos;
@@ -142,10 +242,9 @@ public class ConsentFacade {
       Map<String, String> formMap = formMapList.get(i);
       String rid = formMap.get("rid");
       String guid = formMap.get("guid");
-      String type = formMap.get("type");
       boolean newForm = true;
-
       String newConsent = formMap.get("newConsent");
+
       if (newConsent != null && "true".equals(newConsent)) {
         newForm = true;
       } else {
@@ -154,14 +253,14 @@ public class ConsentFacade {
 
       fos += "    <form name='noname' open-sequence='" + (i + 1) + "' path='" + BuildConfig.CONSENT_EFORM_SERVER_URL + "' request-encode='utf-8' response-encode='utf-8'>";
       fos += "      <parameters>";
-      fos += this.createParamString(formMap);
+      fos += this.createParamString((HashMap<String, String>) formMap);
       fos += "      </parameters>";
       fos += "      <form-get-parameters>";
-      fos += "        <post-param key='OP'><![CDATA[" + (newForm ? "VIEWER_FORM" : "VIEWER_DATA") + "]]></post-param>";
+      fos += "        <post-param key='OP'><![CDATA[" + (newForm == true ? "VIEWER_FORM" : "VIEWER_DATA") + "]]></post-param>";
       fos += "        <post-param key='PD'>";
       fos += "        <![CDATA[";
       fos += "          <data>";
-      fos += "          <action>" + (newForm ? "GET" : "GET_DATA") + "</action>";
+      fos += "          <action>" + (newForm == true ? "GET" : "GET_DATA") + "</action>";
       fos += "            <params>";
       fos += "              <param name='adaptername'>defaultadapter</param>";
 
@@ -187,7 +286,7 @@ public class ConsentFacade {
    * @param param
    * @return
    */
-  private String createParamString(Map<String, String> param) {
+  private String createParamString(HashMap<String, String> param) {
     StringBuffer paramStr = new StringBuffer();
     if (param != null && !param.isEmpty()) {
       for (String key : param.keySet()) {

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

@@ -0,0 +1,25 @@
+package com.dbs.mplus.knuh.consent;
+
+import android.content.Context;
+
+import kr.co.clipsoft.eform.EFormToolkit;
+import kr.co.clipsoft.eform.event.IEventHandler;
+import kr.co.clipsoft.eform.event.ResultEventArgs;
+
+public class EFormSaveHandler implements IEventHandler<ResultEventArgs> {
+
+  private Context mContext;
+  private EFormToolkit eFormToolkit;
+
+
+  public EFormSaveHandler(Context mContext, EFormToolkit eFormToolkit) {
+    this.mContext     = mContext;
+    this.eFormToolkit = eFormToolkit;
+  }
+
+  @Override
+  public void eventReceived(Object o, ResultEventArgs resultEventArgs) {
+    eFormToolkit.sendEFormViewerOkEvent();
+  }
+}
+

+ 42 - 0
app/src/main/java/com/dbs/mplus/knuh/consent/EformExitEventHandler.java

@@ -0,0 +1,42 @@
+package com.dbs.mplus.knuh.consent;
+
+import android.os.Environment;
+import android.util.Log;
+
+import java.io.File;
+
+import kr.co.clipsoft.eform.event.ExitEventArgs;
+import kr.co.clipsoft.eform.event.IEventHandler;
+
+public class EformExitEventHandler implements IEventHandler<ExitEventArgs> {
+
+  private static final String TAG = "EformExitEventHandler";
+
+  @Override
+  public void eventReceived(Object o, ExitEventArgs exitEventArgs) {
+    switch (exitEventArgs.getResultCode()) {
+      case EXIT:
+        Log.e(TAG, "EXIT");
+
+//        String path = Environment.getExternalStorageDirectory().getAbsolutePath() + "/CLIPe-Form/AudioTemp/";
+//        File directory = new File(path);
+//        File[] files = directory.listFiles();
+//        File tempFile = null;
+//
+//        if (files != null) {
+//          if (files.length > 0) {
+//            for (int i = 0; i < files.length; i++) {
+//              String tempFilePath = path + files[i].getName();
+//              tempFile = new File(tempFilePath);
+//              tempFile.delete();
+//            }
+//          }
+//        }
+
+        break;
+      case ERROR_EXIT:
+        Log.e(TAG, "ERROR_EXIT");
+        break;
+    }
+  }
+}

+ 39 - 30
app/src/main/java/com/dbs/mplus/knuh/fragment/HistoryFragment.java

@@ -115,10 +115,41 @@ public class HistoryFragment extends Fragment {
 
     setDate();
     setEvent();
+    setDrawableHistoryType("patient");
 
+    checkAll.setChecked(true);
     return view;
   }
 
+  private void setDrawableHistoryType(String type) {
+    GradientDrawable patientLeftBg = (GradientDrawable) patientLeftRound.getBackground();
+    GradientDrawable patientRightBg = (GradientDrawable) patientRightRound.getBackground();
+    GradientDrawable writerLeftBg = (GradientDrawable) writerLeftRound.getBackground();
+    GradientDrawable writerRightBg = (GradientDrawable) writerRightRound.getBackground();
+
+    if (type.equals("patient")) {
+      patientLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeLeftColor), PorterDuff.Mode.SRC_ATOP);
+      patientRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeRightColor), PorterDuff.Mode.SRC_ATOP);
+      ivPatient.setColorFilter(ContextCompat.getColor(mContext, R.color.white), PorterDuff.Mode.SRC_ATOP);
+      tvPatient.setTextColor(ContextCompat.getColor(mContext, R.color.white));
+
+      writerLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.historyTypeColor), PorterDuff.Mode.SRC_ATOP);
+      writerRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.departmentBtnColor), PorterDuff.Mode.SRC_ATOP);
+      ivWriter.setColorFilter(ContextCompat.getColor(mContext, R.color.black), PorterDuff.Mode.SRC_ATOP);
+      tvWriter.setTextColor(ContextCompat.getColor(mContext, R.color.black));
+    } else {
+      patientLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.historyTypeColor), PorterDuff.Mode.SRC_ATOP);
+      patientRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.departmentBtnColor), PorterDuff.Mode.SRC_ATOP);
+      ivPatient.setColorFilter(ContextCompat.getColor(mContext, R.color.black), PorterDuff.Mode.SRC_ATOP);
+      tvPatient.setTextColor(ContextCompat.getColor(mContext, R.color.black));
+
+      writerLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeLeftColor), PorterDuff.Mode.SRC_ATOP);
+      writerRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeRightColor), PorterDuff.Mode.SRC_ATOP);
+      ivWriter.setColorFilter(ContextCompat.getColor(mContext, R.color.white), PorterDuff.Mode.SRC_ATOP);
+      tvWriter.setTextColor(ContextCompat.getColor(mContext, R.color.white));
+    }
+  }
+
   private void setEvent() {
 
     // 환자별/작성자별 색상 변경 리스너
@@ -213,43 +244,17 @@ public class HistoryFragment extends Fragment {
   private View.OnClickListener onClickListener = new View.OnClickListener() {
     @Override
     public void onClick(View v) {
-      GradientDrawable patientLeftBg = (GradientDrawable) patientLeftRound.getBackground();
-      GradientDrawable patientRightBg = (GradientDrawable) patientRightRound.getBackground();
-      GradientDrawable writerLeftBg = (GradientDrawable) writerLeftRound.getBackground();
-      GradientDrawable writerRightBg = (GradientDrawable) writerRightRound.getBackground();
 
-      /** 환자별 및 작성자별 색상 변경 **/
       if (v == typePatient) {
-        patientLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeLeftColor), PorterDuff.Mode.SRC_ATOP);
-        patientRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeRightColor), PorterDuff.Mode.SRC_ATOP);
-        ivPatient.setColorFilter(ContextCompat.getColor(mContext, R.color.white), PorterDuff.Mode.SRC_ATOP);
-        tvPatient.setTextColor(ContextCompat.getColor(mContext, R.color.white));
-
-        writerLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.historyTypeColor), PorterDuff.Mode.SRC_ATOP);
-        writerRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.departmentBtnColor), PorterDuff.Mode.SRC_ATOP);
-        ivWriter.setColorFilter(ContextCompat.getColor(mContext, R.color.black), PorterDuff.Mode.SRC_ATOP);
-        tvWriter.setTextColor(ContextCompat.getColor(mContext, R.color.black));
-
+        setDrawableHistoryType("patient");
       } else if (v == typeWriter) {
-        patientLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.historyTypeColor), PorterDuff.Mode.SRC_ATOP);
-        patientRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.departmentBtnColor), PorterDuff.Mode.SRC_ATOP);
-        ivPatient.setColorFilter(ContextCompat.getColor(mContext, R.color.black), PorterDuff.Mode.SRC_ATOP);
-        tvPatient.setTextColor(ContextCompat.getColor(mContext, R.color.black));
-
-        writerLeftBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeLeftColor), PorterDuff.Mode.SRC_ATOP);
-        writerRightBg.setColorFilter(ContextCompat.getColor(mContext, R.color.typeRightColor), PorterDuff.Mode.SRC_ATOP);
-        ivWriter.setColorFilter(ContextCompat.getColor(mContext, R.color.white), PorterDuff.Mode.SRC_ATOP);
-        tvWriter.setTextColor(ContextCompat.getColor(mContext, R.color.white));
-        /** 환자별 및 작성자별 색상 변경 **/
-
-        /** DatePickerDialog **/
+        setDrawableHistoryType("");
       } else if (v == leftDateLayout) {
         leftDateDialog.show();
-      }
-      else if (v == rightDateLayout) {
+      } else if (v == rightDateLayout) {
         rightDateDialog.show();
-
       } /** DatePickerDialog **/
+
     }
   };
 
@@ -288,6 +293,10 @@ public class HistoryFragment extends Fragment {
         checkConfirm.setChecked(false);
         checkPrint.setChecked(false);
       }
+
+      if (!checkAll.isChecked() && !checkCert.isChecked() && !checkTemp.isChecked() && !checkConfirm.isChecked() && !checkPrint.isChecked()) {
+        checkAll.setChecked(true);
+      }
     }
   };
 

+ 9 - 1
app/src/main/java/com/dbs/mplus/knuh/httpTask/SoapParser.java

@@ -240,6 +240,7 @@ public class SoapParser {
         SoapObject so = (SoapObject) object.getProperty(i);
 
         String consentMstRid = so.getProperty("consentMstRid").toString().trim();
+        String ocrTag        = so.getProperty("ocrTag").toString().trim();
         String pid           = so.getProperty("pid").toString().trim();
         String consentState  = so.getProperty("consentState").toString().trim();
         String formCd        = so.getProperty("formCd").toString().trim();
@@ -256,6 +257,7 @@ public class SoapParser {
         String linkFormCd    = so.getProperty("linkFormCd").toString().trim();
 
         consentMstRid = consentMstRid.equals(ConsentConfig.RETURN_NULL) ? "" : consentMstRid;
+        ocrTag        = ocrTag.equals(ConsentConfig.RETURN_NULL) ? "" : ocrTag;
         pid           = pid.equals(ConsentConfig.RETURN_NULL) ? "" : pid;
         consentState  = consentState.equals(ConsentConfig.RETURN_NULL) ? "" : consentState;
         formCd        = formCd.equals(ConsentConfig.RETURN_NULL) ? "" : formCd;
@@ -271,7 +273,7 @@ public class SoapParser {
         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));
+        arrayList.add(new ConsentFormListVO(consentMstRid, ocrTag, pid, consentState, formCd, formGuid, formName, formRid, printOnly, ocrTagPrntYn, formPrntNm, certUseYn, opDiagNm, opNm, userDrFlag, linkFormCd));
       }
     }
 
@@ -296,6 +298,7 @@ public class SoapParser {
         SoapObject so = (SoapObject) object.getProperty(i);
 
         String ordDeptCd   = so.getProperty("ordDeptCd").toString().trim();
+        String deptEngAbbr = so.getProperty("deptEngAbbr").toString().trim();
         String ordDeptNm   = so.getProperty("ordDeptNm").toString().trim();
         String pid         = so.getProperty("pid").toString().trim();
         String cretNo      = so.getProperty("cretNo").toString().trim();
@@ -325,6 +328,7 @@ public class SoapParser {
         String opCnfmDd    = so.getProperty("opCnfmDd").toString().trim();
         String perfDrNm    = so.getProperty("perfDrNm").toString().trim();
         String perfDrFlag  = so.getProperty("perfDrFlag").toString().trim();
+        String perfDrDept  = so.getProperty("perfDrDept").toString().trim();
         String opDiagNm    = so.getProperty("opDiagNm").toString().trim();
         String opNm        = so.getProperty("opNm").toString().trim();
         String anstDrNm1   = so.getProperty("anstDrNm1").toString().trim();
@@ -359,6 +363,7 @@ public class SoapParser {
         String statusEtc   = so.getProperty("statusEtc").toString().trim();
 
         ordDeptCd   = ordDeptCd.equals(ConsentConfig.RETURN_NULL) ? "" : ordDeptCd;
+        deptEngAbbr = deptEngAbbr.equals(ConsentConfig.RETURN_NULL) ? "" : deptEngAbbr;
         ordDeptNm   = ordDeptNm.equals(ConsentConfig.RETURN_NULL) ? "" : ordDeptNm;
         pid         = pid.equals(ConsentConfig.RETURN_NULL) ? "" : pid;
         cretNo      = cretNo.equals(ConsentConfig.RETURN_NULL) ? "" : cretNo;
@@ -388,6 +393,7 @@ public class SoapParser {
         opCnfmDd    = opCnfmDd.equals(ConsentConfig.RETURN_NULL) ? "" : opCnfmDd;
         perfDrNm    = perfDrNm.equals(ConsentConfig.RETURN_NULL) ? "" : perfDrNm;
         perfDrFlag  = perfDrFlag.equals(ConsentConfig.RETURN_NULL) ? "" : perfDrFlag;
+        perfDrDept  = perfDrDept.equals(ConsentConfig.RETURN_NULL) ? "" : perfDrDept;
         opDiagNm    = opDiagNm.equals(ConsentConfig.RETURN_NULL) ? "" : opDiagNm;
         opNm        = opNm.equals(ConsentConfig.RETURN_NULL) ? "" : opNm;
         anstDrNm1   = anstDrNm1.equals(ConsentConfig.RETURN_NULL) ? "" : anstDrNm1;
@@ -422,6 +428,7 @@ public class SoapParser {
         statusEtc   = statusEtc.equals(ConsentConfig.RETURN_NULL) ? "" : statusEtc;
 
         patientInfoVO.setOrdDeptCd(ordDeptCd);
+        patientInfoVO.setDeptEngAbbr(deptEngAbbr);
         patientInfoVO.setOrdDeptNm(ordDeptNm);
         patientInfoVO.setPid(pid);
         patientInfoVO.setCretNo(cretNo);
@@ -451,6 +458,7 @@ public class SoapParser {
         patientInfoVO.setOpCnfmDd(opCnfmDd);
         patientInfoVO.setPerfDrNm(perfDrNm);
         patientInfoVO.setPerfDrFlag(perfDrFlag);
+        patientInfoVO.setPerfDrDept(perfDrDept);
         patientInfoVO.setOpDiagNm(opDiagNm);
         patientInfoVO.setOpNm(opNm);
         patientInfoVO.setAnstDrNm1(anstDrNm1);

+ 26 - 17
app/src/main/java/com/dbs/mplus/knuh/model/ConsentFormListVO.java

@@ -1,8 +1,8 @@
 package com.dbs.mplus.knuh.model;
 
 public class ConsentFormListVO {
-
   private String consentMstRid = "";
+  private String ocrTag        = "";
   private String pid           = "";
   private String consentState  = "";
   private String formCd        = "";
@@ -18,25 +18,25 @@ public class ConsentFormListVO {
   private String userDrFlag    = "";
   private String linkFormCd    = "";
 
-  public ConsentFormListVO(String consentMstRid, String pid, String consentState, String formCd, String formGuid, String formName, String formRid, String printOnly, String ocrTagPrntYn, String formPrntNm, String certUseYn, String opDiagNm, String opNm, String userDrFlag, String linkFormCd) {
+  public ConsentFormListVO(String consentMstRid, String ocrTag, String pid, String consentState, String formCd, String formGuid, String formName, String formRid, String printOnly, String ocrTagPrntYn, String formPrntNm, String certUseYn, String opDiagNm, String opNm, String userDrFlag, String linkFormCd) {
     this.consentMstRid = consentMstRid;
-    this.pid           = pid;
-    this.consentState  = consentState;
-    this.formCd        = formCd;
-    this.formGuid      = formGuid;
-    this.formName      = formName;
-    this.formRid       = formRid;
-    this.printOnly     = printOnly;
-    this.ocrTagPrntYn  = ocrTagPrntYn;
-    this.formPrntNm    = formPrntNm;
-    this.certUseYn     = certUseYn;
-    this.opDiagNm      = opDiagNm;
-    this.opNm          = opNm;
-    this.userDrFlag    = userDrFlag;
-    this.linkFormCd    = linkFormCd;
+    this.ocrTag = ocrTag;
+    this.pid = pid;
+    this.consentState = consentState;
+    this.formCd = formCd;
+    this.formGuid = formGuid;
+    this.formName = formName;
+    this.formRid = formRid;
+    this.printOnly = printOnly;
+    this.ocrTagPrntYn = ocrTagPrntYn;
+    this.formPrntNm = formPrntNm;
+    this.certUseYn = certUseYn;
+    this.opDiagNm = opDiagNm;
+    this.opNm = opNm;
+    this.userDrFlag = userDrFlag;
+    this.linkFormCd = linkFormCd;
   }
 
-
   public String getConsentMstRid() {
     return consentMstRid;
   }
@@ -45,6 +45,14 @@ public class ConsentFormListVO {
     this.consentMstRid = consentMstRid;
   }
 
+  public String getOcrTag() {
+    return ocrTag;
+  }
+
+  public void setOcrTag(String ocrTag) {
+    this.ocrTag = ocrTag;
+  }
+
   public String getPid() {
     return pid;
   }
@@ -156,4 +164,5 @@ public class ConsentFormListVO {
   public void setLinkFormCd(String linkFormCd) {
     this.linkFormCd = linkFormCd;
   }
+
 }

+ 18 - 0
app/src/main/java/com/dbs/mplus/knuh/model/PatientInfoVO.java

@@ -2,6 +2,7 @@ package com.dbs.mplus.knuh.model;
 
 public class PatientInfoVO {
   private String ordDeptCd   = "";
+  private String deptEngAbbr = "";
   private String ordDeptNm   = "";
   private String pid         = "";
   private String cretNo      = "";
@@ -31,6 +32,7 @@ public class PatientInfoVO {
   private String opCnfmDd    = "";
   private String perfDrNm    = "";
   private String perfDrFlag  = "";
+  private String perfDrDept  = "";
   private String opDiagNm    = "";
   private String opNm        = "";
   private String anstDrNm1   = "";
@@ -72,6 +74,14 @@ public class PatientInfoVO {
     this.ordDeptCd = ordDeptCd;
   }
 
+  public String getDeptEngAbbr() {
+    return deptEngAbbr;
+  }
+
+  public void setDeptEngAbbr(String deptEngAbbr) {
+    this.deptEngAbbr = deptEngAbbr;
+  }
+
   public String getOrdDeptNm() {
     return ordDeptNm;
   }
@@ -304,6 +314,14 @@ public class PatientInfoVO {
     this.perfDrFlag = perfDrFlag;
   }
 
+  public String getPerfDrDept() {
+    return perfDrDept;
+  }
+
+  public void setPerfDrDept(String perfDrDept) {
+    this.perfDrDept = perfDrDept;
+  }
+
   public String getOpDiagNm() {
     return opDiagNm;
   }

+ 94 - 0
app/src/main/java/com/dbs/mplus/knuh/model/UserVO.java

@@ -0,0 +1,94 @@
+package com.dbs.mplus.knuh.model;
+
+public class UserVO {
+  private String userId       = "";
+  private String userName     = "";
+  private String userDeptCode = "";
+  private String userDeptName = "";
+  private String deptEngAbbr  = "";
+  private String jobKindCd    = "";
+  private String jobKindNm    = "";
+  private String userInstCd   = "";
+  private String userTelNo    = "";
+  private String ioFlag       = "";
+
+  public String getUserId() {
+    return userId;
+  }
+
+  public void setUserId(String userId) {
+    this.userId = userId;
+  }
+
+  public String getUserName() {
+    return userName;
+  }
+
+  public void setUserName(String userName) {
+    this.userName = userName;
+  }
+
+  public String getUserDeptCode() {
+    return userDeptCode;
+  }
+
+  public void setUserDeptCode(String userDeptCode) {
+    this.userDeptCode = userDeptCode;
+  }
+
+  public String getUserDeptName() {
+    return userDeptName;
+  }
+
+  public void setUserDeptName(String userDeptName) {
+    this.userDeptName = userDeptName;
+  }
+
+  public String getDeptEngAbbr() {
+    return deptEngAbbr;
+  }
+
+  public void setDeptEngAbbr(String deptEngAbbr) {
+    this.deptEngAbbr = deptEngAbbr;
+  }
+
+  public String getJobKindCd() {
+    return jobKindCd;
+  }
+
+  public void setJobKindCd(String jobKindCd) {
+    this.jobKindCd = jobKindCd;
+  }
+
+  public String getJobKindNm() {
+    return jobKindNm;
+  }
+
+  public void setJobKindNm(String jobKindNm) {
+    this.jobKindNm = jobKindNm;
+  }
+
+  public String getUserInstCd() {
+    return userInstCd;
+  }
+
+  public void setUserInstCd(String userInstCd) {
+    this.userInstCd = userInstCd;
+  }
+
+  public String getUserTelNo() {
+    return userTelNo;
+  }
+
+  public void setUserTelNo(String userTelNo) {
+    this.userTelNo = userTelNo;
+  }
+
+  public String getIoFlag() {
+    return ioFlag;
+  }
+
+  public void setIoFlag(String ioFlag) {
+    this.ioFlag = ioFlag;
+  }
+}

+ 7 - 2
app/src/main/java/com/dbs/mplus/knuh/util/ConsentConfig.java

@@ -17,10 +17,15 @@ public class ConsentConfig {
   public static final String SET_USER_FORM_SET     = "SetUserFormSetList"; // 즐겨찾기 추가
   public static final String DEL_USER_FORM_SET     = "DelUserFormSetList"; // 즐겨찾기 삭제
   public static final String UPDATE_USER_SETUP     = "UpdateUserSetup";    // 사용자 기본 화면 설정 외래 O 입원 I 응급 E 수술 OP 검색 SR
+  public static final String GET_SIGN_DATA         = "GetSignImage";       // 서명 이미지
+  public static final String GET_USER_INFO         = "GetUserInfo";        // 사용자 정보
+  public static final String GET_OCR_TAG           = "GetOcrTag";          // ocrTag 채번
 
   public static final String HOST_CONSENT = BuildConfig.CONSENT_SERVER_URL + "ConsentSvc.asmx";
-  public static final String GET_CONSENT_CATEGORYY = "GetCategoryForDropdown";
-  public static final String GET_CONSENT_SEARCH    = "GetConsentBySearch";
+  public static final String GET_CONSENT_CATEGORYY = "GetCategoryForDropdown";  // 동의서 찾기시 카테고리 리스트
+  public static final String GET_CONSENT_SEARCH    = "GetConsentBySearch"; // 동의서 검색(찾기)
+  public static final String GET_CONSENT_BY_FORMCD = "GetConsentByFormcd"; // 연계서식 정보 조회(수술 및 서식 동의서를 선택했을때)
+  public static final String GET_CONSENT_LIST = "GetConsentList"; // 동의서 이력 조회
 
 
   public final static int CONNECT_TIMEOUT   = 5000;

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

@@ -64,7 +64,7 @@
             android:paddingRight="8dp"
             android:paddingBottom="4dp"
             android:layout_marginLeft="4dp"
-            android:text="삭제"
+            android:text="@string/delete"
             android:textColor="@color/white"
             android:textSize="14sp" />
 
@@ -80,7 +80,7 @@
             android:paddingRight="8dp"
             android:paddingBottom="4dp"
             android:layout_marginLeft="4dp"
-            android:text="임시"
+            android:text="@string/check"
             android:textColor="@color/white"
             android:textSize="14sp" />
 

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

@@ -34,4 +34,5 @@
     <color name="typeLeftColor">#1173C1</color>
     <color name="typeRightColor">#1380D7</color>
     <color name="historyTypeColor">#D8D8D8</color>
+    <color name="tempColor">#4C5667</color>
 </resources>

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

@@ -82,6 +82,7 @@
     <string name="emptySign">서명이 누락되었습니다.</string>
     <string name="emptySearchConsent">조회된 동의서가 없습니다.</string>
 
+    <string name="emptyPatientInfo">환자를 선택해주세요.</string>
     <string name="settingAlertMsg">로그인 후 초기화면이 [%1s] 화면으로 설정됩니다. \n 계속 진행하시겠습니까?</string>
     <string name="settingError">설정이 변경에 실패하였습니다.</string>
     <string name="deleteMaker">삭제하시겠습니까?</string>
@@ -94,4 +95,10 @@
     <string name="permissionCheck">전자동의서 로그인을 위해 파일 접근 권한 및 DeviceId 획득을 위한 전화번호 권한이 필요합니다.</string>
     <string name="permissionDenied">권한 허용이 되지 않아 사용하실 수 없습니다. [설정] > [애플리케이션] > %1$s 에서 권한을 허용해주세요.</string>
     <string name="networkError">무선통신이 연결되어있지 않습니다.</string>
+
+    <string name="viewer">뷰어</string>
+    <string name="ERROR_000">뷰어 호출에 실패하였습니다.</string>
+    <string name="ERROR_001">뷰어를 설치해주세요.</string>
+    <string name="ERROR_002">뷰어 버전 정보가 일치하지 않습니다 앱 업데이트가 필요합니다.</string>
+    <string name="ERROR_006">뷰어 실행 권한이 불충분합니다 </string>
 </resources>