Ejemplo n.º 1
0
 def get(self, *args, **kwargs):
     pathway_cls = Pathway.get(kwargs['name'])
     pathway = pathway_cls(
         patient_id=kwargs.get("patient_id"),
         episode_id=kwargs.get("episode_id")
     )
     serialised = _build_json_response(
         pathway.to_dict()
     )
     return serialised
Ejemplo n.º 2
0
 def create(self, request, **kwargs):
     pathway = Pathway.get(self.name)(episode_id=self.episode_id,
                                      patient_id=self.patient_id)
     data = _get_request_data(request)
     patient = pathway.save(data, request.user)
     redirect = pathway.redirect_url(patient)
     return Response({
         "episode_id": patient.episode_set.last().id,
         "patient_id": patient.id,
         "redirect_url": redirect
     })
Ejemplo n.º 3
0
 def create(self, request, **kwargs):
     pathway = Pathway.get(self.name)(
         episode_id=self.episode_id,
         patient_id=self.patient_id
     )
     data = _get_request_data(request)
     patient = pathway.save(data, request.user)
     redirect = pathway.redirect_url(patient)
     return Response({
         "episode_id": patient.episode_set.last().id,
         "patient_id": patient.id,
         "redirect_url": redirect
     })
Ejemplo n.º 4
0
 def dispatch(self, *args, **kwargs):
     self.name = kwargs.get('name', 'pathway')
     self.pathway = Pathway.get(self.name)
     return super(PathwayTemplateView, self).dispatch(*args, **kwargs)
Ejemplo n.º 5
0
 def dispatch(self, *args, **kwargs):
     self.name = kwargs.get('name', 'pathway')
     self.pathway = Pathway.get(self.name)
     return super(PathwayTemplateView, self).dispatch(*args, **kwargs)
Ejemplo n.º 6
0
 def get(self, *args, **kwargs):
     pathway_cls = Pathway.get(kwargs['name'])
     pathway = pathway_cls(patient_id=kwargs.get("patient_id"),
                           episode_id=kwargs.get("episode_id"))
     serialised = _build_json_response(pathway.to_dict())
     return serialised