PatientPHRHistoryDTO.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. package com.lemon.lifecenter.dto;
  2. import java.text.SimpleDateFormat;
  3. import java.util.Date;
  4. import org.springframework.stereotype.Repository;
  5. @Repository
  6. public class PatientPHRHistoryDTO {
  7. private int patientIdx;
  8. private String phrType;
  9. private Float phrValue;
  10. private Float phrValue2;
  11. private String recordedByName;
  12. private String recordedById;
  13. private String createDate;
  14. private int limit;
  15. private int limitMax;
  16. public int getPatientIdx() {
  17. return patientIdx;
  18. }
  19. public void setPatientIdx(int patientIdx) {
  20. this.patientIdx = patientIdx;
  21. }
  22. public String getPhrType() {
  23. return phrType;
  24. }
  25. public void setPhrType(String phrType) {
  26. this.phrType = phrType;
  27. }
  28. public Float getPhrValue() {
  29. return phrValue;
  30. }
  31. public void setPhrValue(Float phrValue) {
  32. this.phrValue = phrValue;
  33. }
  34. public Float getPhrValue2() {
  35. return phrValue2;
  36. }
  37. public void setPhrValue2(Float phrValue2) {
  38. this.phrValue2 = phrValue2;
  39. }
  40. public String getRecordedByName() {
  41. return recordedByName != null ? recordedByName : "";
  42. }
  43. public void setRecordedByName(String recordedByName) {
  44. this.recordedByName = recordedByName;
  45. }
  46. public String getRecordedById() {
  47. return recordedById != null ? recordedById : "";
  48. }
  49. public void setRecordedById(String recordedById) {
  50. this.recordedById = recordedById;
  51. }
  52. public String getCreateDate() {
  53. return createDate;
  54. }
  55. public void setCreateDate(String createDate) {
  56. this.createDate = createDate;
  57. }
  58. public int getLimit() {
  59. return limit;
  60. }
  61. public void setLimit(int limit) {
  62. this.limit = limit;
  63. }
  64. public int getLimitMax() {
  65. return limitMax;
  66. }
  67. public void setLimitMax(int limitMax) {
  68. this.limitMax = limitMax;
  69. }
  70. public boolean getIsWarning() {
  71. try {
  72. if (this.phrType.equals("temperature")) {
  73. return this.phrValue >= 37.5;
  74. }
  75. else if (this.phrType.equals("bloodPressure")) {
  76. boolean highBP = this.phrValue >= 149 || this.phrValue2 >= 99;
  77. boolean lowBP = this.phrValue <= 90 || this.phrValue2 <= 60;
  78. return highBP || lowBP;
  79. }
  80. else if (this.phrType.equals("oxygenSaturation")) {
  81. return this.phrValue <= 94;
  82. }
  83. else if (this.phrType.equals("pulseRate")) {
  84. return this.phrValue <= 55 || this.phrValue >= 110;
  85. }
  86. else if (this.phrType.equals("bloodSugar")) {
  87. return this.phrValue <= 70;
  88. }
  89. }
  90. catch(Exception e) {
  91. }
  92. return false;
  93. }
  94. public String getCreateDateFormatted() {
  95. SimpleDateFormat originalFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
  96. SimpleDateFormat targetFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  97. try {
  98. Date t = originalFormat.parse(this.createDate);
  99. return targetFormat.format(t);
  100. }
  101. catch (Exception e) {
  102. return createDate;
  103. }
  104. }
  105. }