Skip to content

Commit

Permalink
Merge pull request #18 from wellsync/refactor/patient-preference
Browse files Browse the repository at this point in the history
fix: pass prescription drugs
  • Loading branch information
jeroenrinzema authored Jan 16, 2025
2 parents 40496d1 + 9f2e2a8 commit c8252b2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions public/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,15 @@
widget.searchParams.append("drugs.message", options.drugs.message);
}

if (Array.isArray(options.drugs)) {
if (options.drugs.length > 1) {
if (Array.isArray(options.drugs.selected)) {
if (options.drugs.selected.length > 1) {
throw new Error("we only support one drug at the moment");
}

widget.searchParams.append("drugs.selected", options.drugs.join(","));
widget.searchParams.append(
"drugs.selected",
options.drugs.selected.join(",")
);
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/components/Prescription.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
let drugs: Drug[] = [];
let dosages: Dosage[] = [];
console.log(preferredDrugs.message);
let selectedDrugId: string = preferredDrugs?.selected[0] ?? null;
let selectedDosageConcentration: string;
let prescriptionDirections: string;
Expand Down

0 comments on commit c8252b2

Please sign in to comment.