FHIRTransform implements ExchangeTransforms<Bundle> { @Override public OrganizationListType transform(Bundle bundle) throws ExchangeTransformException { try { return buildOrganization(FHIRTransformHelper.extractFhirOrgResourceList(bundle)); } catch (Exception ex) { LOG.error("Transforming FHIR data resulted in exception: {}", ex.getLocalizedMessage(), ex); throw new ExchangeTransformException(ex); } }  @Override OrganizationListType transform(Bundle bundle);  }
@Test public void testTransformXml() { try { Bundle bundle = readTestData(XML_FILE, XML); FHIRTransform transformer = new FHIRTransform(); assertTransformedObject(transformer.transform(bundle)); } catch (UnsupportedEncodingException | ExchangeTransformException | FHIRFormatError ex) { LOG.error("Unable to read test data: {}", ex.getLocalizedMessage(), ex); } }
@Test public void testTransformJson() { try { Bundle bundle = readTestData(JSON_FILE, JSON); FHIRTransform transformer = new FHIRTransform(); assertTransformedObject(transformer.transform(bundle)); } catch (UnsupportedEncodingException | ExchangeTransformException | FHIRFormatError ex) { fail("testTransformJson failed with exception: " + ex.getLocalizedMessage()); } }