Commit 9f273f09 authored by CORP\sonam.kamble's avatar CORP\sonam.kamble

Changes done Koye

parent 55fb8239
...@@ -23,7 +23,7 @@ import ibase.webitm.utility.TransIDGenerator; ...@@ -23,7 +23,7 @@ import ibase.webitm.utility.TransIDGenerator;
public class PatientFamily public class PatientFamily
{ {
public String insertPatientFamilyData(String data,UserInfoBean userInfoBean) public String insertPatientFamilyData(JSONObject data,UserInfoBean userInfoBean)
{ {
String retstr = ""; String retstr = "";
MasterStatefulRemote masterStateful = null; MasterStatefulRemote masterStateful = null;
...@@ -34,11 +34,11 @@ public class PatientFamily ...@@ -34,11 +34,11 @@ public class PatientFamily
int lineNo = 0; int lineNo = 0;
String fName = "", mName = "", lName = "", locCode = "", String fName = "", mName = "", lName = "", locCode = "",
addr1 = "", addr2 = "", addr3 = "", city = "", addr1 = "", addr2 = "", addr3 = "", city = "",
district = "", stanCode = "", stateCode = "", pin = "", 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="",birthDate="",gender ="", name = "",memberName="",attachment="",gender ="",
relation ="",familyMobileNo="",birthDateStr=""; relation ="",familyMobileNo="",birthDateStr="",attachmentDbValue = "";
E12GenericUtility genericUtility = new E12GenericUtility(); E12GenericUtility genericUtility = new E12GenericUtility();
try { try {
...@@ -111,19 +111,20 @@ public class PatientFamily ...@@ -111,19 +111,20 @@ public class PatientFamily
pStmt.close(); pStmt.close();
pStmt = null; pStmt = null;
} }
JSONParser parser = new JSONParser(); //JSONParser parser = new JSONParser();
JSONObject json = (JSONObject) parser.parse(data); //JSONObject json = (JSONObject) parser.parse(data);
System.out.println("##json object data"+json); System.out.println("##json object data"+data);
memberName = (String) json.get("name"); memberName = (String) data.get("name");
gender= (String) json.get("gender"); gender= (String) data.get("gender");
birthDate = (String) json.get("dateOfBirth"); birthDate = (String) data.get("dateOfBirth");
attachment = (String) json.get("attachment"); System.out.println("###birthDate:"+birthDate);
relation = (String) json.get("relation"); attachment = (String) data.get("attachment");
familyMobileNo = (String) json.get("mobileNo"); relation = (String) data.get("relation");
birthDateStr = sdfDBFormat.format(sdfAngularFormat.parse(birthDate)); familyMobileNo = (String) data.get("mobileNo");
System.out.println("birth date in the db format TESTING:"+birthDateStr);
System.out.println("birth date in the db format TESTING:"+birthDateStr);
AppConnectParm appConnect = new AppConnectParm(); AppConnectParm appConnect = new AppConnectParm();
InitialContext ctx = new InitialContext(appConnect.getProperty()); InitialContext ctx = new InitialContext(appConnect.getProperty());
...@@ -204,15 +205,20 @@ public class PatientFamily ...@@ -204,15 +205,20 @@ public class PatientFamily
*/ */
xmlString.append("</Detail1>\r\n"); xmlString.append("</Detail1>\r\n");
++lineNo; ++lineNo;
if(attachment.trim().length() != 0)
{
attachmentDbValue = userId + lineNo;
System.out.println("attachmentDbValue:["+attachmentDbValue);
}
xmlString.append("<Detail2 dbID=\""+userId+lineNo +"\" domID=\"1\" objName=\"patient_family\" objContext=\"2\">"); xmlString.append("<Detail2 dbID=\""+userId+lineNo +"\" domID=\"1\" objName=\"patient_family\" objContext=\"2\">");
xmlString.append("<attribute pkNames=\"\" selected=\"Y\" updateFlag=\"A\" status=\"N\" />"); xmlString.append("<attribute pkNames=\"\" selected=\"Y\" updateFlag=\"A\" status=\"N\" />");
xmlString.append("<patient_code><![CDATA["+userId+"]]></patient_code>"); xmlString.append("<patient_code><![CDATA["+userId+"]]></patient_code>");
xmlString.append("<line_no><![CDATA["+ lineNo +"]]></line_no>"); xmlString.append("<line_no><![CDATA["+ lineNo +"]]></line_no>");
xmlString.append("<member_name><![CDATA["+ memberName +"]]></member_name>"); xmlString.append("<member_name><![CDATA["+ memberName +"]]></member_name>");
xmlString.append("<birth_date><![CDATA["+ birthDateStr +"]]></birth_date>"); xmlString.append("<birth_date><![CDATA["+ birthDate +"]]></birth_date>");
xmlString.append("<sex><![CDATA["+ gender +"]]></sex>"); xmlString.append("<sex><![CDATA["+ gender +"]]></sex>");
xmlString.append("<relation><![CDATA["+ relation +"]]></relation>"); xmlString.append("<relation><![CDATA["+ relation +"]]></relation>");
xmlString.append("<attachment><![CDATA["+ attachment +"]]></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("</Detail2>"); xmlString.append("</Detail2>");
......
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