initial commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
from models.cama import CaMaModel
|
||||
from persistance.cama import paciente_repository
|
||||
|
||||
cama_bp = Blueprint("cama", __name__)
|
||||
|
||||
|
||||
@cama_bp.get("/pacientes/<int:pac_id>")
|
||||
def get_paciente(pac_id: int):
|
||||
paciente = paciente_repository.get(pac_id)
|
||||
if paciente is None:
|
||||
return jsonify({"error": "not found"}), 404
|
||||
return jsonify(paciente.model_dump())
|
||||
|
||||
|
||||
@cama_bp.post("/predict")
|
||||
def predict():
|
||||
model = CaMaModel()
|
||||
try:
|
||||
return jsonify({"prediction": model.predict(data=None)})
|
||||
except NotImplementedError as exc:
|
||||
return jsonify({"error": str(exc)}), 501
|
||||
Reference in New Issue
Block a user