feat: campo descuento en RDA calculado desde VALORDESC/VALORTOTAL
descuento = round(VALORDESC * 100 / VALORTOTAL, 2), 0 si sin descuento Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
eb9c57b324
commit
d9a414396f
@@ -213,9 +213,12 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
|||||||
|
|
||||||
via_ingreso = "01"
|
via_ingreso = "01"
|
||||||
modalidad = "01"
|
modalidad = "01"
|
||||||
|
|
||||||
vigencia = 30
|
vigencia = 30
|
||||||
|
|
||||||
|
_total = float(h.get("VALORTOTAL") or 0)
|
||||||
|
_desc = float(h.get("VALORDESC") or 0)
|
||||||
|
descuento_pct = round(_desc * 100 / _total, 2) if _total > 0 else 0
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"codigoPrefijo": str(h.get("PREFIJO") or "").strip() or default_prefijo or "00",
|
"codigoPrefijo": str(h.get("PREFIJO") or "").strip() or default_prefijo or "00",
|
||||||
"numero": (numero_override if numero_override else (
|
"numero": (numero_override if numero_override else (
|
||||||
@@ -230,6 +233,7 @@ def generar_rda_paciente(rows: list, default_profesional: str = "", default_espe
|
|||||||
"fechaHoraEgreso": egreso,
|
"fechaHoraEgreso": egreso,
|
||||||
"modalidadAtencion": modalidad,
|
"modalidadAtencion": modalidad,
|
||||||
"numeroContrato": cod_contrato,
|
"numeroContrato": cod_contrato,
|
||||||
|
"descuento": descuento_pct,
|
||||||
"diagnosticoprincipal": str(h.get("DIAG_PPAL") or "").strip(),
|
"diagnosticoprincipal": str(h.get("DIAG_PPAL") or "").strip(),
|
||||||
"tipousuario": tipoususispro,
|
"tipousuario": tipoususispro,
|
||||||
"viaIngreso": via_ingreso,
|
"viaIngreso": via_ingreso,
|
||||||
|
|||||||
Reference in New Issue
Block a user