Binding multiple value sets to a single extension element - dstu2-fhir

I'm wondering if there is a way to bind multiple value sets to a single extension element in fhir.
Here's an example of what I'm trying to achieve:
<StructureDefinition xmlns="http://hl7.org/fhir">
...
<snapshot>
...
<element>
<path value="Extension.valueCode"/>
...
<type>
<code value="code"/>
</type>
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/const-yesNo"/>
</binding>
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/missingData"/>
</binding>
</element>
...
</snapshot>
...
</StructureDefinition>
My reason for wanting to bind multiple is that I'm porting data over from a legacy system in which coded values can either come from a value set which represents collected data, or a separate value set which represents missing data. The reason for the split is that sometimes more is known about why the data is missing.
I don't really want to go an create a composite value set for every combination of the missing value set, and the various other value sets if possible, as this will really minimise the reuseability of the value domains.
I'm not sure if I'm just getting my syntax wrong, but I can't find any mention of multiple bindings in the documentation, and which I upload the file in the above (or below format) to simplifier, it only renders one bound domain, which makes me think it is just accepting the last child.
<binding>
<strength value="required"/>
<valueSetUri value="http://stelar.org/valueSet/const-yesNo"/>
<valueSetUri value="http://stelar.org/valueSet/missingData"/>
</binding>
Is there a way to bind multiple value sets? Is there a better way of handling missing data in fhir?

See http://build.fhir.org/elementdefinition-definitions.html#ElementDefinition.binding - binding can only appear once. Creating multiple bindings has a number of practical consequences, so the expectation is that you'll define a single value set that imports the other 2 value sets you might include. Note that you could create a contained value set in the structure definition that imports the two actual value sets, since it has no real existence or meaning outside the structure definition
We are discussing use cases for multiple bindings right now - but it's complicated. If there's more than one binding, is that 'and' or 'or'?

Related

Specify which resource file a variable is coming from

Robot Framework allows you to import multiple resource files containing keywords with the same names, and to call them using their full name to differentiate between them. For example, if you have Resource1.robot that has a keyword called "Test Keyword" that does some action, and Resource2.robot that also has a keyword called "Test Keyword" that does a different action, when you import both resources into a test suite, your test cases can access those keywords with the syntax Resource1.Test Keyword or Resource2.Test Keyword depending on the functionality that you want.
Is there a way to do that with variables? I have two resource files - patient_records_resource.robot and patient_search_resource.robot. patient_records_resource defines a variable ${LAST NAME EDIT} | name=lname, and patient_search_resource defines a variable with the same name ${LAST NAME EDIT} | id=last-name. I'm running into the problem where a test case imports both of those files, and needs to access both of those edit boxes at different points, and consistently picks the wrong one. I have tried things like patient_search_resource.LAST NAME EDIT with no success, but that's approximately what I'm looking for.
I know I could just rename one of them, but I'd like to use that as a last resort solution. Everyone on my team makes sure to create unique variable names within a single resource file, but coming up with unique variable names across the whole test suite to avoid these collisions would add some overhead that we don't want.
There is no way to do that with variables.
All variables from resource files have the same priority. If multiple variables have the same name then only the one that was imported first is taken into use. [source]
Your only options are:
Splitting the suite with both imports into two sub-suites, ensuring that each sub-suite only imports one of the resources.
Your last resort solution: modifying your variable names to all be unique.
I agree that the latter option adds a bothersome amount of overhead, but, until RF changes the way it handles variables, it's probably your best option. Personally, I prefix all variables with a sequence of letters unique to the resource file (e.g. a resource named "Member_Central_Logging_Functions" might have all variables prefixed with MCLF).

How do I change the inner text instead of attributes in config transformations?

I've been using config transformations a lot, but I'm struggling with one bit: the changing of "inner text" as opposed to attributes.
As an example, I've got the following in a config file (Sitecore's webforms for marketers if anyone's interested):
<param desc="connection string">Database=sitecore_webforms;Data Source=CHANGEME;user id=CHANGEME;password=CHANGEME;Connect Timeout=30</param>
and I want to change it to the proper connection string. Usually that would be part of an attribute which I can do fine but in this case it's not.
Is this possible using either the "vanilla" transformations or Sayed Ibrahim Hashimi's SlowCheetah?
You need to use the Replace transform. In your case, something like
<param desc="connection string" xdt:Transform="Replace">new connection string here</param>
You'll need to also add the right xdt:Locator attribute, to select the element.

