Error on CCR update: The thing type is immutable RRS feed

  • Question

  • Hi all,

    I am trying to update a CCR record to the health vault. On the UpdateItem statement, I am getting the error "The thing type is immutable", but I have checked the recordItem's IsImmutable property is false. Following is the code. I am made the line bold in which error occurs.

    Guid recordGuid = new Guid(strRecordID);
                OfflineWebApplicationConnection offlineConn =
                        new OfflineWebApplicationConnection(new Guid(strPersonId));

                PersonInfo info = offlineConn.GetPersonInfo();

                HealthRecordAccessor accessor =
                    new HealthRecordAccessor(offlineConn, recordGuid);

                HealthRecordSearcher searcher = accessor.CreateSearcher();
                HealthRecordFilter filter = new HealthRecordFilter(new Guid(strCCRID));

                HealthRecordItemCollection items = searcher.GetMatchingItems()[0];
                XmlDocument doc = new XmlDocument();

                XmlDocument ccrDocument = new XmlDocument();

                XmlNode node = null;

                foreach (HealthRecordItem ccrItem in items)
                        node = doc.SelectSingleNode(@"//*[local-name()='ContinuityOfCareRecord']");
                        if (node != null)
                            if (node["CCRDocumentObjectID"].InnerXml.Equals(ccrDocument.SelectSingleNode(@"//*[local-name()='CCRDocumentObjectID']").InnerXml))
                                if (!ccrItem.IsImmutable)
                                    HealthRecordItem ccr = info.SelectedRecord.GetItem(ccrItem.Key.Id);
                                    ccr.TypeSpecificData = new XPathDocument(new StringReader(strCCR));
                    catch (Exception ex)

    Any suggestion on whether the implementation is right or wrong, will be of great help!! Or is there any other way to update a CCR?

    • Edited by Janani R Friday, May 22, 2009 2:10 PM
    Friday, May 22, 2009 12:22 PM


All replies