Skip to content

Commit

Permalink
fix: CDR-1512 add tests with create compo with uid
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavploaia committed Jul 22, 2024
1 parent 504c09d commit f98058e
Show file tree
Hide file tree
Showing 5 changed files with 739 additions and 1 deletion.
41 changes: 40 additions & 1 deletion tests/robot/SANITY_TESTS/migrated_ehrscape_tests.robot
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ Suite Setup Precondition
Set Suite Variable ${system_id_with_tenant} ${compo_uid_splitted}[1]
Headers Checks Composition

1.a Create Compo FLAT With Uid
[Documentation] Covers https://vitagroup-ag.atlassian.net/browse/CDR-1512
Commit Composition OpenEHR
... composition=family_history__with_uid.json format=FLAT with_compo_uid=true
Should Be Equal ${resp.status_code} ${201}
Set Test Variable ${compo_uid} ${resp.json()['family_history/_uid']}
Should Be Equal ${generated_compo_uid} ${compo_uid}

2. Create Compo JSON EHRSCAPE Migrated
Commit Composition OpenEHR composition=family_history__.json format=JSON
Should Be Equal ${resp.status_code} ${201}
Expand All @@ -52,6 +60,14 @@ Suite Setup Precondition
Should Be Equal ${compo_uid_splitted}[2] 1
Headers Checks Composition

2.a Create Compo JSON With Uid
[Documentation] Covers https://vitagroup-ag.atlassian.net/browse/CDR-1512
Commit Composition OpenEHR
... composition=family_history__with_uid.json format=JSON with_compo_uid=true
Should Be Equal ${resp.status_code} ${201}
Set Test Variable ${compo_uid} ${resp.json()['uid']['value']}
Should Be Equal ${generated_compo_uid} ${compo_uid}

3. Create Compo XML EHRSCAPE Migrated
Commit Composition OpenEHR composition=family_history__.xml format=XML
Should Be Equal ${resp.status_code} ${201}
Expand All @@ -61,6 +77,15 @@ Suite Setup Precondition
Set Test Variable ${compo_id} ${compo_uid_splitted}[0]
Headers Checks Composition

3.a Create Compo XML With Uid
[Documentation] Covers https://vitagroup-ag.atlassian.net/browse/CDR-1512
Commit Composition OpenEHR
... composition=family_history__with_uid.xml format=XML with_compo_uid=true
Should Be Equal ${resp.status_code} ${201}
${xresp} Parse Xml ${resp.text}
${compo_uid} Get Element Text ${xresp} uid/value
Should Be Equal ${generated_compo_uid} ${compo_uid}

4. Create Compo STRUCTURED EHRSCAPE Migrated
Commit Composition OpenEHR composition=family_history__.json format=STRUCTURED
Should Be Equal ${resp.status_code} ${201}
Expand All @@ -71,6 +96,14 @@ Suite Setup Precondition
Should Be Equal ${compo_uid_splitted}[2] 1
Headers Checks Composition

4.a Create Compo STRUCTURED With Uid
[Documentation] Covers https://vitagroup-ag.atlassian.net/browse/CDR-1512
Commit Composition OpenEHR
... composition=family_history__with_uid.json format=STRUCTURED with_compo_uid=true
Should Be Equal ${resp.status_code} ${201}
Set Test Variable ${compo_uid} ${resp.json()['family_history']['_uid']}
Should Be Equal ${generated_compo_uid} ${compo_uid}

