<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!--
This is a change to the XML Schema based upon changes to Inpatient Data Reporting Instructions, 59E-7.012, 	F.A.C. and 59E-7.014, F.A.C. adopted 05/22/2007. 
This will be posted at:http://www.fdhc.state.fl.us/xmlschemas/inppoa.xsd. 
The content and structure of this file is maintained by the Agency for Health Care Information - State of Florida.  Usage of this schema does NOT guarantee
acceptance of files submitted to the Agency for Health Care Information based upon this schema.
HISTORY:
	Created:  11/01/2006	KDW
	Modified: 01/18/2007	KDW
		Changed DATA_TYPE to PD10-1
	Modified: 05/30/2007	KDW
		Modified comments to reflect rule adoption
	Modified: 09/02/2010 Suresh Kethireddy and Patrick Kennedy
			  RECORD_ID should allow only alpha-numeric, dot(.), dash(-) and underscore(_)

-->
	<xs:element name="HC_DATA">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="HEADER" type="HEADERType"/>
				<xs:element name="RECORDS">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="RECORD" type="RECORDType" maxOccurs="unbounded"/>
						</xs:sequence>
					</xs:complexType>
					<xs:key name="RECORD_ID">
						<xs:selector xpath="RECORD"/>
						<xs:field xpath="@id"/>
					</xs:key>
				</xs:element>
				<xs:element name="TRAILER" type="TRAILERType"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:complexType name="RECORDType">
		<xs:sequence>
			<xs:element name="AHCA_NUM">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="8"/>
						<xs:maxLength value="12"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="PATIENT_SSN" type="SSNType"/>
			<xs:element name="PATIENT_RACE" type="PREType"/>
			<xs:element name="PATIENT_BIRTHDATE">
				<xs:simpleType>
					<xs:restriction base="xs:date"/>
				</xs:simpleType>
			</xs:element>
			<xs:element name="PATIENT_SEX" type="PSEXType"/>
			<xs:element name="PATIENT_ZIP">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="\d{5}"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ADMIT_TYPE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[1-5]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ADMIT_SOURCE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[01][0-9]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ADMIT_DATE">
				<xs:simpleType>
					<xs:restriction base="xs:date"/>
				</xs:simpleType>
			</xs:element>
			<xs:element name="DISCH_DATE">
				<xs:simpleType>
					<xs:restriction base="xs:date"/>
				</xs:simpleType>
			</xs:element>
			<xs:element name="DISCH_STATUS">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[0256][0-9]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="PRINC_PAYER_CODE" type="PPCType"/>
			<xs:element name="PRINC_DIAG_CODE" type="ICD9DiagType"/>
			<xs:element name="OTHER_DIAG_CODE" type="ICD9DiagType" minOccurs="0" maxOccurs="30"/>
			<xs:element name="PRIN_PROC_CODE" type="Proc_Type" minOccurs="0"/>
			<xs:element name="OTHER_PROC_CODE" type="Proc_Type" minOccurs="0" maxOccurs="30"/>
			<xs:element name="ATTENDING_PHYS_ID">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="11"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="OPERATING_PHYS_ID" minOccurs="0">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="11"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="OTHER_PHYS_ID" minOccurs="0">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="11"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ROOM_BOARD_CHARGES" type="ChargeType"/>
			<xs:element name="NURSERY_CHARGES" type="ChargeType"/>
			<xs:element name="L3_NURSERY_CHARGES" type="ChargeType"/>
			<xs:element name="INTENSIVE_CARE_CHARGES" type="ChargeType"/>
			<xs:element name="CORONARY_CARE_CHARGES" type="ChargeType"/>
			<xs:element name="PHARMACY_CHARGES" type="ChargeType"/>
			<xs:element name="MED_SURG_SUPPLY_CHARGES" type="ChargeType"/>
			<xs:element name="LAB_CHARGES" type="ChargeType"/>
			<xs:element name="RADIOLOGY_IMAGING_CHARGES" type="ChargeType"/>
			<xs:element name="CARDIOLOGY_CHARGES" type="ChargeType"/>
			<xs:element name="RESPIRATORY_PULMONARY_CHARGES" type="ChargeType"/>
			<xs:element name="OPER_ROOM_CHARGES" type="ChargeType"/>
			<xs:element name="ANESTHESIA_CHARGES" type="ChargeType"/>
			<xs:element name="RECOVERY_ROOM_CHARGES" type="ChargeType"/>
			<xs:element name="LABOR_ROOM_CHARGES" type="ChargeType"/>
			<xs:element name="ER_ROOM_CHARGES" type="ChargeType"/>
			<xs:element name="TRAUMA_RESPONSE_CHARGES" type="ChargeType"/>
			<xs:element name="TREATMENT_OBSERVATION_ROOM_CHARGES" type="ChargeType"/>
			<xs:element name="BEHAVIORAL_HEALTH_CHARGES" type="ChargeType"/>
			<xs:element name="ONCOLOGY_CHARGES" type="ChargeType"/>
			<xs:element name="PHYS_OCC_THERAPY_CHARGES" type="ChargeType"/>
			<xs:element name="OTHER_CHARGES" type="ChargeType"/>
			<xs:element name="TOTAL_CHARGES" type="GrossChargeType"/>
			<xs:element name="INFANT_LINKAGE_ID" type="SSNType"/>
			<xs:element name="ADMIT_DIAGNOSIS" type="ICD9DiagBaseType"/>
			<xs:element name="EXTERNAL_CAUSE" type="ICD9ECodeType" minOccurs="0" maxOccurs="3"/>
			<xs:element name="EMERG_HOUR_ARRIVAL">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[0129][0-9]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="id">
			<xs:simpleType>
				<xs:restriction base="xs:string">
					<xs:pattern value="^[A-Za-z0-9_.-]{1,17}$"/>
				</xs:restriction>
			</xs:simpleType>
		</xs:attribute>
	</xs:complexType>
	<xs:complexType name="Proc_Type">
		<xs:sequence>
			<xs:element name="PROC_CODE" type="ICD9ProcType"/>
			<xs:element name="PROC_DATE">
				<xs:simpleType>
					<xs:restriction base="xs:date"/>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:complexType name="TRAILERType">
		<xs:sequence>
			<xs:element name="NUMBER_OF_RECORDS">
				<xs:simpleType>
					<xs:restriction base="xs:positiveInteger"/>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="HEADERType">
		<xs:sequence>
			<xs:element name="TRANS_CODE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[QS]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="RPT_YEAR">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[2][0][0][5-9]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="RPT_QTR">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[1-4]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="DATA_TYPE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="^PD10-1$"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="SUBMISSION_TYPE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="[IR]"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="PROCESS_DATE">
				<xs:simpleType>
					<xs:restriction base="xs:date"/>
				</xs:simpleType>
			</xs:element>
			<xs:element name="AHCA_NUM">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:minLength value="8"/>
						<xs:maxLength value="12"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ORG_NAME">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="40"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="CONTACT_PERSON" type="ContactType"/>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="SSNType">
		<xs:restriction base="xs:string">
			<xs:pattern value="\d{9}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PREType">
		<xs:restriction base="xs:positiveInteger">
			<xs:pattern value="[1-8]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PSEXType">
		<xs:restriction base="xs:positiveInteger">
			<xs:pattern value="[1-3]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="PPCType">
		<xs:restriction base="xs:string">
			<xs:pattern value="[A-O]"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ContactType">
		<xs:sequence>
			<xs:element name="NAME">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="25"/>
						<xs:whiteSpace value="preserve"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="PHONE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="\(\d{3}\)\d{3}([.-])?\d{4}([.-])?(\d{1,5})?"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="EMAIL" minOccurs="0">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="100"/>
						<xs:pattern value="\w+([-+._]\w+)*@\w+([-._]\w+)*\.\w+([-._]\w+)*"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="STREET">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="40"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="CITY">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="25"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="STATE">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:maxLength value="2"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
			<xs:element name="ZIP">
				<xs:simpleType>
					<xs:restriction base="xs:string">
						<xs:pattern value="\d{5}([-.]\d{4})?"/>
					</xs:restriction>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
	</xs:complexType>
	<xs:simpleType name="ICD9DiagBaseType">
		<xs:restriction base="xs:string">
			<xs:pattern value="^\d{3}\.\d{0,2}$|^\d{3}$|^V\d{2}\.\d{0,2}$|^V\d{2}$"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:complexType name="ICD9DiagType">
		<xs:sequence>
			<xs:element name="DIAG_CODE" type="ICD9DiagBaseType"/>
			<xs:element name="PRESENT_ON_ADMIT" minOccurs="1" maxOccurs="1">
				<xs:simpleType>
    		<xs:union>
        		<xs:simpleType>
            		<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="Y"/>
                		<xs:enumeration value="N"/>
                		<xs:enumeration value="U"/>
                		<xs:enumeration value="W"/>
            		</xs:restriction>
        		</xs:simpleType>
        		<xs:simpleType>
            		<xs:restriction base="xs:string">
                		<xs:enumeration value=" "/>
				<xs:enumeration value=""/>
            		</xs:restriction>
        		</xs:simpleType>
    		</xs:union>
		</xs:simpleType>

			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:simpleType name="ICD9ProcType">
		<xs:restriction base="xs:string">
			<xs:pattern value="^\d{2}[.]?$|^\d{2}[.]\d{1,2}$"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ICD9ECodeBaseType">
		<xs:restriction base="xs:string">
			<xs:pattern value="^E\d{3}\.?$|^E\d{3}\.\d{1}$"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:complexType name="ICD9ECodeType">
		<xs:sequence>
			<xs:element name="DIAG_CODE" type="ICD9ECodeBaseType"/>
			<xs:element name="PRESENT_ON_ADMIT">
				<xs:simpleType>
    		<xs:union>
        		<xs:simpleType>
            		<xs:restriction base="xs:NMTOKEN">
				<xs:enumeration value="Y"/>
                		<xs:enumeration value="N"/>
                		<xs:enumeration value="U"/>
                		<xs:enumeration value="W"/>
            		</xs:restriction>
        		</xs:simpleType>
        		<xs:simpleType>
            		<xs:restriction base="xs:string">
                		<xs:enumeration value=" "/>
				<xs:enumeration value=""/>
            		</xs:restriction>
        		</xs:simpleType>
    		</xs:union>
		</xs:simpleType>

			</xs:element>
		</xs:sequence>
	</xs:complexType>

	<xs:simpleType name="ChargeType">
		<xs:restriction base="xs:string">
			<xs:pattern value="\d{1,15}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="GrossChargeType">
		<xs:restriction base="xs:string">
			<xs:pattern value="\d{1,20}"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
