Test Suite: EHR_SERVICE / I_COMPOSITION Interface
Normative Reference
Items in this validation suite conceptually use the following abstract interfaces from the Abstract Platform Service Model, EHR/COMPOSITION component.
-
I_EHR_COMPOSITION
These are concretely realised in implementation technology specfic APIs, such as the EHR REST API.
This test suite uses artefacts defined by the following information model specifications:
Dependencies
This test suite depends on other test suites:
-
Functional Conformance: Definitions Component, providing OPTs;
-
Functional Conformance: EHR Component, providing EHRs.
Test Environment
-
The server under test should support at least OPTs, 1.4 or 2, but OPT 1.4 if more frequent since modeling tools supporting this were around for a long time. Could also support ADL, 1.4 or 2.
-
The server should support at least one of the XML or JSON representations of COMPOSITIONs for committing data, and integrate the corresponding schemas (XML or JSON) to validate data syntactically (before validating against an OPT).
Test Cases
Service Model operation: I_EHR_COMPOSITION.has_composition()
Service Model reference: I_EHR_COMPOSITION.has_composition()
Test Case I_EHR_COMPOSITION.has_composition
Description |
Has existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.has_composition-bad_composition
Description |
Has |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.has_composition-bad_ehr
Description |
Has |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Get COMPOSITION latest
Implementation consideration:
When a COMPOSITION is retrieved from a service, it will comply with a specific format. There could be a variant for each test to retrieve the COMPOSITION in any of the supported openEHR formats, and the syntactic validation of those retrieved formats should be done by using the corresponding schemas (XML, JSON, etc). That would be the minimal validation for conformance testing. Though it would be ideal to have semantic validation of the retrieved COMPOSITIONs to ensure conformance, which is achieved by validating against the corresponding OPT in the testing layer.
Service Model reference: I_EHR_COMPOSITION.get_composition_latest()
Test Case I_EHR_COMPOSITION.get_composition_latest
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_latest-bad_composition
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_latest-bad_ehr
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Get COMPOSITION at time
Service Model reference: I_EHR_COMPOSITION.get_composition_at_time()
Test Case I_EHR_COMPOSITION.get_composition_at_time
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_at_time-no_time_arg
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_at_time-bad_composition
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_at_time-bad_ehr
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_at_times
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Get COMPOSITION at version
Service Model reference: I_EHR_COMPOSITION.get_composition_version()
Test Case I_EHR_COMPOSITION.get_composition_version
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_version-bad_version
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_version-bad_ehr
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_composition_versions
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Get VERSIONED COMPOSITION
Service Model reference: I_EHR_COMPOSITION.get_versioned_composition()
Test Case I_EHR_COMPOSITION.get_versioned_composition
Description |
Get existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
To consider different cases, try with VERSIONED_COMPOSITION that contain just one VERSION or many VERSIONs
|
For that, the valid test cases for Create COMPOSITION could be used to comply with the preconditions of this test flow
|
Test Case I_EHR_COMPOSITION.get_versioned_composition-non_existent
Description |
Get non-existent |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.get_versioned_composition-bad_ehr
Description |
Get |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Create COMPOSITION
Service Model reference: I_EHR_COMPOSITION.create_composition()
Test Case I_EHR_COMPOSITION.create_composition-event
Description |
Create new event |
|---|---|
Pre-conditions |
|
Post-conditions |
A new event |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.create_composition-persistent
Description |
Create new persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
A new persistent |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.create_composition-same_opt_twice
Description |
Create persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
A new persistent |
Flow |
|
Test runners |
Notes:
-
Current criteria is: only one ‘create’ operation is allowed for persistent
COMPOSITIONs, the next operations over an existing persistentCOMPOSITIONshould be ‘modifications’. -
This is under debate in the openEHR SEC since some implementations permit 'persistent'
COMPOSIITONSto have more than one instance in the same EHR and some others not. This is due to the lack of information in the openEHR specifications. There is also a discussion to define other types of categories forCOMPOSITIONsto allow different behaviors.
Test Case I_EHR_COMPOSITION.create_composition-invalid_event
Description |
Create new invalid event |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.create_composition-invalid_persistent
Description |
Create new invalid persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.create_composition-event_bad_opt
Description |
Create new event |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.create_composition-event_bad_ehr
Description |
Create new event |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Update COMPOSITION
The update COMPOSITION service needs the VERSION.preceding_version_uid attribute to be set, so the server knows which existing VERSION of the COMPOSITION will be associated with the newly committed COMPOSITION. The Service Model spec is not clear about where that attribute is defined. By taking into account the Reference Model, the COMPOSITION doesn’t contain that value but the VERSION does. For the COMPOSITION update service the preceding_version_uid should be a parameter or the definition in the SM should mention this.
Service Model reference: I_EHR_COMPOSITION.update_composition()
Test Case I_EHR_COMPOSITION.update_composition-event
Description |
Update an existing event |
|---|---|
Pre-conditions |
|
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.update_composition-persistent
Description |
Update an existing persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.update_composition-non_existent
Description |
Update a non-existing |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.update_composition-wrong_template
Description |
Update an existing |
|---|---|
Pre-conditions |
|
Post-conditions |
|
Flow |
|
Test runners |
Delete COMPOSITION
Service Model reference: I_EHR_COMPOSITION.delete_composition()
Test Case I_EHR_COMPOSITION.delete_composition-event
Description |
Delete event |
|---|---|
Pre-conditions |
|
Post-conditions |
|
deleted |
` |
Flow |
|
Test runners |
The common implementation of the delete operation is two create a new VERSION of the COMPOSITION that has VERSION.commit_audit.change_type = openehr::523|deleted|, and VERSION.lifecycle_state = openehr::523|deleted|. So the delete operation is not a physical delete but a logical delete. Some implementations might add the option of a physical deleted. This test case considers the postcondition to be a logical delete, which behaves like an update operation in which a new VERSION of an existing COMPOSITION is created.
|
Test Case I_EHR_COMPOSITION.delete_composition-persistent
Description |
Delete persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
|
deleted |
` |
Flow |
|
Test runners |
Test Case I_EHR_COMPOSITION.delete_composition-non_existent
Description |
Delete persistent |
|---|---|
Pre-conditions |
|
Post-conditions |
None |
Flow |
|
Test runners |