5. Update Compo FLAT EHRSCAPE Migrated
Update Composition OpenEHR composition=family_history.v2__.json format=FLAT
Should Be Equal ${resp.status_code} ${200}
Expand Down Expand Up @@ -252,8 +285,14 @@ Headers Checks Composition
Commit Composition OpenEHR
[Documentation] Commit Composition using OpenEHR endpoint. Previously EHRSCAPE endpoint was used.
... DEPENDENCY: `Precondition` keyword as there is Upload OPT, Create EHR and Create Session
[Arguments] ${composition} ${format}=FLAT
[Arguments] ${composition} ${format}=FLAT ${with_compo_uid}=false
Set Params And Headers For API Call format=${format} composition=${composition}
IF '${with_compo_uid}' != 'false'
Set Test Variable ${generated_compo_uid}
... ${{str(uuid.uuid4())}}::${system_id_with_tenant}::1
${temp_file} Replace String ${file} __TO_BE_REPLACED_BY_TEST__ ${generated_compo_uid}
${file} Set Variable ${temp_file}
END
${resp} POST On Session ${SUT} /ehr/${ehr_id}/composition expected_status=anything
... data=${file} params=${params} headers=${headers}
Set Test Variable ${resp} ${resp}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
{
"_type": "COMPOSITION",
"name": {
"_type": "DV_TEXT",
"value": "Family history"
},
"archetype_details": {
"archetype_id": {
"value": "openEHR-EHR-COMPOSITION.family_history.v0"
},
"template_id": {
"value": "family_history"
},
"rm_version": "1.0.4"
},
"language": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "ISO_639-1"
},
"code_string": "en"
},
"territory": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "ISO_3166-1"
},
"code_string": "DE"
},
"category": {
"_type": "DV_CODED_TEXT",
"value": "event",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "openehr"
},
"code_string": "433"
}
},
"composer": {
"_type": "PARTY_IDENTIFIED",
"name": "Max Mustermann"
},
"context": {
"_type": "EVENT_CONTEXT",
"start_time": {
"_type": "DV_DATE_TIME",
"value": "2022-02-03T04:05:06"
},
"end_time": {
"_type": "DV_DATE_TIME",
"value": "2022-02-03T04:05:06"
},
"setting": {
"_type": "DV_CODED_TEXT",
"value": "home",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "openehr"
},
"code_string": "225"
}
},
"health_care_facility": {
"_type": "PARTY_IDENTIFIED",
"name": "DOE, John"
}
},
"content": [
{
"_type": "EVALUATION",
"name": {
"_type": "DV_TEXT",
"value": "Family history"
},
"archetype_details": {
"archetype_id": {
"value": "openEHR-EHR-EVALUATION.family_history.v2"
},
"rm_version": "1.0.4"
},
"language": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "ISO_639-1"
},
"code_string": "en"
},
"encoding": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "IANA_character-sets"
},
"code_string": "ISO-10646-UTF-1"
},
"workflow_id": {
"_type": "OBJECT_REF",
"namespace": "unknown",
"type": "ANY",
"id": {
"_type": "GENERIC_ID",
"value": "9e122133-6589-3cfc-a96d-b33785d5f103",
"scheme": "scheme"
}
},
"subject": {
"_type": "PARTY_SELF"
},
"provider": {
"_type": "PARTY_SELF"
},
"guideline_id": {
"_type": "OBJECT_REF",
"namespace": "unknown",
"type": "ANY",
"id": {
"_type": "GENERIC_ID",
"value": "6f608111-0960-305a-9bea-8306d1e240e4",
"scheme": "scheme"
}
},
"data": {
"_type": "ITEM_TREE",
"name": {
"_type": "DV_TEXT",
"value": "Tree"
},
"items": [
{
"_type": "CLUSTER",
"name": {
"_type": "DV_TEXT",
"value": "Per family member"
},
"items": [
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Family member name"
},
"value": {
"_type": "DV_TEXT",
"value": "Lorem ipsum"
},
"archetype_node_id": "at0004"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Biological sex"
},
"value": {
"_type": "DV_CODED_TEXT",
"value": "Female",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "SNOMED-CT"
},
"code_string": "248152002"
}
},
"archetype_node_id": "at0060"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Relationship"
},
"value": {
"_type": "DV_CODED_TEXT",
"value": "Mother",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "SNOMED-CT"
},
"code_string": "444301002"
}
},
"archetype_node_id": "at0016"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Date of birth"
},
"value": {
"_type": "DV_DATE_TIME",
"value": "2022-02-03T04:05:06"
},
"archetype_node_id": "at0005"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Deceased?"
},
"value": {
"_type": "DV_BOOLEAN",
"value": true
},
"archetype_node_id": "at0023"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Date of death"
},
"value": {
"_type": "DV_DATE_TIME",
"value": "2022-02-03T04:05:06"
},
"archetype_node_id": "at0058"
},
{
"_type": "CLUSTER",
"name": {
"_type": "DV_TEXT",
"value": "Clinical history"
},
"items": [
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Problem/diagnosis name"
},
"value": {
"_type": "DV_CODED_TEXT",
"value": "No example for terminology '//fhir.hl7.org/ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/condition-code' available",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "//fhir.hl7.org/ValueSet/$expand?url=http://hl7.org/fhir/ValueSet/condition-code"
},
"code_string": "42"
}
},
"archetype_node_id": "at0009"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Age at onset"
},
"value": {
"_type": "DV_DURATION",
"value": "PT0S"
},
"archetype_node_id": "at0010"
},
{
"_type": "ELEMENT",
"name": {
"_type": "DV_TEXT",
"value": "Cause of death?"
},
"value": {
"_type": "DV_CODED_TEXT",
"value": "Direct cause or closely related",
"defining_code": {
"_type": "CODE_PHRASE",
"terminology_id": {
"_type": "TERMINOLOGY_ID",
"value": "local"
},
"code_string": "at0061"
}
},
"archetype_node_id": "at0014"
}
],
"archetype_node_id": "at0008"
}
],
"archetype_node_id": "at0003"
}
],
"archetype_node_id": "at0001"
},
"archetype_node_id": "openEHR-EHR-EVALUATION.family_history.v2"
}
],
"archetype_node_id": "openEHR-EHR-COMPOSITION.family_history.v0",
"uid": {
"_type": "OBJECT_VERSION_ID",
"value": "__TO_BE_REPLACED_BY_TEST__"
}
}
Loading

0 comments on commit f98058e

Please sign in to comment.