Test Suite: EHR_SERVICE
Normative Reference
Items in this validation suite conceptually use the following abstract interfaces from the Abstract Platform Service Model, EHR component.
-
I_EHR_SERVICE -
I_EHR -
I_EHR_STATUS
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:
Test Environment
The server under test should support:
-
at least the OPT 1.4 format, and optionally OPT 2.
-
at least the XML representation of COMPOSITIONs for committing data, which may be validated by the openEHR XSDs.
Test Data Sets
These are the data set classes:
-
VALID:
-
not providing an
EHR_STATUS(empty input, the server creates the default structures and data) -
providing a valid
EHR_STATUS
-
-
INVALID:
-
providing invalid
EHR_STATUS
-
Valid data sets when the EHR_STATUS is provided and internal strucrures are valid (data set class 1.a):
| No. | is_queryable | is_modifiable | subject | other_details | ehr_id |
|---|---|---|---|---|---|
1 |
true |
true |
provided |
not provided |
not provided |
2 |
true |
false |
provided |
not provided |
not provided |
3 |
false |
true |
provided |
not provided |
not provided |
4 |
false |
false |
provided |
not provided |
not provided |
5 |
true |
true |
provided |
provided |
not provided |
6 |
true |
false |
provided |
provided |
not provided |
7 |
false |
true |
provided |
provided |
not provided |
8 |
false |
false |
provided |
provided |
not provided |
9 |
true |
true |
provided |
not provided |
provided |
10 |
true |
false |
provided |
not provided |
provided |
11 |
false |
true |
provided |
not provided |
provided |
12 |
false |
false |
provided |
not provided |
provided |
13 |
true |
true |
provided |
provided |
provided |
14 |
true |
false |
provided |
provided |
provided |
15 |
false |
true |
provided |
provided |
provided |
16 |
false |
false |
provided |
provided |
provided |
Any other data set is invalid, for instance providing EHR_STATUS with:
-
missing
is_queryable,is_modifiable -
empty
is_queryable, `_is_modifiable -
missing or empty
subject_id -
invalid
subject_id -
invalid
other_details
Notes:
-
When the
ehr_idis not present, it is expected that it is assigned by the server. -
The server should set the
EHR.system_idvalue to a known value (defined by the server’s configuration). -
The default values that should be assigned by the server for is_modifiable and is_queryable are 'true', and for the subject it defaults to an instance of
PARTY_SELF. -
There are no cases to check if the provided
ehr_idis valid, since in the openEHR Platform Service Model the parameters are typed toUUID, any other format will be an invalid call. -
The validity of an
EHR_STATUScan be checked in its JSON form by validating against the JSON schemas.
Test Cases
Service Model operation: I_EHR_SERVICE.has_ehr()
Service Model reference: I_EHR_SERVICE.has_ehr()
Test Case I_EHR_SERVICE.has_ehr-existing_ehr_id
Description |
Check has EHR with existing EHR |
|---|---|
Pre-conditions |
An EHR should exist in the system with a known |
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.has_ehr-existing_subject_id
Description |
Check has EHR with existing EHR by |
|---|---|
Pre-conditions |
An EHR should exist in the system with a known subject_id. |
Post-conditions |
None |
Flow |
|
Test runners |
subject_id refers to the PARTY_REF class instance containing the identifier of a patient represented by PARTY_SELF in the openEHR Reference Model.
|
Test Case I_EHR_SERVICE.has_ehr-non_existing_ehr_id
Description |
Check has EHR with non existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.has_ehr-non_existing_subject_id
Description |
Check has EHR with non existing EHR by |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |
Service Model operation: I_EHR_SERVICE.create_ehr()
Service Model reference: I_EHR_SERVICE.create_ehr()
Test Case I_EHR_SERVICE.create_ehr-main
Description |
Create new EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
A new EHR will exist in the system and be consistent with the data sets used. |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.create_ehr-same_ehr_twice
Description |
Attempt to create same EHR twice |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
A new EHR will exist in the system, the first one created, and be consistent with the data sets used. |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.create_ehr-two_ehrs_same_patient
Description |
Create two EHRs for the same patient |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
A new EHR will exist in the system. |
Flow |
|
Test runners |
Service Model operation: I_EHR_SERVICE.get_ehr()
Service Model reference: I_EHR_SERVICE.get_ehr()
Test Case I_EHR_SERVICE.get_ehr-existing_ehr_by_ehr_id
Description |
Get existing EHR |
|---|---|
Pre-conditions |
An EHR should exist in the system with a known |
Post-conditions |
None. |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.get_ehr-existing_ehr_by_subject_id
Description |
Get existing EHR by |
|---|---|
Pre-conditions |
An EHR should exist in the system with a known |
Post-conditions |
None. |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.get_ehr-get_ehr_by_invalid_ehr_id
Description |
Get non existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None. |
Flow |
|
Test runners |
Test Case I_EHR_SERVICE.get_ehr-get_ehr_by_invalid_subject_id
Description |
Get non existing EHR by |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None. |
Flow |
|
Test runners |
EHR_STATUS Test Cases
Service Model operation: I_EHR_STATUS.get_ehr_status()
Service Model reference: I_EHR_STATUS.get_ehr_status()
Test Case I_EHR_STATUS.get_ehr_status-get_by_ehr_id
Description |
Get status of an existing EHR |
|---|---|
Pre-conditions |
An EHR with known |
Post-conditions |
None. |
Flow |
|
Test runners |
Test Case I_EHR_STATUS.get_ehr_status-bad_ehr
Description |
Get status of a non-existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None. |
Flow |
|
Test runners |
Service Model operation: I_EHR_STATUS.set_ehr_queryable()
Service Model reference: I_EHR_STATUS.set_ehr_queryable()
Test Case I_EHR_STATUS.set_ehr_queryable-existing_ehr
Description |
Set EHR queryable of an existing EHR |
|---|---|
Pre-conditions |
An EHR with known |
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_STATUS.set_ehr_queryable-bad_ehr
Description |
Set EHR queryable of non existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |
Service Model operation: I_EHR_STATUS.set_ehr_modifiable()
Service Model reference: I_EHR_STATUS.set_ehr_modifiable()
Test Case I_EHR_STATUS.set_ehr_modifiable-existing_ehr
Description |
Set EHR modifiable of an existing EHR |
|---|---|
Pre-conditions |
An EHR with known |
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_STATUS.set_ehr_modifiable-bad_ehr
Description |
Set EHR modifiable of non-existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |
Service Model operation: I_EHR_STATUS.clear_ehr_queryable()
Service Model reference: I_EHR_STATUS.clear_ehr_queryable()
Test Case I_EHR_STATUS.clear_ehr_queryable-existing_ehr
Description |
Clear EHR queryable of an existing EHR |
|---|---|
Pre-conditions |
An EHR with known |
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_STATUS.clear_ehr_queryable-bad_ehr
Description |
Clear EHR queryable of non-existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |
Service Model operation: I_EHR_STATUS.clear_ehr_modifiable()
Service Model reference: I_EHR_STATUS.clear_ehr_modifiable()
Test Case I_EHR_STATUS.clear_ehr_modifiable-existing_ehr
Description |
Clear EHR modifiable of an existing EHR |
|---|---|
Pre-conditions |
An EHR with known |
Post-conditions |
|
Flow |
|
Test runners |
Test Case I_EHR_STATUS.clear_ehr_modifiable-bad_ehr
Description |
Clear EHR modifiable of non existing EHR |
|---|---|
Pre-conditions |
The server should be empty (no EHRs, no commits, no OPTs). |
Post-conditions |
None |
Flow |
|
Test runners |