Custom Locations

Hi,

I would like to add locations for a clinic in Hong Kong. How can I add custom Suburbs and States to my VPMS install?

Also, how can I remove (or hide) the current locations (which are all in Australia).

Thanks in advance,

Damien

Comment viewing options

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

Re: Custom Locations

If you only have a few suburbs to add, then you can do it via Administration -> Lookups in the web application.

If you have a lot of suburbs to add, then you can create a configuration file with the data, and load it using the dataload script.

The Australian suburb data shouldn't be loaded by default. You've probably run:

dataload ../import/data/postcodes.xml

You'll need to remove this data manually via the web application, or start with a fresh database.

To load via a configuration file, use the above postcodes.xml as a template. E.g:

 <archetype>
  <data id="CAPE_WOOLAMAI_3925" archetype="lookup.suburb" code="CAPE_WOOLAMAI_3925" name="Cape Woolamai" postCode="3925"/>
  <data id="CTY1" archetype="lookup.country" code="AU" name="Australia" defaultLookup="true"/>
  <data id="VIC" archetype="lookup.state" code="VIC" name="Victoria" defaultLookup="true"/>         
  <data archetype="lookupRelationship.countryState" source="id:CTY1" target="id:VIC" />
  <data archetype="lookupRelationship.stateSuburb" source="id:VIC" target="id:CAPE_WOOLAMAI_3925"/>
</archetype> 

The line:

<data id="CAPE_WOOLAMAI_3925" archetype="lookup.suburb" code="CAPE_WOOLAMAI_3925" name="Cape Woolamai" postCode="3925"/>

creates a new suburb named "Cape Woolamai", with a postcode "3925" and unique code "CAPE_WOOLAMAI_3925".

The line:

<data id="CTY1" archetype="lookup.country" code="AU" name="Australia" defaultLookup="true"/>

creates a new country, "Australia", with unique code "AU" - in general, should use the ISO country codes for this.

The line:

<data id="VIC" archetype="lookup.state" code="VIC" name="Victoria" defaultLookup="true"/>  

creates a new state "Victoria".

The lines:

<data archetype="lookupRelationship.countryState" source="id:CTY1" target="id:VIC" />
<data archetype="lookupRelationship.stateSuburb" source="id:VIC" target="id:CAPE_WOOLAMAI_3925"/>

create a relationship between Australia/Victoria and Victoria/Cape Woolamai respectively.

Don't expect to get the above right first time - back up your database first, so you can restore it between loads.

You can also load data using the Pentaho Data Integration and OpenVPMS Loader plugin. Maybe one of the implementers could post an example of how to load suburb data from a text file?

-Tim

Re: Custom Locations

Hi Tim,

Thanks for the in-depth information! For now I have added the suburbs via the web interface using Lookups. Hong Kong doesn't have too many suburbs, so that's the quickest solution! 

All working well, thanks again!

Damien

 

PS: I may be going dotty, but I'm sure I didn't run the dataload with postcodes.xml as an argument. I suspect it was automatically included when I ran the initial dataload.sh setup. 

Syndicate content