Contact.Location attached to ClinicalEventItem

Revisiting an old integration 

We tried to make a act.patientClinicalEventItem that added a contact.location to a hashset...the webapp could not create it. That node is a contact.* archetype hashset

 

Is this an OBM limitiation or webapp?

 

<error-report>
<version>2.1-SNAPSHOT</version>
<revision>20190222-211038.f259181</revision>
<message>Failed to create object for archetype with short name act.EventLocation.</message>
<exception>
<type>org.openvpms.component.business.service.archetype.ArchetypeServiceException</type>
<message>Failed to create object for archetype with short name act.patientEventLocation.</message>
<stackTrace>
 
.....
 
pingRunnable.run(TaskThread.java:61)</trace>
<trace>java.lang.Thread.run(Thread.java:748)</trace>
</stackTrace>
<cause>
<type>org.apache.commons.jxpath.JXPathAbstractFactoryException</type>
<message>Factory org.openvpms.component.business.service.archetype.JXPathGenericObjectCreationFactory@4b3f1520 could not create an object for path: /destination</message>
<stackTrace>
<trace>org.apache.commons.jxpath.ri.model.beans.PropertyPointer.createPath(PropertyPointer.java:179)</trace>
<trace>org.apache.commons.jxpath.ri.model.beans.BeanPropertyPointer.createPath(BeanPropertyPointer.java:238)</trace>
<trace>org.apache.commons.jxpath.ri.model.beans.PropertyPointer.createChild(PropertyPointer.java:217)</trace>
<trac
 
.....
 

 

Comment viewing options

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

Re: Contact.Location attached to ClinicalEventItem

A contact cannot be added to an act as it isn't supported by the data model.

Contacts can only be added to parties or users.

Re: Contact.Location attached to ClinicalEventItem

I solved it by changing the path to /details/destination

which seems to work - 

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

Re: Contact.Location attached to ClinicalEventItem

Check the serialisation. It will be stored in the act_details table, serialised to XML. There are only 5000 characters available, so make sure its not going to be truncated.
Because its serialised, reporting will be more difficult.

Re: Contact.Location attached to ClinicalEventItem

I think Ill just create a derived value using the description node and use that 

the address field is limited to 100 chars ...even with serialization I cant imagine a contact going over 5000 chars

 

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

Re: Contact.Location attached to ClinicalEventItem

Just be aware that it is not officially supported. If the serialisation changes, you will need to migrate your data.

Re: Contact.Location attached to ClinicalEventItem

Is there anyway to force the medical history to display a custom clinical event?

adjusting the  `actRelationship.patientClinicalEventItem` allows you to add them but they dont display in the medical history...another GUI limitation?

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

Re: Contact.Location attached to ClinicalEventItem

Works for me. What do your archetypes look like?

Re: Contact.Location attached to ClinicalEventItem

I have attached the 2 archetypes relating to the new archetype also attached...

Basically we can see the new Archetype and ADD a new entry but on the medical record it doesnt display - which means it either isnt getting created OR its being filtered.  We dont get an error message and nothing occurs in the full.log.

The image is what I get when I add a new record for that new archetype.

However nothing is in the medical record.

 

AttachmentSize
act.patientClinicalEvent.adl 5.75 KB
act.patientDestination.adl 4.43 KB
actRelationship.patientClinicalEventItem.adl 4.71 KB
newarchetype.PNG 15.72 KB
Regards
 
Ben 
OpenVPMS Installer and Helper 
Ph: +61423044823 
Email: info[at]charltonit.com[dot]au

Re: Contact.Location attached to ClinicalEventItem

The contacts aren't being made persistent. Change the contact node to remove the basename="Destination"

        <node name="contact" displayName="Destination Address"
            type="java.util.HashSet"
            path="/details/destination" parentChild="true" minLength="0"
            maxLength="255" minCardinality="0" maxCardinality="3"
            readOnly="false" hidden="false" derived="false">
            <assertion name="archetypeRange">
                <propertyList name="archetypes">
                    <propertyMap name="archetype">
                        <property name="shortName"
                            type="java.lang.String" value="countrycontact.location"/>
                    </propertyMap>
                    <propertyMap name="archetype">
                        <property name="shortName"
                            type="java.lang.String" value="contact.phoneNumber"/>
                    </propertyMap>
                    <propertyMap name="archetype">
                        <property name="shortName"
                            type="java.lang.String" value="contact.email"/>
                    </propertyMap>
                </propertyList>
            </assertion>
        </node>

