// // Purpose: openEHR Platform Conformance Test Case // Identifier: tc_ehr-create_sub_id // Description: Create new EHR for subject with provided Uid // Interface: I_EHR_SERVICE // Copyright: openEHR Foundation (c) 2017 // License: CC-BY-SA 3.0 Unported // Reference: // // Get handle to service and an authorisation token I_EHR_SERVICE svc; UUID an_ehr_id = svc.create_uuid (); PARTY_REF subject_id = svc.create_party_ref ("ehr", "PERSON", "1111"); // ----------- PASS ------------ assert (not svc.has_ehr (an_ehr_id)); svc.create_ehr_with_id_and_subject (an_ehr_id, subject_id); assert (svc.has_ehr (an_ehr_id)); assert (svc.has_ehr_for_subject (subject_id)); EHR_SUMMARY ehr_summary = svc.get_ehr (an_ehr_id); assert (ehr_summary.ehr_status.is_queryable); assert (ehr_summary.ehr_status.is_modifiable); // ----------- FAIL: dup EHR_id ------------ I_EHR_SERVICE.create_ehr_with_id_and_subject (an_ehr_id, subject_id); assert (svc.last_error ()); assert (svc.last_error_call_status.code = EHR_CALL_SATUSES.ehr_create_fail_duplicate_id);