A dialysis system comprising: a dialysis machine; a control unit; a drug delivery device; a portable computing device that is configured to electronically transmit a prescribed dosage of a drug to the drug delivery device; a medical fluid tube (122, 922, 1004) connected to the dialysis machine; an ultrasonic transmitter positioned adjacent to the medical fluid tube (122, 922, 1004); an ultrasonic receiver positioned adjacent to the medical fluid tube (122, 922, 1004) configured to receive one or more signals in response to the activation of the ultrasonic transmitter; and a computer storage medium encoded with computer program instructions that when executed by the dialysis system, causes the dialysis system to perform operations comprising: controlling repetitive activation of the ultrasonic transmitter, wherein controlling repetitive activation of the ultrasonic transmitter comprises, for each repetition: activating the ultrasonic transmitter for a first period; and deactivating the ultrasonic transmitter for a second period; for each repetition, comparing a signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period to a threshold value; and determining presence of fluid in a portion of the medical fluid tube (122, 922, 1004) if the signal received from the ultrasonic receiver satisfies the threshold value for at least a current repetition, wherein: for a previous repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a first threshold value, and for the current repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a second threshold value if the first threshold value was satisfied and compared to a third threshold value if the first threshold value was not satisfied. a dialysis machine; a control unit; a drug delivery device; a portable computing device that is configured to electronically transmit a prescribed dosage of a drug to the drug delivery device; a medical fluid tube (122, 922, 1004) connected to the dialysis machine; an ultrasonic transmitter positioned adjacent to the medical fluid tube (122, 922, 1004); an ultrasonic receiver positioned adjacent to the medical fluid tube (122, 922, 1004) configured to receive one or more signals in response to the activation of the ultrasonic transmitter; and a computer storage medium encoded with computer program instructions that when executed by the dialysis system, causes the dialysis system to perform operations comprising: controlling repetitive activation of the ultrasonic transmitter, wherein controlling repetitive activation of the ultrasonic transmitter comprises, for each repetition: activating the ultrasonic transmitter for a first period; and deactivating the ultrasonic transmitter for a second period; for each repetition, comparing a signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period to a threshold value; and determining presence of fluid in a portion of the medical fluid tube (122, 922, 1004) if the signal received from the ultrasonic receiver satisfies the threshold value for at least a current repetition, wherein: for a previous repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a first threshold value, and for the current repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a second threshold value if the first threshold value was satisfied and compared to a third threshold value if the first threshold value was not satisfied. controlling repetitive activation of the ultrasonic transmitter, wherein controlling repetitive activation of the ultrasonic transmitter comprises, for each repetition: activating the ultrasonic transmitter for a first period; and deactivating the ultrasonic transmitter for a second period; activating the ultrasonic transmitter for a first period; and deactivating the ultrasonic transmitter for a second period; for each repetition, comparing a signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period to a threshold value; and determining presence of fluid in a portion of the medical fluid tube (122, 922, 1004) if the signal received from the ultrasonic receiver satisfies the threshold value for at least a current repetition, wherein: for a previous repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a first threshold value, and for the current repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a second threshold value if the first threshold value was satisfied and compared to a third threshold value if the first threshold value was not satisfied. for a previous repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a first threshold value, and for the current repetition, the signal received from the ultrasonic receiver during the activation of the ultrasonic transmitter for the first period is compared to a second threshold value if the first threshold value was satisfied and compared to a third threshold value if the first threshold value was not satisfied.