Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print Functionality #2

Merged
merged 5 commits into from
Feb 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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