Details
-
Enhancement
-
Status: Closed
-
Should
-
Resolution: Fixed
-
FM2 1.0.0
-
None
-
None
-
Low
Description
Note that ProcedureRequest only exists in R3 and has been replaced in R4 with ServiceRequest
The sample implementations below are for R4. Please see similar methods implemented in the R3 package for how this pattern is adopted there.
Create
Add a method annotated with @Create which takes a resource and updcreatesates the resource. The method should look something like this:
@Update public MethodOutcome createResource(@ResourceParam IAnyResource resource) { return FhirProviderUtils.buildCreate(service.create(resource)); }
Create the corresponding unit tests and web tests.
Update
Add a method annotated with @Update which takes an id and resource and updates the resource. The method should look something like this:
@Update public MethodOutcome updateResource(@IdParam IdType id, @ResourceParam IAnyResource resource) { return FhirProviderUtils.buildUpdate(service.update(id.getIdPart(), resource)); }
Create the corresponding unit tests and web tests.
Delete
Add a method annotated with @Delete which takes an id deletes the corresponding resource. The method should look something like this:
@Delete public OperationOutcome deleteResource(@IdParam IdType id) { return FhirProviderUtils.buildDelete(service.delete(id.getIdPart())); }
Create the corresponding unit tests and web tests.