1: 增加新增电子病历接口
parent
320ed98d67
commit
99f477f1f2
@ -0,0 +1,163 @@
|
|||||||
|
package com.supervision.manage.dto;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.supervision.manage.pojo.vo.MedicalRecInfoReqVo;
|
||||||
|
import com.supervision.model.MedicalExtendItem;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MedicalExtendInfoDTO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 现病史类目id
|
||||||
|
*/
|
||||||
|
private static final String patientHistoryItemId = "1020";
|
||||||
|
/**
|
||||||
|
* 个人史类目id
|
||||||
|
*/
|
||||||
|
private static final String patientPersonalHistoryItemId = "1007";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 既往史类目id
|
||||||
|
*/
|
||||||
|
private static final String patientPastHistoryItemId = "1022";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 家族史类目id
|
||||||
|
*/
|
||||||
|
private static final String patientFamilyHistoryItemId = "1021";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手术史
|
||||||
|
*/
|
||||||
|
private static final String patientSurgeryHistoryItemId = "1055";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 过敏史
|
||||||
|
*/
|
||||||
|
private static final String patientAllergyItemId = "1048";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private MedicalRecInfoReqVo medicalRecInfo;
|
||||||
|
|
||||||
|
public MedicalExtendInfoDTO(MedicalRecInfoReqVo medicalRecInfo) {
|
||||||
|
this.medicalRecInfo = medicalRecInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把病历信息请求对象中的扩展信息设置到extendInfoList中
|
||||||
|
*/
|
||||||
|
public List<MedicalExtendItem> medicalRecInfoReqVo2ExtendInfoList(){
|
||||||
|
|
||||||
|
List<MedicalExtendItem> extendInfoList = new ArrayList<>();
|
||||||
|
String patientHistory = medicalRecInfo.getPatientHistory();
|
||||||
|
if (StrUtil.isNotEmpty(patientHistory)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientHistoryItemId,"现病史",patientHistory));
|
||||||
|
}
|
||||||
|
|
||||||
|
String patientAllergy = medicalRecInfo.getPatientAllergy();
|
||||||
|
if (StrUtil.isNotEmpty(patientAllergy)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientAllergyItemId,"过敏史",patientAllergy));
|
||||||
|
}
|
||||||
|
|
||||||
|
String patientFamilyHistory = medicalRecInfo.getPatientFamilyHistory();
|
||||||
|
if (StrUtil.isNotEmpty(patientFamilyHistory)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientPersonalHistoryItemId,"个人史",patientFamilyHistory));
|
||||||
|
}
|
||||||
|
String patientPersonalHistory = medicalRecInfo.getPatientPersonalHistory();
|
||||||
|
if (StrUtil.isNotEmpty(patientPersonalHistory)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientFamilyHistoryItemId,"家族史",patientPersonalHistory));
|
||||||
|
}
|
||||||
|
String patientPastHistory = medicalRecInfo.getPatientPastHistory();
|
||||||
|
if (StrUtil.isNotEmpty(patientPastHistory)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientPastHistoryItemId,"既往史",patientPastHistory));
|
||||||
|
}
|
||||||
|
String patientSurgeryHistory = medicalRecInfo.getPatientSurgeryHistory();
|
||||||
|
if (StrUtil.isNotEmpty(patientSurgeryHistory)){
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(),patientSurgeryHistoryItemId,"手术史",patientSurgeryHistory));
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MedicalRecInfoReqVo.MedicalExtendInfo> reqExtendInfo = medicalRecInfo.getExtendInfoList();
|
||||||
|
if (CollUtil.isNotEmpty(reqExtendInfo)){
|
||||||
|
for (MedicalRecInfoReqVo.MedicalExtendInfo info : reqExtendInfo) {
|
||||||
|
extendInfoList.add(
|
||||||
|
this.buildMedicalExtendItem(medicalRecInfo.getId(), info.getItemId(),
|
||||||
|
info.getName(), info.getItemContent()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return extendInfoList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 把extendInfoList中的扩展信息设置到病历信息请求对象中
|
||||||
|
* @param extendInfoList
|
||||||
|
*/
|
||||||
|
public void extendInfoListSetMedicalRecInfoReqVo(List<MedicalExtendItem> extendInfoList){
|
||||||
|
if (CollUtil.isEmpty(extendInfoList)){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MedicalRecInfoReqVo.MedicalExtendInfo> medicalExtendInfos = new ArrayList<>();
|
||||||
|
for (MedicalExtendItem extendItem : extendInfoList) {
|
||||||
|
String itemId = extendItem.getItemId();
|
||||||
|
MedicalRecInfoReqVo.MedicalExtendInfo medicalExtendInfo = new MedicalRecInfoReqVo.MedicalExtendInfo();
|
||||||
|
medicalExtendInfo.setMedicalId(medicalRecInfo.getId());
|
||||||
|
medicalExtendInfo.setName(extendItem.getName());
|
||||||
|
medicalExtendInfo.setItemContent(extendItem.getItemContent());
|
||||||
|
medicalExtendInfo.setItemId(itemId);
|
||||||
|
if (StrUtil.isEmpty(itemId)){
|
||||||
|
medicalExtendInfos.add(medicalExtendInfo);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
medicalExtendInfo.setItemId(itemId);
|
||||||
|
switch (itemId){
|
||||||
|
case patientPersonalHistoryItemId:
|
||||||
|
medicalRecInfo.setPatientPersonalHistory(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
case patientFamilyHistoryItemId:
|
||||||
|
medicalRecInfo.setPatientFamilyHistory(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
case patientPastHistoryItemId:
|
||||||
|
medicalRecInfo.setPatientPastHistory(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
case patientSurgeryHistoryItemId:
|
||||||
|
medicalRecInfo.setPatientSurgeryHistory(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
case patientAllergyItemId:
|
||||||
|
medicalRecInfo.setPatientAllergy(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
case patientHistoryItemId:
|
||||||
|
medicalRecInfo.setPatientHistory(extendItem.getItemContent());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
medicalExtendInfos.add(medicalExtendInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private MedicalExtendItem buildMedicalExtendItem(String medicalId,String itemId,String name,String itemContent){
|
||||||
|
MedicalExtendItem medicalExtendItem = new MedicalExtendItem();
|
||||||
|
medicalExtendItem.setMedicalId(medicalId);
|
||||||
|
medicalExtendItem.setItemId(itemId);
|
||||||
|
medicalExtendItem.setName(name);
|
||||||
|
medicalExtendItem.setItemContent(itemContent);
|
||||||
|
return medicalExtendItem;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.supervision.manage.pojo.vo;
|
||||||
|
|
||||||
|
import com.supervision.model.MedicalRec;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
|
public class MedicalRecInfoReqVo extends MedicalRec {
|
||||||
|
|
||||||
|
@Schema(description = "现病史")
|
||||||
|
private String patientHistory;
|
||||||
|
|
||||||
|
@Schema(description = "过敏史")
|
||||||
|
private String patientAllergy;
|
||||||
|
|
||||||
|
@Schema(description = "个人史")
|
||||||
|
private String patientFamilyHistory;
|
||||||
|
|
||||||
|
@Schema(description = "家族史")
|
||||||
|
private String patientPersonalHistory;
|
||||||
|
|
||||||
|
@Schema(description = "既往史")
|
||||||
|
private String patientPastHistory;
|
||||||
|
|
||||||
|
@Schema(description = "手术史")
|
||||||
|
private String patientSurgeryHistory;
|
||||||
|
|
||||||
|
@Schema(description = "扩展信息")
|
||||||
|
private List<MedicalExtendInfo> extendInfoList;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public static class MedicalExtendInfo{
|
||||||
|
|
||||||
|
@Schema(description = "病历id")
|
||||||
|
private String medicalId;
|
||||||
|
|
||||||
|
@Schema(description = "类目id")
|
||||||
|
private String itemId;
|
||||||
|
|
||||||
|
@Schema(description = "分类名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Schema(description = "类目内容")
|
||||||
|
private String itemContent;
|
||||||
|
|
||||||
|
public MedicalExtendInfo() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue