Skip to content

Commit

Permalink
feat: add feedback_enabled property to protocol card effect (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmpsilva authored Oct 28, 2024
1 parent 14d4be1 commit 5dd7d96
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions canvas_sdk/effects/protocol_card/protocol_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Meta:
narrative: str = ""
recommendations: list[Recommendation] = []
status: Status = Status.DUE # type: ignore
feedback_enabled: bool = False

@property
def values(self) -> dict[str, Any]:
Expand All @@ -61,6 +62,7 @@ def values(self) -> dict[str, Any]:
rec.values | {"key": i} for i, rec in enumerate(self.recommendations)
],
"status": self.status.value,
"feedback_enabled": self.feedback_enabled,
}

@property
Expand Down
3 changes: 2 additions & 1 deletion canvas_sdk/effects/protocol_card/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def test_apply_method_succeeds_with_patient_id_and_key() -> None:
applied = p.apply()
assert (
applied.payload
== '{"patient": "uuid", "key": "something-unique", "data": {"title": "", "narrative": "", "recommendations": [], "status": "due"}}'
== '{"patient": "uuid", "key": "something-unique", "data": {"title": "", "narrative": "", "recommendations": [], "status": "due", "feedback_enabled": false}}'
)


Expand Down Expand Up @@ -135,6 +135,7 @@ def test_add_recommendations(
},
],
"status": "due",
"feedback_enabled": False,
}


Expand Down

0 comments on commit 5dd7d96

Please sign in to comment.