Skip to content

Commit

Permalink
Applying auto format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wluyima committed May 16, 2013
1 parent b42458f commit a6f2486
Show file tree
Hide file tree
Showing 13 changed files with 79 additions and 79 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/Drug.java
Expand Up @@ -236,7 +236,7 @@ public void setId(Integer id) {
setDrugId(id);

}


/**
* Convenience method that returns a display name for the drug, defaults to drug.name
*
Expand All @@ -249,5 +249,5 @@ public String getDisplayName() {
if (getConcept() != null)
return getConcept().getName().getName();
return "";
}
}
}
2 changes: 1 addition & 1 deletion api/src/main/java/org/openmrs/api/db/PatientDAO.java
Expand Up @@ -68,7 +68,7 @@ public interface PatientDAO {
* @should get patients with a matching identifier and type
*/
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes,

boolean matchIdentifierExactly, Integer start, Integer length, boolean searchOnNamesOrIdentifiers) throws DAOException;

/**
Expand Down
Expand Up @@ -95,9 +95,9 @@ public Encounter getEncounter(Integer encounterId) throws DAOException {
*/
@SuppressWarnings("unchecked")
public List<Encounter> getEncountersByPatientId(Integer patientId) throws DAOException {
Criteria crit = sessionFactory.getCurrentSession().createCriteria(Encounter.class).createAlias("patient", "p")
.add(Expression.eq("p.patientId", patientId)).add(Expression.eq("voided", false))
.addOrder(Order.desc("encounterDatetime"));
Criteria crit = sessionFactory.getCurrentSession().createCriteria(Encounter.class).createAlias("patient", "p").add(
Expression.eq("p.patientId", patientId)).add(Expression.eq("voided", false)).addOrder(
Order.desc("encounterDatetime"));

return crit.list();
}
Expand Down Expand Up @@ -196,9 +196,9 @@ public List<EncounterType> getAllEncounterTypes(Boolean includeRetired) throws D
@SuppressWarnings("unchecked")
public List<EncounterType> findEncounterTypes(String name) throws DAOException {
return sessionFactory.getCurrentSession().createCriteria(EncounterType.class)
// 'ilike' case insensitive search
.add(Expression.ilike("name", name, MatchMode.START)).addOrder(Order.asc("name"))
.addOrder(Order.asc("retired")).list();
// 'ilike' case insensitive search
.add(Expression.ilike("name", name, MatchMode.START)).addOrder(Order.asc("name")).addOrder(
Order.asc("retired")).list();
}

/**
Expand Down
Expand Up @@ -481,7 +481,7 @@ public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) {
*
* patients = query.list(); }
*/

return patients;
}

