@Test public void load() throws ComponentLookupException { PatientData<Object> result = this.mocker.getComponentUnderTest().load(this.patient); Assert.assertTrue(result.isNamed()); Assert.assertEquals("specificity", result.getName()); Assert.assertEquals(0.25, (double) result.get("score"), 0.0); Assert.assertEquals(this.dateStr, result.get("date")); Assert.assertEquals("monarchinitiative.org", result.get("server")); }
@Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; } }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  @Override void initialize(); @Override PatientData<Object> load(Patient patient); @Override void save(Patient patient); @Override void save(final Patient patient, final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<Object> readJSON(JSONObject json); @Override String getName(); }
SpecificityController implements PatientDataController<Object>, Initializable { @Override public PatientData<Object> load(Patient patient) { PatientSpecificity spec = this.service.getSpecificity(patient); if (spec != null) { Map<String, Object> data = new LinkedHashMap<String, Object>(); data.put("score", spec.getScore()); data.put("date", this.isoDateFormat.format(spec.getComputationDate())); data.put("server", spec.getComputingMethod()); return new DictionaryPatientData<Object>(NAME, data); } return null; }  @Override void initialize(); @Override PatientData<Object> load(Patient patient); @Override void save(Patient patient); @Override void save(final Patient patient, final PatientWritePolicy policy); @Override void writeJSON(Patient patient, JSONObject json); @Override void writeJSON(Patient patient, JSONObject json, Collection<String> selectedFieldNames); @Override PatientData<Object> readJSON(JSONObject json); @Override String getName();  }