Skip to content

Commit

Permalink
Add documentation on create bundle
Browse files Browse the repository at this point in the history
 Update PracctionerDetailsEndpoint to use BaseEndpoint
  • Loading branch information
lincmba committed Apr 12, 2024
1 parent 2d07102 commit 4b90bd6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@

import com.google.fhir.gateway.TokenVerifier;

import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;

@WebServlet("/PractitionerDetail")
public class PractitionerDetailEndpoint extends BaseEndpoint {
private final TokenVerifier tokenVerifier;
private final FhirContext fhirR4Context = FhirContext.forR4();
private final IParser fhirR4JsonParser = fhirR4Context.newJsonParser().setPrettyPrint(true);
private final PractitionerDetailsEndpointHelper practitionerDetailsEndpointHelper;

public PractitionerDetailEndpoint() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ private static String constructUpdatedUrl(
return urlBuilder.toString();
}

/**
* Creates a Bundle object containing a list of resources. This method set the total number of
* records in the resourceList
*
* @param resourceList The list of resources to include in the Bundle.
* @return A Bundle object containing the provided resources.
*/
public static Bundle createBundle(List<Resource> resourceList) {
Bundle responseBundle = new Bundle();
List<Bundle.BundleEntryComponent> bundleEntryComponentList = new ArrayList<>();
Expand Down

0 comments on commit 4b90bd6

Please sign in to comment.