Commit 55fb8239 authored by CORP\sonam.kamble's avatar CORP\sonam.kamble

Patient Appointment Status updated

parent 6fc5cf42
package ibase.dashboard.crm.ejb;
import java.sql.Connection;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import org.json.XML;
import org.json.simple.JSONArray;
......@@ -461,6 +463,66 @@ public class Appointment
return jsonObject.toString();
}
//Added by Amey W. [ To update status of appointment ] on 3-04-2020 START
@SuppressWarnings({ "static-access", "resource" })
public String updateMyApptStatus(String apptId, UserInfoBean userInfoBean) {
String sql = "", status = "", errSting = "";
int cnt = 0;
ConnDriver connDriver = new ConnDriver();
Connection conn = null;
PreparedStatement pStmt = null;
ResultSet rs = null;
String userCode = userInfoBean.getLoginCode();
org.json.JSONObject jsonObject = new org.json.JSONObject();
try {
String transDB = userInfoBean.getTransDB();
conn = connDriver.getConnectDB(transDB);
sql = "update APPOINTMENT set appoint_status = ? where APPOINT_ID = ? ";
pStmt = conn.prepareStatement(sql);
pStmt.setString(1, "C");
pStmt.setString(2, apptId);
cnt = pStmt.executeUpdate();
System.out.println("Update Status Count :: " + cnt);
if (cnt > 0) {
System.out.println("Update Status Count ::SSSS ");
conn.commit();
status = "Amy success";
errSting = genericUtility.getErrorString("appt_id", "VMAPPTCOMP", userCode);
jsonObject = convertXmlToJsonInError(errSting);
} else {
System.out.println("Update Status Count ::FFF ");
status = "Amy fail";
}
if (pStmt != null) {
pStmt.close();
pStmt = null;
}
} catch (Exception e) {
System.out.println(
"Exception in Appointment Dashboard ..............."+ e);
} finally {
try {
if (conn != null) {
conn.close();
conn = null;
}
if (pStmt != null) {
pStmt.close();
pStmt = null;
}
if (rs != null) {
rs.close();
rs = null;
}
} catch (Exception e) {
System.out.println("Exception while closing resourse in Appointment Dashboard ... " + e);
}
}
return jsonObject.toString();
}
//Added by Amey W. [ To update status of appointment ] on 3-04-2020 END
public org.json.JSONObject convertXmlToJsonInError(String xmlString)
{
org.json.JSONObject jsonObject = new org.json.JSONObject();
......
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