-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds surescripts effect types and classes.
- Loading branch information
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
from typing import Any | ||
|
||
from canvas_sdk.effects.base import EffectType, _BaseEffect | ||
|
||
|
||
class SendSurescriptsEligibilityRequestEffect(_BaseEffect): | ||
""" | ||
An Effect that will send a Surescripts eligibility request. | ||
""" | ||
|
||
class Meta: | ||
effect_type = EffectType.SEND_SURESCRIPTS_ELIGIBILITY_REQUEST | ||
apply_required_fields = ("patient_id", "staff_id") | ||
|
||
patient_id: str | None = None | ||
staff_id: str | None = None | ||
|
||
@property | ||
def values(self) -> dict[str, Any]: | ||
"""Eligibility Request values.""" | ||
return { | ||
"patient_id": self.patient_id, | ||
"staff_id": self.staff_id, | ||
} | ||
|
||
@property | ||
def effect_payload(self) -> dict[str, Any]: | ||
"""Eligibility Request effect payload.""" | ||
return self.values | ||
|
||
|
||
class SendSurescriptsMedicationHistoryRequestEffect(_BaseEffect): | ||
""" | ||
An effect that sends a Surescripts Medication History Request. | ||
""" | ||
|
||
class Meta: | ||
effect_type = EffectType.SEND_SURESCRIPTS_MEDICATION_HISTORY_REQUEST | ||
apply_required_fields = ("patient_id", "staff_id") | ||
|
||
patient_id: str | None = None | ||
staff_id: str | None = None | ||
|
||
@property | ||
def values(self) -> dict[str, Any]: | ||
"""Medication History Request values.""" | ||
return { | ||
"patient_id": self.patient_id, | ||
"staff_id": self.staff_id, | ||
} | ||
|
||
@property | ||
def effect_payload(self) -> dict[str, Any]: | ||
"""Medication History Request effect payload.""" | ||
return self.values | ||
|
||
|
||
class SendSurescriptsBenefitsRequestEffect(_BaseEffect): | ||
""" | ||
An effect that sends a Surescripts Benefits Request. | ||
""" | ||
|
||
class Meta: | ||
effect_type = EffectType.SEND_SURESCRIPTS_BENEFITS_REQUEST | ||
apply_required_fields = ( | ||
"patient_id", | ||
"staff_id", | ||
"medication_description", | ||
"medication_ndc", | ||
"plan", | ||
) | ||
|
||
patient_id: str | None = None | ||
staff_id: str | None = None | ||
medication_description: str | None = None | ||
medication_ndc: str | None = None | ||
plan: str | None = None | ||
|
||
@property | ||
def values(self) -> dict[str, Any]: | ||
"""Benefits Request values.""" | ||
return { | ||
"patient_id": self.patient_id, | ||
"staff_id": self.staff_id, | ||
"medication_description": self.medication_description, | ||
"medication_ndc": self.medication_ndc, | ||
"plan": self.plan, | ||
} | ||
|
||
@property | ||
def effect_payload(self) -> dict[str, Any]: | ||
"""Benefits Request effect payload.""" | ||
return self.values |