Class FHIRJsonParser

    • Field Detail

      • DEBUG

        public static boolean DEBUG
    • Constructor Detail

      • FHIRJsonParser

        FHIRJsonParser()
    • Method Detail

      • parseAndFilter

        public <T extends Resource> T parseAndFilter​(InputStream in,
                                                     Collection<String> elementsToInclude)
                                              throws FHIRParserException
        Read a resource from the passed InputStream and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.
        Type Parameters:
        T - The resource type to read
        Parameters:
        in - An input stream with the JSON contents of a FHIR resource
        elementsToInclude - The top-level elements to include or null to indicate that no filter should be applied
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason
      • parseAndFilter

        public <T extends Resource> T parseAndFilter​(Reader reader,
                                                     Collection<String> elementsToInclude)
                                              throws FHIRParserException
        Read a resource using the passed Reader and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.
        Type Parameters:
        T - The resource type to read
        Parameters:
        reader - A reader with the JSON contents of a FHIR resource
        elementsToInclude - The top-level elements to include or null to indicate that no filter should be applied
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason
      • parse

        public <T extends Resource> T parse​(jakarta.json.JsonObject jsonObject)
                                     throws FHIRParserException
        Read a resource from a JsonObject. This method does not close the passed InputStream.
        Type Parameters:
        T - The resource type to read
        Parameters:
        jsonObject - A JsonObject with the contents of a FHIR resource
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason
      • parseAndFilter

        public <T extends Resource> T parseAndFilter​(jakarta.json.JsonObject jsonObject,
                                                     Collection<String> elementsToInclude)
                                              throws FHIRParserException
        Read a resource from a JsonObject and filter its top-level elements to the collection of elementsToInclude. This method does not close the passed InputStream.
        Type Parameters:
        T - The resource type to read
        Parameters:
        jsonObject - A JsonObject with the contents of a FHIR resource
        elementsToInclude - The top-level elements to include or null to indicate that no filter should be applied
        Returns:
        Throws:
        FHIRParserException - if the resource could not be parsed for any reason