make sure snapshots are generated when fetching types
This commit is contained in:
parent
f598ade02c
commit
33776523ae
|
@ -8,7 +8,7 @@ import org.hl7.fhir.r5.model.StructureDefinition;
|
||||||
import org.hl7.fhir.utilities.VersionUtilities;
|
import org.hl7.fhir.utilities.VersionUtilities;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This doesn't do anythign at this time
|
* This works around known issues in struture definitions
|
||||||
*
|
*
|
||||||
* @author graha
|
* @author graha
|
||||||
*
|
*
|
||||||
|
@ -48,7 +48,7 @@ public class StructureDefinitionHacker {
|
||||||
ed.setComment("e.g. The patient is a pregnant, has congestive heart failure, has an Adenocarcinoma, and is allergic to penicillin.");
|
ed.setComment("e.g. The patient is a pregnant, has congestive heart failure, has an Adenocarcinoma, and is allergic to penicillin.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return sd;
|
return sd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2472,7 +2472,30 @@ public abstract class BaseWorkerContext extends I18nBase implements IWorkerConte
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return typeManager.fetchTypeDefinition(typeName);
|
StructureDefinition p = typeManager.fetchTypeDefinition(typeName);
|
||||||
|
if (p != null && !p.isGeneratedSnapshot()) {
|
||||||
|
if (p.isGeneratingSnapshot()) {
|
||||||
|
throw new FHIRException("Attempt to fetch the profile "+p.getVersionedUrl()+" while generating the snapshot for it");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
if (logger.isDebugLogging()) {
|
||||||
|
System.out.println("Generating snapshot for "+p.getVersionedUrl());
|
||||||
|
}
|
||||||
|
p.setGeneratingSnapshot(true);
|
||||||
|
try {
|
||||||
|
new ContextUtilities(this).generateSnapshot(p);
|
||||||
|
} finally {
|
||||||
|
p.setGeneratingSnapshot(false);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// not sure what to do in this case?
|
||||||
|
System.out.println("Unable to generate snapshot @4 for "+p.getVersionedUrl()+": "+e.getMessage());
|
||||||
|
if (logger.isDebugLogging()) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue