Skip to main content

Generacion de HTML para impresion de Anexo II

Project description

Build Status GitHub All Releases GitHub Issues GitHub PR Licence PyPi version Pypi py version Last Commit

Anexo II

Generación para impresión del "Comprobante de Atención de Beneficiarios de Obras Sociales" (Conocido como Anexo II).
Según Resolucion 487/2002.

Art. 2° — Los Hospitales Públicos de Gestión Descentralizada deberán 
  cumplimentar el "Comprobante de Atención de Beneficiarios de Obras Sociales", 
  que se agrega como Anexo II, que pasa a formar parte integrante de la presente 
  Resolución, con carácter de Declaración Jurada, firmado por el médico actuante 
  o Jefe del Servicio, con sello y número de matrícula, y el responsable 
  administrativo del Hospital, con sello, cargo y aclaración de firma, 
  con la correspondiente suscripción o firma del beneficiario, 
  familiar o responsable.

Documento original usado de base acá.

Herramienta desarrollada

Este instrumento toma un diccionario con datos y genera un HTML listo para imprimir, firmar y sellar.

Muestra

anexo II

Instalacion

pypi link

pip install anexo2

Uso

hospital = {'nombre': 'HOSPITAL SAN ROQUE',  # https://www.sssalud.gob.ar/index.php?page=bus_hosp&cat=consultas
            'codigo_hpgd': '4321323'}

beneficiario = {'apellido_y_nombres': 'Juan Perez',
                'tipo_dni': 'DNI',  # | LE | LC
                'dni': '34100900',
                'tipo_beneficiario': 'titular',  # | no titular | adherente
                'parentesco': 'conyuge',  # hijo | otro
                'sexo': 'M',  # | F
                'edad': 88}
atencion = {'tipo': ['consulta', 'práctica', 'internación'],
            'especialidad': 'Va un texto al parecer largo, quizas sea del nomenclador',
            'codigos_N_HPGD': ['AA01', 'AA02', 'AA06', 'AA07'],  # no se de donde son estos códigos
            'fecha': {'dia': 3, 'mes': 9, 'anio': 2019},
            'diagnostico_ingreso_cie10': {'principal': 'W020', 'otros': ['w021', 'A189']}}
obra_social = {'codigo_rnos': '800501',
               'nombre': 'OBRA SOCIAL ACEROS PARANA',
               'nro_carnet_obra_social': '9134818283929101',
               'fecha_de_emision': {'dia': 11, 'mes': 9, 'anio': 2009},
               'fecha_de_vencimiento': {'dia': 11, 'mes': 9, 'anio': 2029}}
empresa = {'nombre': 'Telescopios Hubble',
           'direccion': 'Av Astronómica s/n',
           'ultimo_recibo_de_sueldo': {'mes': 7, 'anio': 2019},
           'cuit': '31-91203043-8'}

data = {'dia': 3,
        'mes': 9,
        'anio': 2019,
        'hospital': hospital,
        'beneficiario': beneficiario,
        'atencion': atencion,
        'obra_social': obra_social,
        'empresa': empresa
        }

from anexo2.docs import Anexo2
anx = Anexo2(data=data)
save_to = 'path.html'
res = anx.get_html(save_path=save_to)
if res is None:
    print('ERRORES al procesar pedido')
    for field, error in anx.errors.items():
        print(f' - {field}: {error}')
else:
    print(f'Procesado correctamente y grabado en {save_to}')

Validación de los datos

Internamente se usa la librería cerberus para validar los datos.
Ninguno de los campos es requerido y los que estén ausentes no se completarán en el html.

Aquí se puede ver el esquema de validación:

from anexo2.docs import Anexo2
anx = Anexo2(data={})
anx.get_schema()
{
	'dia': {
		'type': 'integer',
		'min': 1,
		'max': 31
	},
	'mes': {
		'type': 'integer',
		'min': 1,
		'max': 12
	},
	'anio': {
		'type': 'integer',
		'min': 2019,
		'max': 2030
	},
	'hospital': {
		'type': 'dict',
		'schema': {
			'nombre': {
				'type': 'string'
			},
			'codigo_hpgd': {
				'type': 'string'
			}
		}
	},
	'beneficiario': {
		'type': 'dict',
		'schema': {
			'apellido_y_nombres': {
				'type': 'string'
			},
			'tipo_dni': {
				'type': 'string',
				'allowed': ['DNI', 'LE', 'LC']
			},
			'dni': {
				'type': 'string'
			},
			'tipo_beneficiario': {
				'type': 'string',
				'allowed': ['titular', 'no titular', 'adherente']
			},
			'parentesco': {
				'type': 'string',
				'allowed': ['conyuge', 'hijo', 'otro']
			},
			'sexo': {
				'type': 'string',
				'allowed': ['F', 'M']
			},
			'edad': {
				'type': 'integer',
				'min': 0,
				'max': 110
			}
		}
	},
	'atencion': {
		'type': 'dict',
		'schema': {
			'tipo': {
				'type': 'string',
				'allowed': ['consulta', 'práctica', 'internación']
			},
			'especialidad': {
				'type': 'string'
			},
			'codigos_N_HPGD': {
				'type': 'list'
			},
			'fecha': {
				'type': 'dict',
				'schema': {
					'dia': {
						'type': 'integer',
						'min': 1,
						'max': 31
					},
					'mes': {
						'type': 'integer',
						'min': 1,
						'max': 12
					},
					'anio': {
						'type': 'integer',
						'min': 2019,
						'max': 2030
					}
				}
			},
			'diagnostico_ingreso_cie10': {
				'type': 'dict',
				'schema': {
					'principal': {
						'type': 'string'
					},
					'otros': {
						'type': 'list'
					}
				}
			}
		}
	},
	'obra_social': {
		'type': 'dict',
		'schema': {
			'codigo_rnos': {
				'type': 'string'
			},
			'nombre': {
				'type': 'string'
			},
			'nro_carnet_obra_social': {
				'type': 'string'
			},
			'fecha_de_emision': {
				'type': 'dict',
				'schema': {
					'dia': {
						'type': 'integer',
						'min': 1,
						'max': 31
					},
					'mes': {
						'type': 'integer',
						'min': 1,
						'max': 12
					},
					'anio': {
						'type': 'integer',
						'min': 1970,
						'max': 2030
					}
				}
			},
			'fecha_de_vencimiento': {
				'type': 'dict',
				'schema': {
					'dia': {
						'type': 'integer',
						'min': 1,
						'max': 31
					},
					'mes': {
						'type': 'integer',
						'min': 1,
						'max': 12
					},
					'anio': {
						'type': 'integer',
						'min': 2019,
						'max': 2030
					}
				}
			}
		}
	},
	'empresa': {
		'type': 'dict',
		'schema': {
			'nombre': {
				'type': 'string'
			},
			'direccion': {
				'type': 'string'
			},
			'ultimo_recibo_de_sueldo': {
				'type': 'dict',
				'schema': {
					'dia': {
						'type': 'integer',
						'min': 1,
						'max': 31
					},
					'mes': {
						'type': 'integer',
						'min': 1,
						'max': 12
					},
					'anio': {
						'type': 'integer',
						'min': 1970,
						'max': 2030
					}
				}
			},
			'cuit': {
				'type': 'string'
			}
		}
	}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anexo2-1.0.21.tar.gz (193.0 kB view details)

Uploaded Source

Built Distribution

anexo2-1.0.21-py3-none-any.whl (195.6 kB view details)

Uploaded Python 3

File details

Details for the file anexo2-1.0.21.tar.gz.

File metadata

  • Download URL: anexo2-1.0.21.tar.gz
  • Upload date:
  • Size: 193.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.0

File hashes

Hashes for anexo2-1.0.21.tar.gz
Algorithm Hash digest
SHA256 a827b983fed6c9f425a202f0a34c03d41a873a4d9a5637d5d0ccc4d6d33478af
MD5 6802559ed24e946edca480d8bf6906b9
BLAKE2b-256 81f61a614eb65da585186b22ca42e4d971eb7fd3e695842acf84d4adefee2a19

See more details on using hashes here.

File details

Details for the file anexo2-1.0.21-py3-none-any.whl.

File metadata

  • Download URL: anexo2-1.0.21-py3-none-any.whl
  • Upload date:
  • Size: 195.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.8.0

File hashes

Hashes for anexo2-1.0.21-py3-none-any.whl
Algorithm Hash digest
SHA256 ab375a50b53f9ebf36730afeb2e38105a81b5ddf5b2a5a35b5a2d4e61f7d13dd
MD5 15596cbf80b2c7192f35e251162ab101
BLAKE2b-256 9171364baef31a37bf53e60280d66ea9513bd1d8c758bb54a40e0af6e7928c0a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page