Class SubjectAreaUtils


  • public class SubjectAreaUtils
    extends Object
    Subject Area OMAS utilities.
    • Constructor Detail

      • SubjectAreaUtils

        public SubjectAreaUtils()
    • Method Detail

      • createTemplateFromTypeDef

        public static InstanceType createTemplateFromTypeDef​(TypeDef typeDef)
      • extractCategorySummaryFromCategory

        public static CategorySummary extractCategorySummaryFromCategory​(Category category,
                                                                         Relationship relationship)
        Convert a Category to a CategorySummary
        Parameters:
        category - to convert
        relationship - Relationship
        Returns:
        CategorySummary
      • extractGlossarySummaryFromGlossary

        public static GlossarySummary extractGlossarySummaryFromGlossary​(Glossary glossary,
                                                                         Relationship relationship)
        Extract Glossary Summary
        Parameters:
        glossary - the glossary that is to be summarised
        relationship - the relationship to the glossary, which feeds part of the node summary
        Returns:
        Glossary Summary or null
      • getGlossaryGuidFromAnchor

        public static String getGlossaryGuidFromAnchor​(Relationship relationship)
        Get glossary guid from anchors
        Parameters:
        relationship - - TermAnchor or CategoryAnchor
        Returns:
        glossaryGuid
      • convertInstanceStatusToStatus

        public static Status convertInstanceStatusToStatus​(InstanceStatus instanceStatus)
      • convertStatusToInstanceStatus

        public static InstanceStatus convertStatusToInstanceStatus​(Status status)
      • createSystemAttributes

        public static SystemAttributes createSystemAttributes​(InstanceHeader instanceHeader)
        create SystemAttributes instance from an insance header object
        Parameters:
        instanceHeader - omrs instance header
        Returns:
        SystemAttributes
      • populateSystemAttributesForInstanceAuditHeader

        public static void populateSystemAttributesForInstanceAuditHeader​(SystemAttributes systemAttributes,
                                                                          InstanceAuditHeader instanceAuditHeader)
      • setStringPropertyInInstanceProperties

        public static void setStringPropertyInInstanceProperties​(InstanceProperties instanceProperties,
                                                                 String stringValue,
                                                                 String propertyName)
        Set the String value into the InstanceProperties.
        Parameters:
        instanceProperties - supplied instanceproperties
        stringValue - string value
        propertyName - property name.
      • setIntegerPropertyInInstanceProperties

        public static void setIntegerPropertyInInstanceProperties​(InstanceProperties instanceProperties,
                                                                  Integer integerValue,
                                                                  String propertyName)
        Set the Integer value into the InstanceProperties.
        Parameters:
        instanceProperties - supplied instanceproperties
        integerValue - integer value
        propertyName - property name.
      • setDatePropertyInInstanceProperties

        public static void setDatePropertyInInstanceProperties​(InstanceProperties instanceProperties,
                                                               Date date,
                                                               String propertyName)
        set the Date value into the InstanceProperties
        Parameters:
        instanceProperties - supplied instanceproperties
        date - Datew value
        propertyName - property name
      • getIconSummarySet

        public SubjectAreaOMASAPIResponse<IconSummary> getIconSummarySet​(String userId,
                                                                         String guid)
        Set icon summaries from related media relationships by issuing a call to omrs using the related media guid - which is at one end of the relationship. Note that we should only return the icons that are effective - by checking the effective From and To dates against the current time
        Parameters:
        userId - userid under which to issue to the get of the related media
        guid - to get associated icons from
        Returns:
        response with Set of IconSummary objects or an Exception response.
      • setStatusPropertyInInstanceProperties

        public static void setStatusPropertyInInstanceProperties​(InstanceProperties instanceProperties,
                                                                 TermRelationshipStatus status,
                                                                 String propertyName)
        Set status values into instance properties.
        Parameters:
        instanceProperties - supplied instanceproperties
        status - Status value
        propertyName - property name