Advertisement
Guest User

Untitled

a guest
Nov 30th, 2012
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.17 KB | None | 0 0
  1. 1. HibernatePatientSetDAO.java
  2. has following code re birthDateEstimated:
  3.  
  4. in method: public String exportXml(Integer patientId) throws DAOException
  5.  
  6. if (p.getBirthdateEstimated() != null) {
  7. patientNode.setAttribute("birthdate_estimated", p.getBirthdateEstimated().toString());
  8. }
  9.  
  10. Should I add similar code for deathDateEstimated?
  11.  
  12. *** Also this code is full of commented out methods
  13.  
  14. 2. PatientServiceImpl.java
  15. following code re birthDateEstimated:
  16.  
  17. in method:
  18. public void mergePatients(Patient preferred, Patient notPreferred) throws APIException, SerializationException {
  19.  
  20. mergedData.setPriorDateOfBirth(preferred.getBirthdate());
  21. mergedData.setPriorDateOfBirthEstimated(preferred.isBirthdateEstimated());
  22. if (preferred.getBirthdate() == null || (preferred.getBirthdateEstimated() && !notPreferred.getBirthdateEstimated())) {
  23. preferred.setBirthdate(notPreferred.getBirthdate());
  24. preferred.setBirthdateEstimated(notPreferred.getBirthdateEstimated());
  25. }
  26.  
  27. Should I add similar code for deathDateEstimated?
  28.  
  29. 3.ADTA28Handler.java
  30.  
  31. in method:
  32. // Create a new patient when this patient doesn't exist in the database
  33. private Patient createPatient(PID pid, String creatorName) throws HL7Exception {
  34.  
  35. // Estimated birthdate?
  36. ID precisionTemp = dateOfBirth.getDegreeOfPrecision();
  37. if (precisionTemp != null && precisionTemp.getValue() != null) {
  38. String precision = precisionTemp.getValue().toUpperCase();
  39. log.debug("The birthdate is estimated: " + precision);
  40. if (precision.equals("Y") || precision.equals("L"))
  41. patient.setBirthdateEstimated(true);
  42. }
  43.  
  44. Should I add similar code for deathDateEstimated?
  45. Would we ever create a patient for a dead patient?
  46.  
  47.  
  48. 4. HL7ServiceImpl.java
  49. in method:
  50. public Person createPersonFromNK1(NK1 nk1) throws HL7Exception
  51.  
  52. // Estimated birthdate?
  53. ID precisionTemp = dateOfBirth.getDegreeOfPrecision();
  54. if (precisionTemp != null && precisionTemp.getValue() != null) {
  55. String precision = precisionTemp.getValue().toUpperCase();
  56. log.debug("The birthdate is estimated: " + precision);
  57. if (precision.equals("Y") || precision.equals("L"))
  58. person.setBirthdateEstimated(true);
  59. }
  60. Again - Should I add similar code for deathDateEstimated?
  61.  
  62. What do these handler programs do?
  63.  
  64. 5. Person.java
  65. Added private Boolean deathdateEstimated = false;
  66. Duplicated code for deathdateEstimated just like birthdateEstimated except code
  67. in method public void setBirthdateFromAge(int age, Date ageOnDate)
  68.  
  69. Should there be similiar code for deathDateEstimated? Don't see how you can set deathDateEstimated
  70. form age.
  71.  
  72. /**
  73. * Convenience method: sets a person's birth date from an age as of the given date Also sets
  74. * flag indicating that the birth date is inexact. This sets the person's birth date to January
  75. * 1 of the year that matches this age and date
  76. *
  77. * @param age (the age to set)
  78. * @param ageOnDate (null defaults to today)
  79. */
  80. public void setBirthdateFromAge(int age, Date ageOnDate) {
  81. Calendar c = Calendar.getInstance();
  82. c.setTime(ageOnDate == null ? new Date() : ageOnDate);
  83. c.set(Calendar.DATE, 1);
  84. c.set(Calendar.MONTH, Calendar.JANUARY);
  85. c.add(Calendar.YEAR, -1 * age);
  86. setBirthdate(c.getTime());
  87. setBirthdateEstimated(true);
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement