paperclip-plugin-autopilot-ops 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/worker.js +19 -16
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
package/dist/ui/index.js
CHANGED
package/dist/worker.js
CHANGED
|
@@ -39932,7 +39932,7 @@ function startWorkerRpcHost(options) {
|
|
|
39932
39932
|
|
|
39933
39933
|
// src/manifest.ts
|
|
39934
39934
|
var PLUGIN_ID = "alephoo.autopilot-ops";
|
|
39935
|
-
var PLUGIN_VERSION = "0.1.
|
|
39935
|
+
var PLUGIN_VERSION = "0.1.23";
|
|
39936
39936
|
var DB_NAMESPACE_SLUG = "autopilot_ops";
|
|
39937
39937
|
var PAGE_ROUTE = "autopilot";
|
|
39938
39938
|
var TOOL_NAMES = {
|
|
@@ -40529,36 +40529,37 @@ function cruzarCircular(input2) {
|
|
|
40529
40529
|
const codigo = his?.codigo ?? codigoCircular;
|
|
40530
40530
|
const nombre = his?.nombre ?? fb?.nombre ?? fa?.nombre ?? codigo;
|
|
40531
40531
|
const valorActual = his ? redondear(his.componentes.reduce((s, c) => s + c.monto, 0)) : null;
|
|
40532
|
-
const base = { codigo, codigo_his: his?.codigo_his ?? fb?.codigo_original ?? fa?.codigo_original ?? codigo, nombre, valor_a: fa?.valor_nuevo ?? null, valor_b: fb?.valor_nuevo ?? null, valor_actual: valorActual, valor_nuevo: null, variacion: null, estado: "revisar", motivo: null, componentes_nuevos: null };
|
|
40533
|
-
if (
|
|
40534
|
-
items.push({ ...base, motivo:
|
|
40532
|
+
const base = { codigo, codigo_his: his?.codigo_his ?? fb?.codigo_original ?? fa?.codigo_original ?? codigo, nombre, valor_a: fa?.valor_nuevo ?? null, valor_b: fb?.valor_nuevo ?? null, valor_actual: valorActual, valor_nuevo: null, variacion: null, estado: "revisar", causa: null, coinciden: false, motivo: null, componentes_nuevos: null };
|
|
40533
|
+
if (!fa || !fb) {
|
|
40534
|
+
items.push({ ...base, causa: "una_sola_lectura", motivo: fa ? "solo la ley\xF3 el agente: el programa no la encontr\xF3 en la circular" : "solo la ley\xF3 el programa: el agente no la inform\xF3" });
|
|
40535
40535
|
continue;
|
|
40536
40536
|
}
|
|
40537
|
-
if (
|
|
40538
|
-
items.push({ ...base, motivo: `
|
|
40537
|
+
if (Math.abs(fa.valor_nuevo - fb.valor_nuevo) / Math.max(fa.valor_nuevo, fb.valor_nuevo) > TOLERANCIA_EXTRACCIONES) {
|
|
40538
|
+
items.push({ ...base, causa: "lecturas_distintas", motivo: `las dos lecturas no coinciden: el agente ley\xF3 ${pesos(fa.valor_nuevo)} y el programa ${pesos(fb.valor_nuevo)}` });
|
|
40539
40539
|
continue;
|
|
40540
40540
|
}
|
|
40541
|
-
|
|
40542
|
-
|
|
40543
|
-
|
|
40541
|
+
const nuevo = fb.valor_nuevo;
|
|
40542
|
+
const leido = { ...base, valor_nuevo: nuevo, coinciden: true };
|
|
40543
|
+
if (variantes.length > 1) {
|
|
40544
|
+
items.push({ ...leido, causa: "variantes", motivo: `el convenio del HIS tiene ${variantes.length} variantes de este c\xF3digo (${variantes.map((v) => v.codigo_his).join(", ")}): no se carga hasta decidir a cu\xE1l corresponde` });
|
|
40544
40545
|
continue;
|
|
40545
40546
|
}
|
|
40546
|
-
if (
|
|
40547
|
-
items.push({ ...
|
|
40547
|
+
if (his && usadas.has(his.codigo)) {
|
|
40548
|
+
items.push({ ...leido, causa: "fila_repetida", motivo: `otra fila de la circular ya corresponde a la pr\xE1ctica ${his.codigo_his} del HIS` });
|
|
40548
40549
|
continue;
|
|
40549
40550
|
}
|
|
40550
|
-
|
|
40551
|
+
if (his) usadas.add(his.codigo);
|
|
40551
40552
|
if (!his) {
|
|
40552
|
-
items.push({ ...
|
|
40553
|
+
items.push({ ...leido, estado: "sin_convenio", motivo: "la circular la trae y el convenio del HIS no la tiene: no se carga" });
|
|
40553
40554
|
continue;
|
|
40554
40555
|
}
|
|
40555
40556
|
const componentes = repartir(his.componentes, nuevo);
|
|
40556
40557
|
if (!componentes) {
|
|
40557
|
-
items.push({ ...
|
|
40558
|
+
items.push({ ...leido, causa: "componentes_en_cero", motivo: "tiene varios componentes de arancel en $0: no se puede repartir el valor nuevo" });
|
|
40558
40559
|
continue;
|
|
40559
40560
|
}
|
|
40560
40561
|
const variacion = valorActual && valorActual > 0 ? redondear((nuevo - valorActual) / valorActual * 100, 1) : null;
|
|
40561
|
-
items.push({ ...
|
|
40562
|
+
items.push({ ...leido, variacion, estado: "propuesta", componentes_nuevos: componentes });
|
|
40562
40563
|
}
|
|
40563
40564
|
const conVariacion = items.filter((i) => i.estado === "propuesta" && i.variacion !== null);
|
|
40564
40565
|
const declarado = typeof input2.porcentajeDeclarado === "number" && Number.isFinite(input2.porcentajeDeclarado) ? input2.porcentajeDeclarado : null;
|
|
@@ -40586,9 +40587,11 @@ function cruzarCircular(input2) {
|
|
|
40586
40587
|
filas_a: nA,
|
|
40587
40588
|
filas_b: nB,
|
|
40588
40589
|
filas_declaradas: declaradas,
|
|
40589
|
-
coinciden: items.filter((i) => i.
|
|
40590
|
+
coinciden: items.filter((i) => i.coinciden).length,
|
|
40590
40591
|
propuestas: items.filter((i) => i.estado === "propuesta").length,
|
|
40591
40592
|
revisar: items.filter((i) => i.estado === "revisar").length,
|
|
40593
|
+
revisar_lecturas: items.filter((i) => i.causa === "lecturas_distintas" || i.causa === "una_sola_lectura").length,
|
|
40594
|
+
revisar_variantes: items.filter((i) => i.causa === "variantes" || i.causa === "fila_repetida").length,
|
|
40592
40595
|
sin_convenio: items.filter((i) => i.estado === "sin_convenio").length,
|
|
40593
40596
|
excepciones: items.filter((i) => i.estado === "excepcion").length,
|
|
40594
40597
|
bajas: items.filter((i) => i.variacion !== null && i.variacion < 0).length,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paperclip-plugin-autopilot-ops",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Autopilot Care · operación autónoma gobernada para instituciones de salud: workflows determinísticos, validaciones, registro de negocio, políticas (observa/propone/ejecuta/corte) y tablero del director, como plugin de Paperclip.",
|
|
6
6
|
"files": [
|