Also:

  • the countrycontact.location should follow the naming convention of contact.<type> .e.g. contact.countrylocation
  • patient record acts need a clinician node
  • this will break if XML serialisation changes. The following is an example of what is being seralised in the act_details value column:

 

<set>
  <org.openvpms.component.business.domain.im.party.Contact>
    <id>57</id>
    <active>true</active>
    <archetypeId>
      <entityName>contact</entityName>
      <concept>phoneNumber</concept>
      <version>1.0</version>
      <qualifiedName>contact.phoneNumber.1.0</qualifiedName>
      <shortName>contact.phoneNumber</shortName>
    </archetypeId>
    <description>(03) 123123132 </description>
    <linkId>9d163b28-421f-11e9-8ae4-e19a43ece4d0</linkId>
    <name>Phone Number</name>
    <version>0</version>
    <details>
      <entry>
        <string>areaCode</string>
        <string>03</string>
      </entry>
      <entry>
        <string>telephoneNumber</string>
        <string>123123132</string>
      </entry>
      <entry>
        <string>sms</string>
        <boolean>false</boolean>
      </entry>
      <entry>
        <string>preferred</string>
        <boolean>false</boolean>
      </entry>
    </details>
    <activeStartTime>2019-03-09 14:58:35.841 AEDT</activeStartTime>
    <classifications/>
  </org.openvpms.component.business.domain.im.party.Contact>
  <org.openvpms.component.business.domain.im.party.Contact>
    <id>56</id>
    <active>true</active>
    <archetypeId>
      <entityName>contact</entityName>
      <concept>phoneNumber</concept>
      <version>1.0</version>
      <qualifiedName>contact.phoneNumber.1.0</qualifiedName>
      <shortName>contact.phoneNumber</shortName>
    </archetypeId>
    <description>(03) 123213113223123 </description>
    <linkId>91806156-421f-11e9-8ae4-e19a43ece4d0</linkId>
    <name>Phone Number</name>
    <version>0</version>
    <details>
      <entry>
        <string>areaCode</string>
        <string>03</string>
      </entry>
      <entry>
        <string>telephoneNumber</string>
        <string>123213113223123</string>
      </entry>
      <entry>
        <string>sms</string>
        <boolean>false</boolean>
      </entry>
      <entry>
        <string>preferred</string>
        <boolean>true</boolean>
      </entry>
    </details>
    <activeStartTime>2019-03-09 14:58:16.404 AEDT</activeStartTime>
    <classifications/>
  </org.openvpms.component.business.domain.im.party.Contact>
</set>


Re: Contact.Location attached to ClinicalEventItem

Side note to enable country on contact.location....

<node name="state" displayName="State" type="java.lang.String" 
      path="/details/state" parentChild="false" minLength="0"  maxLength="255" minCardinality="0" maxCardinality="1"
            readOnly="false" hidden="false" derived="false">
            <assertion name="lookup">
                <errorMessage>An error message</errorMessage>
                <property name="type" type="java.lang.String" value="lookup"/>
                <property name="relationship" type="java.lang.String" value="lookupRelationship.countryState"/>
                <property name="value" type="java.lang.String" value="/details/country"/>
            </assertion>
        </node>
<node name="country" displayName="Country" type="java.lang.String"
            path="/details/country" parentChild="false" minLength="0"
            maxLength="255" minCardinality="0" maxCardinality="1"
            readOnly="false" hidden="false" derived="false">
            <assertion name="lookup">
                <errorMessage>An error message</errorMessage>
                <property name="type" type="java.lang.String" value="lookup"/>
                <property name="source" type="java.lang.String" value="lookup.country"/>
            </assertion>
</node>

Does that seem right

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

Re: Contact.Location attached to ClinicalEventItem

https://openvpms.org/forum/contact-updates sorted

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