Use the P_PATIENT_DOC_REFERRED_FROM stored procedure to retrieve the list of physicians that referred the patient to the office.
The P_PATIENT_DOC_REFERRED_FROM stored procedure accepts one parameter, which is the patient number. And, will return a list of doctor numbers, that corresponds to the DOCTORNUMBER field in the FAMILYDOCTOR table.
Example
SELECT P1.DOCTORNUMBER, FAMILYDOCTOR.FIRSTNAME, FAMILYDOCTOR.LASTNAME FROM P_PATIENT_DOC_REFERRED_FROM(:PATIENTNO) AS P1 JOIN FAMILYDOCTOR ON FAMILYDOCTOR.DOCTORNUMBER = P1.DOCTORNUMBER |