123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- package com.lemon.lifecenter.dto;
- import java.util.Calendar;
- import java.util.Date;
- import org.springframework.stereotype.Repository;
- @Repository
- public class PatientPHRLatestDTO {
- private int patientIdx;
- private String patientName;
- private String centerCode;
- private String wardNumber="";
- private String roomNumber="";
- private String todayHospitalizationYN;
- private Float temperature;
- private Date temperatureCreateDate;
- private String temperatureAlarmYN;
- private Integer oxygenSaturation;
- private Date oxygenSaturationCreateDate;
- private String oxygenSaturationAlarmYN;
- private Integer pulseRate;
- private Date pulseRateCreateDate;
- private String pulseRateAlarmYN;
- private Integer systolicBloodPressure;
- private Date systolicBloodPressureCreateDate;
- private Integer diastolicBloodPressure;
- private Date diastolicBloodPressureCreateDate;
- private String highBloodPressureAlarmYN;
- private String lowBloodPressureAlarmYN;
- private Integer bloodSugar;
- private Date bloodSugarCreateDate;
- private String bloodSugarAlarmYN;
- private String symptomYN;
-
- private int memoCount;
- private Date symptomLastDate;
- private String searchText;
- private String sortType;
- private String[] filterList;
- private String timeCriterion;
- private int limit;
- private int limitMax;
-
- private boolean needCheckValue(Date targetDate) {
- boolean needCheck = true;
- Calendar todayCalendar = Calendar.getInstance();
- Calendar targetCalendar = Calendar.getInstance();
-
- try {
- todayCalendar.setTime(new Date());
- targetCalendar.setTime(targetDate);
-
- if (targetCalendar.get(Calendar.YEAR) == todayCalendar.get(Calendar.YEAR)
- && targetCalendar.get(Calendar.MONTH) == todayCalendar.get(Calendar.MONTH)
- && targetCalendar.get(Calendar.DAY_OF_MONTH) == todayCalendar.get(Calendar.DAY_OF_MONTH)
- && targetCalendar.get(Calendar.AM_PM) == todayCalendar.get(Calendar.AM_PM)) {
- needCheck = false;
- }
- }
- catch (Exception e) {
- // 체크가 필요한 것으로 처리
- }
-
- return needCheck;
- }
- public int getPatientIdx() {
- return patientIdx;
- }
- public void setPatientIdx(int patientIdx) {
- this.patientIdx = patientIdx;
- }
- public String getCenterCode() {
- return centerCode;
- }
- public void setCenterCode(String centerCode) {
- this.centerCode = centerCode;
- }
- public String getPatientName() {
- return patientName;
- }
- public void setPatientName(String patientName) {
- this.patientName = patientName;
- }
- public String getWardNumber() {
- return wardNumber;
- }
- public void setWardNumber(String wardNumber) {
- this.wardNumber = wardNumber;
- }
- public String getRoomNumber() {
- return roomNumber;
- }
- public void setRoomNumber(String roomNumber) {
- this.roomNumber = roomNumber;
- }
- public String getTodayHospitalizationYN() {
- return todayHospitalizationYN;
- }
- public void setTodayHospitalizationYN(String todayHospitalizationYN) {
- this.todayHospitalizationYN = todayHospitalizationYN;
- }
- public Float getTemperature() {
- return temperature;
- }
- public void setTemperature(float temperature) {
- this.temperature = temperature;
- }
- public Date getTemperatureCreateDate() {
- return temperatureCreateDate;
- }
- public String getTemperatureAlarmYN() {
- return temperatureAlarmYN;
- }
- public void setTemperatureAlarmYN(String temperatureAlarmYN) {
- this.temperatureAlarmYN = temperatureAlarmYN;
- }
- public Integer getOxygenSaturation() {
- return oxygenSaturation;
- }
- public void setOxygenSaturation(int oxygenSaturation) {
- this.oxygenSaturation = oxygenSaturation;
- }
- public Date getOxygenSaturationCreateDate() {
- return oxygenSaturationCreateDate;
- }
- public String getOxygenSaturationAlarmYN() {
- return oxygenSaturationAlarmYN;
- }
- public void setOxygenSaturationAlarmYN(String oxygenSaturationAlarmYN) {
- this.oxygenSaturationAlarmYN = oxygenSaturationAlarmYN;
- }
- public Integer getPulseRate() {
- return pulseRate;
- }
- public void setPulseRate(int pulseRate) {
- this.pulseRate = pulseRate;
- }
- public Date getPulseRateCreateDate() {
- return pulseRateCreateDate;
- }
- public String getPulseRateAlarmYN() {
- return pulseRateAlarmYN;
- }
- public void setPulseRateAlarmYN(String pulseRateAlarmYN) {
- this.pulseRateAlarmYN = pulseRateAlarmYN;
- }
- public Integer getSystolicBloodPressure() {
- return systolicBloodPressure;
- }
- public void setSystolicBloodPressure(int systolicBloodPressure) {
- this.systolicBloodPressure = systolicBloodPressure;
- }
- public Date getSystolicBloodPressureCreateDate() {
- return systolicBloodPressureCreateDate;
- }
- public Integer getDiastolicBloodPressure() {
- return diastolicBloodPressure;
- }
- public void setDiastolicBloodPressure(int diastolicBloodPressure) {
- this.diastolicBloodPressure = diastolicBloodPressure;
- }
- public Date getDiastolicBloodPressureCreateDate() {
- return diastolicBloodPressureCreateDate;
- }
- public String getHighBloodPressureAlarmYN() {
- return highBloodPressureAlarmYN;
- }
- public void setHighBloodPressureAlarmYN(String highBloodPressureAlarmYN) {
- this.highBloodPressureAlarmYN = highBloodPressureAlarmYN;
- }
- public String getLowBloodPressureAlarmYN() {
- return lowBloodPressureAlarmYN;
- }
- public void setLowBloodPressureAlarmYN(String lowBloodPressureAlarmYN) {
- this.lowBloodPressureAlarmYN = lowBloodPressureAlarmYN;
- }
- public Integer getBloodSugar() {
- return bloodSugar;
- }
- public void setBloodSugar(int bloodSugar) {
- this.bloodSugar = bloodSugar;
- }
- public Date getBloodSugarCreateDate() {
- return bloodSugarCreateDate;
- }
- public String getBloodSugarAlarmYN() {
- return bloodSugarAlarmYN;
- }
- public void setBloodSugarAlarmYN(String bloodSugarAlarmYN) {
- this.bloodSugarAlarmYN = bloodSugarAlarmYN;
- }
- public int getMemoCount() {
- return memoCount;
- }
- public void setMemoCount(int memoCount) {
- this.memoCount = memoCount;
- }
- public Date getSymptomLastDate() {
- return symptomLastDate;
- }
- public String getSymptomYN() {
- return symptomYN;
- }
- public void setSymptomYN(String symptomYN) {
- this.symptomYN = symptomYN;
- }
- public String getSearchText() {
- return searchText;
- }
- public void setSearchText(String searchText) {
- this.searchText = searchText;
- }
- public String getSortType() {
- return sortType;
- }
- public void setSortType(String sortType) {
- this.sortType = sortType;
- }
- public String[] getFilterList() {
- return filterList;
- }
- public void setFilterList(String[] filterList) {
- this.filterList = filterList;
- }
- public String getTimeCriterion() {
- return timeCriterion;
- }
- public void setTimeCriterion(String timeCriterion) {
- this.timeCriterion = timeCriterion;
- }
- public int getLimit() {
- return limit;
- }
- public void setLimit(int limit) {
- this.limit = limit;
- }
- public int getLimitMax() {
- return limitMax;
- }
- public void setLimitMax(int limitMax) {
- this.limitMax = limitMax;
- }
- public String getBloodPressureDisplay() {
- String systolicBloodPressureString = "--";
- if (this.systolicBloodPressure != null) {
- systolicBloodPressureString = this.systolicBloodPressure.toString();
- }
- String diastolicBloodPressureString = "--";
- if (this.diastolicBloodPressure != null) {
- diastolicBloodPressureString = this.diastolicBloodPressure.toString();
- }
- return systolicBloodPressureString + " / " + diastolicBloodPressureString;
- }
- public boolean getNeedTemperatureCheck() {
- return needCheckValue(this.temperatureCreateDate);
- }
- public boolean getNeedBloodPressCheck() {
- return needCheckValue(this.systolicBloodPressureCreateDate) || needCheckValue(this.diastolicBloodPressureCreateDate);
- }
- public boolean getNeedPulseRateCheck() {
- return needCheckValue(this.pulseRateCreateDate);
- }
- public boolean getNeedOxygenSaturationCheck() {
- return needCheckValue(this.oxygenSaturationCreateDate);
- }
- public boolean getNeedBloodSugarCheck() {
- return needCheckValue(this.bloodSugarCreateDate);
- }
- private boolean isAlarm(String alarmYn, boolean defaultValue) {
- boolean useDefaultValue = (alarmYn != "Y") && (alarmYn != "N");
- return useDefaultValue ? defaultValue : (alarmYn == "Y");
- }
- public boolean getIsTemperatureWarning() {
- if (this.temperature == null) return false;
- return isAlarm(this.temperatureAlarmYN, (this.temperature >= 37.5));
- }
- public boolean getIsBloodPressureWarning() {
- if (this.systolicBloodPressure == null || this.diastolicBloodPressure == null) return false;
-
- boolean highBPWarning = isAlarm(this.highBloodPressureAlarmYN, (this.systolicBloodPressure >= 149 || this.diastolicBloodPressure >= 99));
- boolean lowBPWarning = isAlarm(this.lowBloodPressureAlarmYN, (this.systolicBloodPressure <= 90 || this.diastolicBloodPressure <= 60));
- return highBPWarning || lowBPWarning;
- }
- public boolean getIsPulseRateWarning() {
- if (this.pulseRate == null) return false;
- return isAlarm(this.pulseRateAlarmYN, (this.pulseRate <= 55 || this.pulseRate >= 110));
- }
- public boolean getIsOxygenSaturationeWarning() {
- if (this.oxygenSaturation == null) return false;
- return isAlarm(this.oxygenSaturationAlarmYN, (this.oxygenSaturation <= 94));
- }
- public boolean getIsBloodSugarWarning() {
- if (this.bloodSugar == null) return false;
- return isAlarm(this.bloodSugarAlarmYN, (this.bloodSugar <= 70 || this.bloodSugar >= 200));
- }
- public boolean getHasTodaySymptom() {
- boolean ret = false;
- Calendar todayCalendar = Calendar.getInstance();
- Calendar symptomCalendar = Calendar.getInstance();
-
- try {
- todayCalendar.setTime(new Date());
- symptomCalendar.setTime(this.symptomLastDate);
-
- if (symptomCalendar.get(Calendar.YEAR) == todayCalendar.get(Calendar.YEAR)
- && symptomCalendar.get(Calendar.MONTH) == todayCalendar.get(Calendar.MONTH)
- && symptomCalendar.get(Calendar.DAY_OF_MONTH) == todayCalendar.get(Calendar.DAY_OF_MONTH)
- && symptomCalendar.get(Calendar.AM_PM) == todayCalendar.get(Calendar.AM_PM)) {
- ret = true;
- }
- }
- catch (Exception e) {
- // 없는 것으로 처리
- }
-
- return ret;
- }
- }
|