@Override public List<ExtensionDt> getUndeclaredExtensionsByUrl(String theUrl) { org.apache.commons.lang3.Validate.notNull(theUrl, "URL can not be null"); ArrayList<ExtensionDt> retVal = new ArrayList<ExtensionDt>(); for (ExtensionDt next : getAllUndeclaredExtensions()) { if (theUrl.equals(next.getUrlAsString())) { retVal.add(next); } } return Collections.unmodifiableList(retVal); }
@Override public List<ExtensionDt> getUndeclaredExtensionsByUrl(String theUrl) { org.apache.commons.lang3.Validate.notNull(theUrl, "URL can not be null"); ArrayList<ExtensionDt> retVal = new ArrayList<ExtensionDt>(); for (ExtensionDt next : getAllUndeclaredExtensions()) { if (theUrl.equals(next.getUrlAsString())) { retVal.add(next); } } return Collections.unmodifiableList(retVal); }
@Test public void test() throws URISyntaxException { IDomainFactory<BaseResource> factory = DomainFactory.getInstance(); Patient pat1 = factory.fetchObject(Patient.class, "1"); assertNotNull(pat1); for (ExtensionDt extension : pat1.getAllUndeclaredExtensions()) { System.out.println(extension.getUrlAsString() + "=" + extension.getValue()); } List<Patient> patients = factory.fetchObjects(Patient.class, PAT_IDS); assertNotNull(patients); assertEquals(2, patients.size()); DocumentReference dr = factory.fetchObject(DocumentReference.class, "1"); assertNotNull(dr); UriDt uri = dr.getContentFirstRep().getUrlElement(); IGenericClient client = ClientUtil.getFhirClient(); Binary result = (Binary) client.read(uri); assertNotNull(result); byte[] text = result.getContent(); System.out.println(new String(text)); Condition cond = factory.fetchObject(Condition.class, "1"); assertNotNull(cond); testException(client, ROOT + "Patient/309349993439"); }