Search in sources :

Example 1 with SimpleClassName

use of org.ehrbase.serialisation.dbencoding.SimpleClassName in project openEHR_SDK by ehrbase.

the class IsmTransitionAttributes method toMap.

/**
 * encode the attributes lower snake case to comply with UML conventions and make is queryable
 * @return
 */
public Map<String, Object> toMap() {
    Map<String, Object> valuemap = PathMap.getInstance();
    if (ismTransition == null)
        return null;
    if (ismTransition.getReason() != null) {
        List<Map<String, Object>> reasons = new ArrayList<>();
        for (DvText reason : ismTransition.getReason()) {
            valuemap.put(TAG_CLASS, new SimpleClassName(reason).toString());
            valuemap.put("value", reason.getValue());
            reasons.add(valuemap);
        }
        valuemap.put("reason", reasons);
    }
    if (ismTransition.getCareflowStep() != null) {
        valuemap.put("careflow_step", ismTransition.getCareflowStep());
    }
    if (ismTransition.getCurrentState() != null) {
        valuemap.put("current_state", ismTransition.getCurrentState());
    }
    if (ismTransition.getTransition() != null) {
        valuemap.put("transition", ismTransition.getTransition());
    }
    return valuemap;
}
Also used : ArrayList(java.util.ArrayList) SimpleClassName(org.ehrbase.serialisation.dbencoding.SimpleClassName) Map(java.util.Map) PathMap(org.ehrbase.serialisation.dbencoding.PathMap) DvText(com.nedap.archie.rm.datavalues.DvText)

Example 2 with SimpleClassName

use of org.ehrbase.serialisation.dbencoding.SimpleClassName in project openEHR_SDK by ehrbase.

the class FeederAuditAttributes method toMap.

/**
 * encode the attributes lower snake case to comply with UML conventions and make is queryable
 * @return
 */
public Map<String, Object> toMap() {
    Map<String, Object> valuemap = PathMap.getInstance();
    valuemap.put(TAG_CLASS, new SimpleClassName(feederAudit).toString());
    if (feederAudit.getOriginatingSystemItemIds() != null && !feederAudit.getOriginatingSystemItemIds().isEmpty()) {
        valuemap.put("originating_system_item_ids", encodeDvIdentifiers(feederAudit.getOriginatingSystemItemIds()));
    }
    valuemap.put("feeder_system_audit", new FeederAuditDetailsAttributes(feederAudit.getFeederSystemAudit()).toMap());
    if (feederAudit.getFeederSystemItemIds() != null && !feederAudit.getFeederSystemItemIds().isEmpty()) {
        valuemap.put("feeder_system_item_ids", encodeDvIdentifiers(feederAudit.getFeederSystemItemIds()));
    }
    if (feederAudit.getOriginalContent() != null)
        valuemap.put("original_content", new RmObjectEncoding(feederAudit.getOriginalContent()).toMap());
    valuemap.put("originating_system_audit", new FeederAuditDetailsAttributes(feederAudit.getOriginatingSystemAudit()).toMap());
    return valuemap;
}
Also used : RmObjectEncoding(org.ehrbase.serialisation.dbencoding.RmObjectEncoding) SimpleClassName(org.ehrbase.serialisation.dbencoding.SimpleClassName)

Example 3 with SimpleClassName

use of org.ehrbase.serialisation.dbencoding.SimpleClassName in project openEHR_SDK by ehrbase.

the class LinksAttributes method toMap.

public List<Map<String, Object>> toMap() {
    List<Map<String, Object>> links = new ArrayList<>();
    for (Link link : linkList) {
        Map<String, Object> valuemap = PathMap.getInstance();
        valuemap.put(TAG_CLASS, new SimpleClassName(link).toString());
        valuemap.put("meaning", link.getMeaning());
        valuemap.put("type", link.getType());
        valuemap.put("target", link.getTarget());
        links.add(valuemap);
    }
    return links;
}
Also used : ArrayList(java.util.ArrayList) SimpleClassName(org.ehrbase.serialisation.dbencoding.SimpleClassName) Map(java.util.Map) PathMap(org.ehrbase.serialisation.dbencoding.PathMap) Link(com.nedap.archie.rm.archetyped.Link)

Example 4 with SimpleClassName

use of org.ehrbase.serialisation.dbencoding.SimpleClassName in project openEHR_SDK by ehrbase.

the class OtherParticipationAttributes method toMap.

public List<Map<String, Object>> toMap() {
    List<Map<String, Object>> participations = new ArrayList<>();
    for (Participation participation : participationList) {
        Map<String, Object> valuemap = PathMap.getInstance();
        valuemap.put(TAG_CLASS, new SimpleClassName(participation).toString());
        valuemap.put("function", participation.getFunction());
        valuemap.put("mode", participation.getMode());
        valuemap.put("time", participation.getTime());
        valuemap.put("performer", new SubjectAttributes(participation.getPerformer(), compositionSerializer).toMap());
        participations.add(valuemap);
    }
    return participations;
}
Also used : Participation(com.nedap.archie.rm.generic.Participation) ArrayList(java.util.ArrayList) SimpleClassName(org.ehrbase.serialisation.dbencoding.SimpleClassName) Map(java.util.Map) PathMap(org.ehrbase.serialisation.dbencoding.PathMap)

Aggregations

SimpleClassName (org.ehrbase.serialisation.dbencoding.SimpleClassName)4 ArrayList (java.util.ArrayList)3 Map (java.util.Map)3 PathMap (org.ehrbase.serialisation.dbencoding.PathMap)3 Link (com.nedap.archie.rm.archetyped.Link)1 DvText (com.nedap.archie.rm.datavalues.DvText)1 Participation (com.nedap.archie.rm.generic.Participation)1 RmObjectEncoding (org.ehrbase.serialisation.dbencoding.RmObjectEncoding)1