Scenario
A new department of the hospital needs different types of reports for different users. The receptionist needs patient details and corresponding doctor information. The doctor needs the patient details and his medical history. The lab needs doctor's diagnosis and recommendations. The information needs to be provided depending upon the users.
Operation
SQL/XML queries and Xquery can be used inside a stored procedure. XML can also be passed as input parameter for stored procedures.
Create Procedure
--> Creates a procedure which accepts XML as input parameter.
The SQL/XML or Xquery inside the procedure fetches the information depending on the type of user querying information.
The user type is also passed as an input parameter.
Solution
The information from the PMD document is fetched according to the type of user querying the information.