Skip to content

Commit

Permalink
fix pickin patients
Browse files Browse the repository at this point in the history
  • Loading branch information
jabahum committed Apr 15, 2024
1 parent 156c1f8 commit 83aca0c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"packages/*"
],
"scripts": {
"start": "openmrs develop --backend http://localhost:8080 --sources 'packages/esm-*-app'",
"start": "openmrs develop --backend http://194.163.171.253:8282 --sources 'packages/esm-*-app'",
"ci:publish": "lerna publish from-package --yes",
"ci:prepublish": "lerna publish from-package --no-git-reset --yes --dist-tag next",
"release": "lerna version --no-git-tag-version",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ const ChangeStatusMoveToNext: React.FC<ChangeStatusDialogProps> = ({ patientUuid
getCurrentPatientQueueByPatientUuid(patientUuid, sessionUser?.sessionLocation?.uuid).then(
(res) => {
const queues = res.data?.results[0]?.patientQueues;
const queueEntry = queues?.filter((item) => item?.patient?.uuid === patientUuid);

if (queues.length > 0) {
if (queueEntry.length > 0) {
updateQueueEntry(
QueueStatus.Completed,
provider,
queues[0]?.uuid,
queueEntry[0]?.uuid,
contentSwitcherIndex,
priorityComment,
comment,
Expand All @@ -173,11 +174,11 @@ const ChangeStatusMoveToNext: React.FC<ChangeStatusDialogProps> = ({ patientUuid
});
},
);
} else if (queues.length === 1) {
} else if (queueEntry.length === 1) {
updateQueueEntry(
QueueStatus.Completed,
provider,
queues[0]?.uuid,
queueEntry[0]?.uuid,
contentSwitcherIndex,
priorityComment,
comment,
Expand Down Expand Up @@ -234,14 +235,15 @@ const ChangeStatusMoveToNext: React.FC<ChangeStatusDialogProps> = ({ patientUuid
getCurrentPatientQueueByPatientUuid(patientUuid, sessionUser?.sessionLocation?.uuid).then(
(res) => {
const queues = res.data?.results[0]?.patientQueues;
const queueEntry = queues?.filter((item) => item?.patient?.uuid === patientUuid);

if (queues.length > 0) {
updateQueueEntry(status, provider, queues[0]?.uuid, 0, priorityComment, comment).then(() => {
if (queueEntry.length > 0) {
updateQueueEntry(status, provider, queueEntry[0]?.uuid, 0, priorityComment, comment).then(() => {
closeModal();
mutate();
});
} else if (queues.length === 1) {
updateQueueEntry(status, provider, queues[0]?.uuid, 0, priorityComment, comment).then(() => {
} else if (queueEntry.length === 1) {
updateQueueEntry(status, provider, queueEntry[0]?.uuid, 0, priorityComment, comment).then(() => {
closeModal();
mutate();
});
Expand All @@ -263,12 +265,13 @@ const ChangeStatusMoveToNext: React.FC<ChangeStatusDialogProps> = ({ patientUuid
getCurrentPatientQueueByPatientUuid(patientUuid, sessionUser?.sessionLocation?.uuid).then(
(res) => {
const queues = res.data?.results[0]?.patientQueues;
const queueEntry = queues?.filter((item) => item?.patient?.uuid === patientUuid);

if (queues.length > 0) {
if (queueEntry.length > 0) {
updateQueueEntry(
QueueStatus.Completed,
provider,
queues[0]?.uuid,
queueEntry[0]?.uuid,
contentSwitcherIndex,
priorityComment,
comment,
Expand Down Expand Up @@ -336,11 +339,11 @@ const ChangeStatusMoveToNext: React.FC<ChangeStatusDialogProps> = ({ patientUuid
mutate();
},
);
} else if (queues.length === 1) {
} else if (queueEntry.length === 1) {
updateQueueEntry(
QueueStatus.Completed,
provider,
queues[0]?.uuid,
queueEntry[0]?.uuid,
contentSwitcherIndex,
priorityComment,
comment,
Expand Down

0 comments on commit 83aca0c

Please sign in to comment.