|
@@ -2,6 +2,7 @@ package com.coffee.bus.registry.patient;
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import com.coffee.bus.registry.constant.PatientKeyConstant;
|
|
|
import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
|
|
import com.coffee.bus.registry.patient.bean.DeviceTimeSmallInfo;
|
|
|
import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
|
|
import com.coffee.bus.registry.patient.bean.PatientCacheInfo;
|
|
|
import com.coffee.common.cache.ConfigStorage;
|
|
import com.coffee.common.cache.ConfigStorage;
|
|
@@ -107,102 +108,104 @@ public class ClusterPatientOperator implements PatientOperator<PatientCacheInfo>
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setCode(String code) {
|
|
public void setCode(String code) {
|
|
|
- configStorage.setConfig("code",code);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.CODE,code);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getCode() {
|
|
public String getCode() {
|
|
|
- return getValue("code").as(String.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.CODE).as(String.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setGender(SexEnum gender) {
|
|
public void setGender(SexEnum gender) {
|
|
|
if(gender==null){
|
|
if(gender==null){
|
|
|
- return;
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.GENDER,null);
|
|
|
|
|
+ }else {
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.GENDER,gender.ordinal());
|
|
|
}
|
|
}
|
|
|
- configStorage.setConfig("gender",gender.ordinal());
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public SexEnum getGender() {
|
|
public SexEnum getGender() {
|
|
|
- return getValue("gender").as(SexEnum.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.GENDER).as(SexEnum.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setName(String name) {
|
|
public void setName(String name) {
|
|
|
- configStorage.setConfig("name",name);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.NAME,name);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getName() {
|
|
public String getName() {
|
|
|
- return getValue("name").as(String.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.NAME).as(String.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setTenantId(String tenantId) {
|
|
public void setTenantId(String tenantId) {
|
|
|
- configStorage.setConfig("tenantId",tenantId);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.TENANT_ID,tenantId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getTenantId() {
|
|
public String getTenantId() {
|
|
|
- return getValue("tenantId").as(String.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.TENANT_ID).as(String.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setClinicId(String clinicId) {
|
|
public void setClinicId(String clinicId) {
|
|
|
- configStorage.setConfig("clinicId",clinicId);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.CLINIC_ID,clinicId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public Boolean getFinished() {
|
|
|
|
|
- return getValue("finished").as(Boolean.class);
|
|
|
|
|
|
|
+ public String getClinicId() {
|
|
|
|
|
+ return getValue(PatientKeyConstant.CLINIC_ID).as(String.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public void setFinished(Boolean finished) {
|
|
|
|
|
- configStorage.setConfig("finished",finished);
|
|
|
|
|
|
|
+ public Boolean getFinished() {
|
|
|
|
|
+ return getValue(PatientKeyConstant.FINISHED).as(Boolean.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public String getClinicId() {
|
|
|
|
|
- return getValue("clinicId").as(String.class);
|
|
|
|
|
|
|
+ public void setFinished(Boolean finished) {
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.FINISHED,finished);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void setStartTime(Date startTime) {
|
|
public void setStartTime(Date startTime) {
|
|
|
- configStorage.setConfig("startTime",startTime);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.START_TIME,startTime);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Date getStartTime() {
|
|
public Date getStartTime() {
|
|
|
- return getValue("startTime").as(Date.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.START_TIME).as(Date.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setBindDeviceId(String deviceId) {
|
|
public void setBindDeviceId(String deviceId) {
|
|
|
- configStorage.setConfig("bindDeviceId",deviceId);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.BIND_DEVICE_ID,deviceId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public String getBindDeviceId() {
|
|
public String getBindDeviceId() {
|
|
|
- return getValue("bindDeviceId").asString();
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.BIND_DEVICE_ID).asString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public Set<DeviceTimeSmallInfo> getAllDevice() {
|
|
public Set<DeviceTimeSmallInfo> getAllDevice() {
|
|
|
- return getValue("devices").as(HashSet.class);
|
|
|
|
|
|
|
+ return getValue(PatientKeyConstant.DEVICES).as(HashSet.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void setAllDevice(Collection<DeviceTimeSmallInfo> devices) {
|
|
public void setAllDevice(Collection<DeviceTimeSmallInfo> devices) {
|
|
|
- configStorage.setConfig("devices",devices);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.DEVICES,devices);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void add(Collection<DeviceTimeSmallInfo> devices) {
|
|
public void add(Collection<DeviceTimeSmallInfo> devices) {
|
|
|
- Set<DeviceTimeSmallInfo> deviceList = getValue("devices").as(HashSet.class);
|
|
|
|
|
|
|
+ Set<DeviceTimeSmallInfo> deviceList = getValue(PatientKeyConstant.DEVICES).as(HashSet.class);
|
|
|
deviceList.addAll(devices);
|
|
deviceList.addAll(devices);
|
|
|
- configStorage.setConfig("devices",deviceList);
|
|
|
|
|
|
|
+ configStorage.setConfig(PatientKeyConstant.DEVICES,deviceList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -212,12 +215,12 @@ public class ClusterPatientOperator implements PatientOperator<PatientCacheInfo>
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void clearClinic() {
|
|
public void clearClinic() {
|
|
|
- configStorage.remove(Arrays.asList("clinicId","startTime","finished"));
|
|
|
|
|
|
|
+ configStorage.remove(Arrays.asList(PatientKeyConstant.CLINIC_ID,PatientKeyConstant.START_TIME,PatientKeyConstant.FINISHED));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public void clearDevice() {
|
|
public void clearDevice() {
|
|
|
- configStorage.remove(Arrays.asList("bindDeviceId","devices"));
|
|
|
|
|
|
|
+ configStorage.remove(Arrays.asList(PatientKeyConstant.BIND_DEVICE_ID,PatientKeyConstant.DEVICES));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|