Skip to content

Commit

Permalink
Merge branch 'develop' into adding-sms-providers
Browse files Browse the repository at this point in the history
  • Loading branch information
DraKen0009 authored Jan 2, 2025
2 parents f673760 + 954ddca commit 72c9741
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 20 deletions.
2 changes: 0 additions & 2 deletions care/emr/api/viewsets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ class EMRModelViewSet(
EMRUpdateMixin,
EMRListMixin,
EMRDeleteMixin,
EMRQuestionnaireMixin,
EMRBaseViewSet,
EMRUpsertMixin,
):
Expand All @@ -280,7 +279,6 @@ class EMRModelViewSet(
class EMRModelReadOnlyViewSet(
EMRRetrieveMixin,
EMRListMixin,
EMRQuestionnaireMixin,
EMRBaseViewSet,
):
pass
2 changes: 1 addition & 1 deletion care/emr/api/viewsets/notes.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def get_patient(self):
def authorize_create(self, instance):
patient = self.get_patient()
if instance.encounter:
encounter = get_object_or_404(Encounter, instance.encounter)
encounter = get_object_or_404(Encounter, external_id=instance.encounter)
allowed = AuthorizationController.call(
"can_update_encounter_obj", self.request.user, encounter
)
Expand Down
2 changes: 1 addition & 1 deletion care/emr/models/medication_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ class MedicationRequest(EMRBaseModel):
patient = models.ForeignKey("emr.Patient", on_delete=models.CASCADE)
encounter = models.ForeignKey("emr.Encounter", on_delete=models.CASCADE)
authored_on = models.DateTimeField(null=True, blank=True)
dosage_instruction = models.JSONField(default=dict, null=True, blank=True)
dosage_instruction = models.JSONField(default=list, null=True, blank=True)
note = models.TextField(null=True, blank=True)
15 changes: 1 addition & 14 deletions care/emr/resources/medication/request/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,6 @@ def validate_additional_instruction(cls, codes):
for code in codes
]

@field_validator("as_needed_for")
@classmethod
def validate_as_needed_for(cls, code, values):
if values.data.get("as_needed_boolean", False) and not code:
err = "as_needed_for is required when as_needed_boolean is True"
raise ValueError(err)

return validate_valueset(
"as_needed_for",
cls.model_fields["as_needed_for"].json_schema_extra["slug"],
code,
)

@field_validator("site")
@classmethod
def validate_site(cls, code):
Expand Down Expand Up @@ -236,7 +223,7 @@ class BaseMedicationRequestSpec(EMRResource):
description="When request was initially authored",
)

dosage_instruction: DosageInstruction = Field(
dosage_instruction: list[DosageInstruction] = Field(
description="Dosage instructions for the medication",
)

Expand Down
3 changes: 1 addition & 2 deletions config/api_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
AvailabilityExceptionsViewSet,
)
from care.emr.api.viewsets.scheduling.booking import TokenBookingViewSet
from care.emr.api.viewsets.units import UnitsView
from care.emr.api.viewsets.user import UserViewSet
from care.emr.api.viewsets.valueset import ValueSetViewSet
from care.facility.api.viewsets.facility import AllFacilityViewSet
Expand Down Expand Up @@ -78,7 +77,7 @@

router.register("batch_requests", BatchRequestView, basename="batch-requests")

router.register("units", UnitsView, basename="units")
# router.register("units", UnitsView, basename="units")

router.register("valueset", ValueSetViewSet, basename="value-set")

Expand Down

0 comments on commit 72c9741

Please sign in to comment.