def save_to_tagdata(self, tagdata, room_state, mins, delay): now = datetime.datetime.now() n_day = room_state["day"] n_hour = math.floor(mins / 60) n_min = mins % 60 from_time = datetime.datetime(int(now.year), int(now.month), int(n_day), int(n_hour), int(n_min)) to_time = from_time + datetime.timedelta(minutes = int(delay)) x1,y1 = room_state["patient"].x,room_state["patient"].y x2,y2 = simulator_util.get_point_by_position(room_state["room"]) tagdata.append(location.get_patient_location(room_state["patient"].id, "ROOM", from_time, to_time, x1,y1, x2,y2, room_state["room"])) room_state["patient"].x = x2 room_state["patient"].y = y2
def save_to_tagdata(self, tagdata, patient_info): now = datetime.datetime.now() n_day = patient_info["day"] n_hour = math.floor(patient_info["from_time"] / 60) n_min = patient_info["from_time"] % 60 n_seq = patient_info["to_time"] - patient_info["from_time"] from_time = datetime.datetime(int(now.year), int(now.month), int(n_day), int(n_hour), int(n_min)) to_time = from_time + datetime.timedelta(minutes = int(n_seq)) x1,y1 = patient_info["patient"].x,patient_info["patient"].y x2,y2 = simulator_util.get_point_by_position("image") tagdata.append(location.get_patient_location(patient_info["patient"].id, "IMAGING", from_time, to_time, x1,y1, x2,y2)) tagdata.append(alert.get_image_alert(patient_info["patient"].id, from_time, to_time, n_seq, x2, y2)) patient_info["patient"].x = x2 patient_info["patient"].y = y2
def save_to_tagdata(self, tagdata, patient_info): # append REGISTRATION to tag_data now = datetime.datetime.now() n_day = patient_info["day"] n_hour = math.floor(patient_info["from_time"] / 60) n_min = patient_info["from_time"] % 60 n_seq = patient_info["to_time"] - patient_info["from_time"] from_time = datetime.datetime(int(now.year), int(now.month), int(n_day), int(n_hour), int(n_min)) to_time = from_time + datetime.timedelta(minutes=int(n_seq)) x1, y1 = simulator_util.get_point_by_position("enter") x2, y2 = simulator_util.get_point_by_position("registration") tagdata.append( location.get_patient_location(patient_info["patient"].id, "REGISTRATION", from_time, to_time, x1, y1, x2, y2)) tagdata.append( alert.get_registration_alert(patient_info["patient"].id, from_time, to_time, n_seq, x2, y2)) patient_info["patient"].x = x2 patient_info["patient"].y = y2