import json
import sys

sys.path.append("../")
from lambda_base import LambdaBase
from models import HealthCareProfessional
from constant_variables import *
from response_helper import sendResponse

class ListHealthCareProfessionalsLambda(LambdaBase):
    def __init__(self): 
        pass

    def getItems(self, HealthCareProfessionalid):
        return HealthCareProfessional().requestHealthCareProfessionals(HealthCareProfessionalid)

    def handle(self, event, context):
        try:
            id = event["queryStringParameters"][DATASTORE_COLUMN_HEALTH_CARE_PROFESSSIONAL_ID] if DATASTORE_COLUMN_HEALTH_CARE_PROFESSSIONAL_ID in event["queryStringParameters"] else None  
            result = self.getItems(id)
            return sendResponse(200, result)
        except Exception as e:
            return sendResponse(500, {'message':  "An unknown error has occurred. Please try again."})

lambda_handler = ListHealthCareProfessionalsLambda.get_handler()
import json
import sys

sys.path.append("../")
from lambda_base import LambdaBase
from models import HealthCareProfessional
from constant_variables import *
from response_helper import sendResponse

class ListHealthCareProfessionalsLambda(LambdaBase):
    def __init__(self): 
        pass

    def getItems(self, HealthCareProfessionalid):
        return HealthCareProfessional().requestHealthCareProfessionals(HealthCareProfessionalid)

    def handle(self, event, context):
        try:
            id = event["queryStringParameters"][DATASTORE_COLUMN_HEALTH_CARE_PROFESSSIONAL_ID] if DATASTORE_COLUMN_HEALTH_CARE_PROFESSSIONAL_ID in event["queryStringParameters"] else None  
            result = self.getItems(id)
            return sendResponse(200, result)
        except Exception as e:
            return sendResponse(500, {'message':  "An unknown error has occurred. Please try again."})

lambda_handler = ListHealthCareProfessionalsLambda.get_handler()