@Test public void readJSONIgnoresNullParameter() { PatientData<List<VocabularyTerm>> patientData = this.tested.readJSON(null); Assert.assertNull(patientData); }
@Override public PatientData<List<VocabularyTerm>> readJSON(JSONObject json) { try { Map<String, List<VocabularyTerm>> result = new HashMap<>(); for (String property : this.getProperties()) { JSONArray elements = json.optJSONArray(property); if (elements != null) { List<VocabularyTerm> propertyTerms = new LinkedList<>(); Iterator<Object> elementsIterator = elements.iterator(); while (elementsIterator.hasNext()) { JSONObject element = (JSONObject) elementsIterator.next(); String termId = element.optString(ID_NAME); if (termId != null) { VocabularyTerm term = this.vocabularyManager.resolveTerm(termId); propertyTerms.add(term); } } result.put(property, propertyTerms); } else { result.put(property, null); } } return new DictionaryPatientData<>(DATA_NAME, result); } catch (Exception ex) { } return null; }
GlobalQualifiersController implements PatientDataController<List<VocabularyTerm>> { @Override public PatientData<List<VocabularyTerm>> readJSON(JSONObject json) { try { Map<String, List<VocabularyTerm>> result = new HashMap<>(); for (String property : this.getProperties()) { JSONArray elements = json.optJSONArray(property); if (elements != null) { List<VocabularyTerm> propertyTerms = new LinkedList<>(); Iterator<Object> elementsIterator = elements.iterator(); while (elementsIterator.hasNext()) { JSONObject element = (JSONObject) elementsIterator.next(); String termId = element.optString(ID_NAME); if (termId != null) { VocabularyTerm term = this.vocabularyManager.resolveTerm(termId); propertyTerms.add(term); } } result.put(property, propertyTerms); } else { result.put(property, null); } } return new DictionaryPatientData<>(DATA_NAME, result); } catch (Exception ex) { } return null; } }
GlobalQualifiersController implements PatientDataController<List<VocabularyTerm>> { @Override public PatientData<List<VocabularyTerm>> readJSON(JSONObject json) { try { Map<String, List<VocabularyTerm>> result = new HashMap<>(); for (String property : this.getProperties()) { JSONArray elements = json.optJSONArray(property); if (elements != null) { List<VocabularyTerm> propertyTerms = new LinkedList<>(); Iterator<Object> elementsIterator = elements.iterator(); while (elementsIterator.hasNext()) { JSONObject element = (JSONObject) elementsIterator.next(); String termId = element.optString(ID_NAME); if (termId != null) { VocabularyTerm term = this.vocabularyManager.resolveTerm(termId); propertyTerms.add(term); } } result.put(property, propertyTerms); } else { result.put(property, null); } } return new DictionaryPatientData<>(DATA_NAME, result); } catch (Exception ex) { } return null; }  }
GlobalQualifiersController implements PatientDataController<List<VocabularyTerm>> { @Override public PatientData<List<VocabularyTerm>> readJSON(JSONObject json) { try { Map<String, List<VocabularyTerm>> result = new HashMap<>(); for (String property : this.getProperties()) { JSONArray elements = json.optJSONArray(property); if (elements != null) { List<VocabularyTerm> propertyTerms = new LinkedList<>(); Iterator<Object> elementsIterator = elements.iterator(); while (elementsIterator.hasNext()) { JSONObject element = (JSONObject) elementsIterator.next(); String termId = element.optString(ID_NAME); if (termId != null) { VocabularyTerm term = this.vocabularyManager.resolveTerm(termId); propertyTerms.add(term); } } result.put(property, propertyTerms); } else { result.put(property, null); } } return new DictionaryPatientData<>(DATA_NAME, result); } catch (Exception ex) { } return null; }  @Override PatientData<List<VocabularyTerm>> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<List<VocabularyTerm>> readJSON(JSONObject json); @Override String getName(); }
GlobalQualifiersController implements PatientDataController<List<VocabularyTerm>> { @Override public PatientData<List<VocabularyTerm>> readJSON(JSONObject json) { try { Map<String, List<VocabularyTerm>> result = new HashMap<>(); for (String property : this.getProperties()) { JSONArray elements = json.optJSONArray(property); if (elements != null) { List<VocabularyTerm> propertyTerms = new LinkedList<>(); Iterator<Object> elementsIterator = elements.iterator(); while (elementsIterator.hasNext()) { JSONObject element = (JSONObject) elementsIterator.next(); String termId = element.optString(ID_NAME); if (termId != null) { VocabularyTerm term = this.vocabularyManager.resolveTerm(termId); propertyTerms.add(term); } } result.put(property, propertyTerms); } else { result.put(property, null); } } return new DictionaryPatientData<>(DATA_NAME, result); } catch (Exception ex) { } return null; }  @Override PatientData<List<VocabularyTerm>> load(Patient patient); @Override void save(Patient patient); @Override void save(@Nonnull final Patient patient, @Nonnull final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<List<VocabularyTerm>> readJSON(JSONObject json); @Override String getName();  }