def Query_Data_From_Database(self, ID, infoDB):
        ## connect database, query previous one day data from Database
        # Database = database_dict()
        Heart_Rate = list()
        Blood_oxygen = list()

        Systolic = list()
        Diastolic = list()
        DataBaseModule.search(ID)
        # Username = input("")
        #get dictionary from database
        for key in infoDB:
            if key == ID:
                # pressure = dict.get('blood_pressure')
                Heart_Rate = dict.get('Heart_Rate')
                oxygen = dict.get('blood_oxygen')
                Diastolic_BP = dict.get('Diastolic_BP')
                Systolic_BP = dict.get('Systolic_BP')
                # Blood_pressure.append(pressure)
                Heart_Rate.append(Heart_Rate)
                Blood_oxygen.append(oxygen)
                Systolic.append(Systolic_BP)
                Diastolic.append(Diastolic_BP)

        return Heart_Rate, Blood_oxygen, Systolic, Diastolic
コード例 #2
0
    def Query_Data_From_Database(self, ID):
        ## connect database, query previous one day data from Database
        # Database = database_dict()
        Blood_oxygen = []
        Diastolic_BP = []
        Pulses = []
        Systolic_BP = []

        info = DataBaseModule()
        info.authen('admin', '123456')
        info = info.search(ID)
        # Username = input("")
        #get dictionary from database
        for key in self.infoDB:
            if key == ID:
                _Diastolic_BP = info['Diastolic_BP']
                _Systolic_BP = info['Systolic_BP']
                _oxygen = info['blood_oxygen']
                _Pulse = info['heartrate']
                Diastolic_BP.append(int(_Diastolic_BP))
                Systolic_BP.append(int(_Systolic_BP))
                Blood_oxygen.append(int(_oxygen))
                Pulses.append(int(_Pulse))

        return Blood_oxygen, Diastolic_BP, Systolic_BP, Pulses
コード例 #3
0
    def Query_Data_From_Database(self):
        ## connect database, query previous one day data from Database
        # Database = database_dict()
        Blood_oxygen=list()
        Systolic= list()
        Diastolic= list()
        heartrate=list()
        ID = self.ID
        p= DataBaseModule()
        infoDB= p.search(ID)
        # get dictionary from database
        for key in self._dict:
            # if key== ID:
                heartate=self._dict.get("heartrate")
                oxygen = self._dict.get('blood_oxygen')
                Diastolic_BP = self._dict.get('Diastolic_BP')
                Systolic_BP = self._dict.get('Systolic_BP')
                heartrate.append(heartate)
                Blood_oxygen.append(oxygen)
                Systolic.append(Systolic_BP)
                Diastolic.append(Diastolic_BP)

        return Blood_oxygen, heartate, Systolic,Diastolic