示例#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
示例#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
     })
示例#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
     })
示例#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)
示例#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)
示例#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