Hi All,
Trying to validate xml file, however xsd restriction error results. Data should be valid for this rule though(any number of alphanumeric characters - up to 40 max).
Thoughts? Thx Robert
ERROR: Element 'patient-id': [facet 'pattern'] The value 'str1234' is not accepted by the pattern '^[a-zA-Z0-9]+$'.
ERROR: Element 'patient-id': 'str1234' is not a valid value of the local atomic type.
XML:
<?xml version="1.0" encoding="utf-8"?>
<submission type="OUTPATIENT" data="str1234" version="123.45" action-code="ADD">
<provider>
<provider-id>str123</provider-id>
<npi>str1234</npi>
<patient>
<birthdate>08-01-2016</birthdate>
<sex>str1234</sex>
<race>str1234</race>
<ethnic>str1234</ethnic>
<postal-code>str1234</postal-code>
<attesting_physician_code>str1234</attesting_physician_code>
<attesting_physician_specialty_code>str1234</attesting_physician_specialty_code>
<principal_procedure_physician_code>str1234</principal_procedure_physician_code>
<first-name>str1234</first-name>
<last-name>str1234</last-name>
<encounter measure-set="str1234">
<encounter-date>08-01-2016</encounter-date>
<arrival-time>str1234</arrival-time>
<patient-id>str1234</patient-id>
<medical-record-number>str1234</medical-record-number>
<pthic>str1234</pthic>
<detail answer-code="str1234" row-number="1234" question-cd="str1234">
<answer-value>str1234</answer-value>
</detail>
</encounter>
</patient>
</provider>
</submission>
XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs=" <xs:element name="submission">
<xs:complexType>
<xs:sequence>
<xs:element name="provider" maxOccurs="1" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="provider-id" minOccurs="1" maxOccurs="1" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="npi" type="xs:string" maxOccurs="1" minOccurs="0" />
<xs:element name="patient" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="birthdate" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-([0-9][0-9][0-9][0-9])"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="sex" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="race" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ethnic" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="postal-code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="attesting_physician_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="attesting_physician_specialty_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="principal_procedure_physician_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="first-name" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="last-name" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="encounter" maxOccurs="1" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="encounter-date" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-([0-9][0-9][0-9][0-9])"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="arrival-time" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="patient-id" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
<xsattern value="^[a-zA-Z0-9]+$"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="medical-record-number" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="15"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="pthic" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element maxOccurs="unbounded" name="detail" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="answer-value" type="xs:string" />
</xs:sequence>
<xs:attribute name="answer-code" type="xs:string" use="required" />
<xs:attribute name="row-number" type="xs:integer" use="required" />
<xs:attribute name="question-cd" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="measure-set" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="OUTPATIENT"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="data" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:decimal" use="required" />
<xs:attribute name="action-code" use="required" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ADD"/>
<xs:enumeration value="DELETE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Trying to validate xml file, however xsd restriction error results. Data should be valid for this rule though(any number of alphanumeric characters - up to 40 max).
Thoughts? Thx Robert
ERROR: Element 'patient-id': [facet 'pattern'] The value 'str1234' is not accepted by the pattern '^[a-zA-Z0-9]+$'.
ERROR: Element 'patient-id': 'str1234' is not a valid value of the local atomic type.
XML:
<?xml version="1.0" encoding="utf-8"?>
<submission type="OUTPATIENT" data="str1234" version="123.45" action-code="ADD">
<provider>
<provider-id>str123</provider-id>
<npi>str1234</npi>
<patient>
<birthdate>08-01-2016</birthdate>
<sex>str1234</sex>
<race>str1234</race>
<ethnic>str1234</ethnic>
<postal-code>str1234</postal-code>
<attesting_physician_code>str1234</attesting_physician_code>
<attesting_physician_specialty_code>str1234</attesting_physician_specialty_code>
<principal_procedure_physician_code>str1234</principal_procedure_physician_code>
<first-name>str1234</first-name>
<last-name>str1234</last-name>
<encounter measure-set="str1234">
<encounter-date>08-01-2016</encounter-date>
<arrival-time>str1234</arrival-time>
<patient-id>str1234</patient-id>
<medical-record-number>str1234</medical-record-number>
<pthic>str1234</pthic>
<detail answer-code="str1234" row-number="1234" question-cd="str1234">
<answer-value>str1234</answer-value>
</detail>
</encounter>
</patient>
</provider>
</submission>
XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs=" <xs:element name="submission">
<xs:complexType>
<xs:sequence>
<xs:element name="provider" maxOccurs="1" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="provider-id" minOccurs="1" maxOccurs="1" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:length value="6" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="npi" type="xs:string" maxOccurs="1" minOccurs="0" />
<xs:element name="patient" maxOccurs="unbounded" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="birthdate" minOccurs="0" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-([0-9][0-9][0-9][0-9])"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="sex" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="race" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="ethnic" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="postal-code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="attesting_physician_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="attesting_physician_specialty_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="principal_procedure_physician_code" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="first-name" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="last-name" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="encounter" maxOccurs="1" minOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="encounter-date" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xsattern value="(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])-([0-9][0-9][0-9][0-9])"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="arrival-time" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="8"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="patient-id" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="40"/>
<xsattern value="^[a-zA-Z0-9]+$"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="medical-record-number" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="15"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="pthic" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element maxOccurs="unbounded" name="detail" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="0">
<xs:element name="answer-value" type="xs:string" />
</xs:sequence>
<xs:attribute name="answer-code" type="xs:string" use="required" />
<xs:attribute name="row-number" type="xs:integer" use="required" />
<xs:attribute name="question-cd" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="measure-set" type="xs:string" use="required" />
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="type" use="required">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="OUTPATIENT"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="data" type="xs:string" use="required" />
<xs:attribute name="version" type="xs:decimal" use="required" />
<xs:attribute name="action-code" use="required" >
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="ADD"/>
<xs:enumeration value="DELETE"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>