Returning batch numbers from a product in a document.
Submitted by Ben_Charlton on Fri, 06/03/2015 - 15:07
I have been working throw documents for 1.8 and I am looking at the jxpath expression that would be required to return the batch number and manufacterur for a given product that has a linked document ie Vacc Certificate
so far I have
for batch name
openvpms.get(openvpms:get(openvpsm:get(.,"product.entity.objectReference"),"batch.objectReference"),"name")
FOR THE MANUFACTURER i COULDNT SEE THE DRILL DOWN FOR ENTITYLINKS IN jxpath
Sorry for caps.
Re: Returning batch numbers from a product in a document.
Given a product, you can't get the batch. You need an invoice item or medication which has a batch, and then navigate from there.
E.g., if you have an invoice item or medication, you can get the batch as follows:
This returns an entity.productBatch.
To get the batch number:
To get the product name:
To get the batch expiry:
To get the manufacturer name:
Re: Returning batch numbers from a product in a document.
I assume you cant just access the invoiceItem node by doing
calling invoiceItem.source.act ? or invoiceitem.source.entity ?
Ben
Re: Returning batch numbers from a product in a document.
If you have an act.patientDocumentForm or act.patientDocumentLetter linked to an invoice item, then you can do:
to get the corresponding act.customerAccountInvoiceItem (the "invoiceItem" returns an actRelationship.invoiceItemDocument", the "source" returns the source of the relationship). From there, you can get the batch details:
Re: Returning batch numbers from a product in a document.
I have successfully used the above in a odt document. However
However we also use a
jrxml document as a patient form to return a certificate because the formatting is much more precise
gives a
Re: Returning batch numbers from a product in a document.
Solved sorry
Re: Returning batch numbers from a product in a document.
Nope jumped the gun thought I had left out some brackets
<message>Failed to generate report: Error evaluating expression :
Source text : $F{[openvpms:get(., "invoiceItem.source.batch.entity.product.activeEndTime")]}</message>
<exception>
<type>org.openvpms.report.ReportException</type>
is the error now
Re: Returning batch numbers from a product in a document.
Whats the stack trace?
Re: Returning batch numbers from a product in a document.
I sent the stack trace error report
Re: Returning batch numbers from a product in a document.
arg its the report feild being set as as string v timestamp
Caused by: java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.lang.String
Re: Returning batch numbers from a product in a document.
Greetings all...
I've been trying to implement the batch numbering system for our vaccines and am updating our vaccination certificates (.odt) to show the relevant information. I seem to be bouncing back and forth between the following two error messages: "Expression Error" or "Invalid property name". I can't seem to get the translation correct between the openvpms:get functions listed above and User Fields in the document.
Can someone please provide the idiot-proof version of the syntax I should be putting in the Value fields.
(Sounds of head banging on desk)
Thanks,
Sam
Re: Returning batch numbers from a product in a document.
Got it! You know what they say about monkeys and typewriters...
Sam