A portable medical device for injecting a medicament into a patient. The device includes a control circuit with a memory, the control circuit automatically storing in the memory an ejection event including an amount of the medicament that is ejected from the portable medical device during the ejection event; and a proximity sensor configured to sense proximity of a solid object located in an ejection direction of the portable medical device without making contact with the solid object. The control circuit is configured to tag the ejection event as an injection event if the ejection takes place in proximity of the solid object and to tag the ejection event as a priming ejection if the ejection does not take place in proximity of the solid object.