Skip to content

Commit a6f2486

Browse files
committedMay 16, 2013
Applying auto format changes
1 parent b42458f commit a6f2486

File tree

13 files changed

+79
-79
lines changed

13 files changed

+79
-79
lines changed
 

‎api/src/main/java/org/openmrs/Drug.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public void setId(Integer id) {
236236
setDrugId(id);
237237

238238
}
239-
239+
240240
/**
241241
* Convenience method that returns a display name for the drug, defaults to drug.name
242242
*
@@ -249,5 +249,5 @@ public String getDisplayName() {
249249
if (getConcept() != null)
250250
return getConcept().getName().getName();
251251
return "";
252-
}
252+
}
253253
}

‎api/src/main/java/org/openmrs/api/db/PatientDAO.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public interface PatientDAO {
6868
* @should get patients with a matching identifier and type
6969
*/
7070
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes,
71-
71+
7272
boolean matchIdentifierExactly, Integer start, Integer length, boolean searchOnNamesOrIdentifiers) throws DAOException;
7373

7474
/**

‎api/src/main/java/org/openmrs/api/db/hibernate/HibernateEncounterDAO.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ public Encounter getEncounter(Integer encounterId) throws DAOException {
9595
*/
9696
@SuppressWarnings("unchecked")
9797
public List<Encounter> getEncountersByPatientId(Integer patientId) throws DAOException {
98-
Criteria crit = sessionFactory.getCurrentSession().createCriteria(Encounter.class).createAlias("patient", "p")
99-
.add(Expression.eq("p.patientId", patientId)).add(Expression.eq("voided", false))
100-
.addOrder(Order.desc("encounterDatetime"));
98+
Criteria crit = sessionFactory.getCurrentSession().createCriteria(Encounter.class).createAlias("patient", "p").add(
99+
Expression.eq("p.patientId", patientId)).add(Expression.eq("voided", false)).addOrder(
100+
Order.desc("encounterDatetime"));
101101

102102
return crit.list();
103103
}
@@ -196,9 +196,9 @@ public List<EncounterType> getAllEncounterTypes(Boolean includeRetired) throws D
196196
@SuppressWarnings("unchecked")
197197
public List<EncounterType> findEncounterTypes(String name) throws DAOException {
198198
return sessionFactory.getCurrentSession().createCriteria(EncounterType.class)
199-
// 'ilike' case insensitive search
200-
.add(Expression.ilike("name", name, MatchMode.START)).addOrder(Order.asc("name"))
201-
.addOrder(Order.asc("retired")).list();
199+
// 'ilike' case insensitive search
200+
.add(Expression.ilike("name", name, MatchMode.START)).addOrder(Order.asc("name")).addOrder(
201+
Order.asc("retired")).list();
202202
}
203203

204204
/**

‎api/src/main/java/org/openmrs/api/db/hibernate/HibernatePatientDAO.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public List<Patient> getDuplicatePatientsByAttributes(List<String> attributes) {
481481
*
482482
* patients = query.list(); }
483483
*/
484-
484+
485485
return patients;
486486
}
487487

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

494-
p = (Patient) sessionFactory.getCurrentSession().createQuery("from Patient p where p.uuid = :uuid")
495-
.setString("uuid", uuid).uniqueResult();
494+
p = (Patient) sessionFactory.getCurrentSession().createQuery("from Patient p where p.uuid = :uuid").setString(
495+
"uuid", uuid).uniqueResult();
496496

497497
return p;
498498
}
499499

500500
public PatientIdentifier getPatientIdentifierByUuid(String uuid) {
501-
return (PatientIdentifier) sessionFactory.getCurrentSession()
502-
.createQuery("from PatientIdentifier p where p.uuid = :uuid").setString("uuid", uuid).uniqueResult();
501+
return (PatientIdentifier) sessionFactory.getCurrentSession().createQuery(
502+
"from PatientIdentifier p where p.uuid = :uuid").setString("uuid", uuid).uniqueResult();
503503
}
504504

505505
/**
506506
* @see org.openmrs.api.db.PatientDAO#getPatientIdentifierTypeByUuid(java.lang.String)
507507
*/
508508
public PatientIdentifierType getPatientIdentifierTypeByUuid(String uuid) {
509-
return (PatientIdentifierType) sessionFactory.getCurrentSession()
510-
.createQuery("from PatientIdentifierType pit where pit.uuid = :uuid").setString("uuid", uuid).uniqueResult();
509+
return (PatientIdentifierType) sessionFactory.getCurrentSession().createQuery(
510+
"from PatientIdentifierType pit where pit.uuid = :uuid").setString("uuid", uuid).uniqueResult();
511511
}
512512

