Commit 189e77a5 authored by CORP\sonam.kamble's avatar CORP\sonam.kamble

To store service type and service id

parent caf00733
...@@ -10,21 +10,15 @@ import java.util.Date; ...@@ -10,21 +10,15 @@ import java.util.Date;
import javax.naming.InitialContext; import javax.naming.InitialContext;
import org.apache.poi.ss.formula.ptg.MemErrPtg;
import org.json.JSONObject; import org.json.JSONObject;
import org.json.XML; import org.json.XML;
import org.json.simple.JSONArray;
import org.json.simple.parser.JSONParser;
import ibase.system.config.AppConnectParm; import ibase.system.config.AppConnectParm;
import ibase.system.config.ConnDriver; import ibase.system.config.ConnDriver;
import ibase.utility.BaseLogger; import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
import ibase.utility.UserInfoBean; import ibase.utility.UserInfoBean;
import ibase.webitm.ejb.MasterStatefulRemote; import ibase.webitm.ejb.MasterStatefulRemote;
import ibase.webitm.utility.TransIDGenerator;
public class PatientFamily public class PatientFamily
{ {
...@@ -42,8 +36,9 @@ public class PatientFamily ...@@ -42,8 +36,9 @@ public class PatientFamily
district = "", stanCode = "", stateCode = "", pin = "",birthDate ="", district = "", stanCode = "", stateCode = "", pin = "",birthDate ="",
countCode = "", tel1 = "", tel2 = "", tel3 = "", mobileNo = "", countCode = "", tel1 = "", tel2 = "", tel3 = "", mobileNo = "",
status = "", sex = "", dob = "", serviceType = "", serviceNo = "", status = "", sex = "", dob = "", serviceType = "", serviceNo = "",
name = "",memberName="",attachment="",gender ="",errSting = "", name = "",memberName="",attachment="",gender ="",errSting = "",idNo = "",
relation ="",familyMobileNo="",birthDateStr="",attachmentDbValue = ""; relation ="",familyMobileNo="",birthDateStr="",attachmentDbValue = "",
familyServiceType = "",familyServiceNo ="";
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
Timestamp birtDateTstmp = null; Timestamp birtDateTstmp = null;
...@@ -127,6 +122,9 @@ public class PatientFamily ...@@ -127,6 +122,9 @@ public class PatientFamily
attachment = data.getString("attachment"); attachment = data.getString("attachment");
relation = data.getString("relation"); relation = data.getString("relation");
familyMobileNo = data.getString("mobileNo"); familyMobileNo = data.getString("mobileNo");
idNo = data.getString("idNo");
serviceNo = data.getString("service_no");
serviceType = data.getString("service_type");
Date date= new Date(); Date date= new Date();
long time = date.getTime(); long time = date.getTime();
...@@ -278,6 +276,10 @@ public class PatientFamily ...@@ -278,6 +276,10 @@ public class PatientFamily
xmlString.append("<relation><![CDATA["+ relation +"]]></relation>"); xmlString.append("<relation><![CDATA["+ relation +"]]></relation>");
xmlString.append("<attachment><![CDATA["+ attachmentDbValue +"]]></attachment>"); xmlString.append("<attachment><![CDATA["+ attachmentDbValue +"]]></attachment>");
xmlString.append("<mobile_no><![CDATA["+ familyMobileNo +"]]></mobile_no>"); xmlString.append("<mobile_no><![CDATA["+ familyMobileNo +"]]></mobile_no>");
xmlString.append("<id_no><![CDATA["+ idNo +"]]></id_no>");
xmlString.append("<serv_card_no><![CDATA["+ serviceNo +"]]></serv_card_no>");
xmlString.append("<serv_card_type><![CDATA["+ serviceType +"]]></serv_card_type>");
xmlString.append("<status><![CDATA["+ "A" +"]]></status>");
xmlString.append("</Detail2>"); xmlString.append("</Detail2>");
xmlString.append("</Root>\r\n"); xmlString.append("</Root>\r\n");
...@@ -372,4 +374,88 @@ public class PatientFamily ...@@ -372,4 +374,88 @@ public class PatientFamily
} }
return jsonObject; return jsonObject;
} }
public String updateFamilyStatus(String lineNo,UserInfoBean userInfoBean)
{
PreparedStatement pStmt = null;
ResultSet rs = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String sql ="",errSting ="",memberName ="";
JSONObject jsonObject = new JSONObject();
String transDB = userInfoBean.getTransDB();
String userCode = userInfoBean.getLoginCode();
E12GenericUtility genericUtility = new E12GenericUtility();
try
{
conn = connDriver.getConnectDB(transDB);
sql = "SELECT MEMBER_NAME FROM PATIENT_FAMILY WHERE PATIENT_CODE = ?"
+ "AND LINE_NO = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, userCode);
pStmt.setString(2, lineNo);
rs = pStmt.executeQuery();
if(rs.next())
{
memberName = rs.getString("MEMBER_NAME");
System.out.println("memberName:"+memberName);
}
//jsonObject.put("member_name", memberName);
if(rs != null)
{
rs.close();
rs = null;
}
if( pStmt != null )
{
pStmt.close();
pStmt = null;
}
sql ="UPDATE PATIENT_FAMILY SET STATUS = ? WHERE PATIENT_CODE = ?"
+ " AND LINE_NO = ?";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, "C");
pStmt.setString(2, userCode);
pStmt.setString(3, lineNo);
int i = pStmt.executeUpdate();
if(i > 0)
{
System.out.println("data updated:"+i);
conn.commit();
errSting = genericUtility.getErrorString("", "VTMEMCLOSE", userCode);
jsonObject = this.convertXmlToJsonInError(errSting);
jsonObject.put("member_name", memberName);
System.out.println("jsonObject"+jsonObject);
}
if( pStmt != null )
{
pStmt.close();
pStmt = null;
}
}
catch(Exception e)
{
System.out.println("PatientFamily.updateFamilyStatus()"+e);
}
finally
{
try
{
if( pStmt != null )
{
pStmt.close();
pStmt = null;
}
if( conn != null )
{
conn.close();
conn = null;
}
}
catch(Exception e)
{
}
}
return jsonObject.toString();
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment