Skip to content
22 changes: 0 additions & 22 deletions infrastructure/instance/oas.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,6 @@ paths:
httpMethod: "POST"
timeoutInMillis: 30000
type: "AWS_PROXY"
parameters:
- name: patient.identifier
in: query
required: true
schema:
type: string
- name: -immunization.target
in: query
schema:
type: string
- name: -date.from
in: query
schema:
type: string
- name: -date.to
in: query
schema:
type: string
- name: _include
in: query
schema:
type: string
responses:
"201":
description: An Immunisation search event
Expand Down
4 changes: 4 additions & 0 deletions lambdas/backend/src/controller/aws_apig_event_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
from utils import dict_utils


def get_multi_value_query_params(event: APIGatewayProxyEventV1) -> dict:
return dict_utils.get_field(dict(event), "multiValueQueryStringParameters", default={})


def get_path_parameter(event: APIGatewayProxyEventV1, param_name: str) -> str:
return dict_utils.get_field(event["pathParameters"], param_name, default="")

Expand Down
27 changes: 27 additions & 0 deletions lambdas/backend/src/controller/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,31 @@
"""FHIR Controller constants"""

from enum import StrEnum

SUPPLIER_SYSTEM_HEADER_NAME = "SupplierSystem"
E_TAG_HEADER_NAME = "E-Tag"

SEARCH_IMMS_POST_PATH = "/Immunization/_search"


class IdentifierSearchParameterName(StrEnum):
IDENTIFIER = "identifier"
ELEMENTS = "_elements"


class ImmunizationSearchParameterName(StrEnum):
PATIENT_IDENTIFIER = "patient.identifier"
IMMUNIZATION_TARGET = "-immunization.target"
DATE_FROM = "-date.from"
DATE_TO = "-date.to"
INCLUDE = "_include"


class IdentifierSearchElement(StrEnum):
"""Valid elements which can be requested to include in the identifier search response"""

ID = "id"
META = "meta"


IMMUNIZATION_TARGET_LEGACY_KEY_NAME = "immunization-target"
4 changes: 4 additions & 0 deletions lambdas/backend/src/controller/fhir_api_exception_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
InvalidJsonError,
InvalidResourceVersionError,
InvalidStoredDataError,
ParameterExceptionError,
ResourceVersionNotProvidedError,
Severity,
TooManyResultsError,
UnauthorizedError,
UnauthorizedVaxError,
UnhandledResponseError,
Expand All @@ -38,6 +40,8 @@
InvalidResourceVersionError: 400,
CustomValidationError: 400,
ResourceVersionNotProvidedError: 400,
ParameterExceptionError: 400,
TooManyResultsError: 400,
UnauthorizedError: 403,
UnauthorizedVaxError: 403,
ResourceNotFoundError: 404,
Expand Down
Loading