Skip to content

Commit

Permalink
Add time_asserted field to EVALUATION.class (#641)
Browse files Browse the repository at this point in the history
* Add NULLABLE time_asserted attribute to EVALUATION.class and exclude in bmm comparison test

* Fix proporder

* Include time_asserted in test files
  • Loading branch information
EBrader authored Dec 10, 2024
1 parent eb7b43d commit 4df05e2
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@
import com.nedap.archie.rm.datastructures.ItemStructure;
import com.nedap.archie.rm.datatypes.CodePhrase;
import com.nedap.archie.rm.datavalues.DvText;
import com.nedap.archie.rm.datavalues.quantity.datetime.DvDateTime;
import com.nedap.archie.rm.generic.Participation;
import com.nedap.archie.rm.generic.PartyProxy;
import com.nedap.archie.rm.support.identification.ObjectId;
import com.nedap.archie.rm.support.identification.ObjectRef;
import com.nedap.archie.rm.support.identification.UIDBasedId;

import javax.annotation.Nullable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.*;
import java.util.List;
import java.util.Objects;

Expand All @@ -27,19 +25,34 @@
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "EVALUATION", propOrder = {
"timeAsserted",
"data"
})
public class Evaluation extends CareEntry {

@Nullable
@XmlElement(name = "time_asserted")
private DvDateTime timeAsserted;
private ItemStructure data;

public Evaluation() {
}

public Evaluation(@Nullable UIDBasedId uid, String archetypeNodeId, DvText name, @Nullable Archetyped archetypeDetails, @Nullable FeederAudit feederAudit, @Nullable List<Link> links, @Nullable Pathable parent, @Nullable String parentAttributeName, CodePhrase language, CodePhrase encoding, PartyProxy subject, @Nullable PartyProxy provider, @Nullable ObjectRef<? extends ObjectId> workflowId, @Nullable List<Participation> otherParticipations, @Nullable ItemStructure protocol, @Nullable ObjectRef<? extends ObjectId> guidelineId, ItemStructure data) {
public Evaluation(@Nullable UIDBasedId uid, String archetypeNodeId, DvText name, @Nullable Archetyped archetypeDetails, @Nullable FeederAudit feederAudit, @Nullable List<Link> links, @Nullable Pathable parent, @Nullable String parentAttributeName, CodePhrase language, CodePhrase encoding, PartyProxy subject, @Nullable PartyProxy provider, @Nullable ObjectRef<? extends ObjectId> workflowId, @Nullable List<Participation> otherParticipations, @Nullable ItemStructure protocol, @Nullable ObjectRef<? extends ObjectId> guidelineId, @Nullable DvDateTime timeAsserted, ItemStructure data) {
super(uid, archetypeNodeId, name, archetypeDetails, feederAudit, links, parent, parentAttributeName, language, encoding, subject, provider, workflowId, otherParticipations, protocol, guidelineId);
this.timeAsserted = timeAsserted;
this.data = data;
}

@Nullable
public DvDateTime getTimeAsserted() {
return timeAsserted;
}

public void setTimeAsserted(@Nullable DvDateTime timeAsserted) {
this.timeAsserted = timeAsserted;
}

public ItemStructure getData() {
return data;
}
Expand All @@ -56,11 +69,12 @@ public boolean equals(Object o) {
if (!super.equals(o)) return false;
Evaluation that = (Evaluation) o;

return Objects.equals(data, that.data);
return Objects.equals(timeAsserted, that.timeAsserted) &&
Objects.equals(data, that.data);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), data);
return Objects.hash(super.hashCode(), timeAsserted, data);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@
<code_string>UTF-8</code_string>
</encoding>
<subject xsi:type="PARTY_SELF" />
<time_asserted xsi:type="DV_DATE_TIME">
<value>20190114T183650,154+0000</value>
</time_asserted>
<data archetype_node_id="at0001" xsi:type="ITEM_TREE">
<name>
<value>Arbol</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@
"items": [
{
"_type": "EVALUATION",
"time_asserted": {
"_type": "DV_DATE_TIME",
"value": "2021-10-22T15:34:09.788+03:00"
},
"data": {
"_type": "ITEM_SINGLE",
"item": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public void compareBmmWithRM() {
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "DV_QUANTIFIED", "magnitude"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "DV_TEMPORAL", "magnitude"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "DV_TIME", "magnitude"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "EVALUATION", "time_asserted"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "HIER_OBJECT_ID", "extension"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "HIER_OBJECT_ID", "root"));
knownDifferences.add(new ModelDifference(ModelDifferenceType.PROPERTY_MISSING_IN_BMM, "", "IMPORTED_VERSION", "is_branch"));
Expand Down

0 comments on commit 4df05e2

Please sign in to comment.