Skip to content

Commit 0f9787c

Browse files
NRL-1050 Fix integration tests
1 parent d2fd995 commit 0f9787c

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

tests/features/consumer/readDocumentReference-success.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ Feature: Consumer - readDocumentReference - Success Scenarios
2828
"coding": [
2929
{
3030
"system": "http://snomed.info/sct",
31-
"code": "736253002"
31+
"code": "736253002",
32+
"display": "Mental health crisis plan"
3233
}
3334
]
3435
},
@@ -102,7 +103,8 @@ Feature: Consumer - readDocumentReference - Success Scenarios
102103
"coding": [
103104
{
104105
"system": "http://snomed.info/sct",
105-
"code": "736253002"
106+
"code": "736253002",
107+
"display": "Mental health crisis plan"
106108
}
107109
]
108110
},

tests/features/producer/readDocumentReference-success.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Feature: Producer - readDocumentReference - Success Scenarios
3030
"coding": [
3131
{
3232
"system": "http://snomed.info/sct",
33-
"code": "736253002"
33+
"code": "736253002",
34+
"display": "Mental health crisis plan"
3435
}
3536
]
3637
},
@@ -104,7 +105,8 @@ Feature: Producer - readDocumentReference - Success Scenarios
104105
"coding": [
105106
{
106107
"system": "http://snomed.info/sct",
107-
"code": "736253002"
108+
"code": "736253002",
109+
"display": "Mental health crisis plan"
108110
}
109111
]
110112
},

tests/features/utils/data.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from layer.nrlf.core.constants import CATEGORY_ATTRIBUTES
1+
from layer.nrlf.core.constants import CATEGORY_ATTRIBUTES, TYPE_ATTRIBUTES
22
from nrlf.producer.fhir.r4.model import (
33
Attachment,
44
CodeableConcept,
@@ -40,9 +40,13 @@ def create_test_document_reference(items: dict) -> DocumentReference:
4040
if items.get("id"):
4141
base_doc_ref.id = items["id"]
4242

43-
if items.get("type"):
43+
if type_code := items.get("type"):
44+
type_system = items.get("type_system", "http://snomed.info/sct")
45+
type_str = f"{type_system}|{type_code}"
46+
type_display = TYPE_ATTRIBUTES.get(type_str, {}).get("display")
47+
4448
base_doc_ref.type = CodeableConcept(
45-
coding=[Coding(system="http://snomed.info/sct", code=items["type"])]
49+
coding=[Coding(system=type_system, code=type_code, display=type_display)]
4650
)
4751

4852
if items.get("subject"):

0 commit comments

Comments
 (0)