How to implement ExtractCCDAAttributes processor in Apache Nifi? - xml-parsing

I am on the process to extract some healthcare Data. Initially started with CCDA which is XML file format. How can i config the ExtractCCDAAttributes to extract the attributes with its value?

You can refer to this minimal flow that demonstrates use of ExtractCCDAAttributes processor.
1) Get CDA Document (Processor type: GetFile)
This will create a FlowFile with the document contents. The sample data file (XML) used is available here.
2) ExtractCCDAAttributes (Processor type: ExtractCCDAAttributes)
This processor has a single property (Skip Validation) to indicate whether or not to validate CDA message values. We accept the default value of true. The processor outputs individual attributes as FlowFile attributes.
3) Success (Processor type: LogAttribute)
This is to log attributes upon success of ExtractCCDAAttributes processor.
4) Failure (Processor type: LogAttribute)
This is to log attributes upon failure of ExtractCCDAAttributes processor.
Verification:
When the sample file is processed, two of the (many) attributes logged by the Success processor are:
Key: 'vitalSignsSection.organizer_01.observations_02.code.displayName'
Value: 'Intravascular Systolic'
Key: 'vitalSignsSection.organizer_02.observations_03.code.displayName'
Value: 'Intravascular Systolic'
In the sample file, the two places where these appear are on lines 3592 and 3700:
and

Related

What does "Building tree for null using TinyBuilder" mean with Saxon extension function and using -t option?

With my Saxon extension function code I have the log messages:
> java -cp ./saxon-he-10.2.jar:./ net.sf.saxon.Transform -t -init:MyInitializer -xsl:./exttest.xsl -o:./out.xml -it:initialtemplate
Saxon-HE 10.2J from Saxonica
Java version 14.0.2
Stylesheet compilation time: 305.437652ms
Processing (no source document) initial template = initialtemplate
Using parser com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser
Building tree for null using class net.sf.saxon.tree.tiny.TinyBuilder
Tree built in 0.850325ms
Tree size: 3 nodes, 0 characters, 0 attributes
Execution time: 29.965658ms
Memory used: 14Mb
It is not clear to me wether Building tree for null using class net.sf.saxon.tree.tiny.TinyBuilder means that there is something wrong with my code https://gitlab.com/ms452206/socode20200915 and how to avoid it.
It's a poor message and I will improve it; the "null" would be the base URI (or systemId) of the document if it had one. The fact that the document has no known base URI could be a predictor of trouble downstream, since some things rely on a document having a known base URI; but it's not an error in itself.
It's most likely to happen if you build a document using a JAXP Source object whose systemId property is null. Which is what you have done when you wrote:
new StreamSource(new StringReader("<foo/>"))
This is likely to cause failures only if the document contains relative URIs (for example in external entity references or href or xml:base attributes), which is not the case with your simple XML document.

jmeter | Get pass/fail count of samples from jtl file

