<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 $Log: sp_service_provider.xsd,v $
 Revision 1.1.1.1  2003/07/22 14:26:28  richard
 initial import

-->
<xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
 <xsd:include schemaLocation="sp_simple_types.xsd"/>
 <xsd:include schemaLocation="sp_attrib_groups.xsd"/>

 <xsd:complexType name="serviceProviderBaseType">
  <xsd:all>
   <xsd:element name="name"					type="tok100Type" 			minOccurs='1' maxOccurs='1' nillable="false"/>
   <xsd:element name="type"				        type="providertypesPickOption"		minOccurs='1' maxOccurs='1' nillable="false"/>
   <xsd:element name="physical_address"				type="streetAddressType"		minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="area"	 				type="areaType" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="county"					type="countyType" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="mailing_address"				type="streetAddressType"		minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_number1"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_descrip1"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_number2"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_descrip2"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_number3"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_descrip3"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_number4"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="telephone_descrip4"			type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="fax"					type="tok20Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="email_address"				type="tok50Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="website_address"				type="tok50Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="contact_person"				type="tok50Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="contact_title"				type="tok50Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="shelter_service_code"                     type="serviceCodeType"                  minOccurs='0' maxOccurs='1' nillable="true"/>

   <xsd:element name="shelter"                                  type="xsd:boolean"                      minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="shelter_requirements"                     type="xsd:string"                       minOccurs='0' maxOccurs='1' nillable="true"/>

   <xsd:element name="description"				type="xsd:string" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="landmarks"				type="xsd:string" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="handicap_access"			        type="xsd:boolean"			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="brochures"			        type="xsd:boolean"			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="hours"					type="tok60Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="fees"                                     type="xsd:string"                       minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="eligibility"                              type="xsd:string"                       minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="languages"	        		type="tok60Type" 			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="intake_procedure"		                type="xsd:string"			minOccurs='0' maxOccurs='1' nillable="true"/>
 
   <xsd:element name="zips_served"				type="zipList"				minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="cities_served"				type="cityList"				minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="areas_served"				type="areaList"				minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="counties_served"				type="countyList"			minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="services_provided"			type="serviceCodeList"			minOccurs='0' maxOccurs='1' nillable="true"/>

  </xsd:all>
  <xsd:attributeGroup ref="entityIdentifierGroup"/>
  <xsd:attribute name="parent_provider_id"	        type="legacyIDType"			use="optional"/>
  <xsd:attribute name="show_on_public_site"		type="xsd:boolean"			use='optional'/>
  <xsd:attribute name="printed_directory"		type="xsd:boolean"			use='optional'/>
 </xsd:complexType>

 <xsd:complexType name="streetAddressType">
  <xsd:sequence>
   <xsd:element name="address1" type="tok50Type"    minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="address2" type="tok50Type"    minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="city" 	type="stateType"    minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="state"    type="tok100Type"   minOccurs='0' maxOccurs='1' nillable="true"/>
   <xsd:element name="zip"      type="zipType"      minOccurs='0' maxOccurs='1' nillable="true"/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="zipList">
  <xsd:sequence>
   <xsd:element name="zip" type="zipType" minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="cityList">
  <xsd:sequence>
   <xsd:element name="city" type="cityType" minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="areaList">
  <xsd:sequence>
   <xsd:element name="area" type="areaType" minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="countyList">
  <xsd:sequence>
   <xsd:element name="county" type="countyType" minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="serviceCodeList">
  <xsd:sequence>
   <xsd:element name="service_code" type="serviceCodeType" minOccurs='0' maxOccurs='unbounded'/>
  </xsd:sequence>
 </xsd:complexType>

 <xsd:complexType name="serviceCodeType">
  <xsd:simpleContent>
   <xsd:extension base="tok250Type">
    <xsd:attribute name="type" type="tok250Type" use="required"/>
   </xsd:extension>
  </xsd:simpleContent>
 </xsd:complexType>

    <xsd:simpleType name="providertypesPickOption">
        <xsd:union>
            <xsd:simpleType>
                <xsd:restriction base="xsd:token">
                    <xsd:maxLength value="100"/>
                </xsd:restriction>
            </xsd:simpleType>
            <xsd:simpleType>
                <xsd:restriction base="xsd:token">
                    <xsd:enumeration value="city/county(parish)"/>
                    <xsd:enumeration value="educational"/>
                    <xsd:enumeration value="faith based , non profit"/>
                    <xsd:enumeration value="federal"/>
                    <xsd:enumeration value="non-profit"/>
                    <xsd:enumeration value="other"/>
                    <xsd:enumeration value="private individual"/>
                    <xsd:enumeration value="private, non-profit"/>
                    <xsd:enumeration value="profit"/>
                    <xsd:enumeration value="public service"/>
                    <xsd:enumeration value="religious"/>
                    <xsd:enumeration value="state"/>
                    <xsd:enumeration value="test 123"/>
                    <xsd:enumeration value="united way"/>
                    <xsd:enumeration value="volunteer"/>
                </xsd:restriction>
            </xsd:simpleType>
        </xsd:union>
    </xsd:simpleType>


</xsd:schema>
