Open shansamlu opened 5 years ago
Same problem... any suggestions...
Hi @jamesagnew
I have also faced this same issue, and have looked into the implementation.
As per the hapi-fhir-cli, it should support:
-v,--fhir-version
However, as per the implementation, it only supports "DSTU3" https://github.com/jamesagnew/hapi-fhir/blob/22413911bff4fc9de814982e74facdfd5509b0f2/hapi-fhir-cli/hapi-fhir-cli-api/src/main/java/ca/uhn/fhir/cli/IgPackUploader.java#L91
for (File nextFile : files) {
FhirContext ctx = getFhirContext();
switch (ctx.getVersion().getVersion()) {
case DSTU3:
IgPackParserDstu3 packParser = new IgPackParserDstu3(ctx);
IValidationSupport ig = null;
try {
ig = packParser.parseIg(new FileInputStream(nextFile), nextFile.getName());
} catch (FileNotFoundException e) {
throw new CommandFailureException(e);
}
Iterable<IBaseResource> conformanceResources = ig.fetchAllConformanceResources();
for (IBaseResource nextResource : conformanceResources) {
String nextResourceUrl = ((IPrimitiveType<?>)ctx.newTerser().getSingleValueOrNull(nextResource, "url")).getValueAsString();
ourLog.info("Uploading resource: {}", nextResourceUrl);
client
.update()
.resource(nextResource)
.conditional()
.and(StructureDefinition.URL.matches().value(nextResourceUrl))
.execute();
}
break;
default:
throw new ParseException("This command does not support FHIR version " + ctx.getVersion().getVersion());
}
Any idea/workaround on this? Seems like a pretty big gap IMHO.....
Describe the issue Please continue to support upload-igpack for FHIR version R4.
Environment (please complete the following information):