<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema elementFormDefault="qualified" version="1.0" targetNamespace="http://www.esveikata.lt/erx-fhir" xmlns="http://www.esveikata.lt/erx-fhir" xmlns:tns="http://www.esveikata.lt/erx-fhir" xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <xs:element name="drugInteractionQuery">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="patientId" type="xs:long" minOccurs="0"/>
                <xs:element name="qDrug" type="qDrug" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="qDrug">
        <xs:sequence>
            <xs:element name="activeSubstances" type="xs:string"/>
            <xs:element name="pharmForm" type="xs:string"/>
            <xs:element name="oldDrug" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:element name="drugInteractionQueryResult">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="drugInteractionQueryId" type="xs:long"/>
                <xs:element name="drugLimit" type="xs:int"/>
                <xs:element name="drugLimitReached" type="xs:boolean"/>
                <xs:element name="drugInteraction" type="drugInteraction" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="drugInteraction">
        <xs:sequence>
            <xs:element name="iDrug" type="iDrug" maxOccurs="unbounded"/>
            <xs:element name="consequences" type="xs:string"/>
            <xs:element name="recommendation" type="xs:string"/>
            <xs:element name="clinicalImportanceCode" type="xs:string"/>
            <xs:element name="clinicalImportanceText" type="xs:string"/>
            <xs:element name="scientificDocumentationCode" type="xs:string"/>
            <xs:element name="scientificDocumentationText" type="xs:string"/>
            <xs:element name="link" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="iDrug">
        <xs:sequence>
            <xs:element name="activeSubstance" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>