|
@ -247,7 +247,7 @@ public class FamilyMemberService extends BaseService {
|
|
|
* @param patient 居民
|
|
|
* @return
|
|
|
*/
|
|
|
public JSONArray getPatientFamilyMembers(String patient, String doctorCode) {
|
|
|
public JSONArray getPatientFamilyMembers(String patient, String doctorCode, boolean isContain, String current) {
|
|
|
JSONArray resultArray = new JSONArray();
|
|
|
String sql = "select * " +
|
|
|
" from " +
|
|
@ -321,6 +321,47 @@ public class FamilyMemberService extends BaseService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (isContain && !patient.equals(current)) {
|
|
|
Patient p = patientDao.findByCode(patient);
|
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
List<SignFamily> signs = contractService.findAllSignByPatient(p.getCode());
|
|
|
boolean ssSign = false;
|
|
|
boolean jtSign = false;
|
|
|
|
|
|
for (SignFamily sign : signs) {
|
|
|
if (sign.getType() == 1 && sign.getStatus() > 0) {
|
|
|
ssSign = true;
|
|
|
} else if (sign.getType() == 2 && sign.getStatus() > 0) {
|
|
|
jtSign = true;
|
|
|
} else if (sign.getStatus() == 0) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
obj.put("code", p.getCode());
|
|
|
obj.put("name", p.getName());
|
|
|
obj.put("sex", p.getSex());
|
|
|
obj.put("birthday", p.getBirthday());
|
|
|
obj.put("idcard", StringUtils.isEmpty(p.getIdcard()) ? "" : p.getIdcard());
|
|
|
obj.put("photo", StringUtils.isEmpty(p.getPhoto()) ? "" : p.getPhoto());
|
|
|
obj.put("mobile", StringUtils.isEmpty(p.getMobile()) ? "" : p.getMobile());
|
|
|
obj.put("address", StringUtils.isEmpty(p.getAddress()) ? "" : p.getAddress());
|
|
|
obj.put("familyRelation", "-1");
|
|
|
obj.put("familyRelationName", "自己");
|
|
|
|
|
|
if (ssSign && jtSign) {
|
|
|
obj.put("signType", 3);
|
|
|
} else if (!ssSign && jtSign) {
|
|
|
obj.put("signType", 2);
|
|
|
} else if (ssSign && !jtSign) {
|
|
|
obj.put("signType", 1);
|
|
|
} else {
|
|
|
obj.put("signType", 0);
|
|
|
}
|
|
|
|
|
|
resultArray.put(obj);
|
|
|
}
|
|
|
|
|
|
return resultArray;
|
|
|
}
|
|
|
|