use of ca.uhn.fhir.rest.annotation.Create in project elexis-server by elexis.
the class FamilyMemberHistoryResourceProvider method createFamilyMemberHistory.
@Create
public MethodOutcome createFamilyMemberHistory(@ResourceParam FamilyMemberHistory familyMemberHistory) {
MethodOutcome outcome = new MethodOutcome();
Optional<IFamilyMemberHistory> exists = getTransformer().getLocalObject(familyMemberHistory);
if (exists.isPresent()) {
outcome.setCreated(false);
outcome.setId(new IdType(familyMemberHistory.getId()));
} else {
Optional<IFamilyMemberHistory> created = getTransformer().createLocalObject(familyMemberHistory);
if (created.isPresent()) {
outcome.setCreated(true);
outcome.setId(new IdType(created.get().getId()));
} else {
throw new InternalErrorException("Creation failed");
}
}
return outcome;
}
use of ca.uhn.fhir.rest.annotation.Create in project elexis-server by elexis.
the class ClaimResourceProvider method createClaim.
@Create
public MethodOutcome createClaim(@ResourceParam Claim claim) {
MethodOutcome outcome = new MethodOutcome();
Optional<List<IBilled>> created = getTransformer().createLocalObject(claim);
if (created.isPresent() && !created.get().isEmpty()) {
outcome.setCreated(true);
} else {
throw new InternalErrorException("Creation failed");
}
return outcome;
}
Aggregations