I'll be honest: I saw both questions, and felt like neither were particularly good questions.
However, in addition to the specific medical advice, this questionthis question included elements that I felt were on-topic (mostly "How do you deal with your baby being so frustrated?").
The other questionThe other question didn't seem to exclude non-medical issues, since the core of the question seemed to be "she is very restless,scared and keeps crying without a reason.What could be the problem?", in which case the medical content could be seen as merely background information.
In both cases, I took no action (aside from some cleanup edits) because I wanted to see what the community consensus was.
As it was, one of the questions got two answers, each of which addressed different parts of the question (and the higher-voted of the two addressed the frustration part of the question which I felt was on-topic).
That being said... neither question received any flags, edit suggestions, close votes, or even down-votes.
I am trying to be slower to react as a moderator for any "grey" areas, particularly where new users are concerned. Partly this is to make the site more welcoming; partly this is in hopes of seeing more "policing" activities from the community members at large.
Frankly, I was surprised neither one of the questions went as long as they did without any negative or corrective attention.
So, thank you for bringing this to meta.
Regarding your basic question here, though (where do we draw the line):
I suggest technical questions about a specific medical condition that has been diagnosed are off-topic. This also applies to any question that details a set of specific symptoms, and asks for a diagnosis or suggestions as to "what it might be".
Questions about how medical conditions relate to behavior (either how the person with the condition behaves, or how people around them behave), should be on-topic.
In both of the examples listed, the questions fall clearly on both sides of those dividing lines.
I think the best way to handle this is to edit out the parts that deal with asking about the diagnosis (i.e. anything that isn't explicitly relevant as background for the behavior).