Hey Guys,
I want to generate a barcode for a patient after registration of a patient which I can later on scan to pull up the patient information, any ideas?
Hey Guys,
I want to generate a barcode for a patient after registration of a patient which I can later on scan to pull up the patient information, any ideas?
Use Barcode generator to create barcodes, create a Barcode DocType, link it on Patient DocType.
Add a Standard filter to pull up the Patient Information.
Thanks for the response, I know how to create the doctype but the rest I donāt get rest I am a newbie
Hello @Dev_Thagichu
Here i am sharing sample example to generate the QR Code with Custom Information.
This example is for Sales Invoice. Simply add one new field āqr_codeā in sales invoice doctype and then create doc event to call method.
Our Function / method will generate the QR and Update in our doctype.
from pyqrcode import create as qrcreate
qrdata = sale_invoice.name
doctype = sale_invoice.doctype
docname = sale_invoice.name
filename = ā{}_QRCODE.pngā.format(docname).replace(os.path.sep, ā__ā)
qr_image = io.BytesIO()
url = qrcreate(str(qrcode), error=āLā)
url.png(qr_image, scale=2, quiet_zone=1)
_file = frappe.get_doc({
ādoctypeā: āFileā,
āfile_nameā: filename,
āattached_to_doctypeā: doctype,
āattached_to_nameā: docname,
āattached_to_fieldā: āqr_codeā,
āis_privateā: 0,
ācontentā: qr_image.getvalue()})
_file.save()
frappe.db.commit()
sale_invoice.qr_code = _file.file_url
frappe.db.sql(āāāUpdate tabSales Invoice
set qr_code = %s
where name = %sāāā, (_file.file_url,
sale_invoice.name))
frappe.db.commit()
Thanks
Hey, did you solve the issue? Or want me to help you out with this ?
Hereās a demo app, that shows how to integrate QR codes into any form and printouts:
Sehr schƶn gemacht.
Sauber, funktioniert, ohne unnƶtigen Schnickschnack.
Ein Lichtblick.
Danke!
Tested just fine on:
ERPNext: v15.26.1 (version-15)
Frappe Framework: v15.29.1 (version-15)
QR Demo: v0.0.1 (version-14)