locked
CCR schema validation error RRS feed

  • Question

  • Hi,

    I tried to verify a sample CCR xml document using "Verify XML against schema" utility on http://developer.healthvault.com/types/verifytypexml.aspx?id=1e1ccbfc-a55d-4d91-8940-fa2fbf73c195 but get error below. The CCR only contains <body> with <medications>.

     

    Schema Validation Error

    The schema could not be validated: The element 'Medication' in namespace 'urn:astm-org:CCR' has invalid child element 'Status' in namespace 'urn:astm-org:CCR'. List of possible elements expected: 'CCRDataObjectID' in namespace 'urn:astm-org:CCR'.

     

    Can someone please verify the xml and let me know what needs to be done for successful validation.

     

    Thanks

     

     

    Code Snippet

    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:astm-org:CCR CCR_20051109.xsd">
    <CCRDocumentObjectID>1e1ccbfc-a55d-4d91-8940-fa2fbf73c195</CCRDocumentObjectID>
    <Language>
       <Text>English</Text>
       <Code>
          <Value>en</Value>
          <CodingSystem>ISO-639-1</CodingSystem>
       </Code>
    </Language>
    <Version>V1.0</Version>
    <DateTime>
       <ExactDateTime>2007-01-07T13:00:00-0500</ExactDateTime>
    </DateTime>
    <Patient>
       <ActorID>John Doe</ActorID>
    </Patient>
    <From>
      <ActorLink>
        <ActorID>John Doe</ActorID>
        <ActorRole>
          <Text>author</Text>
        </ActorRole>
      </ActorLink>
    </From>
    <Body>
    <Medications>
       <Medication>
        <Status><Text>Active</Text></Status>
        <DateTime>
          <Type><Text>Prescription Date</Text></Type>
          <ExactDateTime>2007-04-01T05:00:00Z</ExactDateTime>
        </DateTime>
        <Source>
           <Actor>
              <ActorID>John Doe</ActorID>
           </Actor>
           <ActorRole>Prescribing clinician</ActorRole>
        </Source>
          <Product>
             <ProductName>
                <Text>Ibuprofen</Text>
                <Code>
                   <Value>198405</Value>
                   <CodingSystem>RxNorm</CodingSystem>
                </Code>
         <Code>
            <Value>123456789</Value>
            <CodingSystem>NDC</CodingSystem>
         </Code>  
             </ProductName>
             <Strength>
                <Value>100</Value>
                <Units>
                   <Unit>mg</Unit>
                </Units>
             </Strength>
             <Form>
                <Text>Tablet</Text>
             </Form>
          </Product>
          <FulfillmentHistory>
             <Fulfillment>
                <Quantity>30</Quantity>
                <DateTime>
                   <Type><Text>Dispense date</Text></Type>
                   <ExactDateTime>2007-06-01T06:00:00Z</ExactDateTime>
                </DateTime>
             </Fulfillment>
          </FulfillmentHistory>
       </Medication>
    </Medications>

    </Body>

    </ContinuityOfCareRecord>

     

     

    Thursday, July 17, 2008 2:23 PM

Answers

All replies

  • It's in the error that you are getting - it's telling you that the child element Status is invalid *at that position*.

     

    A quick look at the schema shows that CCRDataObjectID element is required, so you need to have one of those before the status element.

    Thursday, July 17, 2008 4:23 PM
  • I added CCRDataObjectID but now validation error for some other tag. We are on Java platform and will be using the Java API. I am manually trying to create the XML but ran into these errors. Can you please point to some resources that will help generate CCR with medications?

     

    Thanks

     

    Thursday, July 17, 2008 9:22 PM
  • On little internet search it seems like http://www.centerforhit.org/PreBuilt/ccr/ccrsample_Healthvision.xml has a valid CCR XML sample with medications.

     

    regards,

    Vaibhav

    Thursday, July 17, 2008 9:59 PM
  •  

    Thanks that helped a lot. Is it mandatory to use the type-ids in http://developer.healthvault.com/types/types.aspx? I was able to add CCR with value in the sample. Can the value of CCRDocumentObjectID be replaced?
    Monday, July 21, 2008 1:26 PM
  • HealthVault doesn't do anything with CCRDocumentObjectID. The schema comes from the foks who designed CCR, so the appropriate thing to do with that element is defined by them.

    Monday, July 21, 2008 5:27 PM
  • Got it...I was confused and misunderstood CCRDocumentObjectID with type-id. I am using HealthVaultJavaLib and successfully "put" a sample CCR but got exception when changed the type-id.

     

    Code Snippet

    <info>

    <thing><type-id>1e1ccbfc-a55d-4d91-8940-fa2fbf73c195</type-id><data-xml>
     <ContinuityOfCareRecord xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:astm-org:CCR">
       <CCRDocumentObjectID>2.16.840.1.113883.3.43.0</CCRDocumentObjectID>

    .........

    </ContinuityOfCareRecord>
    <common/></data-xml>

    </thing>

    </info>

     

     

    Thanks

    Monday, July 21, 2008 6:20 PM
  • <Medication> has a child element <FulfillmentHistory><Fulfillment></Fulfillment></FulfillmentHistory>. But the CCR html viewed on HV does not display it. Only Medication Date Status Form Strength Quantity SIG Indications Instruction Refills Source are displayed. Can someone please let me know why <FulfillmentHistory> is not displayed?

     

    Thanks

     

    Monday, July 21, 2008 7:37 PM
  • The transform being used to display the CCR was obtained from the ASTM (developer of the CCR format).  You would have to ask them why they chose not to display this piece of information.

     

    Jeff Jones

     

    Tuesday, July 22, 2008 5:03 PM