Framework Question

There was an old PDF floating wround which outlined the Framework for OpenVPMS it used to be on the website but it has since vanished?

Second question

Is it possible for a clinical eventitem to link 2 patients?

Or is it possible to create a field on a clinical event that links in the patients? and avoiding adding 2 to the primary link.

 

Comment viewing options

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

Re: Framework Question

Don't recall such a document, but it would be very much out of date.

You could link another patient by creating a new participation, which is essentially the same as participation.patient, but with a different archetype short name.

 

Re: Framework Question

Yep so by that you mean the Act would have 2 nodes detailing a participation.patient.

Because a participation can only link 1 entity according to the framework.

What I ideally was trying to do was have a node that could hold a Participation set. IE add an unlimited number of patients then return them for parsing in a document.

Its possible but not without changing framework, which I want to avoid for the purposes of this patch.  

 

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

Re: Framework Question

What are you trying to achieve?

You should be able to have multiple patients, simply by specifying the maxCardinality of the node. I suspect it won't result in what you want however:

    <archetype name="act.patientExample1.1.0" latest="true"
               type="org.openvpms.component.business.domain.im.act.Act" displayName="Example Act 1">
        <node name="id" path="/id" type="java.lang.Long" hidden="true" readOnly="true"/>
        <node name="patients" path="/participations" type="java.util.HashSet" minCardinality="2" maxCardinality="2"
              filter="participation.patient"/>
    </archetype>

When editing acts for a particular patient, typically you want it to be automatically populated with the current patient, and this should be hidden from the user.

You would then use a different participation for the second patient.

<!-- act.patientExample --> 
   <archetype name="act.patientExample1.1.0" latest="true"
               type="org.openvpms.component.business.domain.im.act.Act" displayName="Example Act 1">
        <node name="id" path="/id" type="java.lang.Long" hidden="true" readOnly="true"/>
        <node name="patient" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="1"
              filter="participation.patient" hidden="true"/>
        <node name="otherPatient" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="1"
              filter="participation.otherPatient"/>
    </archetype>

<!-- participation.otherPatient.adl -->
    <archetype name="participation.otherPatient.1.0"
               latest="true"
               type="org.openvpms.component.business.domain.im.common.Participation" displayName="Other Patient">
        <node name="id" path="/id" type="java.lang.Long" hidden="true" readOnly="true"/>
        <node displayName="Patient" name="entity" path="/entity" minCardinality="1" maxCardinality="1"
              type="org.openvpms.component.business.domain.im.common.IMObjectReference">
            <assertion name="archetypeRange">
                <propertyList name="archetypes">
                    <propertyMap name="archetype">
                        <property name="shortName" value="party.patient*"/>
                    </propertyMap>
                </propertyList>
            </assertion>
        </node>
        <node name="act" path="/act" minCardinality="1" maxCardinality="1"
              type="org.openvpms.component.business.domain.im.common.IMObjectReference">
            <assertion name="archetypeRange">
                <propertyList name="archetypes">
                    <propertyMap name="archetype">
                        <property name="shortName"
                                  value="act.*"/>
                    </propertyMap>
                </propertyList>
            </assertion>
        </node>
    </archetype>

 

 

 

Re: Framework Question

Thanks yeah the issue for me is that an export act may have anything from 1 to ∞ patients in theory (most often 1-3)

Thus the issue is that using single participations where the participation has only 1 entity linked per node falls apart or becomes unweildy early.  

Its the nature of the framework design here that fails me - it was designed so that patients have participations not the other way round.

What am I trying to achieve.  A large part of the practice I design for is export work.  This involves sending consignments of animals overseas

a consignment becomes the act.patientexport

the owner in this case is the exporter, the act may also have a string field to detail out the origin address which may be the real owner and a destination address which may be the real owner.  

I made the election early that adding real owners as entities was unwieldy as they are single instances and are deactivated after 1 visit and dont usually have any financial records.

by your example above I would simply adjust the participation.otherpatient to have minCard=0 and maxCard=* as per a Entityrelationship.patient*

I think the Layout will need a lot of work to make this work Ill give it a go.

 

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

Re: Framework Question

You can model using consignments acts and participations. I would suggest creating a new workspace for managing consignments however, as patient history acts are only designed to have a single patient.

For the exporter and importer you can model these using parties. This way, you get the contact information for free. For the exporter, just use party.customerperson - presumably they are already in the system.

For the importer, create a new party.importer, which you can loosely base on party.customerperson. You'll need a new workspace to query these.

Your act is then something like:

    <archetype name="act.patientExport.1.0" latest="true"
               type="org.openvpms.component.business.domain.im.act.Act" displayName="Patient Export">
        <node name="id" path="/id" type="java.lang.Long" hidden="true" readOnly="true"/>
        <node name="name" type="java.lang.String" path="/name" hidden="true" minCardinality="1" derived="true"
              derivedValue="'Patient Export'"/>
        <node displayName="Date" name="startTime" path="/activityStartTime" type="java.util.Date" minCardinality="1"
              defaultValue="java.util.Date.new()" hidden="true"/>
        <node name="exporter" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="1" filter="participation.customer"/>
        <node name="importer" path="/participations" type="java.util.HashSet" minCardinality="0" maxCardinality="1" filter="participation.importer"/>
        <node name="patients" path="/participations" type="java.util.HashSet" minCardinality="1" maxCardinality="*" filter="participation.patient"/>
    </archetype>

 

