From 0e497681af30feafe1533df913fdb4668b8082ec Mon Sep 17 00:00:00 2001 From: Adeola Badmus Date: Thu, 16 Feb 2017 16:36:45 +0100 Subject: [PATCH 1/5] Implement print button --- app/reports/edit/controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/reports/edit/controller.js b/app/reports/edit/controller.js index 965cf613f2..88dab4de60 100644 --- a/app/reports/edit/controller.js +++ b/app/reports/edit/controller.js @@ -90,7 +90,7 @@ export default AbstractEditController.extend(PatientSubmodule, PatientDiagnosis, actions: { printReport() { - + window.print(); } } From bac66a6cbe09c54ba0360b6cb9aa19563d91881f Mon Sep 17 00:00:00 2001 From: Adeola Badmus Date: Thu, 16 Feb 2017 21:43:25 +0100 Subject: [PATCH 2/5] Remove print section header --- app/templates/section.hbs | 1 - 1 file changed, 1 deletion(-) diff --git a/app/templates/section.hbs b/app/templates/section.hbs index 7deaed121b..7c89d7f305 100644 --- a/app/templates/section.hbs +++ b/app/templates/section.hbs @@ -2,7 +2,6 @@

{{currentScreenTitle}}

-
{{#if newButtonAction}} From 5b2efbb349f741c445ed6cdffa67e8b61e966553 Mon Sep 17 00:00:00 2001 From: Adeola Badmus Date: Fri, 17 Feb 2017 00:18:03 +0100 Subject: [PATCH 3/5] Write styles and markup for print page --- app/reports/edit/template.hbs | 7 ++++-- app/styles/_print.scss | 45 +++++++++++++++++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/app/reports/edit/template.hbs b/app/reports/edit/template.hbs index 4b92531197..7d20230766 100644 --- a/app/reports/edit/template.hbs +++ b/app/reports/edit/template.hbs @@ -1,5 +1,7 @@ {{#if model.visit.outPatient}} - {{#edit-panel editPanelProps=editPanelProps}} +
+ {{partial "report-header"}} + {{#edit-panel editPanelProps=editPanelProps}} {{#em-form model=model submitButton=false }} {{#if model.visit}} {{patient-summary @@ -10,7 +12,7 @@ }} {{/if}} {{#if model.visit.patient.displayPatientId}} -
+ @@ -102,6 +104,7 @@ {{/em-form}} {{/edit-panel}} +
{{else}}
diff --git a/app/styles/_print.scss b/app/styles/_print.scss index 2816743972..22db9a3b0e 100644 --- a/app/styles/_print.scss +++ b/app/styles/_print.scss @@ -1,4 +1,4 @@ -.print-section { +.report-header { display: none; } @@ -17,9 +17,11 @@ width: 90%; } - .print-section { + .report-header { display: block; text-align: center; + padding: 10px 0; + border-bottom: 1px solid #d2dae3; } .panel-footer, @@ -32,4 +34,43 @@ .patient-history-heading { border-bottom: 1px solid $black; } + + .report-logo { + height: 80px; + } + + .opd-report { + font-size: 0.8em; + } + + .opd-report .patient-summary { + margin-bottom: 20px; + border-bottom: 1px solid #d2dae3; + } + + .opd-report input { + padding: 5px; + font-size: 0.8em; + border: none; + } + + .opd-report .panel-primary { + position: absolute; + left: 0; + margin: 0; + width: 100%; + } + + .print-hide { + display: none; + } + + .view-top-bar { + display: none; + } + + .view-sub-bar { + display: none; + } + } From 6d6e851bbcb642dcc60dbee6150238372a91d864 Mon Sep 17 00:00:00 2001 From: Adeola Badmus Date: Fri, 17 Feb 2017 00:18:49 +0100 Subject: [PATCH 4/5] Refactor report header into partial --- app/templates/report-header.hbs | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/templates/report-header.hbs diff --git a/app/templates/report-header.hbs b/app/templates/report-header.hbs new file mode 100644 index 0000000000..36b184ffea --- /dev/null +++ b/app/templates/report-header.hbs @@ -0,0 +1,5 @@ +
+ +

Hospital Name

+ Hospital Address, No 23, 4th Avenue, Gwarimpa Abuja. +
\ No newline at end of file From a9a3159cdf55202ce2bbf9c2ebab72fdc6596284 Mon Sep 17 00:00:00 2001 From: Adeola Badmus Date: Fri, 17 Feb 2017 01:17:45 +0100 Subject: [PATCH 5/5] fix style lint errors --- app/styles/_print.scss | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/styles/_print.scss b/app/styles/_print.scss index 22db9a3b0e..b287f87dde 100644 --- a/app/styles/_print.scss +++ b/app/styles/_print.scss @@ -19,9 +19,9 @@ .report-header { display: block; - text-align: center; - padding: 10px 0; border-bottom: 1px solid #d2dae3; + padding: 10px 0; + text-align: center; } .panel-footer, @@ -40,7 +40,7 @@ } .opd-report { - font-size: 0.8em; + font-size: .8em; } .opd-report .patient-summary { @@ -49,9 +49,9 @@ } .opd-report input { + border: 0; padding: 5px; - font-size: 0.8em; - border: none; + font-size: .8em; } .opd-report .panel-primary { @@ -72,5 +72,4 @@ .view-sub-bar { display: none; } - }