I am trying to do something but I am not sure how to append this to the query. I have a query that will get the patient demographic information that I need then on the next line of the file I need to add the diagnosis which could be one line or 30. Once I have all of the diagnosis finished I need to move to the next patient.
Here is a very basic example.
TEST, PATIENT|123456789|1234567890|2016-10-11 13:05:25.000<crlf>
TEST, PATIENT2|145236987|1236549870|2016-10-10 15:42:35.000<crlf>
The lines with the patient name is from one query and the diagnosis is from another query.
Any help on how I might sent this up?