New updates
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
from rest_framework import serializers
|
||||
|
||||
from apps.synthea.models import Synthea
|
||||
|
||||
class SyntheaSerializer(serializers.ModelSerializer):
|
||||
class Meta:
|
||||
model = Synthea
|
||||
fields = ['state', 'population', 'gender', 'age', 'module']
|
||||
fields = ['state', 'population', 'gender', 'age', 'module']
|
||||
|
||||
class SyntheaModelsSerializer(serializers.Serializer):
|
||||
id = serializers.CharField(max_length=200)
|
||||
name = serializers.CharField(max_length=200)
|
||||
|
||||
|
||||
class SyntheaStatesSerializer(serializers.Serializer):
|
||||
id = serializers.CharField(max_length=200)
|
||||
name = serializers.CharField(max_length=200)
|
||||
|
13
webservice/apps/synthea/api/views.py
Normal file
13
webservice/apps/synthea/api/views.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from rest_framework import viewsets
|
||||
|
||||
from .serializers import SyntheaSerializer
|
||||
from apps.synthea.models import Synthea
|
||||
|
||||
|
||||
class SyntheaViewSet(viewsets.ModelViewSet):
|
||||
|
||||
"""
|
||||
API endpoint for creating/reading/updating/deleting invitations.
|
||||
"""
|
||||
queryset = Synthea.objects.all().order_by('-created_at')
|
||||
serializer_class = SyntheaSerializer
|
15
webservice/apps/synthea/templates/synthea/api.html
Normal file
15
webservice/apps/synthea/templates/synthea/api.html
Normal file
@@ -0,0 +1,15 @@
|
||||
{% extends 'base.html' %} <!-- Add this for inheritance -->
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}{% trans "dHealth Synthea" %}{% endblock %}
|
||||
{% block pagetitle %}{% trans "dHealth Synthea" %}{% endblock %}
|
||||
|
||||
{% block menu %}
|
||||
{% include 'synthea/menu.html' %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>API</h1>
|
||||
<p>Hier kunt u informatie vinden over de API zodat er ge-automatiseed patient data kan worden gegenereerd</p>
|
||||
<p>Documentatie: <a href="redoc" target="_blank">Redoc / Swagger</a> </p>
|
||||
{% endblock %}
|
@@ -4,6 +4,6 @@ from . import views
|
||||
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
path('api/', views.index, name='api_info'),
|
||||
path('api/', views.api, name='api_info'),
|
||||
path('generate/', views.show_synthea_form, name='generator_form'),
|
||||
]
|
@@ -12,6 +12,10 @@ def index(request):
|
||||
template_name = 'synthea/index.html'
|
||||
return render(request,template_name,{})
|
||||
|
||||
def api(request):
|
||||
template_name = 'synthea/api.html'
|
||||
return render(request,template_name,{})
|
||||
|
||||
def show_synthea_form(request):
|
||||
template_name = 'synthea/generator_form.html'
|
||||
|
||||
|
Reference in New Issue
Block a user