Expand All @@ -491,23 +491,23 @@ public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) {
public Patient getPatientByUuid(String uuid) {
Patient p = null;

p = (Patient) sessionFactory.getCurrentSession().createQuery("from Patient p where p.uuid = :uuid")
.setString("uuid", uuid).uniqueResult();
p = (Patient) sessionFactory.getCurrentSession().createQuery("from Patient p where p.uuid = :uuid").setString(
"uuid", uuid).uniqueResult();

return p;
}

public PatientIdentifier getPatientIdentifierByUuid(String uuid) {
return (PatientIdentifier) sessionFactory.getCurrentSession()
.createQuery("from PatientIdentifier p where p.uuid = :uuid").setString("uuid", uuid).uniqueResult();
return (PatientIdentifier) sessionFactory.getCurrentSession().createQuery(
"from PatientIdentifier p where p.uuid = :uuid").setString("uuid", uuid).uniqueResult();
}

/**
* @see org.openmrs.api.db.PatientDAO#getPatientIdentifierTypeByUuid(java.lang.String)
*/
public PatientIdentifierType getPatientIdentifierTypeByUuid(String uuid) {
return (PatientIdentifierType) sessionFactory.getCurrentSession()
.createQuery("from PatientIdentifierType pit where pit.uuid = :uuid").setString("uuid", uuid).uniqueResult();
return (PatientIdentifierType) sessionFactory.getCurrentSession().createQuery(
"from PatientIdentifierType pit where pit.uuid = :uuid").setString("uuid", uuid).uniqueResult();
}

/**
Expand Down
Expand Up @@ -65,7 +65,7 @@ public PatientSearchCriteria(SessionFactory sessionFactory, Criteria criteria) {
* @return {@link Criteria}
*/
public Criteria prepareCriteria(String name, String identifier, List<PatientIdentifierType> identifierTypes,

boolean matchIdentifierExactly, boolean orderByNames, boolean searchOnNamesOrIdentifiers) {

//Find patients that match either the name or identifier if only
Expand Down Expand Up @@ -294,8 +294,8 @@ private LogicalExpression getNameSearch(String name) {
SimpleExpression familyName = Expression.like("name.familyName", name, mode);
SimpleExpression familyName2 = Expression.like("name.familyName2", name, mode);

return Expression.and(Expression.eq("name.voided", false),
Expression.or(familyName2, Expression.or(familyName, Expression.or(middleName, givenName))));
return Expression.and(Expression.eq("name.voided", false), Expression.or(familyName2, Expression.or(familyName,
Expression.or(middleName, givenName))));
}

/**
Expand All @@ -309,10 +309,10 @@ private String replaceSearchString(String regex, String identifierSearched) {
String returnString = regex.replaceAll("@SEARCH@", identifierSearched);
if (identifierSearched.length() > 1) {
// for 2 or more character searches, we allow regex to use last character as check digit
returnString = returnString.replaceAll("@SEARCH-1@",
identifierSearched.substring(0, identifierSearched.length() - 1));
returnString = returnString.replaceAll("@CHECKDIGIT@",
identifierSearched.substring(identifierSearched.length() - 1));
returnString = returnString.replaceAll("@SEARCH-1@", identifierSearched.substring(0,
identifierSearched.length() - 1));
returnString = returnString.replaceAll("@CHECKDIGIT@", identifierSearched
.substring(identifierSearched.length() - 1));
} else {
returnString = returnString.replaceAll("@SEARCH-1@", "");
returnString = returnString.replaceAll("@CHECKDIGIT@", "");
Expand Down
Expand Up @@ -188,7 +188,7 @@ public List<Patient> getAllPatients(boolean includeVoided) throws APIException {
*/
@Deprecated
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes)
throws APIException {
throws APIException {
return getPatients(name, identifier, identifierTypes, false);
}

Expand Down Expand Up @@ -555,7 +555,7 @@ public PatientIdentifierType getPatientIdentifierTypeByName(String name) throws
* String)
*/
public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType patientIdentifierType, String reason)
throws APIException {
throws APIException {
if (reason == null || reason.length() < 1)
throw new APIException("A reason is required when retiring an identifier type");

Expand All @@ -570,7 +570,7 @@ public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType p
* @see org.openmrs.api.PatientService#unretirePatientIdentifierType(org.openmrs.PatientIdentifierType)
*/
public PatientIdentifierType unretirePatientIdentifierType(PatientIdentifierType patientIdentifierType)
throws APIException {
throws APIException {
patientIdentifierType.setRetired(false);
patientIdentifierType.setRetiredBy(null);
patientIdentifierType.setDateRetired(null);
Expand Down Expand Up @@ -874,7 +874,7 @@ public void mergePatients(Patient preferred, Patient notPreferred) throws APIExc
* if (preferred.getRace() == null || preferred.getRace().equals(""))
* preferred.setRace(notPreferred.getRace());
*/

if (preferred.getBirthdate() == null || (preferred.getBirthdateEstimated() && !notPreferred.getBirthdateEstimated())) {
preferred.setBirthdate(notPreferred.getBirthdate());
preferred.setBirthdateEstimated(notPreferred.getBirthdateEstimated());
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/hl7/handler/ORUR01Handler.java
Expand Up @@ -1027,14 +1027,14 @@ private Location getLocation(PV1 pv1) throws HL7Exception {
location.setLocationId(locationId);
return location;
}


/**
* needs to find a Form based on information in MSH-21. example: 16^AMRS.ELD.FORMID
*
* @param msh
* @return
* @throws HL7Exception
*/
*/
private Form getForm(MSH msh) throws HL7Exception {
Integer formId = null;
try {
Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/org/openmrs/validator/ObsValidator.java
Expand Up @@ -60,10 +60,10 @@ public boolean supports(Class c) {
* @should fail validation if concept datatype is numeric and valueNumeric is null
* @should fail validation if concept datatype is text and valueText is null
* @should fail validation if obs ancestors contains obs
* @should pass validation if all values present
* @should pass validation if all values present
* @should fail validation if the parent obs has values
* @should reject an invalid concept and drug combination
* @should pass if answer concept and concept of value drug match
* @should pass if answer concept and concept of value drug match
*/
public void validate(Object obj, Errors errors) {
Obs obs = (Obs) obj;
Expand Down

0 comments on commit a6f2486

Please sign in to comment.