Error validating a simple FHIR resource based on profile - validation

I am currently trying to build some examples for using profiles with complex extensions, but they all fail to validate on SIMPLIFIER and my local HAPI-FHIR server.
I got a simple profile https://simplifier.net/Velferd-test-og-lek/test-flag/~overview
This one has two timestamps, and one of them is mandatory.
When I try to implement it like this (https://simplifier.net/Velferd-test-og-lek/Flag-example-2/~xml):
<Flag>
<meta>
<profile value="http://ehelse.no/fhir/vft/STU3/StructureDefinition/test-flag" />
</meta>
<extension url="kodeverdi">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
</extension>
<extension url="kodeverdi-obligatorisk">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T11:00:00.936+02:00" />
</extension>
</extension>
<identifier>
<value value="test-id" />
</identifier>
<status value="active" />
<code>
<text value="Bruker utenfor Geofence" />
</code>
<subject>
<identifier>
<system value="http://ehelse.no/fhir/identifiertypes/FNR" />
<value value="05073500186" />
</identifier>
</subject>
</Flag>
The example fails to validate because it supposedly don't contain a "kodeverdi-obligatorisk" element.
ERROR on SIMPLIFIER: Instance count for 'Flag.extension:kodeverdi-obligatorisk' is 0, which is not within the specified cardinality of 1..1
I guess there is some problem related to naming the "kodeverdi-obligatorisk" element so that the validator recognize it, but I have tried different approaches and they all fail somehow.
Any help is appreciated.
Thomas

The outer URL needs to be a full URL. The inner URL can be just a string if you're dealing with a complex extension.
i.e. This might be legal:
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/kodeverdi">
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
</extension>
or this
<extension url="http://ehelse.no/fhir/vft/STU3/StructureDefinition/vft-timestamp">
<valueDateTime value="2017-05-09T10:00:00.936+02:00" />
</extension>
Exactly what's legal depends on the StructureDefinition that defines your extensions

Related

How to change hardware requirements in Windows Universal App?

I developed a Windows (10) Universal App and is deployed to the Store (see here). To my surprise people can't rate it, it gives this reason: "This app needs hardware your device doesn't have, hindering app performance. Rating and reviewing is turned off."
On the bottom of the page in the Store it says "Hardware requirements: Mouse, Touch". I did not configured that anywhere, and I can't find where to change it. I checked the appmanifest with the editor, and there is no tab "Hardware requirements".
This is my appmanifest:
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Identity Name="xxx" Publisher="CN=xxx" Version="1.1.10.0" />
<mp:PhoneIdentity PhoneProductId="xxxx" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>StudioBrussel</DisplayName>
<PublisherDisplayName>BrechtB</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="StudioBrussel.App">
<uap:VisualElements DisplayName="Studio Brussel" Square150x150Logo="Assets\Square150x150Logo.png" Square44x44Logo="Assets\Square44x44Logo.png" Description="Listen to Studio Brussels with this app! Luister naar Studio Brussel met deze app! Écoutez Studio Brussel avec cette app!" BackgroundColor="#cb030b">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" BackgroundColor="#cb030b" />
<uap:InitialRotationPreference>
<uap:Rotation Preference="portrait" />
<uap:Rotation Preference="landscape" />
<uap:Rotation Preference="portraitFlipped" />
<uap:Rotation Preference="landscapeFlipped" />
</uap:InitialRotationPreference>
</uap:VisualElements>
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="StudioBrussel.App">
<BackgroundTasks>
<Task Type="audio" />
</BackgroundTasks>
</Extension>
</Extensions>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>
Does anyone have an idea how to change it, or is this a store bug?
I found it, apparently the "hardware preferences" are not in the appmanifest anymore, but on dev.windows.com in the dashboard under submission => app properties => hardware preferences.

Wix: Creating multiple associations for single file type

I have a Wix based installer that installs two executables. I want to associate my own custom file type to both executables
<Component Id="A.exe" Guid="{GUID}">
<File Id="A.exe" Name="A.exe" Source="../A.exe" KeyPath="yes" Checksum="yes"/>
<ProgId Id="cfgfilerun" Description="Config file for A" Advertise="no" >
<Extension Id="cfg" ContentType="application/text" Advertise="no" >
<Verb Id="Run" Command="Run" TargetFile="A.exe" Argument='"%1"' />
</Extension>
</ProgId>
</Component>
then later
<Component Id="B.exe" Guid="{GUID}">
<File Id="B.exe" Name="B.exe" Source="../B.exe" KeyPath="yes" Checksum="yes"/>
<ProgId Id="cfgfileopen" Description="Config file" Advertise="no" >
<Extension Id="cfg" ContentType="application/text" Advertise="no" >
<Verb Id="Open" Command="Open" TargetFile="B.exe" Argument='"%1"' />
</Extension>
</ProgId>
</Component>
does not work. How to fix? Behavior is that only one of the extensions appears and works, the one for B. If I comment out B's ProgId, then I get the one for A.
Fixed it by putting both files in the same component:
<Component Id="A.exe" Guid="{GUID}">
<File Id="A.exe" Name="A.exe" Source="../A.exe" KeyPath="yes" Checksum="yes"/>
<File Id="B.exe" Name="B.exe" Source="../B.exe" Checksum="yes"/>
<ProgId Id="cfgfilerun" Description="Config file for A" Advertise="no" >
<Extension Id="cfg" ContentType="application/text" Advertise="no" >
<Verb Id="Run" Command="Run" TargetFile="A.exe" Argument='"%1"' />
<Verb Id="Open" Command="Open" TargetFile="B.exe" Argument='"%1"' />
</Extension>
</ProgId>
</Component>
I looked at the debug output from logging from msiexec, what it was doing before with the cfg file just looked broken. I think this is a bug in Wix that you need to have everything in the same component. Generally, I'm a little disappointed with Wix overall, but then again I haven't used any of the competition. Perhaps all Windows installers are a total morass.

How to conditionally set a file extension using Wix?

I'd like to conditionally set a file extension during install. As I understand it, in order to do anything conditionally in Wix, it should be a self-contained component. So for each file type association I would like to allow the user to set, I've got a component similar to the following:
<Component Id="FileAssocComponent_PS" Guid="DAFE9461-2DF0-934A-F204-6B28CEA23C01">
<Condition>FILE_ASSOC_PS</Condition>
<RegistryValue Root="HKLM" Key="SOFTWARE\PrinterApp\Capabilities\FileAssociations" Name=".prn" Value="PrinterApp.ps" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\PrinterApp\Capabilities\MIMEAssociations" Name="application/postscript" Value="PrinterApp.ps" Type="string" />
<RegistryValue Root="HKLM" Key="SOFTWARE\Classes\PrinterApp.ps" Name="FriendlyTypeName" Value="PostScript File" Type="string" />
<ProgId Id="PrinterApp.ps" Description="PostScript File" Icon="PrinterApp.ico" Advertise="yes">
<Extension Id="ps">
<Verb Id="open" Command="Open" Argument=""%1""/>
</Extension>
</ProgId>
</Component>
But this gives me the following error:
error LGHT0204: ICE19: Extension: 'ps' advertises component: 'FileAssocComponent_PS'. This component cannot be advertised because the KeyPath type disallows it.
I've tried setting KeyPath="yes" on one of the registry entries, but that doesn't work - and from what I've been able to find it's expecting a file KeyPath. But this is a component that doesn't contain any files!
How do I get around this error, or am I going about this the wrong way?
Advertised components require a keyfile so here are some ways around the error.
1)
Give the component a fake file ( printermimeinstalled.txt ) that won't harm the system.
2)
Author PrinterAppMime.ps as the keyfile of this component. Use the CopyFile element to get the file copied to PrinterApp.ps
Author PrinterAppNoMime.ps (same contents) as the keyfile of another component. Also use the CopyFile element to get the file copied to PrinterApp.ps. Give this component a mutually exclusive component condition so that only 1 component ever gets instaleld.
3)
Change the design of your app a little bit. Have PrinterApp.ps always installed and PrinterAppMimeServer.ps conditionally installed.
4)
Eliminate this custom action and use a custom action to author MSI temp table rows at installtime to defind the MIME stuff if the checkbox is selected.
Each of these 4 approaches have pro's and con's and I personally would choose #3.
If you set Advertise="no" you should be able to use the code you wrote. Here's an example I posted a couple of years ago here using a separate component for optional file associations.
<Component ....>
<ProgId Id="AcmeFoobar.Document" hDescription="ACME XYZ Document">
<Extension Id="pdf" ContentType="application/xyz">
<Verb Id="open" Command="Open" TargetFile="[APPLICATIONFOLDER]AcmeFoobar.exe" Argument="%1" />
</Extension>
</ProgId>
<Condition><![CDATA[DEFAULTVIEWER=1]]></Condition>
</Component>
I found a solution that worked for me. The issue I had was that I had a condition on the association of the extension to the exe. If the extension was unchecked to not associate, I needed the exe component to get installed but without the progid. Problem was that if a put a condition on the component, the progid wouldn't be created but the exe didn't get installed as well. The solution I found was two create two components. One with the condition and one with mutually exclusive condition. This is basically option 2 from Christopher Painters post.
See below:
<Component Id="My.exe" Guid="{D9CF6FDD-1234-4E90-85A1-3BF1F912C1E3}">
<Condition>NOT FILES_ASSOCIATIONS_ABC</Condition>
<File Id="My.exe.without_assoc" Name="My.exe" KeyPath="yes" Vital="yes" Compressed="yes" DiskId="1" Source=".\SourceDir\My.exe" />
</Component>
<Component Id="My.exe_assoc" Guid="{07F96643-5D74-1234-9DAE-CDEB5AC2D11E}">
<File Id="My.exe.with_assoc" Name="My.exe" KeyPath="yes" Vital="yes" Compressed="yes" DiskId="1" Source=".\SourceDir\My.exe" />
<Condition>FILES_ASSOCIATIONS_ABC</Condition>
<ProgId Id="My.Document" Description="My exe" Icon="MyIcon" Advertise="yes">
<Extension Id="abc">
<Verb Id="open" Command="My Exe" Argument=""%1"" />
<MIME Advertise="yes" ContentType="application/abc" Default="yes" />
</Extension>
</ProgId>
</Component>

