Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix db ser event #315

Merged
merged 3 commits into from
Feb 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ Note: version releases in the 0.x.y range may introduce breaking changes.
- Upgrade to Archie 1.0.4 ([#292](https://github.com/ehrbase/openEHR_SDK/pull/292))
- cleanup created templates (https://github.com/ehrbase/openEHR_SDK/issues/298)
- WebTemplate based validation (see https://github.com/ehrbase/openEHR_SDK/pull/309)
- flat: created conformance tests (see https://github.com/ehrbase/openEHR_SDK/pull/310; https://github.com/ehrbase/openEHR_SDK/pull/305; https://github.com/ehrbase/openEHR_SDK/pull/304; https://github.com/ehrbase/openEHR_SDK/pull/301)
- db-serialising: created conformance test (see https://github.com/ehrbase/openEHR_SDK/pull/311)
- flat: created conformance tests (see https://github.com/ehrbase/openEHR_SDK/pull/310
; https://github.com/ehrbase/openEHR_SDK/pull/305; https://github.com/ehrbase/openEHR_SDK/pull/304
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as small comment:
I did it by mistake here because I use this format in EHRbase but I am now thinking that we should also use the Markdown for link [<#pr_number>](<pr_url>) here. It would be prettier

; https://github.com/ehrbase/openEHR_SDK/pull/301)
- db-serialising: created conformance test (see https://github.com/ehrbase/openEHR_SDK/pull/311)
- db-serialising: fix handing of guideline_id & work_flow_id &
wf_definition (https://github.com/ehrbase/openEHR_SDK/pull/315)

### Fixed

Expand All @@ -20,7 +24,7 @@ Note: version releases in the 0.x.y range may introduce breaking changes.
- Fix issue in AQL regarding LIMIT and OFFSET (https://github.com/ehrbase/openEHR_SDK/pull/296)
- Fix issue while unmarshalling FLAT composition that contains ELEMENT with children DV_CODED_TEXT and DV_TEXT (https://github.com/ehrbase/openEHR_SDK/pull/300)
- Fix missing 'type' attribute in ExternalRef encoding (https://github.com/ehrbase/openEHR_SDK/pull/303)
-
- Fix db-serialising: date-time dv_order attributes (https://github.com/ehrbase/openEHR_SDK/pull/314)
## 1.16.0

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@
import com.nedap.archie.rm.composition.CareEntry;
import org.ehrbase.serialisation.dbencoding.CompositionSerializer;
import org.ehrbase.serialisation.dbencoding.ItemStack;
import org.ehrbase.serialisation.dbencoding.RmObjectEncoding;

import java.util.Map;

import static org.ehrbase.serialisation.dbencoding.CompositionSerializer.TAG_GUIDELINE_ID;

/** populate the attributes for RM CareEntry */
public abstract class CareEntryAttributes extends EntryAttributes {

Expand All @@ -34,8 +36,10 @@ public CareEntryAttributes(

public Map<String, Object> toMap(CareEntry careEntry) {

if (careEntry.getGuidelineId() != null)
map = toMap(TAG_GUIDELINE_ID, careEntry.getGuidelineId(), careEntry.getName());
if (careEntry.getGuidelineId() != null) {

map.put(TAG_GUIDELINE_ID, new RmObjectEncoding(careEntry.getGuidelineId()).toMap());
}

map = super.toMap(careEntry);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ protected Map<String, Object> toMap(Entry entry){
map.put(TAG_ENCODING, new RmObjectEncoding(entry.getEncoding()).toMap());
}

if (entry.getWorkflowId() != null)
map = toMap(TAG_WORKFLOW_ID, entry.getWorkflowId(), entry.getName());
if (entry.getWorkflowId() != null) {

map.put(TAG_WORKFLOW_ID, new RmObjectEncoding(entry.getWorkflowId()).toMap());
}

if (entry.getOtherParticipations() != null && !entry.getOtherParticipations().isEmpty()){
map.put(TAG_OTHER_PARTICIPATIONS, new OtherParticipationAttributes(entry.getOtherParticipations(), compositionSerializer).toMap());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

package org.ehrbase.serialisation.attributes;

import static org.ehrbase.serialisation.dbencoding.CompositionSerializer.TAG_EXPIRY_TIME;
import static org.ehrbase.serialisation.dbencoding.CompositionSerializer.TAG_NARRATIVE;

import com.nedap.archie.rm.composition.Instruction;
import java.util.Map;
import org.ehrbase.serialisation.dbencoding.CompositionSerializer;
import org.ehrbase.serialisation.dbencoding.ItemStack;
import org.ehrbase.serialisation.dbencoding.RmObjectEncoding;

import java.util.Map;

import static org.ehrbase.serialisation.dbencoding.CompositionSerializer.*;

/**
* populate the attributes for RM Instruction (narrative)
*/
Expand All @@ -45,6 +45,9 @@ public Map<String, Object> toMap(Instruction instruction) {
if (instruction.getExpiryTime() != null) {
map.put(TAG_EXPIRY_TIME, new RmObjectEncoding(instruction.getExpiryTime()).toMap());
}
if (instruction.getWfDefinition() != null) {
map.put(TAG_WF_DEFINITION, new RmObjectEncoding(instruction.getWfDefinition()).toMap());
}

map = super.toMap(instruction);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public enum WalkerOutputMode {
public static final String TAG_ISM_TRANSITION_REASON = "/careflow_step";
public static final String TAG_TRANSITION = "/transition";
public static final String TAG_WORKFLOW_ID = "/workflow_id";
public static final String TAG_WF_DEFINITION = "/wf_definition";
public static final String TAG_GUIDELINE_ID = "/guideline_id";
public static final String TAG_OTHER_PARTICIPATIONS = "/other_participations";
public static final String TAG_PROVIDER = "/provider"; // care entry provider
Expand Down
5 changes: 4 additions & 1 deletion serialisation_conformance_test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<configuration combine.self="override">
<argLine>${surefireArgLine}</argLine>
<dependenciesToScan>com.github.better-care:web-template-tests</dependenciesToScan>
<includes combine.self="override">
<include>AnySomeConstrainedTest</include>
Expand Down Expand Up @@ -91,6 +91,9 @@
<include>WebTemplateContentTest.java</include>
<include>WorkflowIdTestOverwrite</include>
<include>XdsBuilderTest</include>
<include>DbConformanceTest</include>
<include>DbConformanceTest</include>
<include>FlatConformanceTest</include>
</includes>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,131 +98,6 @@ private static List<Arguments> testRoundTripArguments(){
new String[] {}));
break;

case EHRBASE_CONFORMANCE_OBSERVATION:
case EHRBASE_CONFORMANCE_FEEDER_AUDIT_MULTIMEDIA:
arguments.add(
Arguments.of(
test,
new String[] {},
new String[] {
// see https://jira.vitagroup.ag/browse/CDR-219
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_guideline_id|type, value: GUIDELINE",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_guideline_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_guideline_id|id, value: 3445",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_guideline_id|id_scheme, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_work_flow_id|type, value: WORKFLOW",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_work_flow_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_work_flow_id|id, value: 335645",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_observation/_work_flow_id|id_scheme, value: HOSPITAL-NS"
},
new String[] {
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/workflow_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/workflow_id/type",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/workflow_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/guideline_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/guideline_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-OBSERVATION.conformance_observation.v0, 1]/guideline_id/type"
}));
break;

case EHRBASE_CONFORMANCE_EVALUATION:
arguments.add(
Arguments.of(
test,
new String[] {},
new String[] {
// see https://jira.vitagroup.ag/browse/CDR-219
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_guideline_id|type, value: GUIDELINE",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_guideline_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_guideline_id|id, value: 3445",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_guideline_id|id_scheme, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_work_flow_id|type, value: WORKFLOW",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_work_flow_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_work_flow_id|id, value: 335645",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_evaluation/_work_flow_id|id_scheme, value: HOSPITAL-NS"
},
new String[] {
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/workflow_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/workflow_id/type",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/workflow_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/guideline_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/guideline_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-EVALUATION.conformance_evaluation.v0, 1]/guideline_id/type"
}));
break;
case EHRBASE_CONFORMANCE_ACTION:
arguments.add(
Arguments.of(
test,
new String[] {},
new String[] {
// see https://jira.vitagroup.ag/browse/CDR-219
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_guideline_id|type, value: GUIDELINE",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_guideline_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_guideline_id|id, value: 3445",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_guideline_id|id_scheme, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_work_flow_id|type, value: WORKFLOW",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_work_flow_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_work_flow_id|id, value: 335645",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_action/_work_flow_id|id_scheme, value: HOSPITAL-NS"
},
new String[] {
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/workflow_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/workflow_id/type",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/workflow_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/guideline_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/guideline_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ACTION.conformance_action_.v0, 1]/guideline_id/type"
}));
break;
case EHRBASE_CONFORMANCE_INSTRUCTION:
arguments.add(
Arguments.of(
test,
new String[] {},
new String[] {
// see https://jira.vitagroup.ag/browse/CDR-219
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_guideline_id|type, value: GUIDELINE",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_guideline_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_guideline_id|id, value: 3445",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_guideline_id|id_scheme, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_work_flow_id|type, value: WORKFLOW",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_work_flow_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_work_flow_id|id, value: 335645",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_work_flow_id|id_scheme, value: HOSPITAL-NS",
// https://jira.vitagroup.ag/browse/CDR-221
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_wf_definition|value, value: wf_definition",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_instruction/_wf_definition|formalism, value: formalism"
},
new String[] {
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/workflow_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/workflow_id/type",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/workflow_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/guideline_id/namespace",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/guideline_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-INSTRUCTION.conformance_instruction.v0, 1]/guideline_id/type"
}));
break;

case EHRBASE_CONFORMANCE_ADMIN_ENTRY:
arguments.add(
Arguments.of(
test,
new String[] {},
new String[] {
// see https://jira.vitagroup.ag/browse/CDR-219

"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_admin_entry/_work_flow_id|type, value: WORKFLOW",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_admin_entry/_work_flow_id|namespace, value: HOSPITAL-NS",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_admin_entry/_work_flow_id|id, value: 335645",
"Extra path: conformance-ehrbase.de.v0/conformance_section/conformance_admin_entry/_work_flow_id|id_scheme, value: HOSPITAL-NS"
},
new String[] {
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ADMIN_ENTRY.conformance_admin_entry.v0, 1]/workflow_id/id",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ADMIN_ENTRY.conformance_admin_entry.v0, 1]/workflow_id/type",
"/content[openEHR-EHR-SECTION.conformance_section.v0, 1]/items[openEHR-EHR-ADMIN_ENTRY.conformance_admin_entry.v0, 1]/workflow_id/namespace"
}));
break;

case EHRBASE_CONFORMANCE_DATA_TYPES_DV_EHR_URI:
// see https://jira.vitagroup.ag/browse/CDR-214
Expand Down