Skip to content

Commit

Permalink
Merge pull request #2 from eHealthAfrica/print
Browse files Browse the repository at this point in the history
Print Functionality
  • Loading branch information
Chima Alaebo authored Feb 17, 2017
2 parents 1f85452 + a9a3159 commit c4f497c
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/reports/edit/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default AbstractEditController.extend(PatientSubmodule, PatientDiagnosis,

actions: {
printReport() {

window.print();
}
}

Expand Down
7 changes: 5 additions & 2 deletions app/reports/edit/template.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{{#if model.visit.outPatient}}
{{#edit-panel editPanelProps=editPanelProps}}
<div class="opd-report">
{{partial "report-header"}}
{{#edit-panel editPanelProps=editPanelProps}}
{{#em-form model=model submitButton=false }}
{{#if model.visit}}
{{patient-summary
Expand All @@ -10,7 +12,7 @@
}}
{{/if}}
{{#if model.visit.patient.displayPatientId}}
<div class="ps-info-group patient-name">
<div class="ps-info-group patient-name print-hide">
<label class="ps-info-label">Patient Id</label>
<input class="form-control" value={{model.visit.patient.displayPatientId}}>
</div>
Expand Down Expand Up @@ -102,6 +104,7 @@

{{/em-form}}
{{/edit-panel}}
</div>

{{else}}
<div>
Expand Down
44 changes: 42 additions & 2 deletions app/styles/_print.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.print-section {
.report-header {
display: none;
}

Expand All @@ -17,8 +17,10 @@
width: 90%;
}

.print-section {
.report-header {
display: block;
border-bottom: 1px solid #d2dae3;
padding: 10px 0;
text-align: center;
}

Expand All @@ -32,4 +34,42 @@
.patient-history-heading {
border-bottom: 1px solid $black;
}

.report-logo {
height: 80px;
}

.opd-report {
font-size: .8em;
}

.opd-report .patient-summary {
margin-bottom: 20px;
border-bottom: 1px solid #d2dae3;
}

.opd-report input {
border: 0;
padding: 5px;
font-size: .8em;
}

.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;
}
}
5 changes: 5 additions & 0 deletions app/templates/report-header.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<div class="report-header">
<img src="http://www.webscript.solutions/images/web.png" class="report-logo">
<h4>Hospital Name</h4>
<span>Hospital Address, No 23, 4th Avenue, Gwarimpa Abuja.</span>
</div>
1 change: 0 additions & 1 deletion app/templates/section.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="panel-heading clearfix">
<div class="view-top-bar">
<h1 class="view-current-title">{{currentScreenTitle}}</h1>
<h3 class="print-section">{{t 'messages.forAuthorizedPersons'}}</h3>
<div class="view-action-buttons">
{{#if newButtonAction}}
<button class="btn btn-primary" {{action newButtonAction}}>{{newButtonText}}</button>
Expand Down

0 comments on commit c4f497c

Please sign in to comment.