-
Notifications
You must be signed in to change notification settings - Fork 487
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
zoom in out functionality added and added responsiveness for mobile s… #8336
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -42,61 +42,62 @@ | |||||
|
||||||
return ( | ||||||
<PrintPreview | ||||||
title={ | ||||||
patient ? `Prescriptions - ${patient.name}` : "Print Prescriptions" | ||||||
} | ||||||
title={patient ? `Prescriptions - ${patient.name}` : "Print Prescriptions"} | ||||||
disabled={!(patient && encounter && items)} | ||||||
> | ||||||
<div className="mb-3 flex items-center justify-between p-4"> | ||||||
<h3>{encounter?.facility_name}</h3> | ||||||
<img className="h-10 w-auto" src={main_logo.dark} alt="care logo" /> | ||||||
</div> | ||||||
<div className="mb-6 grid grid-cols-8 gap-y-1.5 border-2 border-secondary-400 p-2"> | ||||||
<PatientDetail name="Patient" className="col-span-5"> | ||||||
{patient && ( | ||||||
<> | ||||||
<span className="uppercase">{patient.name}</span> -{" "} | ||||||
{t(`GENDER__${patient.gender}`)},{" "} | ||||||
{patientAgeInYears(patient).toString()}yrs | ||||||
</> | ||||||
)} | ||||||
</PatientDetail> | ||||||
<PatientDetail name="IP/OP No." className="col-span-3"> | ||||||
{encounter?.patient_no} | ||||||
</PatientDetail> | ||||||
<div className="mb-6 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-y-1.5 border-2 border-secondary-400 p-2"> | ||||||
<PatientDetail name="Patient" className="col-span-1 md:col-span-2 lg:col-span-2"> | ||||||
Check failure on line 53 in src/Components/Medicine/PrintPreview.tsx GitHub Actions / lint
|
||||||
{patient && ( | ||||||
<> | ||||||
<span className="uppercase">{patient.name}</span> -{" "} | ||||||
{t(`GENDER__${patient.gender}`)},{" "} | ||||||
{patientAgeInYears(patient).toString()}yrs | ||||||
</> | ||||||
)} | ||||||
</PatientDetail> | ||||||
<PatientDetail name="IP/OP No." className="col-span-1 md:col-span-1 lg:col-span-1"> | ||||||
{encounter?.patient_no} | ||||||
</PatientDetail> | ||||||
|
||||||
<PatientDetail | ||||||
name={ | ||||||
encounter | ||||||
? `${t(`encounter_suggestion__${encounter.suggestion}`)} on` | ||||||
: "" | ||||||
} | ||||||
className="col-span-5" | ||||||
> | ||||||
{formatDate(encounter?.encounter_date)} | ||||||
</PatientDetail> | ||||||
<PatientDetail name="Bed" className="col-span-3"> | ||||||
{encounter?.current_bed?.bed_object.location_object?.name} | ||||||
{" - "} | ||||||
{encounter?.current_bed?.bed_object.name} | ||||||
</PatientDetail> | ||||||
<PatientDetail | ||||||
name={ | ||||||
encounter | ||||||
? `${t(`encounter_suggestion__${encounter.suggestion}`)} on` | ||||||
: "" | ||||||
} | ||||||
className="col-span-1 md:col-span-2 lg:col-span-2" | ||||||
> | ||||||
{formatDate(encounter?.encounter_date)} | ||||||
</PatientDetail> | ||||||
<PatientDetail name="Bed" className="col-span-1 md:col-span-1 lg:col-span-1"> | ||||||
{encounter?.current_bed?.bed_object.location_object?.name} | ||||||
{" - "} | ||||||
{encounter?.current_bed?.bed_object.name} | ||||||
</PatientDetail> | ||||||
|
||||||
<PatientDetail name="Allergy to medication" className="col-span-1 md:col-span-2 lg:col-span-4"> | ||||||
{patient?.allergies ?? "None"} | ||||||
</PatientDetail> | ||||||
</div> | ||||||
|
||||||
<PatientDetail name="Allergy to medication" className="col-span-8"> | ||||||
{patient?.allergies ?? "None"} | ||||||
</PatientDetail> | ||||||
</div> | ||||||
|
||||||
<PrescriptionsTable items={normalPrescriptions} /> | ||||||
<PrescriptionsTable items={normalPrescriptions}/> | ||||||
<PrescriptionsTable items={prnPrescriptions} prn /> | ||||||
|
||||||
<div className="pt-12"> | ||||||
<p className="font-medium text-secondary-800"> | ||||||
<div className="pt-12 px-4"> | ||||||
<p className="font-medium text-secondary-800 text-base"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's not make changes to things that were not asked in the issue.
Suggested change
|
||||||
Sign of the Consulting Doctor | ||||||
</p> | ||||||
<PatientDetail name="Name of the Consulting Doctor"> | ||||||
{encounter?.treating_physician_object && | ||||||
formatName(encounter?.treating_physician_object)} | ||||||
</PatientDetail> | ||||||
<div className="w-full"> | ||||||
<PatientDetail name="Name of the Consulting Doctor"> | ||||||
{encounter?.treating_physician_object && | ||||||
formatName(encounter?.treating_physician_object)} | ||||||
</PatientDetail> | ||||||
</div> | ||||||
<p className="pt-6 text-center text-xs font-medium text-secondary-700"> | ||||||
Generated on: {formatDateTime(new Date())} | ||||||
</p> | ||||||
|
@@ -106,6 +107,8 @@ | |||||
authorized the same by affixing signature. | ||||||
</p> | ||||||
</div> | ||||||
|
||||||
|
||||||
</PrintPreview> | ||||||
); | ||||||
} | ||||||
|
@@ -150,31 +153,34 @@ | |||||
} | ||||||
|
||||||
if (!items.length) { | ||||||
return; | ||||||
return <div>No prescriptions available</div>; // Add a fallback message for empty items | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
return ( | ||||||
<table className="mb-8 mt-4 w-full border-collapse border-2 border-secondary-400"> | ||||||
<caption className="mb-2 caption-top text-lg font-bold"> | ||||||
{prn && "PRN"} Prescriptions | ||||||
</caption> | ||||||
<thead className="border-b-2 border-secondary-400 bg-secondary-50"> | ||||||
<tr> | ||||||
<th className="max-w-52 p-1">Medicine</th> | ||||||
<th className="p-1">Dosage</th> | ||||||
<th className="p-1">Directions</th> | ||||||
<th className="max-w-32 p-1">Notes / Instructions</th> | ||||||
</tr> | ||||||
</thead> | ||||||
<tbody className="border-b-2 border-secondary-400"> | ||||||
{items.map((item) => ( | ||||||
<PrescriptionEntry key={item.id} obj={item} /> | ||||||
))} | ||||||
</tbody> | ||||||
</table> | ||||||
<div className="overflow-x-auto"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this made scrollable? Print preview content should not be scrollable within the paper view. |
||||||
<table className="mb-8 mt-4 w-full max-w-full border-collapse border-2 border-secondary-400"> | ||||||
<caption className="mb-2 caption-top text-lg font-bold"> | ||||||
{prn && "PRN"} Prescriptions | ||||||
</caption> | ||||||
<thead className="border-b-2 border-secondary-400 bg-secondary-50"> | ||||||
<tr> | ||||||
<th className="p-2 text-left text-sm md:text-base">Medicine</th> | ||||||
<th className="p-2 text-left text-sm md:text-base">Dosage</th> | ||||||
<th className="p-2 text-left text-sm md:text-base">Directions</th> | ||||||
<th className="p-2 text-left text-sm md:text-base">Notes / Instructions</th> | ||||||
</tr> | ||||||
</thead> | ||||||
<tbody className="border-b-2 border-secondary-400"> | ||||||
{items.map((item) => ( | ||||||
<PrescriptionEntry key={item.id} obj={item} /> | ||||||
))} | ||||||
</tbody> | ||||||
</table> | ||||||
</div> | ||||||
); | ||||||
}; | ||||||
|
||||||
|
||||||
const PrescriptionEntry = ({ obj }: { obj: Prescription }) => { | ||||||
const { t } = useTranslation(); | ||||||
const medicine = obj.medicine_object; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ayushpatil2122 Like already mentioned in the issue, let's not make the print preview child responsive based on screen size. This would mean, the print output could differ on different screen size than what was shown in the preview.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry i will fix that