Returning batch numbers from a product in a document.

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.

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

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:

openvpms:get(., "batch.entity")

This returns an entity.productBatch.

To get the batch number:

openvpms:get(., "batch.entity.name")

To get the product name:

openvpms:get(., "batch.entity.product.target.name")

To get the batch expiry:

openvpms:get(., "batch.entity.product.activeEndTime")

To get the manufacturer name:

openvpms:get(., "batch.entity.manufacturer.target.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

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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:

openvpms:get(. "invoiceItem.source")

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:

openvpms:get(., "invoiceItem.source.batch.entity.name")
openvpms:get(., "invoiceItem.source.batch.entity.product.activeEndTime")

 

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

Field:
openvpms:get(.,'invoiceItem.source.batch.entity.name')

Expression:
$F{openvpms:get(.,'invoiceItem.source.batch.entity.name')}

gives a

Invalid property name:openvpms:get(.,'invoiceItem.source.batch.entity.name')

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Returning batch numbers from a product in a document.

Solved sorry 

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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(., &quot;invoiceItem.source.batch.entity.product.activeEndTime&quot;)]}</message>
<exception>
<type>org.openvpms.report.ReportException</type> 

is the error now

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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

 

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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

Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

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

Syndicate content