Teine-meeskond: Difference between revisions

From ICO wiki
Jump to navigationJump to search
Nskoroho (talk | contribs)
Rrattas (talk | contribs)
No edit summary
Line 313: Line 313:
</xsl:template>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
</source>
=Esimese tiimi XML'ide retsensioon=
Lorem ipsum

Revision as of 17:42, 11 May 2013

Võrgurakendused II: hajussüsteemide ehitamine

Kodutöö leht

Meeskond "Mad Doctors"


Rühma liikmed (Doctors):

  • Nikolai Skorohodov
  • Ragnar Rattas
  • Rynga Bogdanov

Projekti kirjeldus

Projektiks on meditsiiniga seotud rakendus, läbi mille saab:

- isik saab jagada oma kaebuseid perearstiga või teiste arstidega, mis võivad olla mõni haiguse sümptoomid

- isik saab lisada ka nende sümptoomide toimimise täpsemat aega, kestust, lisada selle kohta ka kommentaare, kui vaja

- arst saab seda vaadata, vastata patsiendile: milline ravim saaks aidata? kas on vaja tulla perearstile ja kui jah - millal võib?

- arst saab ka grupeerida sümptoome haiguste all

Pean mainida, et see pole selle rakenduse valmimise kava, vaid eeldatavad funktsioonid, mis ei pea kõik olema tehniliselt teostatavad.

Saab vaadata ka AXURE RP Pro 6.5 tarkvara abil tehtud protüübi ekraanitõmmist, see on Kliendirakenduse umbkaudne vaade: http://imageshack.us/a/img7/9987/000673.png

See on tehtud pärast eelmiste aastate tööde pealiskaudset analüüsi.

XML fail

<?xml version="1.0" encoding="utf-8" ?>
<!-- Simple XML datafile for holding patients data -->
<PatientData>
	<Patient id="1" hasInsurance="yes">
		<FirstName>Mari-Liis</FirstName>
		<LastName>Männik</LastName>
		<PersonalCode>47101010033</PersonalCode>
		<MedicalHistory>
			<Complaint id="1" isPrivate="no">
				<Symptom>Fever</Symptom>
				<BeginDateTime>2013-05-28T09:00:00</BeginDateTime>
				<Description>I'm feeling sick and I have 38 degrees fever!</Description>
				<Treatment>
           				<Medicine id="1" isPrescriptionDrug="no">
             					<Name>Aspirin</Name>
              					<BeginDate>2013-05-28</BeginDate>
             					<EndDate>2013-05-30</EndDate>
             					<Notes>Take one tablet three times a day.</Notes>
             				</Medicine>            			
          				<Medicine id="2" isPrescriptionDrug="yes">
             					<Name>Xanax</Name>
              					<BeginDate>2013-05-28</BeginDate>
             					<EndDate>2013-05-30</EndDate>
             					<Notes>Take two pills per day and enjoy your flight!</Notes>
              				</Medicine> 
				</Treatment>		
			</Complaint>
			<Complaint id="2" isPrivate="yes">
				<Symptom>Headache</Symptom>
				<BeginDateTime>2013-05-28T09:00:00</BeginDateTime>
				<EndDateTime>2013-05-30T09:00:00</EndDateTime>
				<Description>I'm having random headaches</Description>
				<Treatment>
           				<Medicine id="2" isPrescriptionDrug="yes">
             					<Name>Xanax</Name>
              					<BeginDate>2013-05-28</BeginDate>
             					<EndDate>2013-05-30</EndDate>
             					<Notes>Take one pill per day and enjoy!</Notes>
              				</Medicine>
				</Treatment>
			</Complaint>	
		</MedicalHistory>
	</Patient>
	<Patient id="2" hasInsurance="no">
		<FirstName>Igor</FirstName>
		<LastName>Žaikovski</LastName>
		<PersonalCode>37101010021</PersonalCode>
		<MedicalHistory>
			<Complaint id="1" isPrivate="no">
				<Symptom>Can't sleep</Symptom>
				<BeginDateTime>2013-05-28T09:00:00</BeginDateTime>
				<Description>I can't sleep.</Description>
				<Treatment>
           				<Medicine id="3" isPrescriptionDrug="no">
             					<Name>Sleeping pills</Name>
              					<BeginDate>2013-05-28</BeginDate>
             					<EndDate>2013-06-30</EndDate>
             					<Notes>Take one pill before going to sleep.</Notes>
              				</Medicine>
				</Treatment>		
			</Complaint>
		</MedicalHistory>
	</Patient>
