I'm trying to get a clarification
Under the definition of what is a (fhir-resource-logical-id)
https://www.hl7.org/fhir/resource-definitions.html#Resource.id
The comment says:
The only time that a resource does not have an id is when it is being submitted to the server using a create operation.
We have having an internal "debate" on the "contained-reference".
https://build.fhir.org/references.html#contained
Example one from the article:
JSON
{
"resourceType" : "Condition",
"contained": [
{
"resourceType" : "Practitioner",
"id" : "p1",
"name" : [{
"family" : "Person",
"given" : ["Patricia"]
}]
}],
"asserter" : {
"reference" : "#p1"
}
}
XML
<Condition xmlns="http://hl7.org/fhir">
<contained>
<Practitioner>
<id value="p1"/>
<name>
<family value="Person"/>
<given value="Patricia"/>
</name>
</Practitioner>
</contained>
<!-- other attributes -->
<asserter>
<reference value="#p1" />
</asserter>
<!-- other attributes -->
</Condition>
So the "p1" (as the fhir-resource-logical-id) is populated....under the contained resourceType of "Practitioner".
So far, so good.
But there is another example with a comment in the example: (below xml)
<Patient xmlns="http://hl7.org/fhir">
<id value="something"/>
<contained>
<Provenance>
<!-- no id necessary (though still allowed) -->
<target>
<reference value="#"/>
</target>
</Provenance>
</contained>
<!-- other attributes -->
</Patient>
The xml-comment-part is (and I'll refer to this as the "comment-documentation") is:
<!-- no id necessary (though still allowed) -->
We are confused. Is this a "Provenance-ONLY" comment for a contained FHIR resource?
Or does this comment-documentation "
<!-- no id necessary (though still allowed) -->
" .. does this "comment-documentation" apply to any/all "contained" Fhir-Resource(s)?
The "comment-documentation" seems in conflict with the "The only time that a resource does not have an id is when it is being submitted to the server using a create operation" rule.
Another way to put it:
Does the rule "The only time that a resource does not have an id is when it is being submitted to the server using a create operation" (always and always) apply to "contained"-fhir-resources?
Thank you.
I wrote that, and I think I was just wrong when I did - just thinking that it wasn't needed functionally in that context, and didn't check whether it had to be present. This is a case where id is required
Related
I have created my custom Index in Sitecore with FlatDataCrawler.
The Index has been created and I can see my documents in Solr.
The problem is, whenever I'm trying to get those documents in my code I see exception like this:
Object reference not set to an instance of an object.
And in sitecore log file I see this WARN:
ManagedPoolThread #4 14:29:09 INFO Solr Query - ?q=*:*&rows=1000000&fq=_indexname:(products_index)&wt=xml
ManagedPoolThread #4 14:29:09 WARN Could not map index document (field: _uniqueid; Value: fae308d2-233f-4f7f-a4fd-9d880e42ff13) - Object reference not set to an instance of an object.
This is my Index config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:search="http://www.sitecore.net/xmlconfig/search/">
<sitecore role:require="Standalone or ContentManagement" search:require="solr">
<contentSearch>
<configuration type="Sitecore.ContentSearch.ContentSearchConfiguration, Sitecore.ContentSearch">
<indexes hint="list:AddIndex">
<index id="products_index" type="Sitecore.ContentSearch.SolrProvider.SolrSearchIndex, Sitecore.ContentSearch.SolrProvider">
<param desc="name">$(id)</param>
<param desc="core">$(id)</param>
<param desc="propertyStore" ref="contentSearch/indexConfigurations/databasePropertyStore" param1="$(id)" />
<configuration ref="contentSearch/indexConfigurations/defaultSolrIndexConfiguration">
<documentOptions type="Sitecore.ContentSearch.SolrProvider.SolrDocumentBuilderOptions, Sitecore.ContentSearch.SolrProvider">
<indexAllFields>false</indexAllFields>
</documentOptions>
</configuration>
<strategies hint="list:AddStrategy">
<strategy ref="contentSearch/indexConfigurations/indexUpdateStrategies/manual" />
</strategies>
<locations hint="list:AddCrawler">
<crawler type="Feature.ProductsIndex.Crawlers.CustomOrderCrawler, Feature.ProductsIndex" />
</locations>
</index>
</indexes>
</configuration>
</contentSearch>
</sitecore>
</configuration>
This is my code:
using (var searchContext = ContentSearchManager.GetIndex("products_index").CreateSearchContext())
{
int count = searchContext.GetQueryable<SearchResultItem>().Count(); //This works
var results = searchContext.GetQueryable<SearchResultItem>().ToList(); //Exception here!
}
See in your schema file , if you have
<uniqueKey>_uniqueid</uniqueKey>
<field name="_uniqueid" type="string" indexed="true" required="true" stored="true"/>
if not follow this link populate solr schema , and restart the solr service and then try to rebuild the index
I developed my gmail gadget to find sender email and add it to database .Hopefully I was able to see my gadget at bottom of email, and also I able to call my web Api from google.I created chrome web store app. I did some part and it works fine now. But I want to know exactly which steps I have to follow to do that?
here's my gadget.xml:
<?xml version="1.0" encoding="UTF-8"?>
<Module>`enter code here`
<ModulePrefs title="Test Gadget"
description=""
height="20"
author="excendia"
author_email="..."
author_location="">
<!-- Declare feature dependencies. -->
<!-- This one is not specific to Gmail contextual gadgets. -->
<Require feature="dynamic-height"/>
<!-- The next feature, Caja, is optional, and is supported for
use only within test domains. Uncomment the tag only for
non-production gadgets. -->
<!-- <Require feature="caja"/> -->
<!-- The next feature, google.contentmatch, is required for all
Gmail contextual gadgets.
<Param> - specify one or more comma-separated extractor IDs in
a param named "extractors". This line is overridden by the extractor ID
in the manifest, but is still expected to be present. -->
<Require feature="google.contentmatch">
<Param name="extractors">
google.com:MessageIDExtractor
</Param>
</Require>
</ModulePrefs>
<!-- Define the content type and display location. The settings
"html" and "card" are required for all Gmail contextual gadgets. -->
<Content type="html" view="card">
<![CDATA[
<script type="text/javascript">
<!-- Fetch the array of content matches. -->
matches = google.contentmatch.getContentMatches();
var matchList = document.createElement('UL');
var listItem;
var extractedText;
<!-- Iterate through the array and display output for each match. -->
for (var match in matches) {
for (var key in matches[match]) {
listItem = document.createElement('LI');
extractedText = document.createTextNode(key + ": " + matches[match][key]);
listItem.appendChild(extractedText);
matchList.appendChild(listItem);
}
}
document.body.appendChild(matchList);
gadgets.window.adjustHeight(100);
</script>
]]>
</Content>
</Module>
You can find steps to create chrome web store here.
When I make the following AppleScript call to my app, I get a list of text objects:
tell "MyApp"
name of every myobject
end tell
But the following call returns an error:
tell "MyApp"
name of selected myobjects
end tell
Script Error
MyApp got an error: Can't make name of selected MyObjects into type specifier.
I turned on verbose logging with the -NSScriptingDebugLogLevel 1 argument to my app, which gave me this:
2015-01-27 14:33:53.650 MyApp[4848:2572448] Error converting apple event to script command: -1700
2015-01-27 14:33:53.650 MyApp[4848:2572448] Original event: <NSAppleEventDescriptor: 'core'\'getd'{ '----':'obj '{ 'form':'prop', 'want':'prop', 'seld':'pnam', 'from':'obj '{ 'form':'prop', 'want':'prop', 'seld':'MASM', 'from':null() } }, &'csig':65536 }>
2015-01-27 14:33:53.650 MyApp[4848:2572448] Offending object descriptor: <NSAppleEventDescriptor: 'obj '{ 'form':'prop', 'want':'prop', 'seld':'pnam', 'from':'obj '{ 'form':'prop', 'want':'prop', 'seld':'MASM', 'from':null() } }>
2015-01-27 14:33:53.651 MyApp[4848:2572448] Expected type descriptor: <NSAppleEventDescriptor: 'obj '>
This is the "application" section of my sdef file:
<class name="application" code="capp" plural="applications" inherits="application">
<cocoa class="MyApp.MAApplication" />
<element type="myobject" access="r">
<cocoa key="myobjects" />
</element>
<property name="selected myobjects" code="MASM">
<cocoa key="selectedMyObjects" />
<type type="myobject" list="yes" />
</property>
</class>
And the MyObject class:
<class name="myobject" code="MAMO" inherits="item" plural="myobjects">
<cocoa class="MyObject" />
<property name="id" code="ID " type="text" access="r">
<cocoa key="permanentID" />
</property>
<property name="name" code="pnam" type="text" access="r">
<cocoa key="displayName" />
</property>
</class>
When I just call selected myobjects, I get back a list of identifiers, so that part is working correctly. When can't I get the name or other properties back from that list, when I can with another list specified the exact same way (except as an element instead of property)?
Update
Still not having any luck so far. I noticed, with verbose logging, that when I call name of every MyObject, the command "Intrinsics.get" triggers with an NSPropertySpecifier "displayName of myobjects". Apparently that link doesn't get made when using a property rather than an element to return a list of items. I found a workaround, though, since I specify an is selected property on MyObject. You can call:
name of every myobject whose is selected = true
That works the way I expected my selected myobjects property to work, returning a list of text objects.
Update 2
I added a sample project to GitHub:
https://github.com/abbeycode/AppleScriptObjectList
That contains a sample script with the first two methods that behave as expected, followed by the one that triggers the error. Feel free to mess around if you'd like. I submitted a radar with this sample project.
I am updating an XML file in an exist-db collection and I have to check if and id is present to decide if I have to replace or insert something in my document.
I noticed that as the file grows the query execution time worsens significantly and I decided to add an index for my file.
I understand that I have to do that in the conf.xml of my exist-db as it is shown in this example:
<!-- Range indexes -->
<create qname="title" type="xs:string"/>
<create qname="author" type="xs:string"/>
<create qname="year" type="xs:integer"/>
<!-- "old" context-dependant configuration using the path attribute: -->
<create path="//booktitle" type="xs:string"/>
I want to add an index for the attribute id in an xml like the following:
<server>
<formal>
<lastimage>
<harvested>
<coverages>
<coverage active="true" id="EUDEM">
...
</coverage>
</coverages>
</harvested>
</lastimage>
</formal>
</server>
I don't think that adding
<create qname="id" type="xs:string"/>
is enough.
What is the right way of adding and index in exist-db for this attribute?
You're close! Just add # to the beginning of the qname attribute:
<create qname="#id" type="xs:string"/>
The relevant section of the documentation is Configuration by path vs. configuration by qname:
Attributes are specified by #attributeName, so if the attribute is called "attrib1", one uses #attrib1 in the index specification.
I want to see if a theme element exists with specified name in the following xml file.
input.xml
<data>
<artifacts>
<document id="efqw4eads">
<name>composite</name>
</document>
<theme id="1">
<name>Terrace</name>
</theme>
<theme id="2">
<name>Garage</name>
</theme>
<theme id="3">
<name>Reception</name>
</theme>
<theme id="4">
<name>Grade II</name>
</theme>
</artifacts>
</data>
I have the following code. return true statement of the method is never executed. answer always contains a null value.
public boolean themeExists(String name, Data data){
String expression = "artifacts/theme[name='"+name+"']/name/text()";
String answer = jaxbContext.getValueByXPath(data, expression, null, String.class);
if(answer == null || answer.equals("")){
return false;
}
return true;
}
This use case isn't currently supported by EclipseLink JAXB (MOXy). I have opened the following enhancement you can use to track our progress:
http://bugs.eclipse.org/413823
There is no <artifacts/> element you're look for in the first axis step. Your XPath expression should be something like
String expression = "data/theme[name='"+name+"']/name/text()";