Browse Source

质控/秘书查看病例列表添加出院时间

bfyMa
zhizhi wu 3 years ago
parent
commit
4e58ebee00
  1. 2
      src/main/java/com/ccsens/carbasics/api/PatientController.java
  2. 32
      src/main/java/com/ccsens/carbasics/bean/vo/OcrVo.java
  3. 2
      src/main/java/com/ccsens/carbasics/bean/vo/PatientVo.java
  4. 12
      src/main/resources/mapper_dao/FirstAidDao.xml

2
src/main/java/com/ccsens/carbasics/api/PatientController.java

@ -40,7 +40,7 @@ public class PatientController {
public JsonResponse<PatientVo.SelfPatient> querySelf(@ApiParam @Validated @RequestBody QueryDto<PatientDto.QueryPatient> params) throws Exception{
log.info("查询自己相关的病例列表:{}", params);
PatientVo.SelfPatient data = firstAidService.querySelf(params.getParam(), params.getUserId());
log.info("查询自己相关的病例列表成功");
log.info("查询自己相关的病例列表成功:{}", data);
return JsonResponse.newInstance().ok(data);
}

32
src/main/java/com/ccsens/carbasics/bean/vo/OcrVo.java

@ -35,22 +35,39 @@ public class OcrVo {
String idCardName = "姓名";
String idCardSex = "性别";
String idCardNo = "公民身份号码";
words.forEach(wordNode ->{
String nation = "民族";
for (int i = 0; i < words.size(); i++) {
BaiDuVo.GeneralWord wordNode = words.get(i);
String word = wordNode.getWords();
if (word.startsWith(idCardName)) {
this.name = word.substring(idCardName.length());
this.name = word.length() != idCardName.length() ?
word.substring(idCardName.length()) :
i + 1 < words.size() ? words.get(i + 1).getWords() : null;
} else if (word.startsWith(idCardSex)) {
int sexIndex = 2;
if (word.length() > sexIndex) {
String sexWord = word.substring(sexIndex,sexIndex +1);
this.sex = "女".equals(sexWord) ? (byte)0 : (byte)1;
} else {
String sexWord = i + 1 < words.size() ? words.get(i + 1).getWords() : null;
this.sex = "女".equals(sexWord) ? (byte)0 : "男".equals(sexWord) ? (byte)1 : null;
}
int nationIndex = 5;
if (word.length() > nationIndex) {
this.nation = word.substring(nationIndex);
}
} else if (word.contains(nation)) {
int nationIndex = word.indexOf(nation) + nation.length() + 1;
if (nationIndex < word.length() ) {
this.nation = word.substring(nationIndex);
} else {
this.nation = i + 1 < words.size() ? words.get(i + 1).getWords() : null;
}
} else if (word.startsWith(idCardNo)) {
this.idCardNo = word.substring(6);
this.age = IdcardUtil.getAgeByIdCard(this.idCardNo);
int idCardIndex = 6;
int idCardMinLength = 15;
if (word.length() > idCardIndex) {
@ -60,7 +77,16 @@ public class OcrVo {
this.age = IdcardUtil.getAgeByIdCard(this.idCardNo);
}
}
});
}
if (StrUtil.isEmpty(this.idCardNo)) {
String lastWord = words.get(words.size() - 1).getWords();
this.idCardNo = lastWord.replaceAll("\\D", "");
int idCardMinLength = 15;
if (StrUtil.isNotBlank(this.idCardNo) && this.idCardNo.length() >= idCardMinLength) {
this.age = IdcardUtil.getAgeByIdCard(this.idCardNo);
}
}
}
}
}

2
src/main/java/com/ccsens/carbasics/bean/vo/PatientVo.java

@ -170,6 +170,8 @@ public class PatientVo {
private String hospitalNumber;
@ApiModelProperty("到院时间")
private Long arriveHospitalTime;
@ApiModelProperty("出院时间")
private Long leaveHospitalTime;
//修改次数
@JsonIgnore
private Integer times;

12
src/main/resources/mapper_dao/FirstAidDao.xml

@ -52,7 +52,7 @@
<if test="param.name != null and param.name != ''">
and a.name like concat('%', #{param.name}, '%')
</if>
order by r2.answer IS NOT NULL,r2.answer DESC,a.created_at DESC
order by r2.answer DESC,a.created_at DESC
</select>
@ -74,6 +74,7 @@
t.*,
t1.answer AS hospitalNumber,
t2.answer AS arriveHospitalTime,
t4.answer AS leaveHospitalTime,
count( t3.id ) AS times
FROM
(
@ -116,6 +117,9 @@
LEFT JOIN t_qcp_first_aid_log t3 ON t.firstAidId = t3.first_aid_id
AND t3.operation_type = 5
AND t3.rec_status = 0
LEFT JOIN t_qcp_first_aid_record t4 ON t.id = t4.first_aid_id
AND t4.question_code = 'CYQK-CYSJ'
AND t4.rec_status = 0
WHERE
1=1
<if test="param.hospitalNumber!=null and param.hospitalNumber!=''">
@ -136,6 +140,7 @@
t.*,
t1.answer AS hospitalNumber,
t2.answer AS arriveHospitalTime,
t4.answer AS leaveHospitalTime,
count( t3.id ) AS times
FROM
(
@ -179,6 +184,9 @@
LEFT JOIN t_qcp_first_aid_log t3 ON t.firstAidId = t3.first_aid_id
AND t3.operation_type = 3
AND t3.rec_status = 0
LEFT JOIN t_qcp_first_aid_record t4 ON t.id = t4.first_aid_id
AND t4.question_code = 'CYQK-CYSJ'
AND t4.rec_status = 0
<trim prefix="WHERE" prefixOverrides="and">
<if test="param.hospitalNumber!=null and param.hospitalNumber!=''">
AND t1.answer LIKE concat('%',#{param.hospitalNumber},'%')
@ -371,6 +379,6 @@
)
)
)
ORDER BY leaveHospitalTime DESC
ORDER BY leaveHospitalTime DESC, firstAidId DESC
</select>
</mapper>

Loading…
Cancel
Save