513513
/**

‎api/src/main/java/org/openmrs/api/db/hibernate/PatientSearchCriteria.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public PatientSearchCriteria(SessionFactory sessionFactory, Criteria criteria) {
6565
* @return {@link Criteria}
6666
*/
6767
public Criteria prepareCriteria(String name, String identifier, List<PatientIdentifierType> identifierTypes,
68-
68+
6969
boolean matchIdentifierExactly, boolean orderByNames, boolean searchOnNamesOrIdentifiers) {
7070

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

297-
return Expression.and(Expression.eq("name.voided", false),
298-
Expression.or(familyName2, Expression.or(familyName, Expression.or(middleName, givenName))));
297+
return Expression.and(Expression.eq("name.voided", false), Expression.or(familyName2, Expression.or(familyName,
298+
Expression.or(middleName, givenName))));
299299
}
300300

301301
/**
@@ -309,10 +309,10 @@ private String replaceSearchString(String regex, String identifierSearched) {
309309
String returnString = regex.replaceAll("@SEARCH@", identifierSearched);
310310
if (identifierSearched.length() > 1) {
311311
// for 2 or more character searches, we allow regex to use last character as check digit
312-
returnString = returnString.replaceAll("@SEARCH-1@",
313-
identifierSearched.substring(0, identifierSearched.length() - 1));
314-
returnString = returnString.replaceAll("@CHECKDIGIT@",
315-
identifierSearched.substring(identifierSearched.length() - 1));
312+
returnString = returnString.replaceAll("@SEARCH-1@", identifierSearched.substring(0,
313+
identifierSearched.length() - 1));
314+
returnString = returnString.replaceAll("@CHECKDIGIT@", identifierSearched
315+
.substring(identifierSearched.length() - 1));
316316
} else {
317317
returnString = returnString.replaceAll("@SEARCH-1@", "");
318318
returnString = returnString.replaceAll("@CHECKDIGIT@", "");

‎api/src/main/java/org/openmrs/api/impl/PatientServiceImpl.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public List<Patient> getAllPatients(boolean includeVoided) throws APIException {
188188
*/
189189
@Deprecated
190190
public List<Patient> getPatients(String name, String identifier, List<PatientIdentifierType> identifierTypes)
191-
throws APIException {
191+
throws APIException {
192192
return getPatients(name, identifier, identifierTypes, false);
193193
}
194194

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

@@ -570,7 +570,7 @@ public PatientIdentifierType retirePatientIdentifierType(PatientIdentifierType p
570570
* @see org.openmrs.api.PatientService#unretirePatientIdentifierType(org.openmrs.PatientIdentifierType)
571571
*/
572572
public PatientIdentifierType unretirePatientIdentifierType(PatientIdentifierType patientIdentifierType)
573-
throws APIException {
573+
throws APIException {
574574
patientIdentifierType.setRetired(false);
575575
patientIdentifierType.setRetiredBy(null);
576576
patientIdentifierType.setDateRetired(null);
@@ -874,7 +874,7 @@ public void mergePatients(Patient preferred, Patient notPreferred) throws APIExc
874874
* if (preferred.getRace() == null || preferred.getRace().equals(""))
875875
* preferred.setRace(notPreferred.getRace());
876876
*/
877-
877+
878878
if (preferred.getBirthdate() == null || (preferred.getBirthdateEstimated() && !notPreferred.getBirthdateEstimated())) {
879879
preferred.setBirthdate(notPreferred.getBirthdate());
880880
preferred.setBirthdateEstimated(notPreferred.getBirthdateEstimated());

‎api/src/main/java/org/openmrs/hl7/handler/ORUR01Handler.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1027,14 +1027,14 @@ private Location getLocation(PV1 pv1) throws HL7Exception {
10271027
location.setLocationId(locationId);
10281028
return location;
10291029
}
1030-
1030+
10311031
/**
10321032
* needs to find a Form based on information in MSH-21. example: 16^AMRS.ELD.FORMID
10331033
*
10341034
* @param msh
10351035
* @return
10361036
* @throws HL7Exception
1037-
*/
1037+
*/
10381038
private Form getForm(MSH msh) throws HL7Exception {
10391039
Integer formId = null;
10401040
try {

‎api/src/main/java/org/openmrs/validator/ObsValidator.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ public boolean supports(Class c) {
6060
* @should fail validation if concept datatype is numeric and valueNumeric is null
6161
* @should fail validation if concept datatype is text and valueText is null
6262
* @should fail validation if obs ancestors contains obs
63-
* @should pass validation if all values present
63+
* @should pass validation if all values present
6464
* @should fail validation if the parent obs has values
6565
* @should reject an invalid concept and drug combination
66-
* @should pass if answer concept and concept of value drug match
66+
* @should pass if answer concept and concept of value drug match
6767
*/
6868
public void validate(Object obj, Errors errors) {
6969
Obs obs = (Obs) obj;

‎api/src/test/java/org/openmrs/api/PatientServiceTest.java

+26-26
Large diffs are not rendered by default.

‎api/src/test/java/org/openmrs/hl7/handler/ORUR01HandlerTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -944,16 +944,16 @@ public void parseObs_shouldAddCommentsToAnObservationGroup() throws Exception {
944944
}
945945
}
946946
Assert.assertEquals("This is a comment", newObservation.getComment());
947-
}
947+
}
948948

949949
/**
950-
* @see {@link ORUR01Handler#processMessage(Message)}
951-
*
952-
*/
953-
@Test
954-
@Verifies(value = "should set complex data for obs with complex concepts", method = "processMessage(Message)")
955-
public void processMessage_shouldSetComplexDataForObsWithComplexConcepts() throws Exception {
956-
ObsHandler handler = new ObsHandler();
950+
* @see {@link ORUR01Handler#processMessage(Message)}
951+
*
952+
*/
953+
@Test
954+
@Verifies(value = "should set complex data for obs with complex concepts", method = "processMessage(Message)")
955+
public void processMessage_shouldSetComplexDataForObsWithComplexConcepts() throws Exception {
956+
ObsHandler handler = new ObsHandler();
957957
final String handlerName = "NeigborHandler";
958958
final String data = "{\"firstname\":\"Horatio\"}";
959959
Context.getObsService().registerHandler(handlerName, handler);
@@ -971,7 +971,7 @@ public void processMessage_shouldSetComplexDataForObsWithComplexConcepts() throw
971971
Context.getObsService().removeHandler(handlerName);
972972
}
973973
Assert.assertEquals(data, handler.getCreatedObs().getComplexData().getData());
974-
}
974+
}
975975

976976
private class ObsHandler implements ComplexObsHandler {
977977

@@ -999,5 +999,5 @@ public Obs getObs(Obs obs, String view) {
999999
public boolean purgeComplexData(Obs obs) {
10001000
return false;
10011001
}
1002-
}
1002+
}
10031003
}

‎web/src/main/java/org/openmrs/web/filter/initialization/InitializationFilter.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ public void run() {
795795
}
796796

797797
// connect via jdbc with root user and create an openmrs user
798-
String host="'%'";
798+
String host = "'%'";
799799
if (wizardModel.databaseConnection.contains("localhost")) {
800800
host = "'localhost'";
801801
}

‎web/src/test/java/org/openmrs/web/controller/ConceptFormControllerTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -759,15 +759,15 @@ public void onSubmit_shouldVoidASynonymMarkedAsPreferredWhenItIsRemoved() throws
759759
}
760760

761761
/**
762-
* @see ConceptFormController#onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)
763-
* @verifies not save changes if there are validation errors
764-
*/
765-
@Test
766-
@NotTransactional
767-
public void onSubmit_shouldNotSaveChangesIfThereAreValidationErrors() throws Exception {
768-
Integer conceptId = 792;
769-
770-
MockHttpServletRequest request = new MockHttpServletRequest("POST", "/dictionary/concept.form");
762+
* @see ConceptFormController#onSubmit(HttpServletRequest,HttpServletResponse,Object,BindException)
763+
* @verifies not save changes if there are validation errors
764+
*/
765+
@Test
766+
@NotTransactional
767+
public void onSubmit_shouldNotSaveChangesIfThereAreValidationErrors() throws Exception {
768+
Integer conceptId = 792;
769+
770+
MockHttpServletRequest request = new MockHttpServletRequest("POST", "/dictionary/concept.form");
771771
request.setParameter("conceptId", conceptId.toString());
772772
request.setParameter("namesByLocale[en].name", "should not change");
773773
request.setParameter("preferredNamesByLocale[en]", "should not change");
@@ -781,5 +781,5 @@ public void onSubmit_shouldNotSaveChangesIfThereAreValidationErrors() throws Exc
781781

782782
Concept concept = conceptService.getConcept(conceptId);
783783
assertEquals("STAVUDINE LAMIVUDINE AND NEVIRAPINE", concept.getPreferredName(Locale.ENGLISH).getName());
784-
}
784+
}
785785
}

‎web/src/test/java/org/openmrs/web/test/WebTestHelper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public Response handle(final HttpServletRequest request) throws Exception {
134134
}
135135

136136
Assert.assertTrue("The requested URI has no handlers: " + request.getRequestURI(), supported);
137-
137+
138138
return new Response(response, request.getSession(), modelAndView);
139139
}
140140

0 commit comments

Comments
 (0)
Please sign in to comment.