/** * If supplied value(s), any resource references at the specified paths will have their * resource versions encoded instead of being automatically stripped during the encoding * process. This setting has no effect on the parsing process. * <p> * This method provides a finer-grained level of control than {@link #setStripVersionsFromReferences(boolean)} * and any paths specified by this method will be encoded even if {@link #setStripVersionsFromReferences(boolean)} * has been set to <code>true</code> (which is the default) * </p> * * @param thePaths A collection of paths for which the resource versions will not be removed automatically * when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that * only resource name and field names with dots separating is allowed here (no repetition * indicators, FluentPath expressions, etc.) * @return Returns a reference to <code>this</code> parser so that method calls can be chained together * @see #setStripVersionsFromReferences(boolean) */ public ParserOptions setDontStripVersionsFromReferencesAtPaths(String... thePaths) { if (thePaths == null) { setDontStripVersionsFromReferencesAtPaths((List<String>) null); } else { setDontStripVersionsFromReferencesAtPaths(Arrays.asList(thePaths)); } return this; }
private boolean isStripVersionsFromReferences(CompositeChildElement theCompositeChildElement) { Boolean stripVersionsFromReferences = myStripVersionsFromReferences; if (stripVersionsFromReferences != null) { return stripVersionsFromReferences; } if (myContext.getParserOptions().isStripVersionsFromReferences() == false) { return false; } Set<String> dontStripVersionsFromReferencesAtPaths = myDontStripVersionsFromReferencesAtPaths; if (dontStripVersionsFromReferencesAtPaths != null) { if (dontStripVersionsFromReferencesAtPaths.isEmpty() == false && theCompositeChildElement.anyPathMatches(dontStripVersionsFromReferencesAtPaths)) { return false; } } dontStripVersionsFromReferencesAtPaths = myContext.getParserOptions().getDontStripVersionsFromReferencesAtPaths(); return dontStripVersionsFromReferencesAtPaths.isEmpty() != false || !theCompositeChildElement.anyPathMatches(dontStripVersionsFromReferencesAtPaths); }
private boolean isOverrideResourceIdWithBundleEntryFullUrl() { Boolean overrideResourceIdWithBundleEntryFullUrl = myOverrideResourceIdWithBundleEntryFullUrl; if (overrideResourceIdWithBundleEntryFullUrl != null) { return overrideResourceIdWithBundleEntryFullUrl; } return myContext.getParserOptions().isOverrideResourceIdWithBundleEntryFullUrl(); }
ctx.getParserOptions().setStripVersionsFromReferences(false); ctx.getParserOptions().setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference", "Patient.managingOrganization");
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.what"); return retVal; }
private boolean isStripVersionsFromReferences(CompositeChildElement theCompositeChildElement) { Boolean stripVersionsFromReferences = myStripVersionsFromReferences; if (stripVersionsFromReferences != null) { return stripVersionsFromReferences; } if (myContext.getParserOptions().isStripVersionsFromReferences() == false) { return false; } Set<String> dontStripVersionsFromReferencesAtPaths = myDontStripVersionsFromReferencesAtPaths; if (dontStripVersionsFromReferencesAtPaths != null) { if (dontStripVersionsFromReferencesAtPaths.isEmpty() == false && theCompositeChildElement.anyPathMatches(dontStripVersionsFromReferencesAtPaths)) { return false; } } dontStripVersionsFromReferencesAtPaths = myContext.getParserOptions().getDontStripVersionsFromReferencesAtPaths(); return dontStripVersionsFromReferencesAtPaths.isEmpty() != false || !theCompositeChildElement.anyPathMatches(dontStripVersionsFromReferencesAtPaths); }
private boolean isOverrideResourceIdWithBundleEntryFullUrl() { Boolean overrideResourceIdWithBundleEntryFullUrl = myOverrideResourceIdWithBundleEntryFullUrl; if (overrideResourceIdWithBundleEntryFullUrl != null) { return overrideResourceIdWithBundleEntryFullUrl; } return myContext.getParserOptions().isOverrideResourceIdWithBundleEntryFullUrl(); }
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); return retVal; }
@Bean @Primary public FhirContext fhirContextDstu3() { FhirContext retVal = FhirContext.forDstu3(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); return retVal; }
@Bean @Primary public FhirContext fhirContextDstu3() { FhirContext retVal = FhirContext.forDstu3(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); return retVal; }
/** * If supplied value(s), any resource references at the specified paths will have their * resource versions encoded instead of being automatically stripped during the encoding * process. This setting has no effect on the parsing process. * <p> * This method provides a finer-grained level of control than {@link #setStripVersionsFromReferences(boolean)} * and any paths specified by this method will be encoded even if {@link #setStripVersionsFromReferences(boolean)} * has been set to <code>true</code> (which is the default) * </p> * * @param thePaths A collection of paths for which the resource versions will not be removed automatically * when serializing, e.g. "Patient.managingOrganization" or "AuditEvent.object.reference". Note that * only resource name and field names with dots separating is allowed here (no repetition * indicators, FluentPath expressions, etc.) * @return Returns a reference to <code>this</code> parser so that method calls can be chained together * @see #setStripVersionsFromReferences(boolean) */ public ParserOptions setDontStripVersionsFromReferencesAtPaths(String... thePaths) { if (thePaths == null) { setDontStripVersionsFromReferencesAtPaths((List<String>) null); } else { setDontStripVersionsFromReferencesAtPaths(Arrays.asList(thePaths)); } return this; }
@Bean @Primary public FhirContext fhirContextR4() { FhirContext retVal = FhirContext.forR4(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.what"); return retVal; }
@Bean @Primary public FhirContext fhirContextDstu3() { FhirContext retVal = FhirContext.forDstu3(); // Don't strip versions in some places ParserOptions parserOptions = retVal.getParserOptions(); parserOptions.setDontStripVersionsFromReferencesAtPaths("AuditEvent.entity.reference"); return retVal; }