|
@@ -329,16 +329,29 @@ public class DrgDipController {
|
|
|
if (null == params.getVisitId()) {
|
|
|
return DrgDipResponseFactory.wrongParameters("visitId不能为空。");
|
|
|
}
|
|
|
- List<HisPatientDagns> list = dao.selectHisPatientDagns(params.getPatNo(), params.getTimes());
|
|
|
- if (list.isEmpty()) {
|
|
|
+ List<HisPatientDagns> admList = dao.selectHisPatientAdmDagns(params.getPatNo(), params.getTimes());
|
|
|
+ List<HisPatientDagns> disList = dao.selectHisPatientDisDangs(params.getPatNo(), params.getTimes());
|
|
|
+ if (admList.isEmpty() && disList.isEmpty()) {
|
|
|
return DrgDipResponseFactory.noCorrespondingDataFound();
|
|
|
}
|
|
|
- for (int i = 0; i < list.size(); i++) {
|
|
|
- HisPatientDagns dagns = list.get(i);
|
|
|
- dagns.setVisitId(params.getVisitId());
|
|
|
+ if (admList.isEmpty()) {
|
|
|
+ return DrgDipResponseFactory.success(accomplishDagns(disList, params.getVisitId()));
|
|
|
+ }
|
|
|
+ if (disList.isEmpty()) {
|
|
|
+ return DrgDipResponseFactory.success(accomplishDagns(admList, params.getVisitId()));
|
|
|
+ }
|
|
|
+ admList.get(0).setDagnsTypeId("2");
|
|
|
+ admList.addAll(disList);
|
|
|
+ return DrgDipResponseFactory.success(accomplishDagns(admList, params.getVisitId()));
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<HisPatientDagns> accomplishDagns(List<HisPatientDagns> dangsList, String visitId) {
|
|
|
+ for (int i = 0; i < dangsList.size(); i++) {
|
|
|
+ HisPatientDagns dagns = dangsList.get(i);
|
|
|
+ dagns.setVisitId(visitId);
|
|
|
dagns.setOrder(i + 1);
|
|
|
}
|
|
|
- return DrgDipResponseFactory.success(list);
|
|
|
+ return dangsList;
|
|
|
}
|
|
|
|
|
|
private JSONObject queryHisPatientOprtInfo(RequestParams params) {
|