Class FHIROpenApiGenerator


  • public class FHIROpenApiGenerator
    extends java.lang.Object
    Generate OpenAPI 3.0 from the HL7 FHIR R4 artifacts and IBM FHIR object model.

    By default, this class will generate:

    1. an "all-in-one" OpenAPI definition for the entire api
    2. a separate OpenAPI definition for each resource type and compartment, with all HTTP interactions enabled

    To limit the output to a given set of resources and/or interactions, pass a set of semicolon-delimited filter strings of the form ResourceType1(interaction1,interaction2). For example:

     Patient(create,read,vread,history,search,update,delete);Contract(create,read,vread,history,search);RiskAssessment(read)
     
    • Field Detail

      • DATA_EXPORT_TYPES

        public static final java.util.List<java.lang.Class<?>> DATA_EXPORT_TYPES
      • RESOURCEPACKAGENAME

        public static final java.lang.String RESOURCEPACKAGENAME
        See Also:
        Constant Field Values
      • APPLICATION_FORM

        public static final java.lang.String APPLICATION_FORM
        See Also:
        Constant Field Values
    • Constructor Detail

      • FHIROpenApiGenerator

        public FHIROpenApiGenerator()
    • Method Detail

      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • populateStructureDefinitionMap

        public static void populateStructureDefinitionMap​(java.util.Map<java.lang.Class<?>,​StructureDefinition> structureDefinitionMap,
                                                          java.lang.String structureDefinitionFile)
                                                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addExamples

        public static void addExamples​(java.lang.Class<?> modelClass,
                                       jakarta.json.JsonObjectBuilder definition)
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • getClassNames

        public static java.util.List<java.lang.String> getClassNames()
      • getAllTypesList

        public static java.util.List<java.lang.String> getAllTypesList()
      • getAllResourceInnerClasses

        public static java.util.List<java.lang.String> getAllResourceInnerClasses()
      • isApplicableForClass

        public static boolean isApplicableForClass​(java.lang.Class<?> typeModelClass,
                                                   java.lang.Class<?> outerModelClass)
        Returns:
        true if the type model class is applicable for the outer model class