Exemplo n.º 1
0
 def test_get_all_active(self):
     # one linked procedure case
     testAssign, testPatient, testProcedure = self.test_create_assignedProcedure(
     )
     # two linked procedures case
     tProcedure = Procedure.objects.create(procedure_name="bloodwork")
     assigned = AssignedProcedures.assign_procedure_to_patient(
         2, testPatient, tProcedure)
     assigned.completed = True
     assigned.save()
     quiriedProcedure = AssignedProcedures.get_all_active_procedures()
     self.assertTrue(assigned not in quiriedProcedure)
Exemplo n.º 2
0
    def return_all_behind_procedures():
        allLateProcedures = []

        for incompleteProcedure in AssignedProcedures.get_all_active_procedures(
        ):
            incompleteProcedurePatient = incompleteProcedure.patient.all()[0]
            incompleteProcedureProc = incompleteProcedure.procedure.all()[0]

            assignedProcStatus = AssignedProcedures.check_goal_status(
                incompleteProcedurePatient, incompleteProcedureProc)
            if assignedProcStatus == "in progress (behind)":
                allLateProcedures.append(incompleteProcedure)

        return allLateProcedures
Exemplo n.º 3
0
    def calculate_behind_procedure_prec():

        totalProc = 0
        for indivAssignedProc in AssignedProcedures.get_all_active_procedures(
        ):
            totalProc += 1

        behindProc = 0
        for flaggedPatients in AssignedProcedures.update_and_return_all_patient_goal_flags(
        ):
            if flaggedPatients.behind_flag is True:
                behindProc += 1

        if totalProc is 0:
            percentBehind = 0
        else:
            percentBehind = (behindProc / totalProc) * 100

        Analytics.behind_procedure_perc = percentBehind

        return round(percentBehind, 1)