Best approach for having Patient ID card in OpenMRS 2x and RefApp 2x

Go to home -> XReports -> Manage Reports -> Then choose a report.

Thanks were for all contributors and the query was also intended for anyone that could help.

At the risk of overburdening this thread. I have recently learned that there is a true type font that willproduce a code 39 barcode. I can now generate adequate barcodes easily in most text editors.

I got my font from http://www.barcodelink.net/barcode-font.php

I would like to have tried this using xreports but have not as yet been able to find any documentation on what governs the available fonts (Arial, Verdana etc). Can you advise if it is possible to add this font?

@mafrica can you send me those fonts and i try them out locally?

@mafrica for how to register custom fonts, take a look at the Font Family property on this page: https://wiki.openmrs.org/display/docs/XReports+Module+Widget+Properties+Pane

You would need to use version 1.8 of the module which you can download from: https://openmrs.jfrog.io/openmrs/modules/org/openmrs/module/xreports-omod/1.8/xreports-omod-1.8.jar Rename the file from “xreports-omod-1.8.jar” to “xreports-1.8.omod” before you can update the module.

Thanks so much for this.

I have installed xreports-1.8.omod and set the xreports.pdf.fonts property as in the jpg, but unfortunately the font family (code39) is not detected when applying the widget property to a label. Could it be that the colon in the windows path is confusing?

@mafrica you are correct. Can you replace full colons with equal signs and then use this version of the module? https://openmrs.jfrog.io/openmrs/modules/org/openmrs/module/xreports-omod/1.9/xreports-omod-1.9.jar Remember to rename the file from “xreports-omod-1.9.jar” to “xreports-1.9.omod” before you can update the module.

I have also updated the documentation with an example: https://wiki.openmrs.org/display/docs/XReports+Module+Widget+Properties+Pane

1 Like

Daniel, I am sorry but with 1.9 it still seems not to be able to locate the new font in the widget properties.

What do you mean by not able to locate the font? Do you mean that you are getting a file not found error while trying to load the report? Or do you mean something else?

I set the parameter type as person for Patient ID Card. when i am trying to run the report from XReports>Run Reports section. I get a person field which list of all persons (it includes nurse, doctor, clerk and patient). How can i list only patients in this dropdown?

@hpardess can you test the updated version of the htmlwidgets module that i have attached on this ticket? https://issues.openmrs.org/browse/HTMLWIDGETS-23 You will need to change the parameter type from Person to Patient.

1 Like

If you type a good font name into the widget property font family cell then the font is immediately applied to the widget. If you type a bad one eg xyz or in this case code39 then nothing happens. This is what I mean by can’t locate.

Is it possible that the path name needs to be in the URL style of filepath eg file///C:/etc?

I tried the idea but with no change. My last thought is that the address should perhaps be relative to some system location?

Thanks.

Also I want to add an image to Patient ID Card. How to upload the image as resource and use the link in xReports? I mean what is the best way to upload the logos in OpenMRS and use it later to either replace the OpenMRS logo or use as image in reports.

@mafrica after typing that font name and save, what happens when you now display the report in PDF format?

@hpardess take a look at this page for how to set the image: https://wiki.openmrs.org/display/docs/XReports+Module+Widget+Properties+Pane

Here is an example for it in action: http://qa-refapp.openmrs.org/openmrs/module/xreports/reportDesigner.form?reportId=5&refApp=true

I have upload the image using file menu but how to locate the file. I do not know where the file is stored and what is the name of that file? How to see other uploaded images previously uploaded in system?

You have got it. The save made all the difference.

It is a bit tricky to get size and spacing right without seeing the visual representation on the design surface, but I guess I can live with it.

I will post some examples of labels and ID cards when I am happy with them as I am sure many folks will be interested in a barcode solution that does not need special printers.

Many thanks.

@hpardess did you get a chance to use the documentation link i gave above and still failed to have it working? If yes, what exactly did you do? I just want to find out what i missed in the documentation.

@mafrica i completely agree about the trickiness without seeing the visual representation on the design surface. Keep reminding me to look into that. Thanks for the spirit of sharing with other folks! :slight_smile:

I have uploaded an image through file menu. then i placed the same name of file as it is uploaded in External Source field. it worked for me.

Just for better usage, it should work in 3 ways,

  1. there should be brows button next to “External Source” field which will show all the files uploaded using menu File>Upload file.
  2. or we place the external URL in this field.
  3. we should be able to pass this link through a “Design Items”. I mean the data source. suppose we can upload the patient photo and we want to print it in ID Card. In database, photo url will be stored. so if we place {photo_url} in “External Source” then patient image should be displayed.

Also, Can we upload the patient profile photo in OpenMRS 2x?