File tree Expand file tree Collapse file tree
sormas-api/src/main/java/de/symeda/sormas/api/symptoms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,20 +43,26 @@ private SymptomsComparisonHelper() {
4343 /**
4444 * Checks if there is a mismatch between two SymptomsDto objects.
4545 *
46- * @param caseSymptoms
46+ * @param symptomsA
4747 * The symptoms from the case
48- * @param externalMessageSymptoms
48+ * @param symptomsB
4949 * The symptoms from the external message
5050 * @return true if there is a mismatch between the two symptom objects, false otherwise
5151 */
52- public static boolean hasCaseSymptomsMismatch (SymptomsDto caseSymptoms , SymptomsDto externalMessageSymptoms ) {
53- Map <String , Object > externalMessageSymptomsMap = getComparableSymptomsValues (externalMessageSymptoms );
52+ public static boolean hasCaseSymptomsMismatch (SymptomsDto symptomsA , SymptomsDto symptomsB ) {
53+ Map <String , Object > externalMessageSymptomsMap = getComparableSymptomsValues (symptomsB );
5454 if (externalMessageSymptomsMap .isEmpty ()) {
5555 return false ;
5656 }
5757
58- Map <String , Object > caseSymptomsMap = getComparableSymptomsValues (caseSymptoms );
59- return !caseSymptomsMap .equals (externalMessageSymptomsMap );
58+ Map <String , Object > caseSymptomsMap = getComparableSymptomsValues (symptomsA );
59+ for (Map .Entry <String , Object > entry : externalMessageSymptomsMap .entrySet ()) {
60+ Object caseValue = caseSymptomsMap .get (entry .getKey ());
61+ if (caseValue == null || !caseValue .equals (entry .getValue ())) {
62+ return true ;
63+ }
64+ }
65+ return false ;
6066 }
6167
6268 /**
You can’t perform that action at this time.
0 commit comments