Re: Framework Question

Is it possible to return a list object using the list functions like so?  As far as I can determine it should work, returning null if the key is outside the list bounds.

public <T extends IMObject> Object object(Collection<T> objects, String node, Integer key) {
    int i=0;
    Object result = null;
    for (T object: objects) {
        if(i==key){
            NodeResolver resolver = new NodeResolver(object, service);
            try{
                Object value =resolver.getObject(node);
                result = object;
            }catch(PropertyResolverException ignore){
                //ignore the error
            }
        }else{
            i++;
        };

    }
    return result;

I am wondering if its possible to perform a return and process a list of objects (in my case patients) and produce a table style result through formating in OpenOffice.

export:getpatients(.) in theory returns an object list

ie

Patient Name Patient ID
openvpms:get(list:object(export:getpatients(.),1),"name") party:getMicrochips(list:object(export:getpatients(.),1))
openvpms:get(list:object(export:getpatients(.),2),"name") party:getMicrochips(list:object(export:getpatients(.),2))

Ben

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

Re: Framework Question

You should be able to use a predicate on the returned collection to access each patient:

  • export:getpatients(.)[1]
  • export:getpatients(.)[2]

The patient names would then be accessed using:

  • openvpms:get(export:getpatients(.)[1], "name")
  • openvpms:get(export:getpatients(.)[2], "name")

Re: Framework Question

Thanks,

I assume that will work on a Set<Party> 

and you could use party rules

such as

party:getMicrochips(export:getpatients(.)[1])

 

Cheers

Ben

 

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

Re: Framework Question

Not sure about sets - try it. If it doesn't work, convert it to a list first.

Note that unless you are a SortedSet, so you might get different results each time you invoke [1] and [2].

You could order them first using:

  • list:sort(export.getpatients(.), "name")[1]
  • list:sort(export.getpatients(.), "name")[2]

 

Re: Framework Question

In that case I will just ensure its sorted on patient.id before its returned.

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

Re: Framework Question

Following up this project - I have a semi working system but have a few issues

Issue 1

I created the party.importer archetype but I the browser is a bit basic...IE only create NEW cant Edit or Delete/Inactivate... I thought I could just pilfer an existing browser leveraging the entitybrowser but seems that wont work. So I plan on building my own based on the customerbrowser

Issue 2

act.customerExports can have items linked in the form of forms letter and attachments

which have act.exportDocumentForm etc etc attached via a actRelationship

I have build rules and functions to return the data in these documents from the underlying act.

However I have quickly found out the system doesnt process my documents through the JXPATH processors during generation. In effect by OpenOffice Docs never get processed by the Reporter.

I must have missed a linkage somewhere

Breifly 

I have created a Customer Export Workspace

which queries exports linked to that customer and then opens them in a window which is done by an extension of actCRUDWindow

The documents are automatically populated by the creation of tabs, at this stage 1 for patients and 1 for records. Records can be forms/letters/attachments at this stage, but I may extend it later to add notes.

The records(docs) are displayed in a table and clicking on a record displays its detail 

However the a the doc templates are not being  processed by JXPATH on load...

any tips?

 

 

 

 

 

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

Re: Framework Question

Issue 1 - you need a Query to query objects, a Browser to select queried objects, a CRUDWindow to perform operations on the selected object, and a Workspace to tie the lot together. If any aren't specified, the app will try to provide meaningful defaults. The CRUDWindow determines the operations that can be performed on an object. Some examples:
  • org.openvpms.web.workspace.customer.info.InformationWorkspace - basic workspace
  • org.openvpms.web.workspace.customer.charge.ChargeWorkspace - act based workspace where the acts are linked to a customer
  • InvestigationsWorkspace - act based workspace where acts aren't constrained to any particular customer
  Issue 2 - Unless you are referring to report macros, document generation is not performed by xpath. To generate documents from an act, use DocumentActReporter or DocumentGenerator.  

Re: Framework Question

Yep re issue 1 I figured as much....

with regard to issue 2 

I assumed I could just declare in the ReporterFactory.properties.

act.customerDocument*    org.openvpms.web.component.im.report.DocumentActReporter
act.exportDocument*      org.openvpms.web.component.im.report.DocumentActReporter
act.patientDocument*     org.openvpms.web.component.im.report.DocumentActReporter
act.supplierDocument*    org.openvpms.web.component.im.report.DocumentActReporter

but there is more too it than that -- the documents generate fine but they arent parsed for expressions at all

the output

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

Re: Framework Question

Sounds like its downloading the template rather than the document.

DocumentActDownloader is responsible for downloading document acts, and can download the document, generating it if there is only a template present. It can also be used to download the template associated with a document act.

Syndicate content