
Package org.hl7.fhir.r5.test.utils
Class TestPackageLoader
java.lang.Object
org.hl7.fhir.r5.test.utils.TestPackageLoader
- All Implemented Interfaces:
IContextResourceLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlet's the loader change the identified type (e.g. when loading converted Basic resources)called when processing R2 for implicit code systems in ValueSetsgetNewLoader(org.hl7.fhir.utilities.npm.NpmPackage npm) called when a new package is being loaded this is called by loadPackageAndDependencies when a new package is loadedgetResourcePath(Resource resource) get the path for references to this resource.getTypes()loadBundle(InputStream stream, boolean isJson) Request to actually load the resources and do whatever is requiredloadResource(InputStream stream, boolean isJson) Load a single resources (lazy load)patch the URL if necessaryreviewActualTypes(Set<String> types) let's the loader review the R5 list of resources being asked for, and add Basic or other names as requiredsetLoadProfiles(boolean value) set this to false (default is true) if you don't want profiles loadedvoidsetPatchUrls(boolean value) if this is true, then the loader will patch canonical URLs and cross-links to add /X.X/ into the URL so that different versions can be loaded safely default is falsebooleanwantLoad(org.hl7.fhir.utilities.npm.NpmPackage pi, org.hl7.fhir.utilities.npm.NpmPackage.PackageResourceInformation pri) Called during the loading process - the loader can decide which resources to load.
-
Constructor Details
-
TestPackageLoader
-
-
Method Details
-
loadBundle
public Bundle loadBundle(InputStream stream, boolean isJson) throws org.hl7.fhir.exceptions.FHIRException, IOException Description copied from interface:IContextResourceLoaderRequest to actually load the resources and do whatever is required- Specified by:
loadBundlein interfaceIContextResourceLoader- Parameters:
stream-isJson-- Returns:
- A bundle because some single resources become multiple resources after loading
- Throws:
org.hl7.fhir.exceptions.FHIRExceptionIOException
-
loadResource
public Resource loadResource(InputStream stream, boolean isJson) throws org.hl7.fhir.exceptions.FHIRException, IOException Description copied from interface:IContextResourceLoaderLoad a single resources (lazy load)- Specified by:
loadResourcein interfaceIContextResourceLoader- Parameters:
stream-isJson-- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRException- - throw this if you a single resource can't be returned - can't lazy load in this circumstanceIOException
-
getTypes
- Specified by:
getTypesin interfaceIContextResourceLoader- Returns:
- List of the resource types that should be loaded
-
getResourcePath
Description copied from interface:IContextResourceLoaderget the path for references to this resource.- Specified by:
getResourcePathin interfaceIContextResourceLoader- Parameters:
resource-- Returns:
- null if not tracking paths
-
getNewLoader
Description copied from interface:IContextResourceLoadercalled when a new package is being loaded this is called by loadPackageAndDependencies when a new package is loaded- Specified by:
getNewLoaderin interfaceIContextResourceLoader- Parameters:
npm-- Returns:
-
getCodeSystems
Description copied from interface:IContextResourceLoadercalled when processing R2 for implicit code systems in ValueSets- Specified by:
getCodeSystemsin interfaceIContextResourceLoader- Returns:
-
setPatchUrls
Description copied from interface:IContextResourceLoaderif this is true, then the loader will patch canonical URLs and cross-links to add /X.X/ into the URL so that different versions can be loaded safely default is false- Specified by:
setPatchUrlsin interfaceIContextResourceLoader
-
patchUrl
Description copied from interface:IContextResourceLoaderpatch the URL if necessary- Specified by:
patchUrlin interfaceIContextResourceLoader- Parameters:
url-- Returns:
-
setLoadProfiles
Description copied from interface:IContextResourceLoaderset this to false (default is true) if you don't want profiles loaded- Specified by:
setLoadProfilesin interfaceIContextResourceLoader- Parameters:
value-- Returns:
-
wantLoad
public boolean wantLoad(org.hl7.fhir.utilities.npm.NpmPackage pi, org.hl7.fhir.utilities.npm.NpmPackage.PackageResourceInformation pri) Description copied from interface:IContextResourceLoaderCalled during the loading process - the loader can decide which resources to load. At this point, only the .index.json is being read- Specified by:
wantLoadin interfaceIContextResourceLoader- Parameters:
pi-pri-- Returns:
-
txFactory
- Specified by:
txFactoryin interfaceIContextResourceLoader- Returns:
- the terminology client factory
-
reviewActualTypes
Description copied from interface:IContextResourceLoaderlet's the loader review the R5 list of resources being asked for, and add Basic or other names as required- Specified by:
reviewActualTypesin interfaceIContextResourceLoader- Parameters:
types-- Returns:
-
editInfo
public SimpleWorkerContext.PackageResourceLoader editInfo(SimpleWorkerContext.PackageResourceLoader pri) Description copied from interface:IContextResourceLoaderlet's the loader change the identified type (e.g. when loading converted Basic resources)- Specified by:
editInfoin interfaceIContextResourceLoader- Returns:
-