Package org.hl7.fhir.dstu2.utils
Class ProfileUtilities
- java.lang.Object
-
- org.hl7.fhir.dstu2.utils.ProfileUtilities
-
public class ProfileUtilities extends Object
This class provides a set of utility operations for working with Profiles. Key functionality: * getChildMap --? * getChildList * generateSnapshot: Given a base (snapshot) profile structure, and a differential profile, generate a new snapshot profile * generateExtensionsTable: generate the HTML for a hierarchical table presentation of the extensions * generateTable: generate the HTML for a hierarchical table presentation of a structure * summarise: describe the contents of a profile- Author:
- Grahame
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProfileUtilities.ElementDefinitionComparerstatic classProfileUtilities.ElementDefinitionHolderclassProfileUtilities.ExtensionContextstatic interfaceProfileUtilities.ProfileKnowledgeProvider
-
Field Summary
Fields Modifier and Type Field Description static StringDERIVATION_POINTERstatic StringIS_DERIVEDstatic intSTATUS_ERRORstatic intSTATUS_FATALstatic intSTATUS_HINTstatic intSTATUS_OKstatic intSTATUS_WARNINGstatic StringUD_ERROR_STATUS
-
Constructor Summary
Constructors Constructor Description ProfileUtilities(IWorkerContext context, List<org.hl7.fhir.utilities.validation.ValidationMessage> messages, ProfileUtilities.ProfileKnowledgeProvider pkp)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringdescribeExtensionContext(StructureDefinition ext)StringdescribeSlice(ElementDefinition.ElementDefinitionSlicingComponent slicing)org.hl7.fhir.utilities.xhtml.XhtmlNodegenerateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, Set<String> outputTracker)voidgenerateSchematrons(OutputStream dest, StructureDefinition structure)voidgenerateSnapshot(StructureDefinition base, StructureDefinition derived, String url, String profileName)Given a base (snapshot) profile structure, and a differential profile, generate a new snapshot profileorg.hl7.fhir.utilities.xhtml.XhtmlNodegenerateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, Set<String> outputTracker)static List<ElementDefinition>getChildList(StructureDefinition profile, String path)Given a Structure, navigate to the element given by the path and return the direct children of that elementstatic List<ElementDefinition>getChildList(StructureDefinition structure, ElementDefinition element)static List<ElementDefinition>getChildMap(StructureDefinition profile, String name, String path, String nameReference)Given a Structure, navigate to the element given by the path and return the direct children of that elementstatic List<ElementDefinition>getChildMap(StructureDefinition profile, ElementDefinition element)StructureDefinitiongetProfile(StructureDefinition source, String url)static booleanisPrimitive(String value)voidsortDifferential(StructureDefinition base, StructureDefinition diff, String name, List<String> errors)static StringtypeCode(List<ElementDefinition.TypeRefComponent> types)
-
-
-
Field Detail
-
STATUS_OK
public static final int STATUS_OK
- See Also:
- Constant Field Values
-
STATUS_HINT
public static final int STATUS_HINT
- See Also:
- Constant Field Values
-
STATUS_WARNING
public static final int STATUS_WARNING
- See Also:
- Constant Field Values
-
STATUS_ERROR
public static final int STATUS_ERROR
- See Also:
- Constant Field Values
-
STATUS_FATAL
public static final int STATUS_FATAL
- See Also:
- Constant Field Values
-
DERIVATION_POINTER
public static final String DERIVATION_POINTER
- See Also:
- Constant Field Values
-
IS_DERIVED
public static final String IS_DERIVED
- See Also:
- Constant Field Values
-
UD_ERROR_STATUS
public static final String UD_ERROR_STATUS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProfileUtilities
public ProfileUtilities(IWorkerContext context, List<org.hl7.fhir.utilities.validation.ValidationMessage> messages, ProfileUtilities.ProfileKnowledgeProvider pkp)
-
-
Method Detail
-
getChildMap
public static List<ElementDefinition> getChildMap(StructureDefinition profile, String name, String path, String nameReference) throws org.hl7.fhir.exceptions.DefinitionException
Given a Structure, navigate to the element given by the path and return the direct children of that element- Parameters:
structure- The structure to navigate intopath- The path of the element within the structure to get the children for- Returns:
- A Map containing the name of the element child (not the path) and the child itself (an Element)
- Throws:
org.hl7.fhir.exceptions.DefinitionExceptionException
-
getChildMap
public static List<ElementDefinition> getChildMap(StructureDefinition profile, ElementDefinition element) throws org.hl7.fhir.exceptions.DefinitionException
- Throws:
org.hl7.fhir.exceptions.DefinitionException
-
getChildList
public static List<ElementDefinition> getChildList(StructureDefinition profile, String path)
Given a Structure, navigate to the element given by the path and return the direct children of that element- Parameters:
structure- The structure to navigate intopath- The path of the element within the structure to get the children for- Returns:
- A List containing the element children (all of them are Elements)
-
getChildList
public static List<ElementDefinition> getChildList(StructureDefinition structure, ElementDefinition element)
-
generateSnapshot
public void generateSnapshot(StructureDefinition base, StructureDefinition derived, String url, String profileName) throws org.hl7.fhir.exceptions.DefinitionException, org.hl7.fhir.exceptions.FHIRException
Given a base (snapshot) profile structure, and a differential profile, generate a new snapshot profile- Parameters:
base- - the base structure on which the differential will be applieddifferential- - the differential to apply to the baseurl- - where the base has relative urls for profile references, these need to be converted to absolutes by prepending this URLtrimDifferential- - if this is true, then the snap short generator will remove any material in the element definitions that is not different to the base- Throws:
org.hl7.fhir.exceptions.FHIRExceptionorg.hl7.fhir.exceptions.DefinitionExceptionException
-
typeCode
public static String typeCode(List<ElementDefinition.TypeRefComponent> types)
-
generateExtensionTable
public org.hl7.fhir.utilities.xhtml.XhtmlNode generateExtensionTable(String defFile, StructureDefinition ed, String imageFolder, boolean inlineGraphics, boolean full, String corePath, Set<String> outputTracker) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
describeExtensionContext
public static String describeExtensionContext(StructureDefinition ext)
-
generateTable
public org.hl7.fhir.utilities.xhtml.XhtmlNode generateTable(String defFile, StructureDefinition profile, boolean diff, String imageFolder, boolean inlineGraphics, String profileBaseFileName, boolean snapshot, String corePath, Set<String> outputTracker) throws IOException, org.hl7.fhir.exceptions.FHIRException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.FHIRException
-
describeSlice
public String describeSlice(ElementDefinition.ElementDefinitionSlicingComponent slicing)
-
isPrimitive
public static boolean isPrimitive(String value)
-
getProfile
public StructureDefinition getProfile(StructureDefinition source, String url)
-
sortDifferential
public void sortDifferential(StructureDefinition base, StructureDefinition diff, String name, List<String> errors)
-
generateSchematrons
public void generateSchematrons(OutputStream dest, StructureDefinition structure) throws IOException, org.hl7.fhir.exceptions.DefinitionException
- Throws:
IOExceptionorg.hl7.fhir.exceptions.DefinitionException
-
-