from radar.api.serializers.transplants import TransplantSerializer
from radar.api.views.common import (
    StringLookupListView,
    SourceObjectViewMixin,
    PatientObjectDetailView,
    PatientObjectListView
)
from radar.models.transplants import TRANSPLANT_MODALITIES, Transplant


class TransplantListView(SourceObjectViewMixin, PatientObjectListView):
    serializer_class = TransplantSerializer
    model_class = Transplant


class TransplantDetailView(SourceObjectViewMixin, PatientObjectDetailView):
    serializer_class = TransplantSerializer
    model_class = Transplant


class TransplantModalityListView(StringLookupListView):
    items = TRANSPLANT_MODALITIES


def register_views(app):
    app.add_url_rule('/transplants', view_func=TransplantListView.as_view('transplant_list'))
    app.add_url_rule('/transplants/<id>', view_func=TransplantDetailView.as_view('transplant_detail'))
    app.add_url_rule('/transplant-modalities', view_func=TransplantModalityListView.as_view('transplant_modality_list'))

@@ -101,22 +101,23 @@
 t (%0A    
-String
+Integer
 LookupLi
@@ -616,14 +616,15 @@
 iew(
-String
+Integer
 Look

serialize transplant id as integer