Skip to content

Feature/stop 710 - #384

Merged
vishwab1 merged 35 commits into
PSMRI:release-3.12.0from
sehjotsinghunthinkable:feature/STOP-710
Oct 22, 2026
Merged

vishwab1 merged 35 commits into
PSMRI:release-3.12.0from
sehjotsinghunthinkable:feature/STOP-710

Conversation

@sehjotsinghunthinkable

Copy link
Copy Markdown
Contributor

📋 Description

JIRA ID: STOP-710

  • 🐞 Bug fix (non-breaking change which resolves an issue)

sehjotsinghunthinkable and others added 30 commits October 13, 2026 12:10
…ing-stop-579

Adding locking for multiple order creation
…tock

Same endpoint stoptb/nurse/generalOpd/save. When the app sends the new
fields (submissionId, chiefComplaints[], prescription.drugs[] with drugID
and qtyPrescribed) the save writes t_benchiefcomplaint, t_prescription,
t_prescribeddrug, t_patientissue and t_itemstockexit and reduces
t_itemstockentry from the van's store, like TM and Inventory-API. One
transaction: insufficient stock rejects the whole submit. submissionId
makes retries safe. Old payload behaves as before.

The configured stoptb.van.id is the source of truth; a different vanID from
the app is rejected. Parking place and store are read from m_van.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Always use stoptb.van.id; a vanID sent by the app is ignored (logged).
- Reduced batch gets Processed='N' so the new quantity uploads to central;
  removed chief complaints are re-sent the same way.
- Batches with no expiry date are usable, as in v_drugforprescription.
- Drug must be mapped to the store on its own service line, same join as
  the drug list, so the save accepts exactly what the list shows.
- Patient name, age and gender filled on t_patientissue for the
  Inventory dispense screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- New payload (chiefComplaints[] / prescription.drugs[]) no longer writes
  tb_stoptb_general_opd; complaints, prescription and dispensing live only
  in t_benchiefcomplaint, t_prescription, t_prescribeddrug, t_patientissue,
  t_itemstockexit.
- generalOpd/getAll reads the standard tables first and falls back to
  tb_stoptb_general_opd only for older visits that exist only there.
  Response fields and formats are unchanged for the app.
- Old app payload keeps its current behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
qtyPrescribed from the app is used as is. When it is missing, for
tablets and capsules (MMU's prescription screen asks quantity only for
other forms) it is doses per day x days from frequency and duration;
Single/Stat dose = 1, Once in a Week = 1 per 7 days. SOS or other forms
without a quantity are rejected. The calculated value is saved in
t_prescribeddrug.QtyPrescribed and dispensed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- chiefComplaintID is required for each chief complaint (getAll and
  reports identify standard-table records by it).
- prescription.instruction is saved in t_prescription even when no drug
  is given, as MMU does for the visit instruction.
- providerServiceMapID and createdBy give a clear error when missing
  instead of a database error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p sends none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- generalOpd/getAll returns a "drugs" list per record (drugID, drugName,
  itemFormID, drugForm, dose, frequency, duration, durationUnit,
  qtyPrescribed, instructions) from t_prescribeddrug, so a saved
  prescription can be shown with form and quantity. Existing fields are
  unchanged; old free-text records return an empty list.
- SOS tablets/capsules without a quantity: 1 per day of duration
  (1 when no duration) instead of rejecting the save.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
TB suspected / confirmed / diagnostic saves create the visit with
ProviderServiceMapID null. When one of them syncs before TB screening
or OPD, the visit keeps null and getAll (filters by psm) skips it.
A later save that has a service line now fills it in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Quantity for tablets uses the dose like MMU (Half Tab 0.5, One Tab 1,
  One & Half Tab 1.5, Two Tabs 2 per intake), rounded up. No dose sent =
  one tablet, so today's results are unchanged.
- Dispense no longer marks the stock batch Processed='N'. Central gets the
  stock-out rows (standard MMU); re-sending a batch could insert a
  duplicate batch on central.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dispensed batch is marked Processed='N' again so the next upload updates
central's copy (matched by VanSerialNo + store, now kept by central MMU-API).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TOP-710

# Conflicts:
#	src/main/java/com/iemr/flw/service/impl/DiagnosticOrderServiceImpl.java
#	src/main/java/com/iemr/flw/service/impl/DiagnosticPollSchedulerService.java
@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 79e72161-65d2-48ae-bc47-f3d3869b98eb
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sehjotsinghunthinkable

Copy link
Copy Markdown
Contributor Author

@coderabbitai code review

@coderabbitai

coderabbitai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@sehjotsinghunthinkable I couldn't produce a complete response to this request. Please try again.

You are interacting with an AI system.

@vishwab1
vishwab1 merged commit 94350a1 into PSMRI:release-3.12.0 Oct 22, 2026
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants