Error - Missing act in docload
Hello all,
After getting everything else with the basic installation now working perfectly, I have been trying to implement the docload function on my Ubuntu Server 14.04. I have done the preliminary setup following the guide posted on the site and have placed a new pending investigation in a patient record (Blood Profile - Request # 340 [In Progress]), created a new document named 340-Bloodwork.pdf and placed it in the Inbox. I call the docload function with the following:
sudo ./docload.sh --byid --source /opt/OpenVPMS/imports/Inbox/ -- dest /opt/OpenVPMS/imports/archives --verbose
I receive the following output:
Missing act for /opt/OpenVPMS/imports/Inbox/340-Bloodwork.pdf, identifier=340
Loaded: 0
Errors: 1
Total: 1
I've seen elsewhere on the site a variation of the command using the "--type act.PatientInvestigation" parameter, but receive the same results when that is included. I see in the Administration>Archetypes that act.PatientInvestigation.1.0 is present. If I try to send the full archetype name in the --type parameter, then it spits java.lang errors regarding "short names".
In this test implementation, I am using the sample database available through svn. Is there an incompatibility here or am I doing somthing wrong? The instructions seemed pretty straightforward so I didn't anticipate any real issues.
Thanks,
Sam
Re: Error - Missing act in docload
Sam - I am reasonably confident that you need to specify a type argument. We run on a Win2003 server and here is our bat file. Note the --type act.patientInvestigation. This bat file is run every 5 minutes by the Windows scheduler. Note also the scan for files before firing up docload. I implemented this after looking at the cpu required to fire up docload - ie what resources it took to run docload if there were no new results to load.
Note that if you invoke docload with no arguments then it outputs its documentation. However that does imply that the -t or --type argument is optional since it defaults to include act.patientInvestigation.
I confess that I cannot remember whether, when I was setting this up I tried it with no --type argument. Also this is one of those areas that once you have it running, you never look at it again.
Recommendation: add in --type act.patientInvestigation and see if it comes good.
Also, if you are short on CPU resources and want to run docload at short intervals, implement the 'is there anything to load' logic.
Regards, Tim G
Re: Error - Missing act in docload
Hi Tim,
Thanks for getting back and for pointing me to the parameter list for docload. I did try the --type act.patientInvestigation with unfortunately the exact same results. However, I've dug into docload.sh itself and see that it includes a reference to:
-classpath $CLASSPATH org.openvpms.etl.tools.doc.DocumentLoader
When I echo $CLASSPATH, I get nothing returned. $CLASSPATH does not seem to be set yet on my system. I know our systems are laid out differently, but any idea if that needs to be set and if so, what it should point to? Just wondering what happens on your system if you C> echo %CLASSPATH%. Maybe my problem is that things are just not being found.
I did see the approach you've taken in checking first if there any files that actually need to be loaded. If you don't mind, once I get the basic docload function sorted out, I'll modify your script and call it as a cron job. Looks like a good approach.
Thanks,
Sam
Re: Error - Missing act in docload
The $CLASSPATH is being set by the setenv.sh script that is sourced by docload.sh.
The error:
Missing act for /opt/OpenVPMS/imports/Inbox/340-Bloodwork.pdf, identifier=340
means that docload can't find a document act record in the document_acts table with id=340 for any of the document types specified by the --type argument.
To check for the presence/absence of the document act, you can execute the following SQL:
If there is one present, check the value of the arch_short_name column; it means that it is not being specified by the --type argument.
-Tim A
Re: Error - Missing act in docload
Hi Tim,
I ran the query and everything seems good I think. Here are the full results:
document_act_id = 340
doc_version = NULL
file_name = NULL
mime_type = NULL
printed = NULL
document_id = NULL
act_id = 340
version = 1
arch_short_name = act.patientInvestigation
arch_version = 1.0
linked_id = 795...813
name = Patient Investigation
description = NULL
active = <blank>
activity_start_time = 2014-04-21 12:26:02
activity_end_time = NULL
reason = NULL
status = IN_PROGRESS
Thanks,
Sam
Re: Error - Missing act in docload
The problem is the null value for the active column; this means that the document act is treated as inactive, and is therefore excluded.
How did you create the Patient Investigation? If you create it within OpenVPMS, it should be assigned a value of 1 by default.
Re: Error - Missing act in docload
Using the svn database, I created a new investigation type named Blood Profile, checked-in one of the patients and started a new investigation of type Blood Profile. A new entry in the medical record was created with
Investigation Blood Profile - Request No: 340 - [In Progress]
exactly as in the screen shot in the guide. I don't see anything in the Edit Investigation screen where I can activate it or deactivate it.
In Administration > Archetypes I have two similar archetypes:
158 "act.PatientInvestigation.1.0" - latest and primary boxes checked, and
159 "act.PatientInvestigationVersion.1.0" - latest checked, primary unchecked
Both refer to org.openvpms.component.business.domain.im.act.DocumentAct.
I thought I did things correctly here... maybe not?
Sam
Re: Error - Missing act in docload
You've done everything correctly. I can't think of a reason why the active flag hasn't been set. If you create another investigation, does it also its active flag unset?
As a workaround, you can edit the act.patientInvestigation archetype in Administration|Archetypes, and add the active flag. This will enable you to toggle it for individual investigations:
Re: Error - Missing act in docload
Hmm...
OK. well that probably explains a few things. My nodes for act.patientInvestigation.1.0 don't look like yours at all. From top to bottom I have:
name, clinician, mimeType, document, status, id, fileName, author, startTime, patient, reviewed, investigationType, description, event, product.
No node name "active".
But I did see the Test button, so hey, why not? Test > Investigation Type > Blood Profile > Validate yields red error box with "Failed to validate User of Act Author: value is required. In the Edit descriptor.archetype window, the author default value is blank.
Is this a consquence of using the svn database?
Sam
Re: Error - Missing act in docload
I added the active flag - you need to do the same to your archetype. That's the short-term workaround until we can sort out why yours is not defaulting to 1 in the database.
You can ignore the Test button error; its unrelated. When you enter the test mode, it works in an isolated environment so any changes you make testing an archetype don't affect the objects outside that environment. The downside of the current implementation means that hidden fields like author aren't populated, as they don't have access to the current user.
Re: Error - Missing act in docload
OK... I'm thinking that the error is here. I'm running this out of a duplicate training version under openvpms-demo. That's my test bed. Under tomcat7 I have two web-apps: openvpms and openvpms-demo. Docload is being called however from /opt/OpenVPMS/openvpms-release-1.7/bin. I see that there is a --context parameter for docload. Clearly if both web-apps are running, then the proper applicationContext.xml is probably not being called... like maybe trying openvpms (where there is no investigation Blood Profile) instead of openvpms-demo where the Investigation was created? I tried to set the --context explicitly to demo's applicationContext.xml but get the error that it can't be set twice. So I think that perhpaps I should pull the -c out of the docload.sh script and set the --context exlicitly in the command. I guess that all makes sense. Otherwise, how does the script even know what database to use?
I guess it's still not clear to me, however, why the archetype within -demo is not getting set properly. It seems that would all be done within the context of the openvpms-demo instance?
Is my thinking correct on this?
Sam
Re: Error - Missing act in docload
The database properties come from <OPENVPMS_HOME>/conf/hibernate.properties.
This is referenced by <OPENVPMS_HOME>/conf/applicationContext.xml.
The easiest approach is to:
1. create a separate install directory for your openvpms-demo environment.
2. change the conf/hibernate.properties to connect to the openvpms-demo database
Re: Error - Missing act in docload
Should probably also point out that any ESCI client Job interfaces that you want to test wont work with two openvpms version running from the same machine. Dont run them at the same time if you want to test the communication with your supplier.
Re: Error - Missing act in docload
OK... all seems well when the investigation is set up within the "real" openvpms and docload is called without the --type parameter. The --type paramameter makes docload throw the shortNames errors as before. So I guess this is an environment thing. I still haven't figured out how to set up the environmemnt for the training version, but at least I have it running for the default installation.
Apologies to all for failing to mention that rather critical point about the parallel -demo traning version. It seems to work so flawlessly elsewhere that it totally slipped my attention. :(
Sam
Re: Error - Missing act in docload
All good to know as I'm sure that having a training version is a pretty popular setup. I'm setting it up now with a separate home as you suggest. I'm sure it will all work now. Sorry if I chased you down a bit of a rabbit hole on this one... just getting a small sense now as to how all this integrates.
Thanks very much for your help on this... great support...
Sam
Re: Error - Missing act in docload
Honestly, the best part of OpenVPMS is the way its supported, we all watch, learn and adapt as people come up with new ideas and new suggestions for the way forward, I honestly believe this project has the potential to be better than any currently available commercial system.
I am constantly talking to companies with vested interest in our market at looking really closely at OpenVPMS and either contributing or intergrating it. If they do either the software benefits.
Goodluck with testing Sam, let us know if you get hung up anywhere else.
Re: Error - Missing act in docload
Off topic...
but I do believe that I am only just getting a small glimmer of what is quite a fabulously well-designed and implemented package. I am really blown away by some of the features that I've seen so far... even something seemingly as simple as the Alt-F1 help screens. Wow... what an incredible amount of work and so helpful. And I've barely scratched the surface I'm sure.
I'm quite convinced that this will develop into a long relationship for me with the project. Truly, thanks and congratulations to everyone involved. A tremendous job! I couldn't be more pleased and I'm sure my wife will just love using it in her new practice.
And certainly I agree with you Ben that the support is excellent.
Sam Longiaru
Kamloops, BC
Re: hosting multiple systems
I have just added a section to the CSH text at http://www.openvpms.org/documentation/csh/1.7/reference/setup/multiple-s... which covers how to set up multiple systems on the one server.
I think that I have the correct recipe but I am currently travelling and do not have the resources to test my recipe. I would appreciate someone casting a beady eye over the text.
Regards, Tim G
Re: hosting multiple systems
As I have several versions of Ubuntu Server saved as VirtualBox appliances, it's pretty easy for me to rollback to one where I only had one version of OpenVPMS running and step through your instructions. I'll do that this morning. From a quick scan, however, it all looks good. I think I wound up assigning a separate username but your approach is simpler.
Anyway, as the README file does not contain any instructions on docload, maybe a link could be added there as well as perhaps a mention of the caveat you gave about not running the ESCI client with two versions of OpenVPMS on the same machine?
I'll get back.
Sam
Re: hosting multiple systems
Sam - I have added the note about ESCI. As regards docload, I could add an 'OpenVPMS Tools' page to the Reference section, but rather than explicitly documenting their parameters, I suspect that it is best to say (where applicable) 'invoke with no arguments to obtain help'. This solves the problem of having to update multiple places if things change. Hence this Tools page would simply list the various tools and their function/purpose.
As a newcomer, does this seem to you to be an acceptable way of doing things?
Regards, Tim G
Re: hosting multiple systems
Yes, that all sounds good. I found the list of docload options a bit daunting at first, so if where you refer to docload you could give a simple example to try first (such as --byid --source --dest) then that would be helpful and probably cover most of the installs. I think you said you needed --type as well? --type didn't work for me.
I have gone ahead and followed your instructions and installed a training version in an older incarnation of my Ubuntu Server... and did run into a problem. When I copied the .war file over to <TOMCAT_HOME>/webapps and retarted tomcat, it blocked access to openvpms and only openvpmsX was working. I think the better suggestion is to copy <TOMCAT_HOME>/webapps/openvpms to <TOMCAT_HOME>/webapps/openvpmsX. The reason is that there needs to be two changes there as well:
1) in <TOMCAT_HOME>/webapps/openvpmsX/WEB-INF/web.xml, the webAppRootKey value needs to be set to "openvpmsX", and
2) <TOMCAT_HOME>/webapps/openvpmsX/WEB-INF/classes/hibernate.properties also needs to have hibernate.connection.url set to "openvpmsX".
As those files don't appear until after .war is expanded by restarting tomcat, tomcat initially runs with a conflict. We could set off a real panic when people fire up and their "real version" is gone! Anyway, I don't think we need the .war file there, and by doing it this way, we shouldn't generate a Tomcat conflict.
I was able to track down what was going on by going back to Yuri's 2011 guide where he just does the copy within the <TOMCAT_HOME>/webapps directory and doesn't copy the .war file from <OPENVPMS_HOME>.
Otherwise... it looks good!
Thanks,
Sam
Re: Error - Missing act in docload
Personally, I'm not too keen on hosting demo and production systems in the same environment; if anything they should be completely isolated. You shouldn't be in an environment where you can accidently trash your production database when intending to update your demo to the latest release for example.
If you must do it, ensure that the following are different between demo and production
As Tim G sufggests in the reference above, changing the colours is also a good idea.
Re: Error - Missing act in docload
OK - I have now updated the CSH text at http://www.openvpms.org/documentation/csh/1.7/reference/setup/multiple-s... to include Sam's corrections and Tim A's input.
Sam - I have not yet done the Tools page - I have some other things that have priority, but I wil get to it in due course.
Regards, Tim G
Re: Error - Missing act in docload
This is a good point and also brings up the whole larger topic of best practices for deployment. I think it is the nature of opensource software that it attracts a lot of DIYers... me included. Wondering if we should move the last couple of exchanges off to another thread.
Sam