Package org.hl7.fhir.r5.conformance
Class ProfileComparer
- java.lang.Object
-
- org.hl7.fhir.r5.conformance.ProfileComparer
-
- All Implemented Interfaces:
ProfileUtilities.ProfileKnowledgeProvider
public class ProfileComparer extends Object implements ProfileUtilities.ProfileKnowledgeProvider
A engine that generates difference analysis between two sets of structure definitions, typically from 2 different implementation guides. How this class works is that you create it with access to a bunch of underying resources that includes all the structure definitions from both implementation guides Once the class is created, you repeatedly pass pairs of structure definitions, one from each IG, building up a web of difference analyses. This class will automatically process any internal comparisons that it encounters When all the comparisons have been performed, you can then generate a variety of output formats- Author:
- Grahame Grieve
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classProfileComparer.ProfileComparison-
Nested classes/interfaces inherited from interface org.hl7.fhir.r5.conformance.ProfileUtilities.ProfileKnowledgeProvider
ProfileUtilities.ProfileKnowledgeProvider.BindingResolution
-
-
Constructor Summary
Constructors Constructor Description ProfileComparer(IWorkerContext context, String folder)ProfileComparer(IWorkerContext context, KeyGenerator keygen, String folder)
-
Method Summary
-
-
-
Constructor Detail
-
ProfileComparer
public ProfileComparer(IWorkerContext context, KeyGenerator keygen, String folder) throws IOException
- Throws:
IOException
-
ProfileComparer
public ProfileComparer(IWorkerContext context, String folder) throws IOException
- Throws:
IOException
-
-
Method Detail
-
transfer
public static void transfer(InputStream in, OutputStream out, int buffer) throws IOException
- Throws:
IOException
-
unzip
public void unzip(String zipFilePath, String destDirectory) throws IOException
Extracts a zip file specified by the zipFilePath to a directory specified by destDirectory (will be created if does not exists)- Parameters:
zipFilePath-destDirectory-- Throws:
IOException
-
getValuesets
public List<ValueSet> getValuesets()
-
status
public void status(ElementDefinition ed, int value)
-
getComparisons
public List<ProfileComparer.ProfileComparison> getComparisons()
-
compareProfiles
public ProfileComparer.ProfileComparison compareProfiles(StructureDefinition left, StructureDefinition right) throws org.hl7.fhir.exceptions.DefinitionException, IOException, org.hl7.fhir.exceptions.FHIRFormatError
Compare left and right structure definitions to see whether they are consistent or not Note that left and right are arbitrary choices. In one respect, left is 'preferred' - the left's example value and data sets will be selected over the right ones in the common structure definition- Throws:
org.hl7.fhir.exceptions.DefinitionExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRFormatError
-
copySlice
public void copySlice(List<ElementDefinition> target, List<ElementDefinition> source, DefinitionNavigator slice)
-
addValueSet
public String addValueSet(ValueSet cvs)
-
getLeftLink
public String getLeftLink()
-
setLeftLink
public void setLeftLink(String leftLink)
-
getLeftName
public String getLeftName()
-
setLeftName
public void setLeftName(String leftName)
-
getRightLink
public String getRightLink()
-
setRightLink
public void setRightLink(String rightLink)
-
getRightName
public String getRightName()
-
setRightName
public void setRightName(String rightName)
-
generate
public String generate() throws IOException
- Throws:
IOException
-
isDatatype
public boolean isDatatype(String typeSimple)
- Specified by:
isDatatypein interfaceProfileUtilities.ProfileKnowledgeProvider
-
isResource
public boolean isResource(String typeSimple)
- Specified by:
isResourcein interfaceProfileUtilities.ProfileKnowledgeProvider
-
hasLinkFor
public boolean hasLinkFor(String name)
- Specified by:
hasLinkForin interfaceProfileUtilities.ProfileKnowledgeProvider
-
getLinkFor
public String getLinkFor(String corePath, String name)
- Specified by:
getLinkForin interfaceProfileUtilities.ProfileKnowledgeProvider
-
resolveBinding
public ProfileUtilities.ProfileKnowledgeProvider.BindingResolution resolveBinding(StructureDefinition def, ElementDefinition.ElementDefinitionBindingComponent binding, String path) throws org.hl7.fhir.exceptions.FHIRException
- Specified by:
resolveBindingin interfaceProfileUtilities.ProfileKnowledgeProvider- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveBinding
public ProfileUtilities.ProfileKnowledgeProvider.BindingResolution resolveBinding(StructureDefinition def, String url, String path) throws org.hl7.fhir.exceptions.FHIRException
- Specified by:
resolveBindingin interfaceProfileUtilities.ProfileKnowledgeProvider- Throws:
org.hl7.fhir.exceptions.FHIRException
-
resolveBindingInt
public ProfileUtilities.ProfileKnowledgeProvider.BindingResolution resolveBindingInt(StructureDefinition def, String url, String desc) throws org.hl7.fhir.exceptions.FHIRException
- Throws:
org.hl7.fhir.exceptions.FHIRException
-
getLinkForProfile
public String getLinkForProfile(StructureDefinition profile, String url)
- Specified by:
getLinkForProfilein interfaceProfileUtilities.ProfileKnowledgeProvider
-
prependLinks
public boolean prependLinks()
- Specified by:
prependLinksin interfaceProfileUtilities.ProfileKnowledgeProvider
-
getLinkForUrl
public String getLinkForUrl(String corePath, String s)
- Specified by:
getLinkForUrlin interfaceProfileUtilities.ProfileKnowledgeProvider
-
getErrCount
public int getErrCount()
-
-