wording fixes
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
"""Patient follow-up for the configured breast cohort."""
|
||||
|
||||
import calendar
|
||||
from datetime import date, timedelta
|
||||
|
||||
from flask import Blueprint, jsonify, request
|
||||
|
||||
from webapi.cama_analysis import SelectionError, selection_response
|
||||
|
||||
|
||||
def _desde(corte, meses):
|
||||
indice = corte.year * 12 + corte.month - 1 - meses
|
||||
anio, mes = divmod(indice, 12)
|
||||
if anio < 1:
|
||||
raise ValueError("la ventana excede el rango de fechas admitido")
|
||||
anterior = date(anio, mes + 1, min(corte.day, calendar.monthrange(anio, mes + 1)[1]))
|
||||
return anterior + timedelta(days=1)
|
||||
|
||||
|
||||
def blueprint_seguimiento_cama():
|
||||
blueprint = Blueprint("cama_seguimiento", __name__)
|
||||
|
||||
@blueprint.after_request
|
||||
def no_cache(response):
|
||||
response.headers["Cache-Control"] = "no-store"
|
||||
return response
|
||||
|
||||
def respond(mode, patient=None):
|
||||
try:
|
||||
return selection_response(request.args, mode, patient)
|
||||
except SelectionError as error:
|
||||
return jsonify(error=error.message), error.status
|
||||
|
||||
@blueprint.get("/seguimiento")
|
||||
def seguimiento():
|
||||
return respond('list')
|
||||
|
||||
@blueprint.get("/seguimiento/exportacion")
|
||||
def exportacion():
|
||||
return respond('export')
|
||||
|
||||
@blueprint.get("/pacientes/<pac_id>")
|
||||
def paciente(pac_id):
|
||||
return respond('patient', pac_id)
|
||||
|
||||
return blueprint
|
||||
Reference in New Issue
Block a user