/** * Create and set a Type Value Pair instance for a given type and value * * @param type the type to set * @param value the value to set * @param defaultValue the value to set if value is null * @return the Type Value Pair instance */ default TypeValuePairType getTypeValuePair(String type, byte[] value, byte[] defaultValue) { return new TypeValuePairType( type, value != null ? value : null, defaultValue); }
/** * Create and set a Type Value Pair instance for a given type and value * * @param type the type to set * @param value the value to set * @param defaultValue the value to set if value is null * @return the Type Value Pair instance */ default TypeValuePairType getTypeValuePair(String type, Object value, String defaultValue) { return new TypeValuePairType( type, value != null ? value.toString() : null, defaultValue); }
/** * @deprecated use {@link IHEAuditMessageBuilder#documentDetails(String, String, String, String, boolean)} */ public static List<TypeValuePairType> makeDocumentDetail(String repositoryId, String homeCommunityId, String seriesInstanceId, String studyInstanceId, boolean xcaHomeCommunityId) { List<TypeValuePairType> tvp = new ArrayList<>(); if (studyInstanceId != null) { tvp.add(new TypeValuePairType(STUDY_INSTANCE_UNIQUE_ID, studyInstanceId)); } if (seriesInstanceId != null) { tvp.add(new TypeValuePairType(SERIES_INSTANCE_UNIQUE_ID, seriesInstanceId)); } if (repositoryId != null) { tvp.add(new TypeValuePairType(REPOSITORY_UNIQUE_ID, repositoryId)); } if (homeCommunityId != null) { String type = xcaHomeCommunityId ? URN_IHE_ITI_XCA_2010_HOME_COMMUNITY_ID : IHE_HOME_COMMUNITY_ID; tvp.add(new TypeValuePairType(type, homeCommunityId)); } return tvp; }