How to do URL authentication in struts2

I am using struts2.1.6 + Spring 2.5 I have four modules in my application.
Registration Module
Admin Module
Quote Module
Location Module.
In registration module the customer can register himself and only after registering he is supposed to have access of the remaining three modules.
I want to implement something like if the action being called belongs to the registration module it will work as normal but if the action being called belongs to the rest of those three modules it first should check if the user is logged-in and session has not timed-out. if yes it should proceed normally otherwise it should redirect to the login page.
Through research I have found out that interceptors could be used for this purpose but before proceeding I thought its better to get some feedback on it from experts.
Please suggest how it should be done and If possible put some code suggestions.
Here is my struts.xml file(The struts.xml contains four different config files belonging to each module):
<struts>
<include file="struts-default.xml" />
<constant name="struts.i18n.reload" value="false" />
<constant name="struts.objectFactory" value="spring" />
<constant name="struts.devMode" value="false" />
<constant name="struts.serve.static.browserCache" value="false" />
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<constant name="struts.multipart.maxSize" value="10000000" />
<constant name="struts.multipart.saveDir" value="C:/Temporary_image_location" />
<include file="/com/action/mappingFiles/registration_config.xml" />
<include file="/com/action/mappingFiles/admin_config.xml" />
<include file="/com/action/mappingFiles/quote.xml" />
<include file="/com/action/mappingFiles/location_config.xml" />
</struts>
The sample registration_config.xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="registration" extends="struts-default"
namespace="/my_company">
<action name="LoginView" class="registration" method="showLoginView">
<result>....</result>
<result name="input">...</result>
</action>
</package>
</struts>
The sample admin_config.xml file is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="admin" extends="struts-default"
namespace="/my_company">
<action name="viewAdmin" class="admin" method="showAdminView">
<result>....</result>
<result name="input">...</result>
</action>
</package>
</struts>
Same code is there in the rest of two struts2 xml config files. I have used the same namespace in all the four config files with the different package names(As you can see)
Note: standard practice is to use a different namespace for each package, e.g. "/my_company/admin" for the admin package, etc.
Using interceptors is the right approach: it decouples authentication from the actions themselves. You can define two different interceptor stacks, one that requires the user to be logged in, and one which doesn't. Start by copying the interceptor stack from struts-default.xml, and then customize to your requirements. These definitions can be placed in an abstract base package:
<package name="my-base" abstract="true" extends="struts-default">
<interceptors>
<interceptor-stack name="login-required">
<interceptor-ref name="exception"/>
<interceptor-ref name="alias"/>
<!-- etc -->
</interceptor-stack>
<interceptor-stack name="login-not-required">
<!-- etc -->
</interceptor-stack>
</interceptors>
</package>
Then your other packages just need to extend this base package:
<package name="admin" extends="my-base" namespace="/my_company/admin">
<default-interceptor-ref name="login-required"/>
<!-- actions defined here -->
</package>

