XSLT stylesheet (PMD.xsl)


<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" > <xsl:template match="/"> <html> <body> <h3>Patient Medical Document</h3> <table width="80%"> <tr> <table border="2" width="100%" align ="center"> <tr bgcolor="grey"> <th>Items</th> <th>value</th> </tr> <tr align ="center"> <td>Hospital Name</td> <td><xsl:value-of select="patient_document/patient/hospital_name"/></td> </tr> <tr align ="center"> <td>Patient Name</td> <td><xsl:value-of select="patient_document/patient/name/first"/> <xsl:value-of select="patient_document/patient/name/last"/></td> </tr> <tr align ="center"> <td>Gender</td> <td><xsl:value-of select="patient_document/patient/gender"/></td> </tr> <tr align ="center"> <td>Address</td> <td><xsl:value-of select="patient_document/patient/address/residence_no"/><br/> <xsl:value-of select="patient_document/patient/address/street"/><br/> <xsl:value-of select="patient_document/patient/address/city"/><br/> <xsl:value-of select="patient_document/patient/address/state"/><br/> <xsl:value-of select="patient_document/patient/address/zip_code"/><br/> </td> </tr> <tr align ="center"> <td>Gender</td> <td><xsl:value-of select="patient_document/patient/gender"/></td> </tr> <tr align ="center"> <td>Email</td> <td><xsl:value-of select="patient_document/patient/email"/></td> </tr> <tr align ="center"> <td>Phone</td> <td><xsl:value-of select="patient_document/patient/phone"/></td> </tr> </table> </tr> <br/> <tr width="80%"><table width="80%"><tr><td><b>Medical Information</b></td><td align ="left"><b>Specialist Info</b></td><td align ="center"><b>Medicines Prescribed</b></td></tr></table></tr> <tr> <table width ="80%"><tr> <td> <table border="2"> <tr bgcolor="grey"> <th>Items</th> <th>value</th> </tr> <tr> <td>Visited Date</td> <td><xsl:value-of select="patient_document/patient/visit_info/visited_date/@date"/></td> </tr> <tr> <td>Doctor Name</td> <td><xsl:value-of select="patient_document/patient/visit_info/visited_date/doctor_details/doctor_name/first"/> <xsl:value-of select="patient_document/patient/visit_info/visited_date/doctor_details/doctor_name/last"/> </td> </tr> </table> </td> <td> <table border="2"> <tr bgcolor="grey"> <th>Items</th> <th>value</th> </tr> <tr> <td>Specialist Name</td> <td><xsl:value-of select="patient_document/patient/visit_info/visited_date/checkup_details/specialist_ref/specialist/name/first"/> <xsl:value-of select="patient_document/patient/visit_info/visited_date/checkup_details/specialist_ref/specialist/name/last"/> </td> </tr> <tr> <td>Referral Reason</td> <td><xsl:value-of select="patient_document/patient/visit_info/visited_date/checkup_details/specialist_ref/specialist/ref_reason"/></td> </tr> <tr> <td>Observation</td> <td><xsl:value-of select="patient_document/patient/visit_info/visited_date/checkup_details/specialist_ref/specialist/observation"/></td> </tr> </table> </td> <td> <table border="2"> <tr bgcolor="grey"> <th>Items</th> <th>value</th> </tr> <xsl:for-each select="patient_document/patient/visit_info/visited_date/checkup_details/medicines"> <tr> <td>Medicines</td> <td><xsl:value-of select="name"/></td> </tr> </xsl:for-each> </table> </td> </tr> </table> </tr> <br/> <tr width="80%"><table width="80%"><tr><td><b>Patient Symptoms</b></td></tr></table></tr> <table width ="80%"><tr> <td> <table border="2"> <tr bgcolor="grey"> <th>Items</th> <th>value</th> </tr> <xsl:for-each select="patient_document/patient/visit_info/visited_date/checkup_details/symptoms"> <tr> <td>Symptoms</td> <td><xsl:value-of select="text"/></td> </tr> </xsl:for-each> </table> </td></tr> </table> </table> </body> </html> </xsl:template> </xsl:stylesheet>


XML document using the XSLT stylesheet (PMD.xml)


<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="PMD.xsl"?> <patient_document> <document id ="PMD10001" version="1"/> <patient ID="10001" > <hospital_name>New Care Hospital</hospital_name> <name> <first>Edward</first> <last>Jhonson</last> <prefix></prefix>l </name> <address> <residence_no>553</residence_no> <street>Milk Street</street> <city>Earth City</city> <state>NewState</state> <zip_code>10101</zip_code> </address> <email>akdk@good.com</email> <phone>+11-324-2345</phone> <date_of_birth>197608161435</date_of_birth> <gender>M</gender> <visit_info> <visited_date date="200703210000"> <doctor_details> <type>DUTY</type> <doctor_name> <first>Durenda</first> <last>Flor</last> <prefix>M.D</prefix> </doctor_name> </doctor_details> <checkup_details> <weight>75</weight> <symptoms>The patient indicated severe head ache for past four days, he says that the pain is permanent and the intensity varies from severe to light headache. the patient also indicated symptoms of chest pain and body ache. this causes to have sleeplessness. </symptoms> <symptoms>The patient explains his work habits to be very stressful with 14 hours of work on an average.</symptoms> <symptoms>the patient approached with symptoms of influenza.</symptoms> <specialist_ref status="yes"> <specialist> <name> <first>Henry</first> <last>Mathew</last> </name> <address> <street>Big street</street> <city>One City</city> <state>Good state</state> <zip_code>43020</zip_code> </address> <ref_reason>Nuero scan verification to neuro surgen.</ref_reason> <observation>The brain scan of the patient seems to be normal.</observation> </specialist> </specialist_ref> <labtests_suggested> <test>Brain Scan</test> <test>Blood Test before breakfast</test> </labtests_suggested> <test_report> <test_results>No issues found</test_results> <test_results>Viral Infection - Viral flu</test_results> </test_report> <medicines>Norfloxacin 400 mg I.P</medicines> <medicines>Ibuprofen 200 mg I.P</medicines> <medicines>Cetirizine Hydrochloride 10mg I.P</medicines> <doctor_advice> <result_diagnosis> The patient is having viral infection and needs medical attention. Also needs to admitted and needs to take complete rest. </result_diagnosis> </doctor_advice> </checkup_details> <admitted status ="yes"></admitted> <admitted_date>199603210000</admitted_date> <ward_no>21</ward_no> <discharge_summary> <description>The patient is normal and all test regarding his illness has tested negative. the patient can be discharged.</description> <discharge_date>199603250000</discharge_date> <payment_mode> <cash> <amount_paid>300</amount_paid> </cash> <card> <card_no></card_no> <cardholder_name></cardholder_name> <amount_paid></amount_paid> </card> <Insuranceclaim> <claim_no></claim_no> <amount_paid></amount_paid> </Insuranceclaim> <anyothermode></anyothermode> </payment_mode> </discharge_summary> </visited_date> </visit_info> </patient> </patient_document>