Skip to content

Commit

Permalink
added missing uninstall (#643)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkiddo authored Feb 14, 2024
1 parent bb8f620 commit 7e82e63
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ static PackageInstallationSpec toPackageInstallationSpec(byte[] npmPackageAsByte
// 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")

// 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) ;

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca.uhn.fhir.jpa.starter.ig;

import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
import ca.uhn.fhir.jpa.starter.annotations.OnR4Condition;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
Expand Down Expand Up @@ -33,4 +34,12 @@ public Parameters install(
}
return new Parameters();
}

@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) {

packageInstallerSvc.uninstall(new PackageInstallationSpec().setName(name).setVersion(version));
return new Parameters();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package ca.uhn.fhir.jpa.starter.ig;

import ca.uhn.fhir.jpa.packages.IPackageInstallerSvc;
import ca.uhn.fhir.jpa.packages.PackageInstallationSpec;
import ca.uhn.fhir.jpa.starter.annotations.OnR5Condition;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
Expand All @@ -13,7 +14,7 @@

@Conditional({OnR5Condition.class, IgConfigCondition.class})
@Service
public class ImplementationGuideR5OperationProvider {
public class ImplementationGuideR5OperationProvider implements IImplementationGuideOperationProvider {

IPackageInstallerSvc packageInstallerSvc;

Expand All @@ -33,4 +34,12 @@ public Parameters install(
}
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) {

packageInstallerSvc.uninstall(new PackageInstallationSpec().setName(name).setVersion(version));
return new org.hl7.fhir.r4.model.Parameters();
}
}

0 comments on commit 7e82e63

Please sign in to comment.