spring form error tag: check for specific error (only display invalid if the not null is not present for example)

So I have a String I need to check for a valid format for which I used a pattern, and whether the entered value is valid according to some business rules for which I used a custom validator. Now the customer would prefer it if the error message associated with the latter is only shown if the former didn't occur. But as far as I know there is no way to make this distinction.
Or can anyone think of a way to do this?
The trick is: have two different constraints (annotations),
one for the pattern, that accept null,
and a second for not null.
By default the javax.validation.constraints.Pattern "validator" accept null.
Accepts String. null elements are considered valid.
(javax.validation.constraints.Pattern javadoc)
So what you need to do in the end is this:
#NotNull(message="{validation.notNull}")
#Pattern(pattern="123" message="{validation.notPattern}")
String myString;
Added:
(Comment)
Not really the desired behaviour since I want to reuse the bean object but the conditions aren't the same for each page. – Jack Nickels 5 mins ago
In this case you can use the so called groups (See JSR303 Bean Validation Spec, Chapter 4.1.2 groups -- there is also an example). Use the default Group for #Pattern and an other group for #NotNull. Now you can enable or disable the Validation rules according the groups you specify for validation.
validator.validate(myObject, Default.class);
validator.validate(myObject, MyGroup.class);
There is one problem left: in Spring 3.0 you can not Specify the Group you want to use for the automatic validation process. But in 3.1 you can, according to that Feature Request SPR-6373 (I have not tryed it, but I hope it works)

Removing header from a flat file in BizTalk

What is the simplest way to remove the header row from a flat file in BizTalk? I have implemented this by creating a separate schema for the header row (and one for the body) and then set the HeaderSpecName property in the 'Configure Pipeline' dialog to the header schema I've just created and then the PreserveHeader property to false. My problem, however, is that with this solution I need to create a schema that does nothing other than it needs to exist so I can remove the header row.
I believe what you stated is the recommended way to do what you are asking. I just had to do this on a project i am working on and chose to have the extra schema.
Another option would be to write your own custom pipeline component for the Disassemble stage that executes before the flat file dissassembler. The Decode stage would work too, but it seems that the disassemble stage is made for this type of work.
This second option would make the removing of the header row more generic and could be used across many different schemas so you wouldn't have to create a separate header schema for each flat file schema.
i recommend doing this through the flat file schema wizard; define your first record as a singular record and then your other records as repeating records. then in whatever map or transformations you're working with you can just ignore the header record. you could also ignore the header record when going through the FF wizard by ignoring it altogether, but i prefer to have everything defined in my schemas...
check out the help and microsoft tutorials, also there's a decent article on the code project that incorporates identifying header records. note that if you know the absolute position of the header record (like: "always the first line") you don't need to mess with record tagging.
http://www.codeproject.com/Articles/13706/Creating-Flat-File-schemas-using-the-BizTalk-Serve
You could always just parse the header row and not map it.
The schema exists for many reasons. One such reason is to capture the structure of the message generated by a party which effectively means the agreement. So it is good to capture the schema as it is even though you may not use the fields.
I don't think PreserveHeader acts as you may expect. This property simply determines whether or not values from the header are promoted into the context of the XML message that comes out of the disassembler.

Deleting / Replacing A Node in E4X (AS3 - Flex)

