Skip to content

Commit

Permalink
Override getUpdatableProperties in PersonResource1_10 and add birthtime
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkumar8789 committed Jan 2, 2024
1 parent a3707b2 commit 42a4150
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.openmrs.module.webservices.rest.web.representation.Representation;
import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingCrudResource;
import org.openmrs.module.webservices.rest.web.resource.impl.DelegatingResourceDescription;
import org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException;
import org.openmrs.module.webservices.rest.web.v1_0.resource.openmrs1_8.PersonResource1_8;

/**
Expand Down Expand Up @@ -46,12 +47,19 @@ public DelegatingResourceDescription getCreatableProperties() {
description.addProperty("birthtime");
return description;
}



/**
* @throws org.openmrs.module.webservices.rest.web.response.ResourceDoesNotSupportOperationException
* @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#getUpdatableProperties()
*/
@Override
public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoesNotSupportOperationException {
DelegatingResourceDescription description = super.getUpdatableProperties();
description.addProperty("birthtime");
return description;
}
@Override
public Model getGETModel(Representation rep) {
return addNewProperties(super.getGETModel(rep), rep);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public DelegatingResourceDescription getUpdatableProperties() throws ResourceDoe
description.addProperty("gender");
description.addProperty("birthdate");
description.addProperty("birthdateEstimated");
description.addProperty("birthtime");
description.addProperty("preferredName");
description.addProperty("preferredAddress");
description.addProperty("addresses");
Expand Down

0 comments on commit 42a4150

Please sign in to comment.