Opened 8 years ago
Closed 8 years ago
#926 closed task (fixed)
SCAN-B referral form generation improvements in Reggie
Reported by: | olle | Owned by: | olle |
---|---|---|---|
Priority: | major | Milestone: | Reggie v4.9 |
Component: | net.sf.basedb.reggie | Keywords: | |
Cc: |
Description
This ticket covers improvements to the first trial version of SCAN-B referral form generation in Reggie (see Ticket #897, "Generate SCAN-B referral forms in Reggie").
Change History (12)
comment:1 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:2 by , 8 years ago
Traceability note:
- SCAN-B referral form generation in Reggie was introduced in Ticket #897 (Generate SCAN-B referral forms in Reggie).
comment:3 by , 8 years ago
(In [4261]) Refs #926. SCAN-B referral form generation updated for Clinical Pathology forms to move short bar codes on labels downwards ~1mm, in order to better fit inside the label limits. This update will also affect generation of Middle Needle Biopsy forms, that uses the same method to create the bar codes for the form.
- Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated in private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
to move short bar codes on labels downwards ~1mm, in order to better fit inside the label limits.
comment:4 by , 8 years ago
(In [4262]) Refs #926. SCAN-B referral form generation updated for Clinical Chemistry forms to have individual adjustment terms in x-directions for bar codes on labels, in order to better fit to label text in the template. This update will also affect generation of Biopsy Clinical Chemistry forms, that uses the same method to create the bar codes for the form.
- Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated in private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
to have individual adjustment terms in x-directions for bar codes on labels, in order to better fit to label text in the template.
comment:5 by , 8 years ago
Design specification update:
- The iText PDF package contains methods for creating bar codes (thanks to Nicklas Nordborg for this information and helpful hints regarding its use). Currently bar codes for SCAN-B referral form generation have been generated by the open source java library Barcode4J (http://barcode4j.sourceforge.net/). Using the iText barcode functionality to produce the barcodes for the SCAN-B referral forms would reduce the dependency on third-party software for the PDF file generation to a single package.
Implementation issues:
- The java class/file
PdfUtil.java
insrc/net/sf/basedb/reggie/pdf/
is used to import bar code images into the PDF file. However, methods in this library class is used to produce other types of PDF documents than referral forms, e.g. result reports (this was actually the original use). When the class is modified, care must therefore be taken, not to break any functionality used by other Reggie modules. - Tests using iText functionality to produce bar codes, revealed an unexpected difference in the width of the created bar code images compared to those produced by the Barcode4J package, when the same parameters were used, as for the latter (the new bar codes were 22.8% wider). If the new "raw" bar codes were decreased in width, the value for the bar code x-position also had to be adjusted. Values for size and placement of individual bar codes for referral forms are stored in class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
. Until it is clear that iText bar code functionality can be used satisfactorily for SCAN-B referral form generation, a simple correction formula is used in new public methodvoid addBarcode(String text, float x, float y, float width, float height, int align, float rotationDegrees)
inPdfUtil.java
, thus allowing the old bar code size and placement values to be retained inReferralGeneratorServlet.java
. If it is decided to use iText functionality for bar code generation, the correction might be removed and the values inReferralGeneratorServlet.java
updated.
Design update:
- Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated:
a.
comment:6 by , 8 years ago
(In [4295]) Refs #926. SCAN-B referral form generation updated to use iText package methods to create bar codes, instead of using open source java library Barcode4J (http://barcode4j.sourceforge.net/). Barcode width and position parameters have been updated to give a result equaling that using the Barcode4J library to create the bar codes.
- Java utility class/file
PdfUtil.java
insrc/net/sf/basedb/reggie/pdf/
updated:
a. New private methodImage createBarcode(String text, float width, float height)
added. It creates a barcode with chosen content, width, and height, and returns an Image object of it. The barcode will be of type Code 128.
b. New public methodvoid addBarcode(String text, float x, float y, float width, float height, int align)
added. It calls new public methodvoid addBarcode(String text, float x, float y, float width, float height, int align, float rotationDegrees)
with value ofrotationDegrees
set to0
.
c. New public methodvoid addBarcode(String text, float x, float y, float width, float height, int align, float rotationDegrees)
added. It calls new private methodImage createBarcode(String text, float width, float height)
to create a barcode with the desired content and size, after which new private methodvoid importImage2(Image img, float x, float y, float width, float height, int align, float rotationDegrees)
is called to import the barcode to the document at the chosen position.
d. Public methodvoid importImage2(byte[] imageByteArray, float x, float y, float width, float height, int align, float rotationDegrees)
updated to call new public methodvoid importImage2(Image img, float x, float y, float width, float height, int align, float rotationDegrees)
to import the image created from the input byte array into the document at the chosen position.
e. New public methodvoid importImage2(Image img, float x, float y, float width, float height, int align)
added. It calls new public methodvoid importImage2(Image img, float x, float y, float width, float height, int align, float rotationDegrees)
with value ofrotationDegrees
set to0
.
f. New public methodvoid importImage2(Image img, float x, float y, float width, float height, int align, float rotationDegrees)
added. It uses code previously in public methodvoid importImage2(byte[] imageByteArray, float x, float y, float width, float height, int align, float rotationDegrees)
to import the input image into the document at the chosen position. - Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated:
a. The following private methods were updated by calling new publicPdfUtil
methodsvoid addBarcode(String text, float x, float y, float width, float height, int align)
andvoid addBarcode(String text, float x, float y, float width, float height, int align, float rotationDegrees)
to add a barcode to the document, instead of calling private methodbyte[] createBarcode(String barcodeText)
to create a barcode image byte array, and then use that as input in a call toPdfUtil
public methodsvoid importImage2(byte[] imageByteArray, float x, float y, float width, float height, int align)
andvoid importImage2(byte[] imageByteArray, float x, float y, float width, float height, int align, float rotationDegrees)
to import the barcode into the document at the desired position:
i.PdfUtil createConsentReportForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
,
ii.PdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
,
iii.PdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
,
iv.PdfUtil createClinChemBloodForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
,
v.PdfUtil createClinChemBcBloodForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, List<String> formTemplateFileList)
.
Barcode width and position parameters have also been updated to give a result equaling that using the Barcode4J library to create the barcodes.
b. The following private methods related to creating barcodes with the Barcode4J library were removed:
i.byte[] createBarcode(String barcodeText)
,
ii.byte[] createBarcode(String barcodeText, String barcodeType, Integer dpi, Boolean humanReadable, String textPlacement, String fontName, Integer fontSize)
,
iii.static Configuration buildBarcodeCfg(String type, Boolean humanReadable, String textPlacement, String fontName, Integer fontSize)
.
comment:7 by , 8 years ago
Design specification update:
- Two of the forms for biopsies in the neoadjuvant therapy kit are generated from unique form templates, but by the same methods as for two forms in the standard kit, that have templates with SCAN-B ID text and bar codes in similar places. However, the longer SCAN-B ID for biopsies (a suffix "
C
" is added) makes the placement of the SCAN-B ID text and bar codes to differ slightly from that in the original referral forms. The two methods should be updated to be able to add corrections in placement, when forms for biopsies are created. Some minor adjustments of bar code placements on labels should also be added for biopsy forms, in order to increase similarity with the original referral forms.
Design update:
- Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated:
a. Private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated to use the value of input argumentString formTemplateName
as argument when calling updated private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
.
b. Private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated with new argumentString formTemplateName
. The value of the new argument is used to adjust SCAN-B ID text and bar code placements for biopsy forms. Code has also been refactored to place code for adding related text and bar code near each other.
c. Private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated to use the value of input argumentString formTemplateName
as argument when calling updated private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
.
d. Private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated with new argumentString formTemplateName
. The value of the new argument is used to adjust SCAN-B ID text and bar code placements for biopsy forms.
comment:8 by , 8 years ago
(In [4300]) Refs #926. SCAN-B referral form generation updated to make SCAN-B ID text and bar code placements for biopsy forms more similar to the original referral forms:
- Java servlet class/file
ReferralGeneratorServlet.java
insrc/net/sf/basedb/reggie/servlet/
updated:
a. Private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated to use the value of input argumentString formTemplateName
as argument when calling updated private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
.
b. Private methodPdfUtil createClinChemForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated with new argumentString formTemplateName
. The value of the new argument is used to adjust SCAN-B ID text and bar code placements for biopsy forms. Code has also been refactored to place code for adding related text and bar code near each other.
c. Private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated to use the value of input argumentString formTemplateName
as argument when calling updated private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
.
d. Private methodPdfUtil createClinPathologyForm(DbControl dc, PdfUtil pdfUtil, File pdfFile, String scanbId, String formTemplateName, List<String> formTemplateFileList)
updated with new argumentString formTemplateName
. The value of the new argument is used to adjust SCAN-B ID text and bar code placements for biopsy forms.
comment:10 by , 8 years ago
comment:11 by , 8 years ago
(In [4305]) Refs #926. Java barcode generation library Barcode4J
and configuration library Avalon framework removed from libraries used for referral form generation in META-INF/lib/
, since the bar codes now are generated by methods in the iText library used to create the PDF file.
- File
MANIFEST.MF
inMETA-INF/
updated by removing entries for jar files related to libraryBarcode4J
and its configuration.
comment:12 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Ticket closed to allow testing of the new modifications of SCAN-B referral form generation.
Ticket accepted.