I am using jmeter for functional testing and have 2 different jmx.
The first jmx has all APIs automated and the second jmx is used to send the html report (generated using Ant-Jmeter task) through SMTP sampler.
Now, I want to send the count of Total, Pass, Fail sample counts in the same email by parsing the jtl file generated by first jmx.
Here is what I can see in the jtl file, s="true" and s="false".
I want count of the same and save it as property to use it further in SMTP sampler.
Example in jtl:
<sample t="2" it="0" lt="2" ct="0" ts="1565592433268" s="false" lb="Verify Latest Patch" rc="200" rm="OK" tn="Tenant_Login 3-1" dt="text" by="9" sby="0" ng="1" na="1">
Any help will be appreciated.
Add the next line to user.properties file:
jmeter.save.saveservice.autoflush=true
it will instruct JMeter to immediately write results to file as soon as they're available
Add tearDown Thread Group to your Test Plan
Add HTTP Request sampler to the TearDown Thread Group
Configure it as follows:
Protocol: file
Path: `location of your .jtl result file
Add XPath Extractor as a child of the HTTP Request sampler
Configure it as follows:
Reference Name: anything meaningful, i.e. successCount
XPath query: count(//sample[#s='true'])
That's it, now you should be able to refer the successful samples count as ${successCount} where required

Oracle Report stuck in post processing when trying to generate a report

I am creating a Oracle Report. The report is supposed to take a bunch of input and create the report. It is not working for some specific cases.
The input are as follows
1. Account number
2.org id
3. start _date
4.end date
the report is supposed to generate a report for the org_id(constant) based on the account number and for date between start date and end date.
When the account_number is not provided it will return all the information regarding all accounts.
It works when I give specific account information
It works for specific dates (10-jan-25th jan ,20thjan-31st-jan) with out any account number: i.e. it returns information about all account number for given time period.
but it fails to give me information about 10-jan-31st jan. Which I can not figure out why.
I have tried to get the xml and put it in the template and create a preview,
the preview does not work and gives me the following error:
error: Conf File: C:\Template Builder for Word\config\xdo config.xml Font Dir: C:\Template Builder for Word\fonts Run XDO Start Template: C:\MyFiles\XML_Publisher\lATEST OUTPUT\XXONT_M193_CANCELLED_HOLDS .rtf RTFProcessor setLocale: en-us FOProcessor setData: C:\MyFiles\XML_Publisher\Test\errchk15jan7feb.xml FOProcessor setLocale: en-us
With the longer date range, the XML file might be too big for the output postprocessor. Did you check the size of the XML file?
If this is the problem, you can use our company's Blitz Report, which doesn't have size limitations: https://www.enginatics.com/faq/#how-does-blitz-report-compare-with-oracle-bi-publisher

Is it possible to obtain file path from IPP headers?

I writeing printing web application which simulate printer behavior. It uses IPP protocol to receive document within printing request.
I can obtain some information about print job from IPP attribute code 0x42 in IPP headers:
filename - full file path (it's my aim) in case of Notepad++ and only filename if I print document from MS Word
user name - from OS
Can I obtain full file path from IPP independent from application? May be I can achieve this with additional request?
0x42 specifies just the value type - in this case it probably represents type nameWithoutLanguage.
Filename
Short answer: There is no standard way to obtain the file path from ipp headers.
Depending on the ipp client implementation (e.g. the windows printer driver) you might be able to use some other attributes. There are various options how a driver could submit a print job.
Jobs sent via the ipp operation PRINT_JOB (0x0002)
The file is being added as stream of bytes (formatted in a specific print-job-language like postscript or pdf) . Most implementations set the job attribute job-name to the name of the original filename or filepath.
Jobs sent via the ipp operation PRINT_URI (0x0003)
This method is rarely used but would provide a URI where the printer would have to load the file or data to print from. The URI includes a path.
Username
As for the username there is a standard ipp attribute available: requesting-user-name. It is the ipp clients (e.g. windows printer driver) responsibility to set the this value. RFC 2911 Section 3.2.1.1 Print-Job-Request says:
The "requesting-user-name" (name(MAX)) attribute SHOULD be supplied by
the client as described in section 8.3.

Google dataflow: AvroIO read from file in google storage passed as runtime parameter

I want to read Avro files in my dataflow using java SDK 2
I have schedule my dataflow using cloud function which are triggered based on the files uploaded to the bucket.
Following is the code for options:
ValueProvider <String> getInputFile();
void setInputFile(ValueProvider<String> value);
I am trying to read this input file using following code:
PCollection<user> records = p.apply(
AvroIO.read(user.class)
.from(String.valueOf(options.getInputFile())));
I get following error while running the pipeline:
java.lang.IllegalArgumentException: Unable to find any files matching RuntimeValueProvider{propertyName=inputFile, default=gs://test_bucket/user.avro, value=null}
Same code works fine in case of TextIO.
How can we read Avro file which is uploaded for triggering cloud function which triggers the dataflow pipeline?
Please try ...from(options.getInputFile())) without converting it to a string.
For simplicity, you could even define your option as simple string:
String getInputFile();
void setInputFile(String value);
You need to use simply from(options.getInputFile()): AvroIO explicitly supports reading from a ValueProvider.
Currently the code is taking options.getInputFile() which is a ValueProvider, calling the JavatoString() function on it which gives a human-readable debug string "RuntimeValueProvider{propertyName=inputFile, default=gs://test_bucket/user.avro, value=null}" and passing that as a filename for AvroIO to read, and of course this string is not a valid filename, that's why the code currently doesn't work.
Also note that the whole point of ValueProvider is that it is placeholder for a value that is not known while constructing the pipeline and will be supplied later (potentially the pipeline will be executed several times, supplying different values) - so extracting the value of a ValueProvider at pipeline construction time is impossible by design, because there is no value. At runtime though (e.g. in a DoFn) you can extract the value by calling .get() on it.

Resources