Validation Errors

565 views
Skip to first unread message

gnanen...@gmail.com

unread,
May 8, 2013, 6:15:03 AM5/8/13
to cancer-reg-...@googlegroups.com

Hello,

We are trying to validate the generated XML for the patient based on the test case(Category 1 and Case 1). When we validate we are getting following CDA schema Violations error message in the tool.

  Message: cvc-complex-type.2.4.a: Invalid content was found starting with element 'raceCode'. One of '{"urn:hl7-org:sdtc":raceCode, "urn:hl7-org:v3":ethnicGroupCode,    "urn:hl7-org:v3":guardian, "urn:hl7-org:v3":birthplace, "urn:hl7-org:v3":languageCommunication}' is expected

   The problem is patient is having two race codes. I formed XML tags for both race code as shown below, in my CDA file and validated, but tool is not accepting.
   I am getting an error as shown above.

           <raceCode displayName="Black or African American" codeSystem="2.16.840.1.113883.6.238" code="2054-5"/>
           <raceCode displayName="Jamaican" codeSystem="2.16.840.1.113883.6.238" code="2072-7"/>


I have attached the XML that we are trying to validate along with the test case and screen shot of the validation result.

Kindly advice.

Thank you

Smith.cda
170 314(f)(6) Test Data Category 1 Case 1.pdf
ValidationError.png

Andrew McCaffrey

unread,
May 8, 2013, 10:45:12 AM5/8/13
to cancer-reg-...@googlegroups.com

Hello,

The base HL7 CDA specification (and related schema) limits raceCode in
the header to 0..1 cardinality.

The IG for Ambulatory Healthcare Provider Reporting to Central Cancer
Regisitries specification uses an extension to CDA to get around this
cardinality. This extension lives in the sdtc (urn:hl7-org:sdtc) namespace.

See table 2-1 and section 2.5.2.1.2 for the definition and figure 2-10
for an example.

In your XML snippet, change the namespace of the second raceCode to
urn:hl7-org:sdtc and your XML should pass validation.

Hope this helps.

On 05/08/2013 06:15 AM, gnanen...@gmail.com wrote:
> Hello,
>
> We are trying to validate the generated XML for the patient based on the
> test case(Category 1 and Case 1). When we validate we are getting
> following CDA schema Violations error message in the tool.
>
> Message: cvc-complex-type.2.4.a: Invalid content was found starting with
> element 'raceCode'. One of '{"urn:hl7-org:sdtc":raceCode,
> "urn:hl7-org:v3":ethnicGroupCode, "urn:hl7-org:v3":guardian,
> "urn:hl7-org:v3":birthplace, "urn:hl7-org:v3":languageCommunication}' is
> expected
>
> The problem is patient is having two race codes. I formed XML tags for
> both race code as shown below, in my CDA file and validated, but tool is
> not accepting.
> I am getting an error as shown above.
>
> /*<raceCode displayName="Black or African American"
> codeSystem="2.16.840.1.113883.6.238" code="2054-5"/>
> <raceCode displayName="Jamaican" codeSystem="2.16.840.1.113883.6.238"
> code="2072-7"/>*/
>
> I have attached the XML that we are trying to validate along with the
> test case and screen shot of the validation result.
>
> Kindly advice.
>
> Thank you
>
> --
> You received this message because you are subscribed to the Google
> Groups "Cancer Reg Testing Tool" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cancer-reg-testin...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

--
Andrew McCaffrey
andrew.m...@nist.gov
----
The words above do not necessarily reflect the opinions of my employers
or any organization I may be associated with. In fact, by the time you
read them, they may not even reflect my own opinions anymore.
----
Any mention of commercial products within NIST web pages or email is for
information only; it does not imply recommendation or endorsement by NIST.

Gnanendra Reddy

unread,
May 9, 2013, 7:59:14 AM5/9/13
to Cancer Reg Testing Tool
Hello,

I did as you said. Still my file is not validating. I formed
my race code in two ways as shown below.
(1) First one:
<sdtc:raceCode displayName="Black or African American"
codeSystem="2.16.840.1.113883.6.238" code="2054-5"/>
<sdtc:raceCode displayName="Jamaican"
codeSystem="2.16.840.1.113883.6.238" code="2072-7"/>

Message File is not valid XML. The prefix "sdtc" for element
"sdtc:raceCode" is not bound. org.xml.sax.SAXParseException;
lineNumber: 40; columnNumber: 124; The prefix "sdtc" for element
"sdtc:raceCode" is not bound.

(2) First one:
<raceCode displayName="Black or African American"
codeSystem="2.16.840.1.113883.6.238" code="2054-5"/>
<sdtc:raceCode displayName="Jamaican"
codeSystem="2.16.840.1.113883.6.238" code="2072-7"/>

Message File is not valid XML. The prefix "sdtc" for element
"sdtc:raceCode" is not bound. org.xml.sax.SAXParseException;
lineNumber: 41; columnNumber: 107; The prefix "sdtc" for element
"sdtc:raceCode" is not bound.

Please advice me.




On May 8, 7:45 pm, Andrew McCaffrey <andrew.mccaff...@nist.gov> wrote:
> Hello,
>
> The base HL7 CDA specification (and related schema) limits raceCode in
> the header to 0..1 cardinality.
>
> The IG for Ambulatory Healthcare Provider Reporting to Central Cancer
> Regisitries specification uses an extension to CDA to get around this
> cardinality.  This extension lives in the sdtc (urn:hl7-org:sdtc) namespace.
>
> See table 2-1 and section 2.5.2.1.2 for the definition and figure 2-10
> for an example.
>
> In your XML snippet, change the namespace of the second raceCode to
> urn:hl7-org:sdtc and your XML should pass validation.
>
> Hope this helps.
>
> andrew.mccaff...@nist.gov

Andrew McCaffrey

unread,
May 9, 2013, 10:30:04 AM5/9/13
to cancer-reg-...@googlegroups.com

Hello,

In XML, if you use a namespace prefix, you must define that prefix in
the root element (so that it propagates down through the entire XML
tree) or at least in the element itself (or any element above the
element it is used in).

So, for your example you will need to add the attribute
"xmlns:sdtc="urn:hl7-org:sdtc". You can place it directly in the
raceCode element. Alternatively, you may find it useful to place it on
the ClinicalDocument element, in case you end up needing the sdtc
extension namespace anywhere else in your XML.

Hope this helps.
--
Andrew McCaffrey
andrew.m...@nist.gov

akont...@gmail.com

unread,
Jun 3, 2015, 10:00:40 AM6/3/15
to cancer-reg-...@googlegroups.com
четверг, 9 мая 2013 г., 17:30:04 UTC+3 пользователь Andrew McCaffrey (NIST) написал:
> Hello,
>
> In XML, if you use a namespace prefix, you must define that prefix in
> the root element (so that it propagates down through the entire XML
> tree) or at least in the element itself (or any element above the
> element it is used in).
>
> So, for your example you will need to add the attribute
> "xmlns:sdtc="urn:hl7-org:sdtc". You can place it directly in the
> raceCode element. Alternatively, you may find it useful to place it on
> the ClinicalDocument element, in case you end up needing the sdtc
> extension namespace anywhere else in your XML.
>
> Hope this helps.

Thanks, this helped!
Reply all
Reply to author
Forward
0 new messages