</PatientData>

XML schema (XSD)

<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- Start of PatientData -->
  <xs:element name="PatientData">
    <xs:complexType>
      <xs:sequence>
        <!-- Start of patinet element description -->
        <xs:element name="Patient" maxOccurs="unbounded">
          <!-- Start of patient child elements description -->
          <xs:complexType>
            <xs:sequence>
              <xs:element name="FirstName" type="xs:string" />
              <xs:element name="LastName" type="xs:string" />
              <!-- Patients Estonian national personal code (without county code), i.e. 380xxxxxxxxx  -->
              <xs:element name="PersonalCode" type="xs:integer" />
              <!-- Start of MedicalHistory, only one is allowed, all complaints go under this element -->
              <xs:element minOccurs="0" maxOccurs="1" name="MedicalHistory">
                <xs:complexType>
                  <xs:sequence>
                    <!-- Start of patient complaints -->
                    <xs:element name="Complaint" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <!-- Illness symptoms -->
                          <xs:element name="Symptom" type="xs:string" />
                          <!-- Start and end dateTime of symptoms -->
                          <xs:element name="BeginDateTime" minOccurs="0" type="xs:dateTime" />
                          <xs:element name="EndDateTime" minOccurs="0" type="xs:dateTime" />
                          <!-- Longer explanation about symptoms -->
                          <xs:element name="Description" type="xs:string" />
                          <!-- Doctors treatment for this complaint -->
                          <xs:element name="Treatment" minOccurs="0" maxOccurs="1">
                            <xs:complexType>
                              <xs:sequence>
                                <!-- Start of medicine -->
                                <xs:element maxOccurs="unbounded" name="Medicine">
                                    <!-- Medicines unique ID -->
                                    <xs:complexType>
                                      <xs:sequence>
                                        <!-- Medicines name -->
                                        <xs:element name="Name" type="xs:string" />
                                        <!-- For how long to take the medicine -->
                                        <xs:element name="BeginDate" minOccurs="0" type="xs:date" />
                                        <xs:element name="EndDate" minOccurs="0" type="xs:date" />
                                        <!-- Some notes how to take the medicine -->
                                        <xs:element name="Notes" type="xs:string" />
                                      </xs:sequence>
                                      <!-- Medicines unique ID -->
                                      <xs:attribute name="id" type="xs:integer" use="required" />
                                      <!-- Is it prescription drug? Only allow yes/no  -->
                                      <xs:attribute name="isPrescriptionDrug" use="required">
                                        <xs:simpleType>
                                          <xs:restriction base="xs:string">
                                            <xs:pattern value="yes|no"/>
                                          </xs:restriction>
                                        </xs:simpleType>
                                      </xs:attribute>
                                    </xs:complexType>
                                <!-- End of medicine -->
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          <!-- End of treatment -->
                          </xs:element>
                        </xs:sequence>
                        <!-- Complaint unique ID -->
                        <xs:attribute name="id" type="xs:integer" use="required" />
                        <!-- Is this complaint very delicate issue and it should be hidden to other doctors -->
                        <xs:attribute name="isPrivate" use="required">
                          <xs:simpleType>
                            <xs:restriction base="xs:string">
                            <xs:pattern value="yes|no"/>
                            </xs:restriction>
                          </xs:simpleType>
                        </xs:attribute>
                      </xs:complexType>
                    </xs:element> 
                  </xs:sequence>
                </xs:complexType>
              <!-- End of MedicalHistory -->
              </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:integer" use="required" />
            <!-- Is patient insured at Haigekassa? Only allow yes/no  -->
            <xs:attribute name="hasInsurance" use="required">
              <xs:simpleType>
                <xs:restriction base="xs:string">
                <xs:pattern value="yes|no"/>
              </xs:restriction>
              </xs:simpleType>
            </xs:attribute>
          </xs:complexType>
          <!-- Patients unique ID -->
        <!-- End of Patient -->
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  <!-- End of PatientData -->
  </xs:element>