getting service from wsdd via xpath not wroking (xmltask)

I am trying to get the XPath "/deployment/service". Tested on this site:
http://www.xmlme.com/XpathTool.aspx
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org /axis/wsdd/providers/java">
<service name="kontowebservice" provider="java:RPC" style="rpc" use="literal">
<parameter name="wsdlTargetNamespace" value="http://strategies.spine"/>
<parameter name="wsdlServiceElement" value="ExposerService"/>
<parameter name="wsdlServicePort" value="kontowebservice"/>
<parameter name="className" value="some.package.internal.KontoWebServiceImpl_WS"/>
<parameter name="wsdlPortType" value="Exposer"/>
<parameter name="typeMappingVersion" value="1.2"/>
<operation xmlns:operNS="http://strategies.spine" xmlns:rtns="http://www.w3.org/2001/XMLSchema" name="expose" qname="operNS:expose" returnQName="exposeReturn" returnType="rtns:anyType" soapAction="">
<parameter xmlns:tns="http://www.w3.org/2001/XMLSchema" qname="in0" type="tns:anyType"/>
</operation>
<parameter name="allowedMethods" value="expose"/>
<parameter name="scope" value="Request"/>
</service>
</deployment>
I absolutely can't find out why it always tells me that my xpath does not match...
This may be stupid, but am I missing something?
EDIT
Thanks to the answer from Dimitre Novatchev I was able to find a workaround:
<xmltask failwithoutmatch="true" report="false">
<fileset dir="${src.gen}/" includes="**/*-deploy.wsdd" />
<copy path="//*[local-name()='service']" buffer="tmpServiceBuf" append="true" />
</xmltask>
<xmltask failwithoutmatch="true" report="false" source="${basedir}/env/axis/WEB-INF/server-config.wsdd" dest="${build.stage}/resources/WEB-INF/server-config.wsdd">
<insert path="//*[local-name()='transport'][last()]" buffer="tmpServiceBuf" position="after" />
</xmltask>
Binding namespaces with xmltask (which is the tool that gave me the headaches) seems not to be possible. The code above did the trick.
The Problem: This XML document has a default namespace. XPath considers any unprefixed names to be in "no-namespace". It tries to select /deployment/service where the elements deployment and service are in no-namespace and doesn't select any node, because in the provided XML documents there are no such elements that are in "no- namespace (they all are in the "http://xml.apache.org/axis/wsdd/" namespace)
The solution: Using the language which hosts XPath (such as C#, Jave, XSLT, or any other language that you may be using) bind a prefix (say x:) to the namespace "http://xml.apache.org/axis/wsdd/".
Then, change:
/deployment/service
to
/x:deployment/x:service
Now the last XPath expression correctly selects the desired node.

Resources