Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove an observation if its values is specified as null in POST / PATCH request
  • Loading branch information
himeshr committed Oct 11, 2023
1 parent af86a17 commit 4b42ba6
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ private static void putObservation(ConceptRepository conceptRepository, Map<Stri
String conceptDataType = concept.getDataType();
Object entryValue = entry.getValue();

Object obsValue = null;
if (entryValue != null) {
obsValue = getObsValue(conceptRepository, conceptDataType, entryValue);
observations.put(conceptUUID, getObsValue(conceptRepository, conceptDataType, entryValue));
} else {
observations.remove(conceptUUID);
}
observations.put(conceptUUID, obsValue);
}

private static Object getObsValue(ConceptRepository conceptRepository, String conceptDataType, Object newValue) {
Expand Down

0 comments on commit 4b42ba6

Please sign in to comment.