Skip to content

Commit

Permalink
Allow non-numeric FHIR resource IDs (#200)
Browse files Browse the repository at this point in the history
* Allow non-numeric (eg UUID) FHIR resource IDs

* Fixup method signature code style (`black`)
  • Loading branch information
ivan-c authored Nov 14, 2023
1 parent fe624a9 commit 2ae8f73
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions patientsearch/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ def post_resource(resource_type):
return jsonify_abort(status_code=400, message=str(error))


@api_blueprint.route("/fhir/<string:resource_type>/<int:resource_id>", methods=["PUT"])
@api_blueprint.route(
"/fhir/<string:resource_type>/<string:resource_id>", methods=["PUT"]
)
def update_resource_by_id(resource_type, resource_id):
"""Update individual resource within HAPI; return JSON result
Expand Down Expand Up @@ -359,7 +361,7 @@ def update_resource_by_id(resource_type, resource_id):


@api_blueprint.route(
"/fhir/<string:resource_type>/<int:resource_id>", methods=["DELETE"]
"/fhir/<string:resource_type>/<string:resource_id>", methods=["DELETE"]
)
def delete_resource_by_id(resource_type, resource_id):
"""Delete individual resource from HAPI; return JSON result
Expand Down Expand Up @@ -389,7 +391,9 @@ def delete_resource_by_id(resource_type, resource_id):
return jsonify_abort(status_code=400, message=str(error))


@api_blueprint.route("/fhir/<string:resource_type>/<int:resource_id>", methods=["GET"])
@api_blueprint.route(
"/fhir/<string:resource_type>/<string:resource_id>", methods=["GET"]
)
def resource_by_id(resource_type, resource_id):
"""Query HAPI for individual resource; return JSON FHIR Resource
Expand Down

0 comments on commit 2ae8f73

Please sign in to comment.