def handle_read(request, resource_type, resource_id): ''' handle FHIR read operation ''' if resource_type in ('Patient', 'Sequence') and resource_id.startswith('ttam_'): resource = ttam.get_one(resource_type, resource_id) else: resource = find_latest_resource(resource_type, resource_id, owner_id=request.authorizer.email) if resource is None: return fhir_error.inform_not_found() elif not resource.visible: return fhir_error.inform_gone() return resource.as_response(request)