Feature/dynamic content (#605)
* Added dynamic content options * Added defaults * Added sane defaults * Added IG operation providers for run time installation of IG's * Refactored conditions for enabling the provider * Refactoring * Disable it by default in config as well * document package install feature * Added hosting options * Provided better custom defaults * Removed double default files --------- Co-authored-by: Jose Costa Teixeira <jose.a.teixeira@gmail.com>
This commit is contained in:
committed by
GitHub
parent
f6671f97c5
commit
9e21d8062e
@@ -9,20 +9,10 @@ import java.io.IOException;
|
||||
public interface IImplementationGuideOperationProvider {
|
||||
static PackageInstallationSpec toPackageInstallationSpec(byte[] npmPackageAsByteArray) throws IOException {
|
||||
NpmPackage npmPackage = NpmPackage.fromPackage(new ByteArrayInputStream(npmPackageAsByteArray));
|
||||
return new PackageInstallationSpec()
|
||||
.setName(npmPackage.name())
|
||||
.setPackageContents(npmPackageAsByteArray)
|
||||
.setVersion(npmPackage.version())
|
||||
.setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL)
|
||||
.setFetchDependencies(false);
|
||||
return new PackageInstallationSpec().setName(npmPackage.name()).setPackageContents(npmPackageAsByteArray).setVersion(npmPackage.version()).setInstallMode(PackageInstallationSpec.InstallModeEnum.STORE_AND_INSTALL).setFetchDependencies(false);
|
||||
}
|
||||
|
||||
// The following declaration is the one that counts but cannot be used across different versions as stating
|
||||
// Base64BinaryType would bind to a separate version
|
||||
// @Operation(name = "$install", typeName = "ImplementationGuide")
|
||||
|
||||
// The following declaration is the one that counts but cannot be used across different versions as stating Base64BinaryType would bind to a separate version
|
||||
// Parameters install(@OperationParam(name = "npmContent",min = 1, max = 1) Base64BinaryType implementationGuide);
|
||||
|
||||
// Parameters uninstall(@OperationParam(name = "name", min = 1, max = 1) String name, @OperationParam(name = "version", min = 1, max = 1) String version) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -23,12 +23,10 @@ public class ImplementationGuideR4OperationProvider implements IImplementationGu
|
||||
}
|
||||
|
||||
@Operation(name = "$install", typeName = "ImplementationGuide")
|
||||
public Parameters install(
|
||||
@OperationParam(name = "npmContent", min = 1, max = 1) Base64BinaryType implementationGuide) {
|
||||
public Parameters install(@OperationParam(name = "npmContent", min = 1, max = 1) Base64BinaryType implementationGuide) {
|
||||
try {
|
||||
|
||||
packageInstallerSvc.install(
|
||||
IImplementationGuideOperationProvider.toPackageInstallationSpec(implementationGuide.getValue()));
|
||||
packageInstallerSvc.install(IImplementationGuideOperationProvider.toPackageInstallationSpec(implementationGuide.getValue()));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -36,10 +34,10 @@ public class ImplementationGuideR4OperationProvider implements IImplementationGu
|
||||
}
|
||||
|
||||
@Operation(name = "$uninstall", typeName = "ImplementationGuide")
|
||||
public Parameters uninstall(
|
||||
@OperationParam(name = "name", min = 1, max = 1) String name, @OperationParam(name = "version", min = 1, max = 1) String version) {
|
||||
public Parameters uninstall(@OperationParam(name = "name", min = 1, max = 1) String name, @OperationParam(name = "version", min = 1, max = 1) String version) {
|
||||
|
||||
packageInstallerSvc.uninstall(new PackageInstallationSpec().setName(name).setVersion(version));
|
||||
return new Parameters();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -23,21 +23,19 @@ public class ImplementationGuideR5OperationProvider implements IImplementationGu
|
||||
}
|
||||
|
||||
@Operation(name = "$install", typeName = "ImplementationGuide")
|
||||
public Parameters install(
|
||||
@OperationParam(name = "npmContent", min = 1, max = 1) Base64BinaryType implementationGuide) {
|
||||
public Parameters install(@OperationParam(name = "npmContent", min = 1, max = 1) Base64BinaryType implementationGuide) {
|
||||
try {
|
||||
|
||||
packageInstallerSvc.install(
|
||||
IImplementationGuideOperationProvider.toPackageInstallationSpec(implementationGuide.getValue()));
|
||||
packageInstallerSvc.install(IImplementationGuideOperationProvider.toPackageInstallationSpec(implementationGuide.getValue()));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
return new Parameters();
|
||||
}
|
||||
|
||||
|
||||
@Operation(name = "$uninstall", typeName = "ImplementationGuide")
|
||||
public org.hl7.fhir.r4.model.Parameters uninstall(
|
||||
@OperationParam(name = "name", min = 1, max = 1) String name, @OperationParam(name = "version", min = 1, max = 1) String version) {
|
||||
public org.hl7.fhir.r4.model.Parameters uninstall(@OperationParam(name = "name", min = 1, max = 1) String name, @OperationParam(name = "version", min = 1, max = 1) String version) {
|
||||
|
||||
packageInstallerSvc.uninstall(new PackageInstallationSpec().setName(name).setVersion(version));
|
||||
return new org.hl7.fhir.r4.model.Parameters();
|
||||
|
||||
Reference in New Issue
Block a user