|
|
|
@ -47,8 +47,27 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public Integer selectChildByClo(Archive_Detail_Vo record) {
|
|
|
|
|
String masterId = record.getPatientId();
|
|
|
|
|
String mIdStr = getChildMidsByMasterId(masterId);
|
|
|
|
|
if(StringUtils.isNotBlank(mIdStr)) {
|
|
|
|
|
try {
|
|
|
|
|
Integer count = archiveDetailMapper.selectChildByCloCount(mIdStr);
|
|
|
|
|
return count;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 根据masterId查询新生儿masterId逗号隔开的字符串
|
|
|
|
|
* @param masterId
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String getChildMidsByMasterId(String masterId) {
|
|
|
|
|
//查询该主键的病案号和住院时间
|
|
|
|
|
Archive_Master archiveMaster = archiveMasterMapper.selectById(record.getPatientId());
|
|
|
|
|
Archive_Master archiveMaster = archiveMasterMapper.selectById(masterId);
|
|
|
|
|
//查询该住院时间的数据集合
|
|
|
|
|
List<Archive_MasterDto> list = archiveMasterMapper.selectChildMasterId(archiveMaster.getAdmissionDateTime());
|
|
|
|
|
//定义是该患者的婴儿的masterId集合
|
|
|
|
@ -63,15 +82,7 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(StringUtils.isNotBlank(mIdStr)) {
|
|
|
|
|
try {
|
|
|
|
|
Integer count = archiveDetailMapper.selectChildByCloCount(mIdStr.toString());
|
|
|
|
|
return count;
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
return mIdStr.toString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@ -298,7 +309,30 @@ public class Archive_DetailServiceImpl implements Archive_DetailService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<String> getPdfUrlByMasterOrId(String[] assortIds, String masterId, String flag, String fileIds) {
|
|
|
|
|
return archiveDetailMapper.getPdfUrlByMasterOrId(assortIds,masterId,flag,fileIds);
|
|
|
|
|
List<String> resultList = new ArrayList<>();
|
|
|
|
|
//查询本病历
|
|
|
|
|
List<String> pdfUrlByMasterOrId = archiveDetailMapper.getPdfUrlByMasterOrId(assortIds, masterId, flag, fileIds);
|
|
|
|
|
if(!CollectionUtils.isEmpty(pdfUrlByMasterOrId)){
|
|
|
|
|
resultList.addAll(pdfUrlByMasterOrId);
|
|
|
|
|
}
|
|
|
|
|
//判断是否存在查询新生儿
|
|
|
|
|
if(null != assortIds){
|
|
|
|
|
boolean childFlag = false;
|
|
|
|
|
for (String assortId:assortIds){
|
|
|
|
|
if(StringUtils.isNotBlank(assortId) && assortId.equals("1000")){
|
|
|
|
|
childFlag = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(childFlag){
|
|
|
|
|
String childMidsByMasterId = getChildMidsByMasterId(masterId);
|
|
|
|
|
List<String> childPdfUrlByMasterIds = archiveDetailMapper.getChildPdfUrlByMasterIds(childMidsByMasterId);
|
|
|
|
|
if(!CollectionUtils.isEmpty(childPdfUrlByMasterIds)){
|
|
|
|
|
resultList.addAll(childPdfUrlByMasterIds);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return resultList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|