there are 2 reasons why scholars have deemed this as breaking your fast:
- one is from a hadith about vomiting volentary and involentary
the Prophet (peace and blessings of Allaah be upon him) said: “Whoever vomits involuntarily does not have to make up the fast, but whoever vomits deliberately let him make up the fast.” Narrated by al-Tirmidhi, 720, classed as saheeh by al-Albaani in Saheeh al-Tirmidhi, 577.
this would mean that is somthing comes out of the body volentarily, such as a cut, nosebleed, etc, then your fast is valid. But if one deliberatly tries to expell nutriants, then their fast is invalid.
- the second reason is because of a hadith about cupping- a medicinal practice that involves removing blood from the body to ease pain. read more here
the Prophet (peace and blessings of Allaah be upon him) said: “The cupper and the one for whom cupping is done have both invalidated their fast.” Narrated by Abu Dawood, 2367; classed as saheeh by al-Albaani in Saheeh Abi Dawood, 2047.
taking out blood to run tests is the same, since it is deliberatly pulling blood out of the body, even if it is for your health.
I would also like to point out that if you are fasting and you pull blood out it may be a safety hazard, as you are loosing neseccary nutrients. This may be one of the reasons why the prophet seemed it as breaking your fast
unless it is absoulutly necessary to run tests at that moment (which im assuming it isn't) you cannot break you fast. Even though it may be easier to do it in ramadan, it would be best to postpone your appointment. This month of ramadan is about sacrafice, and it is not limited to food.
If this is necessary, Allah said in the quran:
[Fasting is for] a limited number of days. So whoever among you is ill or on a journey [during them] - then an equal number of days [are to be made up]. And upon those who are able [to fast, but with hardship] - a ransom [as substitute] of feeding a poor person [each day]. And whoever volunteers excess - it is better for him. But to fast is best for you, if you only knew. 2:184
If you truley are ill, then it would be permissible to give the blood, and break your fast, and feed a poor person for each day you break. But if it can be postponed, it would be preferred.