Use the P_PATIENT_DOC_REFERRED_TO stored procedure to retrieve the list of physicians to whom the patient was referred to.
The P_PATIENT_DOC_REFERRED_TO 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 : Retrieves Doctors names to which a patient has been referred to.
SELECT P1.DOCTORNUMBER, FAMILYDOCTOR.FIRSTNAME, FAMILYDOCTOR.LASTNAME FROM P_PATIENT_DOC_REFERRED_TO(:PATIENTNO) AS P1 JOIN FAMILYDOCTOR ON FAMILYDOCTOR.DOCTORNUMBER = P1.DOCTORNUMBER |