Package org.ehrbase.service
Class ContributionServiceHelper
java.lang.Object
org.ehrbase.service.ContributionServiceHelper
Helper class to collect helper methods for contribution processing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<com.nedap.archie.rm.changecontrol.Version>extractVersionObjects(ArrayList listVersions, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) returns a list of RM VERSIONs extracted from given serializationstatic com.nedap.archie.rm.generic.AuditDetailsparseAuditDetails(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) Helper that parses the AuditDetails from the contribution input.static List<com.nedap.archie.rm.changecontrol.Version>parseVersions(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) Convenience helper that combines some methods from above and prepares direct access to the list of contained versionssplitContent(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) splits contribution string content into its versions list & audit partstatic com.nedap.archie.rm.RMObjectunmarshalMapContentToRmObject(LinkedHashMap content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) TODO CONTRIBUTION: isn't this in its current form independent of the format? the map should be <string, object> without JSON specifics.
-
Constructor Details
-
ContributionServiceHelper
public ContributionServiceHelper()
-
-
Method Details
-
splitContent
public static Map<String,Object> splitContent(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) splits contribution string content into its versions list & audit part- Parameters:
content- Payload serialized inputformat- Format of given input- Returns:
- Map split at first level of input, so access to the version list and audit is directly possible
-
extractVersionObjects
public static List<com.nedap.archie.rm.changecontrol.Version> extractVersionObjects(ArrayList listVersions, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) returns a list of RM VERSIONs extracted from given serialization- Parameters:
listVersions- List of still serialized version objectsformat- Format of the serialization- Returns:
- List of deserialized version objects
- Throws:
IllegalArgumentException- when processing of given input fails
-
unmarshalMapContentToRmObject
public static com.nedap.archie.rm.RMObject unmarshalMapContentToRmObject(LinkedHashMap content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) TODO CONTRIBUTION: isn't this in its current form independent of the format? the map should be <string, object> without JSON specifics. only the problematic round trip conversation depends of a format, but that could be fix. unmarshaller that creates an RMObject from a Map's content- Parameters:
content- Map instance containing data for a RMObject (i.e. pseudo marshalled)format- Format of the origin payload // TODO technically given content doesn't contain any (real) marshalled, for instance, json parts anymore- Returns:
- RM Object representation fitting the given content
- Throws:
IllegalArgumentException- when processing of given input fails
-
parseVersions
public static List<com.nedap.archie.rm.changecontrol.Version> parseVersions(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) Convenience helper that combines some methods from above and prepares direct access to the list of contained versions- Parameters:
content- Plain string contentformat- Format of content- Returns:
- List of version objects extracted from content
-
parseAuditDetails
public static com.nedap.archie.rm.generic.AuditDetails parseAuditDetails(String content, org.ehrbase.openehr.sdk.response.dto.ehrscape.CompositionFormat format) Helper that parses the AuditDetails from the contribution input.- Parameters:
content- Plain string contentformat- Format of content- Returns:
- AuditDetails object
-