Class FHIRPersistenceSupport


  • public class FHIRPersistenceSupport
    extends java.lang.Object
    Collection of helper methods related to the persistence of FHIR resource payload data
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Instant getCurrentInstant()
      Get the current time which can be used for the lastUpdated field
      static int getMetaVersionId​(Resource resource)
      Obtain the versionId value from the Resource meta element, converting to an int for use by the persistence layer
      static <T extends Resource>
      T
      parse​(java.lang.Class<T> resourceType, java.io.InputStream in, java.util.List<java.lang.String> elements, boolean uncompress)
      Parse the given stream, using elements if needed
      static InputOutputByteStream render​(Resource resource, boolean compress)
      Render the payload
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FHIRPersistenceSupport

        public FHIRPersistenceSupport()
    • Method Detail

      • parse

        public static <T extends Resource> T parse​(java.lang.Class<T> resourceType,
                                                   java.io.InputStream in,
                                                   java.util.List<java.lang.String> elements,
                                                   boolean uncompress)
                                            throws FHIRParserException,
                                                   java.io.IOException
        Parse the given stream, using elements if needed
        Type Parameters:
        T -
        Parameters:
        resourceType -
        in -
        elements -
        uncompress -
        Returns:
        Throws:
        FHIRParserException
        java.io.IOException
      • getCurrentInstant

        public static Instant getCurrentInstant()
        Get the current time which can be used for the lastUpdated field
        Returns:
        current time in UTC
      • getMetaVersionId

        public static int getMetaVersionId​(Resource resource)
                                    throws FHIRPersistenceException
        Obtain the versionId value from the Resource meta element, converting to an int for use by the persistence layer
        Parameters:
        resource -
        Returns:
        Throws:
        FHIRPersistenceException