Documentos + Homepage rediseñada
Build & Push Docker Images / test-backend (push) Successful in 24s
Build & Push Docker Images / test-frontend (push) Successful in 23s
Build & Push Docker Images / build-backend (push) Successful in 2m22s
Build & Push Docker Images / build-frontend (push) Successful in 57s
Build & Push Docker Images / test-backend (push) Successful in 24s
Build & Push Docker Images / test-frontend (push) Successful in 23s
Build & Push Docker Images / build-backend (push) Successful in 2m22s
Build & Push Docker Images / build-frontend (push) Successful in 57s
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
||||
FROM node:18-alpine
|
||||
FROM node:18-slim
|
||||
WORKDIR /app
|
||||
COPY backend/package*.json ./
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends python3 make g++ && rm -rf /var/lib/apt/lists/*
|
||||
RUN npm ci --omit=dev
|
||||
COPY backend/ .
|
||||
COPY API/ /API/
|
||||
|
||||
@@ -340,6 +340,55 @@ app.get('/api/pharmacies', async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
// TSI Card scan: return mock prescriptions for a given CIP
|
||||
// In production this would integrate with a real health data source
|
||||
app.get('/api/tsi/:cip/prescriptions', async (req, res) => {
|
||||
try {
|
||||
const cip = req.params.cip || '';
|
||||
|
||||
// Deterministic prescription set based on CIP prefix — simulates per-patient data
|
||||
const cipUpper = cip.toUpperCase();
|
||||
let medicineNames;
|
||||
if (cipUpper.startsWith('ALPE')) {
|
||||
medicineNames = ['Paracetamol', 'Omeprazol', 'Ibuprofeno'];
|
||||
} else if (cipUpper.startsWith('MADS')) {
|
||||
medicineNames = ['Amoxicilina', 'Loratadina', 'Ibuprofeno'];
|
||||
} else if (cipUpper.startsWith('VALE')) {
|
||||
medicineNames = ['Atorvastatina', 'Metformina', 'Losartán'];
|
||||
} else {
|
||||
medicineNames = ['Paracetamol', 'Ibuprofeno'];
|
||||
}
|
||||
|
||||
// Build a static prescription list (CIMA API mock)
|
||||
const prescriptions = medicineNames.map((name, idx) => {
|
||||
const dosages = ['500mg', '20mg', '600mg', '500mg', '850mg'];
|
||||
const forms = ['Comprimidos', 'Cápsulas', 'Comprimidos recubiertos', 'Cápsulas', 'Comprimidos'];
|
||||
const actives = {
|
||||
'Paracetamol': 'Paracetamol',
|
||||
'Omeprazol': 'Omeprazol',
|
||||
'Ibuprofeno': 'Ibuprofeno',
|
||||
'Amoxicilina': 'Amoxicilina',
|
||||
'Loratadina': 'Loratadina',
|
||||
'Atorvastatina': 'Atorvastatina',
|
||||
'Metformina': 'Metformina',
|
||||
'Losartán': 'Losartán potásico',
|
||||
};
|
||||
return {
|
||||
id: `RX_${cip}_${idx}`,
|
||||
name: name,
|
||||
active_ingredient: actives[name] || name,
|
||||
dosage: dosages[idx % dosages.length],
|
||||
form: forms[idx % forms.length],
|
||||
};
|
||||
});
|
||||
|
||||
res.json(prescriptions);
|
||||
} catch (error) {
|
||||
console.error('Error fetching TSI prescriptions:', error);
|
||||
res.status(500).json({ error: 'Internal server error' });
|
||||
}
|
||||
});
|
||||
|
||||
// ========== AUTHENTICATION MIDDLEWARE ==========
|
||||
|
||||
// Middleware to check if user is authenticated
|
||||
|
||||
Reference in New Issue
Block a user