Hello there, I am trying to add new property called image in location table to give logo to each location. I have added a column in location table and declared it in openmrs api . Data for respective image is coming from database but its not returning the image in response of api. I am new to hibernate ORM i also mapped the property for logo but didn’t getting it in api response.
end point that I am hitting
Thanks in Advance.
after adjusting the Location Model ,
you would also make a coresponding change in the Location Resource in the Rest API ,
but in the submodule coressponding to the OpenMRS version youre running.
you would have to add the new property in the Location Resource
@mozzy desperately waited for response. Appreciate ! ! I am using core 2.3.2 I will do the changes and revert back the outcome with you Thanks A lot
I am using core 2.3.2
Actually , simply add your property
here , in the Location Resource Class for omod-2.0
this resource class supports up to
Actually I am running 2.29.0 for web rest I couldn’t find Location Resource at there
Ok actually i was searching in 2.29.0 branch in tags. I will follow as you suggest.
well even under the 2.29.0 tag ,
This file has been truncated.
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
@mozzy I am getting this error after buid is kind of error related to latitude but i haven’t done any changes in latitude.
here is the error
can i have a look at your changes in github ??
can i also look at your property in the Location Class ??
from the Logs , Looks like theres a mismatch between the property you added in the Rest Module and what exactly you added in the Location Class
@mozzy I just created repo and pushed the code for core only. Please check my changes here
Changes what i did in webrest module.
Better if you had just Forked the source code from OpenMRS repo to Your repo and then add your changes. It becomes easy and direct to track the changes you added
Ok will do the same. Thanks
did you add the coresponding column in the hibernate mappings for the property ??
Yes I did I am sharing direct path to location.hbm
This file has been truncated.
This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
graphic logo is a trademark of OpenMRS Inc.
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
<class name="Location" table="location">
@mozzy Sorry my bad there will be accidental mistake in locationId replaced with latitude. in hibernate mapping.
cool , does it work fine now ??