예제 #1
0
 def include_patient(self, follow_up):
     if not follow_up['referral']:
         return follow_up
     
     referral = referralManager.read("id", follow_up['referral'])
     patient = patientManager.read("patientId", referral['patientId'])
     follow_up['patient'] = patient
     return follow_up
예제 #2
0
    def include_patient(self, follow_up):
        if not follow_up["referral"]:
            return follow_up

        referral = referralManager.read("id", follow_up["referral"])
        patient = patientManager.read("patientId", referral["patientId"])
        follow_up["patient"] = patient
        return follow_up
예제 #3
0
    def create_reading_and_patient(self, patient_id, patient_reading_data):
        patient = patientManager.read("patientId", patient_id)
        if patient is None:
            patient = patientManager.create(patient_reading_data['patient'])

        patient_reading_data['reading']['patientId'] = patient_id

        # need to save urine test data from reading for urine test creation
        reading = self.create_reading(patient_reading_data['reading'])

        # return all created data
        return {'reading': reading, 'patient': patient}
    def create_reading_and_patient(self, patient_id, patient_reading_data):
        patient = patientManager.read("patientId", patient_id)
        if patient is None:
            patient = patientManager.create(patient_reading_data["patient"])

        patient_reading_data["reading"]["patientId"] = patient_id
        # get the symptoms array
        symptomArray = patient_reading_data["reading"]["symptoms"]
        # need to save urine test data from reading for urine test creation
        reading = self.create_reading(patient_reading_data["reading"])
        # clearlogging.debug(reading["patient"])
        # return all created data
        return {"reading": reading, "patient": patient}
예제 #5
0
    def put_data_together(self, patient_id):

        patient = patientManager.read("patientId", patient_id)
        if patient is None:
            abort(404, message="Patient {} doesn't exist.".format(patient_id))

        readings = readingManager.read_all()

        # getting all bpSystolic readings for each month
        bp_systolic = self.get_data("bpSystolic", readings, patient_id)
        # self.clean_up_data(bp_systolic)

        # getting all bpDiastolic readings for each month
        bp_diastolic = self.get_data("bpDiastolic", readings, patient_id)
        # self.clean_up_data(bp_diastolic)

        # getting all heart rate readings for each month
        heart_rate = self.get_data("heartRateBPM", readings, patient_id)
        # self.clean_up_data(heart_rate)

        # getting all traffic lights from day 1 for this patient
        traffic_light_statuses = self.get_data("trafficLightStatus", readings,
                                               patient_id)
        # self.clean_up_data(traffic_light_statuses)

        # putting data into one object now
        data = {
            "bpSystolicReadingsMonthly": bp_systolic,
            "bpDiastolicReadingsMonthly": bp_diastolic,
            "heartRateReadingsMonthly": heart_rate,
            "trafficLightCountsFromDay1": {
                "green": traffic_light_statuses[0],  # dont
                "yellowUp": traffic_light_statuses[1],  # hate
                "yellowDown": traffic_light_statuses[2],  # the
                "redUp": traffic_light_statuses[3],  # magic
                "redDown": traffic_light_statuses[4],  # numbers
            },
        }

        # ret
        return data
    def put_data_together(self, patient_id):

        patient = patientManager.read("patientId", patient_id)
        if patient is None:
            abort(404, message="Patient {} doesn't exist.".format(patient_id))

        readings = readingManager.read_all()

        # getting all bpSystolic readings for each month
        bp_systolic = self.get_data('bpSystolic', readings, patient_id)
        #self.clean_up_data(bp_systolic)

        # getting all bpDiastolic readings for each month
        bp_diastolic = self.get_data('bpDiastolic', readings, patient_id)
        #self.clean_up_data(bp_diastolic)

        # getting all heart rate readings for each month
        heart_rate = self.get_data('heartRateBPM', readings, patient_id)
        #self.clean_up_data(heart_rate)

        # getting all traffic lights from day 1 for this patient
        traffic_light_statuses = self.get_data('trafficLightStatus', readings,
                                               patient_id)
        #self.clean_up_data(traffic_light_statuses)

        # putting data into one object now
        data = {
            'bpSystolicReadingsMontly': bp_systolic,
            'bpDiastolicReadingsMonthly': bp_diastolic,
            'heartRateReadingsMonthly': heart_rate,
            'trafficLightCountsFromDay1': {
                'green': traffic_light_statuses[0],  # dont
                'yellowUp': traffic_light_statuses[1],  # hate
                'yellowDown': traffic_light_statuses[2],  # the
                'redUp': traffic_light_statuses[3],  # magic
                'redDown': traffic_light_statuses[4]  # numbers
            }
        }

        # ret
        return data