work around issue where constraint.source is not populated properly in base packages

This commit is contained in:
Grahame Grieve 2020-04-02 11:03:35 +11:00
parent 1da57be1c0
commit bdad4d9a6b
1 changed files with 13 additions and 2 deletions

View File

@ -589,7 +589,18 @@ public class ProfileUtilities extends TranslatingUtilities {
for (ElementDefinition ed : derived.getSnapshot().getElement()) { for (ElementDefinition ed : derived.getSnapshot().getElement()) {
for (ElementDefinitionMappingComponent mm : ed.getMapping()) { for (ElementDefinitionMappingComponent mm : ed.getMapping()) {
mm.setMap(mm.getMap().trim()); mm.setMap(mm.getMap().trim());
}
for (ElementDefinitionConstraintComponent s : ed.getConstraint()) {
if (s.hasSource()) {
String ref = s.getSource();
if (!Utilities.isAbsoluteUrl(ref)) {
if (ref.contains(".")) {
s.setSource("http://hl7.org/fhir/StructureDefinition/"+ref.substring(0, ref.indexOf("."))+"#"+ref);
} else {
s.setSource("http://hl7.org/fhir/StructureDefinition/"+ref);
}
}
}
} }
} }
if (derived.getDerivation() == TypeDerivationRule.SPECIALIZATION) { if (derived.getDerivation() == TypeDerivationRule.SPECIALIZATION) {