@Override public IBaseResource parseResource(Reader theReader) throws ConfigurationException, DataFormatException { return parseResource(null, theReader); }
@Override public IBaseResource parseResource(String theMessageString) throws ConfigurationException, DataFormatException { return parseResource(null, theMessageString); }
@SuppressWarnings("cast") @Override public <T extends IBaseResource> T parseResource(Class<T> theResourceType, String theMessageString) { StringReader reader = new StringReader(theMessageString); return parseResource(theResourceType, reader); }
@Override public IBaseResource parseResource(InputStream theInputStream) throws DataFormatException { return parseResource(new InputStreamReader(theInputStream, Charsets.UTF_8)); }
@Override public IBaseResource parseResource(String theMessageString) throws ConfigurationException, DataFormatException { return parseResource(null, theMessageString); }
@Override public IBaseResource parseResource(Reader theReader) throws ConfigurationException, DataFormatException { return parseResource(null, theReader); }
@Override public <T extends IBaseResource> T parseResource(Class<T> theResourceType, Reader theReader) throws DataFormatException { /* * We do this so that the context can verify that the structure is for * the correct FHIR version */ if (theResourceType != null) { myContext.getResourceDefinition(theResourceType); } // Actually do the parse T retVal = doParseResource(theResourceType, theReader); RuntimeResourceDefinition def = myContext.getResourceDefinition(retVal); if ("Bundle".equals(def.getName())) { BaseRuntimeChildDefinition entryChild = def.getChildByName("entry"); BaseRuntimeElementCompositeDefinition<?> entryDef = (BaseRuntimeElementCompositeDefinition<?>) entryChild.getChildByName("entry"); List<IBase> entries = entryChild.getAccessor().getValues(retVal); if (entries != null) { for (IBase nextEntry : entries) { /** * If Bundle.entry.fullUrl is populated, set the resource ID to that */ // TODO: should emit a warning and maybe notify the error handler if the resource ID doesn't match the // fullUrl idPart BaseRuntimeChildDefinition fullUrlChild = entryDef.getChildByName("fullUrl"); if (fullUrlChild == null) {
@SuppressWarnings("cast") @Override public <T extends IBaseResource> T parseResource(Class<T> theResourceType, String theMessageString) { StringReader reader = new StringReader(theMessageString); return parseResource(theResourceType, reader); }
@Override public IBaseResource parseResource(InputStream theInputStream) throws DataFormatException { return parseResource(new InputStreamReader(theInputStream, Charsets.UTF_8)); }
@Override public <T extends IBaseResource> T parseResource(Class<T> theResourceType, Reader theReader) throws DataFormatException { /* * We do this so that the context can verify that the structure is for * the correct FHIR version */ if (theResourceType != null) { myContext.getResourceDefinition(theResourceType); } // Actually do the parse T retVal = doParseResource(theResourceType, theReader); RuntimeResourceDefinition def = myContext.getResourceDefinition(retVal); if ("Bundle".equals(def.getName())) { BaseRuntimeChildDefinition entryChild = def.getChildByName("entry"); BaseRuntimeElementCompositeDefinition<?> entryDef = (BaseRuntimeElementCompositeDefinition<?>) entryChild.getChildByName("entry"); List<IBase> entries = entryChild.getAccessor().getValues(retVal); if (entries != null) { for (IBase nextEntry : entries) { /** * If Bundle.entry.fullUrl is populated, set the resource ID to that */ // TODO: should emit a warning and maybe notify the error handler if the resource ID doesn't match the // fullUrl idPart BaseRuntimeChildDefinition fullUrlChild = entryDef.getChildByName("fullUrl"); if (fullUrlChild == null) {