I'm building a listing/grid control in a Flex application and using it in a .NET web application. To make a really long story short I am getting XML from a webservice of serialized objects. I have a page limit of how many things can be on a page. I've taken a data grid and made it page, sort across pages, and handle some basic filtering.
In regards to paging I'm using a Dictionary keyed on the page and storing the XML for that page. This way whenever a user comes back to a page that I've saved into this dictionary I can grab the XML from local memory instead of hitting the webservice. Basically, I'm caching the data retrieved from each call to the webservice for a page of data.
There are several things that can expire my cache. Filtering and sorting are the main reason. However, a user may edit a row of data in the grid by opening an editor. The data they edit could cause the data displayed in the row to be stale. I could easily go to the webservice and get the whole page of data, but since the page size is set at runtime I could be looking at a large amount of records to retrieve.
So let me now get to the heart of the issue that I am experiencing. In order to prevent getting the whole page of data back I make a call to the webservice asking for the completely updated record (the editor handles saving its data).
Since I'm using custom objects I need to serialize them on the server to XML (this is handled already for other portions of our software). All data is handled through XML in e4x. The cache in the Dictionary is stored as an XMLList.
Now let me show you my code...
var idOfReplacee:String = this._WebService.GetSingleModelXml.lastResult.*[0].*[0].#Id;
var xmlToReplace:XMLList = this._DataPages[this._Options.PageIndex].Data.(#Id == idOfReplacee);
if(xmlToReplace.length() > 0)
{
delete (this._DataPages[this._Options.PageIndex].Data.(#Id == idOfReplacee)[0]);
this._DataPages[this._Options.PageIndex].Data += this._WebService.GetSingleModelXml.lastResult.*[0].*[0];
}
Basically, I get the id of the node I want to replace. Then I find it in the cache's Data property (XMLList). I make sure it exists since the filter on the second line returns the XMLList.
The problem I have is with the delete line. I cannot make that line delete that node from the list. The line following the delete line works. I've added the node to the list.
How do I replace or delete that node (meaning the node that I find from the filter statement out of the .Data property of the cache)???
Hopefully the underscores for all of my variables do not stay escaped when this is posted! otherwise this.&#95 == this._
Thanks for the answers guys.
#Theo:
I tried the replace several different ways. For some reason it would never error, but never update the list.
#Matt:
I figured out a solution. The issue wasn't coming from what you suggested, but from how the delete works with Lists (at least how I have it in this instance).
The Data property of the _DataPages dictionary object is list of the definition nodes (was arrived at by a previous filtering of another XML document).
<Models>
<Definition Id='1' />
<Definition Id='2' />
</Models>
I ended up doing this little deal:
//gets the index of the node to replace from the same filter
var childIndex:int = (this._DataPages[this._Options.PageIndex].Data.(#Id == idOfReplacee)[0]).childIndex();
//deletes the node from the list
delete this._DataPages[this._Options.PageIndex].Data[childIndex];
//appends the new node from the webservice to the list
this._DataPages[this._Options.PageIndex].Data += this._WebService.GetSingleModelXml.lastResult.*[0].*[0];
So basically I had to get the index of the node in the XMLList that is the Data property. From there I could use the delete keyword to remove it from the list. The += adds my new node to the list.
I'm so used to using the ActiveX or Mozilla XmlDocument stuff where you call "SelectSingleNode" and then use "replaceChild" to do this kind of stuff. Oh well, at least this is in some forum where someone else can find it. I do not know the procedure for what happens when I answer my own question. Perhaps this insight will help someone else come along and help answer the question better!
Perhaps you could use replace instead?
var oldNode : XML = this._DataPages[this._Options.PageIndex].Data.(#Id == idOfReplacee)[0];
var newNode : XML = this._WebService.GetSingleModelXml.lastResult.*[0].*[0];
oldNode.parent.replace(oldNode, newNode);
I know this is an incredibly old question, but I don't see (what I think is) the simplest solution to this problem.
Theo had the right direction here, but there's a number of errors with the way replace was being used (and the fact that pretty much everything in E4X is a function).
I believe this will do the trick:
oldNode.parent().replace(oldNode.childIndex(), newNode);
replace() can take a number of different types in the first parameter, but AFAIK, XML objects are not one of them.
I don't immediately see the problem, so I can only venture a guess. The delete line that you've got is looking for the first item at the top level of the list which has an attribute "Id" with a value equal to idOfReplacee. Ensure that you don't need to dig deeper into the XML structure to find that matching id.
Try this instead:
delete (this._DataPages[this._Options.PageIndex].Data..(#Id == idOfReplacee)[0]);
(Notice the extra '.' after Data). You could more easily debug this by setting a breakpoint on the second line of the code you posted, and ensure that the XMLList looks like you expect.

Resources