Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. HibernatePatientSetDAO.java
- has following code re birthDateEstimated:
- in method: public String exportXml(Integer patientId) throws DAOException
- if (p.getBirthdateEstimated() != null) {
- patientNode.setAttribute("birthdate_estimated", p.getBirthdateEstimated().toString());
- }
- Should I add similar code for deathDateEstimated?
- *** Also this code is full of commented out methods
- 2. PatientServiceImpl.java
- following code re birthDateEstimated:
- in method:
- public void mergePatients(Patient preferred, Patient notPreferred) throws APIException, SerializationException {
- mergedData.setPriorDateOfBirth(preferred.getBirthdate());
- mergedData.setPriorDateOfBirthEstimated(preferred.isBirthdateEstimated());
- if (preferred.getBirthdate() == null || (preferred.getBirthdateEstimated() && !notPreferred.getBirthdateEstimated())) {
- preferred.setBirthdate(notPreferred.getBirthdate());
- preferred.setBirthdateEstimated(notPreferred.getBirthdateEstimated());
- }
- Should I add similar code for deathDateEstimated?
- 3.ADTA28Handler.java
- in method:
- // Create a new patient when this patient doesn't exist in the database
- private Patient createPatient(PID pid, String creatorName) throws HL7Exception {
- // Estimated birthdate?
- ID precisionTemp = dateOfBirth.getDegreeOfPrecision();
- if (precisionTemp != null && precisionTemp.getValue() != null) {
- String precision = precisionTemp.getValue().toUpperCase();
- log.debug("The birthdate is estimated: " + precision);
- if (precision.equals("Y") || precision.equals("L"))
- patient.setBirthdateEstimated(true);
- }
- Should I add similar code for deathDateEstimated?
- Would we ever create a patient for a dead patient?
- 4. HL7ServiceImpl.java
- in method:
- public Person createPersonFromNK1(NK1 nk1) throws HL7Exception
- // Estimated birthdate?
- ID precisionTemp = dateOfBirth.getDegreeOfPrecision();
- if (precisionTemp != null && precisionTemp.getValue() != null) {
- String precision = precisionTemp.getValue().toUpperCase();
- log.debug("The birthdate is estimated: " + precision);
- if (precision.equals("Y") || precision.equals("L"))
- person.setBirthdateEstimated(true);
- }
- Again - Should I add similar code for deathDateEstimated?
- What do these handler programs do?
- 5. Person.java
- Added private Boolean deathdateEstimated = false;
- Duplicated code for deathdateEstimated just like birthdateEstimated except code
- in method public void setBirthdateFromAge(int age, Date ageOnDate)
- Should there be similiar code for deathDateEstimated? Don't see how you can set deathDateEstimated
- form age.
- /**
- * Convenience method: sets a person's birth date from an age as of the given date Also sets
- * flag indicating that the birth date is inexact. This sets the person's birth date to January
- * 1 of the year that matches this age and date
- *
- * @param age (the age to set)
- * @param ageOnDate (null defaults to today)
- */
- public void setBirthdateFromAge(int age, Date ageOnDate) {
- Calendar c = Calendar.getInstance();
- c.setTime(ageOnDate == null ? new Date() : ageOnDate);
- c.set(Calendar.DATE, 1);
- c.set(Calendar.MONTH, Calendar.JANUARY);
- c.add(Calendar.YEAR, -1 * age);
- setBirthdate(c.getTime());
- setBirthdateEstimated(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement