How to run FHIR Validator (java jar) - hl7-fhir

I had downloaded "Validation Pack" from http://www.hl7.org/implement/standards/fhir/downloads.html.
After unzip 'validator.zip' and read 'readme.txt', I tried to run 'org.hl7.fhir.validator.jar' file on Windows Command Prompt.
java -jar org.hl7.fhir.validator.jar mysourcefile.xml
I encountered the following error:
java.lang.Exception: Unknown command 'mysourcefile.xml' at org.hl7.fhir.instance.test.ToolsHelper.main(ToolsHelper.java:77)
java.lang.ArrayIndexOutOfBoundsException: 1 at org.hl7.fhir.instance.test.ToolsHelper.main(ToolsHelper.java:81)
Why is 'mysourcefile.xml' an unknown command? Please help. Thanks!

The jar file is set up to load the wrong class. The correct class is org.hl7.fhir.instance.validation.Validator.
You can name that class explicitly when you run the jar, and you'll get the help, which will say:
Usage: FHIRValidator.jar [source] (-defn [definitions]) (-output [output]) (-noxslt)
you'll got more documentation as well.
Else you edit the manifest inside the jar and change the main class.

If you want to validate your resource against the base specification run the following command:
java -jar org.hl7.fhir.validator.jar your-fhir-resource.xml -defn validation.zip
If you want to validate your resource against a profile (structure definition) run the following command:
java -jar org.hl7.fhir.validator.jar your-fhir-resource.xml -defn validation.zip -profile your-structure-definition.xml

Updated docmentation
Validation Instructions:
You need java 1.7 jre or jdk installed
Download the validator tool and the validation pack (java executable, and dictionary of FHIR definitions, respectively), and unzip the validator (but not the validation pack)
Execute the validator with the following command line: java –jar org.hl7.fhir.validator.jar [source] (-defn [definitions]) (-profile [profile]) (-output [output]) where:
[source] is a file name or url of the resource or bundle feed to validate
 [definitions] is the file name or url of the validation pack
(validation.zip). Default: get it from inside the jar file
[profile] is an optional filename or URL for a specific profile to
validate a resource against. In the absence of this parameter, the
resource will be checked against the base specification using the
definitions.
[output] is a filename for the results (OperationOutcome). Default: results are sent to the std out.
Note: at this time, the validator is only able to validate XML resources, not JSON ones.
Here’s a windows batch file that will do all this:
REM get the validator and unzip it
wget.exe http://hl7-fhir.github.io/validator.zip
7z.exe x validator.zip
7z.exe x saxon.zip
REM Get the validation source file (dictionary)
wget.exe http://hl7-fhir.github.io/validation-min.zip
REM get an example to validate
wget.exe http://ec2-54-87-74-90.compute-
1.amazonaws.com/open/Patient/1234 -O daf-patient.xml
REM validate it. The DAF profile will be loaded out of the
definitions in validation-min.zip
java -jar org.hl7.fhir.validator.jar daf-patient.xml -defn
validation-min.zip -profile
http://hl7.org/fhir/StructureDefinition/patient-daf-dafpatient
pause

The documentation needs updating. Try:
java -jar org.hl7.fhir.validator.jar round mysourcefile.xml output.xml
But I don't think the DSTU validation.jar is applying the XSD or Schematrons. If this is your goal, then you can use other tools.
For XSD:
xmllint --noout --schema <XSD_FILE> mysourcefile.xml
For Schematron, using probatron4j
java -jar probatron.jar mysourcefile.xml fhir-atom.sch

Related

HL7 FHIR IG Publisher returns java NullPointerException

I'm trying to generate documentation of my HL7 FHIR profiles using IG Publisher (publisher.jar). I'm running it on command line on macOS. I've uploaded the IG resource on Simplifier and it validates with no errors.
The problem is that i'm getting java.lang.NullPointerException. Full output below:
java -jar publisher.jar -ig fsh-generated/resources/ImplementationGuide-nfz.pozplus.json -tx n/a
FHIR IG Publisher Version 1.1.120 (Git# 210e48f945ad). Built 2022-05-13T15:20:39.709Z (8 days old)
Detected Java version: 11.0.10 from /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home on Mac OS X/x86_64 (64bit). 2048MB available
dir = /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest, path = /Users/marcingrudzien/.gem/ruby/3.1.2/bin:/Users/marcingrudzien/.rubies/ruby-3.1.2/lib/ruby/gems/3.1.0/bin:/Users/marcingrudzien/.rubies/ruby-3.1.2/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Postgres.app/Contents/Versions/latest/bin
Parameters: -ig fsh-generated/resources/ImplementationGuide-nfz.pozplus.json -tx n/a
Start Clock # sobota, 21 maja 2022 20:56:04 czas środkowoeuropejski letni (2022-05-21T20:56:04+02:00)
API keys loaded from /Users/marcingrudzien/fhir-api-keys.ini (00:00.0027)
Package Cache: /Users/marcingrudzien/.fhir/packages (00:00.0030)
Load Configuration from /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest/fsh-generated/resources/ImplementationGuide-nfz.pozplus.json (00:00.0053)
Root directory: /Users/marcingrudzien/Library/CloudStorage/OneDrive-Osobisty/Praca/iEHReu/NFZ/POZ-Plus/FHIR/sushi-test/NfzTest/fsh-generated/resources (00:00.0084)
Publishing Content Failed: null (00:00.0086)
(00:00.0087)
Use -? to get command line help (00:00.0087)
(00:00.0087)
Stack Dump (for debugging): (00:00.0088)
java.lang.NullPointerException
at org.hl7.fhir.igtools.publisher.Publisher.initializeFromJson(Publisher.java:2947)
at org.hl7.fhir.igtools.publisher.Publisher.initialize(Publisher.java:2168)
at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:854)
at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:10144)
I hope someone here could help me. I could provide any additional information, if needed.
From the stack dump, you are missing a "path" property in your json config file, but I highly recommend that you switch to using the new set up, a ini file that points to a template and a IG resource. Use something like the sample-ig as a starter (https://github.com/FHIR/sample-ig) or see the how-to (https://build.fhir.org/ig/FHIR/ig-guidance/index.html)

Jmeter - How to set Jmeter to pick up specific Java version (windows)

My windows system has two Java versions: 15 & 17
I want to make Jmeter pick up version 15.
I set path as: C:\Program Files\Java\jdk-15.0.2\bin
And JAVA_HOME as C:\Program Files\Java\jdk-15.0.2
When I do: java -version I have:
But still seems like Jmeter is picking up Java 17 due to an exception when I run code that contains JSR223 Assertion
2022-05-12 13:40:51,300 ERROR o.a.j.a.JSR223Assertion: Problem in JSR223 script: JSR223 Assertion
javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during conversion: Unsupported class file major version 61
How to 'force' Jmeter to pick up java 15?
It's sufficient to set the Java version you want to use to be ahead of other Javas in PATH environment variable and JMeter will pick it up.
set PATH="C:\Program Files\Java\jdk-15.0.2\bin";%PATH%
In order to check what Java version JMeter is using you can add a Debug Sampler configured like:
and look for java.version property in the View Results Tree listener
or just look for java.version line in the JMeter.log file
Milk and honey for me here were:
1 set path as: set PATH="C:\Program Files\Java\jdk-15.0.2\bin";%PATH%
2 lunch Jmeter from cmd as: java -jar ApacheJMeter.jar
coz launching from 'ApacheJMeter.jar' probably initiated hardcode java version
the alternative is the creation of .bat launcher as:
a) create startJmeter.bat
b) put inside
c:
cd C:\apache-jmeter-5.4.3\bin
java -jar ApacheJMeter.jar

Oracle Universal Installer stops after launch (Oracle Forms and Reports 12.2.1.4)

i try to install Oracle Forms and Reports 12.2.1.4, but everytime I run setup.fmw.12.2.1.4.0_fr_win64.exe file Oracle Universal Installer window shows up for a moment with communicate "Preparing the installer...". After that it dissappears and shows again with another communicate: "Cleaning up...". After this communicate, the installer window turns off and there are no other steps.
Screens below
first communicate
second communicate
Did anybody have this problem also? My JAVA_HOME is set as C:\Java\jdk1.8.0_241 and PATH=%JAVA_HOME%\bin.
Here's also -debug log below
m_szTempDirectory: C:\Windows\Temp
Extract to C:\Windows\Temp\sfxCD9A.tmp
Extracting sfx.ini from D:\setup_fmw_12.2.1.4.0_fr_win64.exe to C:\Windows\Temp\sfxCD9A.tmp
Wiz_SingleEntryUnzip (extractAutorun) return code: 0
Total uncompressed size: 2447428290
m_szTempDirectory: C:\Windows\Temp
Extract to same C:\Windows\Temp\sfxCD9A.tmp
Extracting installer files
Wiz_SingleEntryUnzip() result: 0
Total disks: 1 (1)
Finished extracting Disk1
Using version 1.8.0.211.12 of component Disk1\stage\Components\oracle.jre
Jar list: Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
New command: oracle.jre\.\jdk\jre\bin\java.exe -jar install/modules/ora-launcher.jar
Unzipping Java jars Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar to oracle.jre
Getting size of Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Size of Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar: 201205655
Checking space for Java components in C:\Windows\Temp
Unzipping Java jars: Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Unzipping Disk1\stage\Components\oracle.jre\1.8.0.211.12\DataFiles\filegroup1.jar
Launch command length: 278
Launch command: "C:\Windows\Temp\sfxCD9A.tmp\oracle.jre\jdk\jre\bin\java.exe" "-Djava.io.tmpdir=C:\Windows\Temp" "-Dsfx.installer.launcher.home=D:\" "-Dsfx.extract.path=C:\Windows\Temp\sfxCD9A.tmp" "-Dsfx.exe=D:\setup_fmw_12.2.1.4.0_fr_win64.exe" -jar install/modules/ora-launcher.jar "-debug"
cmdLine: "C:\Windows\Temp\sfxCD9A.tmp\oracle.jre\jdk\jre\bin\java.exe" "-Djava.io.tmpdir=C:\Windows\Temp" "-Dsfx.installer.launcher.home=D:\" "-Dsfx.extract.path=C:\Windows\Temp\sfxCD9A.tmp" "-Dsfx.exe=D:\setup_fmw_12.2.1.4.0_fr_win64.exe" -jar install/modules/ora-launcher.jar "-debug"
Command successfully started; waiting for completion
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.
-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
A ; separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D<name>=<value>
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:<value>
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:<packagename>...|:<classname>]
-enableassertions[:<packagename>...|:<classname>]
enable assertions with specified granularity
-da[:<packagename>...|:<classname>]
-disableassertions[:<packagename>...|:<classname>]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:<libname>[=<options>]
load native agent library <libname>, e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:<pathname>[=<options>]
load native agent library by full pathname
-javaagent:<jarpath>[=<options>]
load Java programming language agent, see java.lang.instrument
-splash:<imagepath>
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.
dwExitCode: 1
myspawn() result: 1
Press any key to exit
To be clear, you need to start the installer using an elevated shell. This is not the same as being a member of the Windows "Administrator" group. Right-click on the exe and click on "Run as administrator".
Instead of running setup.exe, try execute \install\oui.exe -debug

oracledb_exporter binary files

There is Prometheus Oracle database exporter https://github.com/iamseth/oracledb_exporter
Under Running section, "/path/to/binary -l log.level error -l web.listen-address 9161" is not clear me.
Here I am not getting what is "/path/to/binary" mean, is it oracle client or /usr/bin/ path, or which file I need to replace with? I have RHEL7.3
After setting DATA_SOURCE_NAME is set correctly and running below commman, its throwing error (no such cmd - /path/to/binary)
/path/to/binary -l log.level error -l web.listen-address 9161
Please refer ZIP/clone from location :-https://github.com/iamseth/oracledb_exporter
Oracle database exporter should start and fetch required values/status from oracle database.
In case you're still looking for the answer:
The easiest way is to download the pre-compiled version. Otherwise you will need to compile it yourself: https://github.com/iamseth/oracledb_exporter/releases
Download the version you want e.g. 'oracledb_exporter.0.2.2.linux-amd64.tar.gz' and unzip it.
You will get a folder 'oracledb_exporter.0.2.2.linux-amd64' which conatins two files:
default-metrics.toml
oracledb_exporter
The second one is the one you need to execute:
-> /path_to/oracledb_exporter.0.2.2.linux-amd64/oracledb_exporter log.level error web.listen-address 9161

Verpatch.exe error

I am trying to add new version resource string to .exe file using verpatch.
I need to add new sting to version resource as I am creating test connector to Qlikview. For QlikView and Qlik Sense to be able to recognize an .exe file as a connector, the file version information resource must include the property “QlikView Connector”.
I am developing my connector with Visual Studio and this command is run as a post build command and build ends with error. I also tried to run it from command line with same result:
C:\verpatch>verpatch.exe C:\QV_temp\QVTestConnector.exe /s "QlikView Connector" "Qv Test Connector"
Exception in ParseBinaryVersionResource
Error in ParseBinaryVersionResource
error parsing version info from the file
Some of actions failed, exiting
I have also tried different versions on verpatch.exe. Any ideas?
The example that Qlik gives on their documentation does not seem to work with the version of verpatch.exe that ships with QVX SDK 2.1.
I resolved this error by updating to a newer version from CodePlex.
Edit:
verpatch seems to have moved to https://github.com/pavel-a/ddverpatch/releases
Please see documentation. After /s should go "description".
If it has problem reading existing version resource, try to rewrite it completely with /va. So, do something like:
verpatch your.exe 1.0.0.0 /va /s desc "QlikView Connector" /s product "Qv Test Connector"
If you can share the problematic exe with the author of verpatch (on Codeplex), he may provide a fix.
I couldn't set properties on my executable with any version of verpatch - because I had a different codepage in the resource strings.
I would recommend rather using the Python package pe-tools (PyPI), which has a nicely documented command peresed that does this (docs).
You can also set specific version-info fields or set resource entries to the contents of a file:
peresed filename.exe -V "QlikView Connector=Qv Test Connector"
I have run this command successfully, but not verified whether the properties were set - but other properties like FileDescription are set correctly.

Resources