Hack for wrong URLs in subscriptions backport
This commit is contained in:
parent
87b756e0c7
commit
12cdccf3bb
|
@ -123,7 +123,7 @@ public class R4BToR5Loader extends BaseLoaderR5 implements IContextResourceLoade
|
||||||
if (killPrimitives) {
|
if (killPrimitives) {
|
||||||
throw new FHIRException("Cannot kill primitives when using deferred loading");
|
throw new FHIRException("Cannot kill primitives when using deferred loading");
|
||||||
}
|
}
|
||||||
if (r5 instanceof StructureDefinition && VersionUtilities.isR4BVer(version)) {
|
if (r5 instanceof StructureDefinition) {
|
||||||
r5 = new StructureDefinitionHacker(version).fixSD((StructureDefinition) r5);
|
r5 = new StructureDefinitionHacker(version).fixSD((StructureDefinition) r5);
|
||||||
}
|
}
|
||||||
if (patchUrls) {
|
if (patchUrls) {
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class R4ToR5Loader extends BaseLoaderR5 implements IContextResourceLoader
|
||||||
if (killPrimitives) {
|
if (killPrimitives) {
|
||||||
throw new FHIRException("Cannot kill primitives when using deferred loading");
|
throw new FHIRException("Cannot kill primitives when using deferred loading");
|
||||||
}
|
}
|
||||||
if (r5 instanceof StructureDefinition && VersionUtilities.isR4Ver(version)) {
|
if (r5 instanceof StructureDefinition) {
|
||||||
r5 = new StructureDefinitionHacker(version).fixSD((StructureDefinition) r5);
|
r5 = new StructureDefinitionHacker(version).fixSD((StructureDefinition) r5);
|
||||||
}
|
}
|
||||||
if (patchUrls) {
|
if (patchUrls) {
|
||||||
|
|
|
@ -49,9 +49,29 @@ public class StructureDefinitionHacker {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (sd.getUrl().startsWith("http://hl7.org/fhir/uv/subscriptions-backport")) {
|
||||||
|
for (ElementDefinition ed : sd.getDifferential().getElement()) {
|
||||||
|
fixMarkdownR4BURLs(ed);
|
||||||
|
}
|
||||||
|
for (ElementDefinition ed : sd.getSnapshot().getElement()) {
|
||||||
|
fixMarkdownR4BURLs(ed);
|
||||||
|
}
|
||||||
|
}
|
||||||
return sd;
|
return sd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void fixMarkdownR4BURLs(ElementDefinition ed) {
|
||||||
|
if (ed.hasDefinition()) {
|
||||||
|
ed.setDefinition(ed.getDefinition().replace("http://hl7.org/fhir/R4B/", "http://hl7.org/fhir/R4/"));
|
||||||
|
}
|
||||||
|
if (ed.hasComment()) {
|
||||||
|
ed.setComment(ed.getComment().replace("http://hl7.org/fhir/R4B/", "http://hl7.org/fhir/R4/"));
|
||||||
|
}
|
||||||
|
if (ed.hasRequirements()) {
|
||||||
|
ed.setRequirements(ed.getRequirements().replace("http://hl7.org/fhir/R4B/", "http://hl7.org/fhir/R4/"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void fixDocSecURL(ElementDefinition ed) {
|
private void fixDocSecURL(ElementDefinition ed) {
|
||||||
for (TypeRefComponent tr : ed.getType()) {
|
for (TypeRefComponent tr : ed.getType()) {
|
||||||
for (CanonicalType c : tr.getProfile()) {
|
for (CanonicalType c : tr.getProfile()) {
|
||||||
|
|
Loading…
Reference in New Issue