</xs:schema>

Style Sheet 1

Prindib kõik patsiendid välja.

Tulemust saab vaadata siin: https://wiki.itcollege.ee/index.php/Teine-meeskond_XSLT1

<?xml version="1.0" encoding="utf-8"?>
<!-- Very simple XSLT, print out all patients -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
    <html>
      <head>
        <title>List of patients</title>
        </head>
        <body>
          <h1>List of patients</h1>
          <ul>
          <xsl:for-each select="PatientData/Patient">
            <li>
              <xsl:value-of select="FirstName"/>
              <xsl:text> </xsl:text>
              <xsl:value-of select="LastName"/>
              <xsl:text> (</xsl:text>
              <xsl:value-of select="PersonalCode"/>
              <xsl:text>)</xsl:text>
            </li>
          </xsl:for-each>
          </ul>
        </body>        
      </html>
    </xsl:template>
</xsl:stylesheet>

Style Sheet 2

Prindib kõik sümptomeid välja.

Tulemust saab vaadata siin: https://wiki.itcollege.ee/index.php/Teine-meeskond_XSLT2

<?xml version="1.0" encoding="utf-8"?>
<!-- Very simple XSLT, print out all syptoms patients have ever had -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
   <html>
    <body>
      <h2>List of symptoms</h2>
      <table border="1">
       <tr bgcolor="#9acd32">
        <th>Symptom</th>
       </tr>
          <xsl:for-each select="PatientData/Patient/MedicalHistory/Complaint">
           <tr>
            <td><xsl:value-of select="Symptom"/></td>
           </tr>
         </xsl:for-each>
      </table>
    </body>        
   </html>
  </xsl:template>
</xsl:stylesheet>

Style Sheet 3

Näitab sümptomi, selle registreetitud aja, mille viidi n-ö (month day, year) kujul ja sümptoomi kirjelduse. Püüdsin teha nii, et oleks natuke sarnane prototüübiga :) Natuke

Tulemust saab vaadata siin: https://wiki.itcollege.ee/index.php/Teine-meeskond_XSLT3

<?xml version="1.0" encoding="utf-8"?>
<!-- Very simple XSLT, print out symptom, its formatted registered time and description -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
				 xmlns:ms="urn:schemas-microsoft-com:xslt"
				 xmlns:dt="urn:schemas-microsoft-com:datatypes">
	<xsl:output method="html" indent="yes"/>

	<xsl:template match="/">
		<html>
			<body>
				<h2>Symptom, time and description</h2>
				<table border="1">
					<tr bgcolor="#9acd32">
						<th>Symptom</th>
						<th>Registered Time</th>
						<th>Description</th>
					</tr>
					<xsl:for-each select="PatientData/Patient/MedicalHistory/Complaint[Symptom='Fever']">
						<tr>
							<td>
								<xsl:value-of select="Symptom"/>
							</td>
							<td>
								<xsl:value-of select="ms:format-date(BeginDateTime, 'MMM dd, yyyy')"/>
							</td>
							<td>
								<xsl:value-of select="Description"/>
							</td>
						</tr>
					</xsl:for-each>
				</table>
			</body>
		</html>
	</xsl:template>
</xsl:stylesheet>

Esimese tiimi XML'ide retsensioon

Lorem ipsum