Digital prescription platform · Bangladesh

Write it. Print it. Send it. Even offline.

DPMS turns the daily rush of a chamber, clinic or diagnostic centre into one fast, secure prescription flow, and turns every doctor seat into recurring revenue.

Works offlineBangla printSMS link to the patientPay per doctor seatConsent-based history
  1. RegisterDoctor, clinic or diagnostic centre signs up
  2. Check inPatient found or registered, serial assigned
  3. PrescribeDrug search, templates, works offline
  4. IssueNumbered, frozen, printed, sent by SMS
  5. Subscribe30-day trial, then a paid plan per doctor seat
How to read this page. Flows, rules, tables and routes come from the DPMS code as it stands. Plan prices are not set in the code (every paid plan is inactive at 0), so any amount here is an example. Market size, user counts and revenue forecasts are not in the repositories and are not claimed.
For doctors

Prescribe fast. Print on your own pad.

  • Works with no internet. Draft, search and issue offline; it syncs when the signal returns.
  • About 40,000 drugs at your fingertips, plus templates and repeat-previous.
  • Your pad, your language. A4, A5 or 80 mm slip, Bangla or English.
  • Patients get it by SMS as a protected link, with no medical detail in the text.
  • One login for your chamber and every clinic you work in.
For investors

A seat-based subscription business.

  • Revenue per doctor seat, with feature tiers on top (tiers proposed).
  • Prices and limits are data, changed in a console with no release.
  • Automatic lifecycle: trial, grace, read-only, with no lost data.
  • Patient data protected by encryption and two isolation walls.
  • An honest roadmap: 21 ranked gaps and a path to a paid pilot.
Value proposition

Why doctors switch. Why investors lean in.

One system that serves the doctor, the clinic, the patient and the business

The product is built around a single record, the issued prescription, and each party gets something different from it. Everything below is a capability that exists in the code today, apart from the items marked as planned.

98API operations across identity, patients, queue, prescriptions, billing and operator tools
48database models, with row-level security on the business tables
~40,000drugs in the offline catalogue, imported from a real DGDA file
3workplace types: private chamber, clinic, diagnostic centre
Doctor

A fast prescription that never waits for the network

  • Works offline. Drug search, drafts and issuing run on the device and sync later.
  • Quick to write. Type-ahead over the full drug catalogue, reusable templates (kits), repeat the previous prescription.
  • Prints on the doctor's own pad. A4, A5 or 80 mm slip, millimetre margins, letterhead or pre-printed pad, Bangla or English.
  • Legitimate by design. Number, BM&DC registration and signature are frozen into every issued prescription.
  • Follow-ups. A due list shows who should return, with a call and one-tap check-in.
Clinic and diagnostic centre

Many doctors, one workplace, clear control

  • Roles. Manager, doctor, front desk and compounder each see only what their job needs.
  • Doctors keep their identity. One login works in every workplace; a doctor invited by email accepts with their BM&DC details.
  • Pay per doctor. The clinic buys doctor seats; inviting a doctor beyond the paid seats is refused.
  • Managers do not read clinical notes. A manager is not a doctor unless they choose to practise and take a seat.
  • Vetted. A clinic or centre is reviewed by an operator before anyone can open it.
Patient

The prescription in hand, and control over who sees the history

  • SMS link. The patient receives a Bangla SMS with a short link, valid for 30 days, with no medical detail in the message.
  • Phone check. The page opens only after the last four digits of the patient's phone; repeated wrong guesses lock it.
  • One identity, many doctors. A new doctor can see earlier prescriptions only after the patient reads out a one-time code.
  • Patient page. No account needed: a code to the phone shows who has access and who looked, and lets the patient remove access.
Business and investor

Recurring revenue with low operating effort

  • Revenue per doctor seat. Clinics already buy seats per doctor; a chamber is one seat. Feature tiers on top of the seat are proposed, billed per 30-day period.
  • Prices are data. Operators change prices, limits and availability in a console; no release needed.
  • Lapse handling is automatic. Trial, grace and read-only follow dates, so no sweeper job can unlock or lock a customer by mistake.
  • Clean data trail. Subscriptions, payments and issued prescriptions are separate tables, so revenue and usage metrics can be queried directly.
  • Compliance built in. Encrypted patient data, audit rows, BM&DC verification and operator two-factor sign-in.

Why the design is hard to copy

Identity that follows the patient

A thin global person record links each doctor's own chart. One printed barcode works at every doctor, and history sharing is consent-based. This is a data advantage that grows with each doctor who joins.

Built for Bangladesh conditions

Offline-first writes, Bangla print with calibrated printer profiles, a DGDA drug catalogue, bKash and Nagad payments, Greenweb SMS and Dhaka-time queue dates.

Safe to scale

Two isolation walls between workplaces (application filter and database row-level security), encrypted fields, and an event outbox so side effects never get lost or doubled.

The model

One record. Zero chaos.

A workplace owns charts, queues and prescriptions; a person owns their identity

Reference data (drugs, tests, plans) is global. Everything clinical belongs to one workplace and carries its id. The only record that crosses workplaces is a thin person identity, and reading another doctor's history needs the patient's consent.

Shared reference dataDrug cataloguedrug_master · globalTest cataloguetest_master · globalOperator consoleplans, approvals, BM&DCPlans and limitsplans · priced by operatorsWorkplace and peopleWorkplace (tenant)chamber · clinic · centreMembersmanager · doctor · desk · compounderDoctor profileBM&DC no, signature, chamberSubscriptiontrial → active → grace → read-onlyhasispriced byClinical recordPersonglobal id + barcodePatient chartone per workplaceQueue entryserial, vitals, statusPrescriptiondraft → issued → voidPatient share linkSMS · last-4 · 30 dayslinkedcheck-inwrittensent
The clinical chain runs left to right: a person is linked to a chart in the workplace, checked into the queue, given a prescription, and the patient receives a share link. The subscription belongs to the workplace, not to a doctor.

Roles

Four workplace roles (manager, doctor, front desk, compounder) and one platform role for operators, who never see patient data.

Immutable output

An issued prescription cannot be edited. Corrections create a linked new draft; the original stays valid and printable.

Everything is a row

Plans, prices, limits, approvals, consents and payments are data. Business changes do not need a code release.

Functionality

Everything a chamber needs, already built.

What the product does today, and what it does not yet

A complete list of capabilities by area. "Built" means the code, the API and the screen exist. "Not started" means nothing exists yet; section "Where we improve" explains how each gap would be closed.

CapabilityUsed byWhat it includesStatus
Accounts and sign-inEveryoneEmail sign-up with emailed code and password; sign-in by email or mobile; password reset; login lockout; refresh sessions that rotate and detect reuseBuilt
Workplace registrationDoctor, manager, operatorPrivate chamber (instant), clinic and diagnostic centre (operator approval), doctor invitations, doctor seatsBuilt
Doctor profileDoctorBM&DC number, qualifications, specialties, chamber details, signature image; verification by operatorBuilt
Patient registration and searchDesk, doctor, manager, compounderRegister with client-minted id, search by exact mobile, barcode or patient number, barcode scan check-in, audited readsBuilt
Daily queueDesk, doctorServer-assigned serial per doctor and Dhaka date, vitals and fee, Waiting → In consultation → Completed or CancelledBuilt
Prescription editorDoctorComplaints, diagnoses, drugs with dose and duration, tests, advice, next-visit date; autosaved drafts; repeat previous; history panelBuilt
Templates (kits)DoctorSave from the editor, one-tap merge, offline create and edit; enforced limit per planBuilt
Issue, amend, void, revokeDoctorNumbered RX-nnnnnn, frozen print snapshot, linked amendment, void with reason, revoke patient linkBuilt
Print padDoctor, managerA4, A5 and 80 mm slip; margins; letterhead or pre-printed pad; footer; Bangla, English or mixed; per-device printer calibrationBuilt
Patient share linkPatientShort code, last-4 phone gate, lockout with growing delays, same 404 for unknown, expired, revoked and voidedBuilt
SMS notificationPatientBangla template through Greenweb on issue, via transactional outbox and queue; no medical detail in the textBuilt
Patient channels: WhatsApp and emailPatientSecond and third delivery channels after SMS, with a per-patient preference and fallbackNot started
Global patient identity and consentDoctor, patientMasked lookup, code sent to the patient, 12-month consent, cross-workplace history, access log, patient page to revokeBuilt
Follow-up listDoctor, deskPatients whose next-visit date has come and who have not returnedBuilt
Drug and test cataloguesAll, operatorDelta feed with tombstones, type-ahead search, operator create, update and deactivate, CSV and XLSX importBuilt
Offline modeAllOutbox with ordered replay, conflict parking, service worker app shell, local drug search, wipe on sign-outBuilt
Billing and entitlementsManager, operatorPlans as data, derived trial, grace and read-only, manual bKash and Nagad payments with operator approval, limits enforced for prescriptions, templates and doctor seatsBuilt
Operator consoleOperatorPayment review, BM&DC queue, clinic approval, suspend and reactivate, plan pricing, support override; authenticator-app second factorBuilt
Online payment gatewayManagerAutomatic card or wallet collection, recurring chargesNot started
Invoices and tax documentsManagerNumbered invoices, VAT, receiptsNot started
Reports and analyticsDoctor, manager, operatorPractice reports, business metrics dashboardNot started
Diagnostic centre workflowCentreTest orders, sample tracking, result entry and routing to the prescriber. Today a centre is treated like a clinicNot started
WhatsApp share, server PDF, data exportDoctor, patientAlternative channels and documentsNot started
Server-driven forms and padsDoctorCustom fields and a pad designer without a release (a hook exists in patient custom fields)Not started

Screens in the web app: sign-in and sign-up, queue, check-in, prescribe, follow-ups, settings (profile, print pad, templates, team, billing), the public prescription page, the patient access page, and the operator console (payments, doctors, workplaces, plans).

Registration

Sign up in minutes. Prescribe the same day.

Three ways in, one account, many workplaces

Every person first creates one account with an email address. From there a doctor opens a private chamber in minutes, while a clinic or diagnostic centre is reviewed by an operator first. A doctor can later join clinics with the same login and keep the private chamber.

AccountIndividual doctorClinic or centrePlatform operatorEnter emailEnter emailedcode and choosepasswordSign in; noworkplace yetName, BM&DCnumber,qualificationsChamber createdand open at once30-day trialstartsOptional: add oneassistant byemailType, name,address, phone,licence noPending: cannotbe openedApproved; 30-daytrial startsManager invitesdoctors, desk,compoundersDoctor accepts,adds BM&DC if newCheck licence,approve or rejectwith noteVerify BM&DCnumbersapprove
The top lane is shared. Individual doctors are open immediately. Clinics and centres wait for an operator, then invite their team. Dashed lines show BM&DC numbers entering the operator's verification queue.

The three paths side by side

QuestionIndividual doctorClinicDiagnostic centre
Who signs upThe doctor, for themselvesA manager or owner of the clinicA manager or owner of the centre
Details askedFull name, BM&DC number, qualifications, optional chamber nameName, address, phone of the place, trade or health-facility licence numberSame as a clinic, with type set to diagnostic centre
ReviewNone for the workplace; the BM&DC number goes to the operator queueOperator checks the licence, approves or rejects (a rejection needs a note)Same as a clinic
Before approvalNot applicableShows as "waiting for approval"; opening it is refusedSame as a clinic
Limits on sign-upOne private chamber per personA cap on requests waiting for approval per personSame cap
Trial30 days from the day the chamber is created30 days from approval30 days from approval
Who is the managerThe doctor is owner and practises automaticallySigner becomes manager; not a doctor unless they choose to practise and take a seatSame as a clinic
Members allowedOne assistant (compounder)Doctors (must accept), front desk, compoundersSame as a clinic
Plan audienceSolo plansClinic plans, priced per doctorClinic plans, priced per doctor
Issuing prescriptionsAllowed once BM&DC is verified, or for 7 days after submitting itEach doctor needs a seat and the same BM&DC ruleSame as a clinic

Account rules

  • Email is mandatory. Mobile number is optional and not verified by us.
  • Codes are single use. Hashed, with an attempt counter that counts before it compares, and a resend cooldown.
  • Guessing is slowed. Repeated wrong passwords lock password sign-in for a while.
  • Invited before signing up. A clinic can invite an email address that has no account yet; the person claims it with an emailed code.

What a rejected or pending workplace sees

  • Pending. Sign-in works, but opening the workplace answers "waiting for approval".
  • Rejected. Opening is refused and the operator's note is kept on the record.
  • Suspended. Members cannot open it again; a token they already hold works until it expires (15 minutes).

Data touched at each registration step

table readtable written
StepReads fromWrites toRoute and rule
Request sign-up codenoneotp_challengesPOST /auth/signup/request; throttled, cooldown, hourly cap; refused if the email exists
Create accountotp_challengesusersotp_challengesrefresh_sessionsPOST /auth/signup; attempts counted before comparing; password stored as bcrypt hash
Individual: create chamberusersusers (BM&DC, qualifications)tenants (SOLO_DOCTOR, approved)tenant_members (manager who practises)audit_logsoutbox_messagesPOST /workspaces; trial subscription appears the first time it is needed, dated from creation
Clinic or centre: sign upuserstenants (pending, licence, address)tenant_members (manager)audit_logsoutbox_messagesPOST /workspaces/facility
Operator approvestenantstenants (approval, reviewer, note)subscriptionsaudit_logsPOST /admin/tenants/:id/approval; decided once; trial starts here
Invite a memberuserssubscriptionsusers (created by email if new)tenant_members (invited or active)audit_logsPOST /workspaces/current/members; doctor invitations hold a seat; email sent best effort
Doctor acceptsuserssubscriptionstenant_membersusers (BM&DC if first time)tenant_members (active)audit_logsPOST /workspaces/invitations/:id/accept; seat re-checked
Operator verifies BM&DCusersusers (bmdc_status, checker, note)audit_logsPOST /admin/doctors/:id/bmdc; rejection needs a reason
Day in the chamber

A packed waiting room, without the paperwork.

From the patient walking in to a prescription in their phone

The same flow serves a private chamber and a clinic. The front desk and the doctor work on the same queue; the server hands out serials and prescription numbers so two devices can never clash.

PatientFront deskDoctor appDPMS serverPatient phoneArrives at thechamber1Find by mobile orbarcode, orregister2Assign serial forthe doctor anddate3Record vitals andfee4Startconsultation5Writeprescription,offline is fine6Issue: number it,freeze snapshot7Print on the pad8Receives SMS withlinkOpens link,enters last 4digits9Follow-up duelist10check insync + issueoutbox → SMS
Numbers match the table below. Steps in the Doctor app lane keep working without internet and sync later. Issue is the one step that needs the server because it assigns the number.

Data touched at each step

table readtable written
#StepReads fromWrites toNote
1Arrivesnonenone
2Find or registerpatientspersonspatients (new chart)persons (new global id)outbox_messagesaudit_logsPhone found by blind index, so no clear-text number is stored
3Check inpatientsusersqueue_serials (serial)number_sequencesoutbox_messagesaudit_logsSame client id replayed gives the same entry
4Record vitals and feequeue_serialsqueue_serials (bp, pulse, weight, sugar, temp, SpO2, fee)Optimistic lock by version
5Start consultationqueue_serialsqueue_serials (IN_CONSULTATION)Doctor only
6Write prescriptionpatientsprescription_templatesprescriptionsdrug_master (local copy)prescriptions (DRAFT)prescription_itemsprescribed_testsDraft saved on device first, then synced; update conflicts answer 409
7Issueuserssubscriptionspatientsprescriptions (ISSUED, rx_no, snapshot)number_sequencesprescription_accessqueue_serials (COMPLETED)outbox_messagesaudit_logsOwning doctor with BM&DC standing and a writable subscription
8Print and SMSprescription_accesspatientsnotification_templatesnotification_requestsnotification_messagesMessage holds rx number, doctor name and link only
9Patient opens linkprescription_accessprescriptionsprescription_access (attempts, lock)audit_logs (shared view)Wrong guesses are reserved before comparing
10Follow-upprescriptionsqueue_serialsnoneNext-visit date in range and no return yet

Screens the doctor and patient use

Simplified views of the real screens. All names and numbers are example data.

Example data

Queue

#1 A. RahmanFever · BP 120/80 · waitingWaiting
#2 S. AkterFollow-up · with doctorIn consultation
#3 M. HasanPrescription issuedCompleted
Check inScan barcode
Example data

Prescription

Tab. Napa 500 mg1+1+1 · 5 days · after meal
Cap. Seclo 20 mg1+0+1 · 14 days · before meal
Test: CBCBefore next visit
Issue and printApply templateSaved on device
Example data

Patient page

SMSYour prescription RX-000123 from Dr. Example is ready. Open the link.
Link opensEnter the last 4 digits of your phone••••
After 5 wrong triesLocked for 15 minutes, then longerLocked
Prescription lifecycle

Locked once issued. Trusted for good.

A prescription is written freely, then locked when issued

Clinical integrity comes from three rules: an issued prescription never changes, drug and test names are copied into it so catalogue edits cannot rewrite history, and the doctor's and patient's identity are frozen into a print snapshot at the moment of issue.

PrescriptionDrafteditable, on deviceIssuednumbered, immutableVoidedreason keptAmendment draftnew row, amends_id → originalissuevoidamend: original stays issued; the new draft is issued the normal wayQueue entryWaitingchecked inIn consultationdoctor startedCompletedby issue or by handCancelledidempotentcancel from waitingPatient share linkActive30 days from issueLocked5 misses: 15 min, ×4 eachExpiredsame 404Revoked or voidedsame 404wrong digitsafter 30 daysdoctor revokes, or prescription voided
Corrections never overwrite: an amendment is a new draft linked to the original, and the original stays printable. A void hides the prescription from the patient link.

What each action does

ActionWhoRuleWrites to
Save draftDoctorCreate or update by client id; updates carry the expected versionprescriptionsprescription_itemsprescribed_tests
IssueOwning doctorBM&DC verified, or unverified for up to 7 days after submitting; subscription not read-only; limit on prescriptions per month if the plan has one; replay returns the same resultprescriptionsnumber_sequencesprescription_accessqueue_serialsoutbox_messagesaudit_logs
AmendOwning doctorCopies an issued prescription into a new draft; only one open amendment at a timeprescriptionsprescription_itemsprescribed_tests
VoidOwning doctorReason required; patient link stops workingprescriptionsaudit_logs
Revoke linkOwning doctorCloses the patient's short link onlyprescription_accessaudit_logs
Patient viewsPatientShort code plus last four phone digits; unknown, expired, revoked and voided look identicalprescription_accessaudit_logs
Offline-first

No signal? Keep prescribing.

The doctor keeps working when the connection drops

Writes go to a local database first, then a sync engine replays them in order when the network returns. The server never needs to merge two versions of a record: ids are created on the device and updates carry a version number.

On the device (phone, tablet or PC)Screensqueue, editor, printLocal database (IndexedDB)outbox: writes waiting to senddrafts, saved on every changedrug catalogue, about 40,000queue, patients, history (24 h)Sync engineordered, one at a timeService workerapp shell, offline pagewriteServerAPIclient ids make replays safeCatalogue feedsince=version, tombstonesConflict409 with a stable codereplay in ordercatalogue deltaparked
The service worker caches the app shell and static files only. It never caches API answers or patient pages.
SituationWhat happens
No internet while writingDraft saved on the device on every change. Drug search runs on the local catalogue.
Same save sent twiceThe client id makes it idempotent: the second send returns the existing record, with no second serial and no second number.
Two devices edit one recordThe second update carries an old version and is answered 409. The app parks it for the user instead of overwriting.
Issuing while offlineThe prescription waits as pending; the number is assigned by the server on sync. Printing the draft sheet remains possible.
Subscription runs out while offlineWork created before writing stopped is accepted when it syncs. The device clock is trusted for at most 7 days back and never into the future.
Sign-out on a shared computerCached patient data is removed; unsent work is kept until it syncs.
Catalogue updatedThe device asks only for changes since its last version, including removals.
Patient identity and channels

One patient. Every doctor. Their consent.

One person, many doctors, shared only with consent

Each doctor keeps their own chart. A thin global person record ties the charts together without holding any personal data itself. A new doctor sees earlier prescriptions only after the patient reads out a code sent to the phone already on file.

Doctor searchesmobile or barcodeNo local chartsearch other doctorsMasked matchinitials, age, genderCode to patientto the phone on filePatient reads codedoctor enters itConsent saved12 months, own chartWrong code5 tries, then new codeHistory from other doctorsissued only, every view loggedPatient page, no account neededcode to phone → see who has access → removea removed doctor finds out when the next history request is refused
The code is sent to the patient's own phone, never to a number the doctor types, so a doctor cannot grant themselves access. Consent expires after 12 months and is renewed by a new code.

How we reach the patient

Most patients in Bangladesh are reached by mobile number, so SMS comes first. WhatsApp is second and email third. Staff accounts are different: sign-up, sign-in and password codes for doctors, managers and desk staff go to their email address.

OrderChannelUsed forStatus
1SMS to mobileUsed for prescription links, consent codes and patient page codes. This is the main channel.Built
2WhatsAppSame messages through a WhatsApp business channel, for patients who use it more than SMS.Planned
3EmailFor patients who give an address. Today a patient chart has no email field; it would be stored encrypted like the phone.Planned

Who can read what

ReaderOwn recordsOther doctors, same patientOther clinical
Doctor with an active seatYes, in every workplaceYes, with active consentNo
Doctor removed by a clinicRead yes; write needs a seat again (not built yet)Existing consents applyNo
Front deskReads and prints issued prescriptions of the workplaceNoNo
CompounderNo prescription accessNoNo
Clinic managerNo clinical contentNoNo
Platform operatorNoNoNo

Privacy rules in the code

  • Masked lookup. Only initials, age and gender; throttled per IP and capped per doctor per hour.
  • Access log. Every view of another doctor's records is written; the patient page shows it.
  • Cross-workplace reads are read-only. Issued prescriptions only; drafts stay private; writes across workplaces are refused by the database.
  • Household phones. Family members who share a phone see each other's list on the patient page, by the same rule as the code.

Data touched

table readtable written
StepReads fromWrites to
Masked lookuppatientspersonsnone
Send code to patientpersonspatientsperson_consent_requestsnotification_messages
Verify codeperson_consent_requestsperson_consentspatients (own chart, same barcode)person_access_log
Read historyperson_consentsprescriptionsperson_access_log
Patient page sign-inpatientspatient_portal_requests
Patient removes accessperson_consentsperson_consents (revoked_at)
Workplaces and roles

Built for chambers, clinics and centres.

Who may do what inside a chamber, clinic or centre

A role is checked at the door of every route, and finer rules (only the owning doctor writes a prescription) are checked inside the use case. A person can hold different roles in different workplaces.

ActionManagerDoctorFront deskCompounder
Manage team and invitations✓———
Register patients and check in✓✓✓✓
Start a consultation, write, issue—✓——
Complete or cancel a queue entry✓✓——
Read and print prescriptions—✓✓—
Void or revoke link—✓——
Templates and consent lookup—✓——
Print pad settings (change)✓✓——
See the subscription✓✓✓✓
Pay, report a payment✓———

Reading prescriptions and printing is open to doctors and front desk. A manager who also sees patients chooses to practise and takes a doctor seat. Platform operators work outside workplaces and see no patient data.

Private chamber

The doctor is the owner and the only clinician. One assistant (compounder) can be added by email.

Clinic

A manager invites doctors, desk staff and compounders. Doctors must accept, and each doctor holds a paid seat, counted from the invitation.

Diagnostic centre

Registered and approved like a clinic. Test orders, samples and results are not built; today the centre runs the same patient, queue and prescription flow.

Subscription and billing

Pay per doctor. Grow by feature.

Trial, paid period, grace, read-only: access follows dates

Every workplace has one subscription. Revenue is per doctor seat. Customers pay by bKash or Nagad and report the transaction; an operator confirms it against the real transaction and approves. Nothing is charged automatically yet, which keeps launch simple and trustworthy while volumes are small.

Trialfull access, 30 daysActivepaid period, 30 daysGrace7 days, banner onlyRead-onlyview, print, share; no new recordspayment approvedperiod endsday 7 endstrial ends unpaidoperator approves a payment: back to activepays in graceStatus is recomputed from dates on every request, so a missing background job cannot lock or unlock anyone.
A clinic's trial starts when an operator approves it; a private chamber's starts when it is created. Data is never deleted when access narrows, and read-only still allows viewing, printing and sharing.

What read-only blocks

Create patient, queue entry or draftRefused (402)
Issue or amend a prescriptionRefused (402)
Read, print, share, void, revokeAllowed
Settings, templates, payingAllowed
Work created offline before the lockAccepted when it syncs, up to 7 days back

Manual payment rules

  • Transaction id is cleaned (6 to 20 letters and digits) and unique per method; another workplace using it gets 409.
  • Amount must cover price × seats, in whole paisa. The date cannot be in the future or older than 60 days.
  • Approval renews one period from the end of a running period, or from now if lapsed. A decision is made once.
  • Clinics pay per doctor; adding a doctor mid-period means renewing early at the new size, with no proration.

Manual payment flow

ManagerDPMSOperatorSends money bybKash or NagadReports amount,trx id, sender,dateChecks id,amount, date;stores asMatches with realtransactionApprove: renewperiod, set seatsReject: reasonshown to managerreview queue
The manager sees the review status of each payment. Rejection always carries a written reason.

Plans, as stored today

Plans are rows an operator edits. The paid plans are seeded inactive at price 0 with placeholder limits, because prices are to be set from pilot data. Activating a paid plan without a price is refused.

PlanForStatePeriodRx / monthSMS / monthTemplatesCompoundersDoctors
Free trialAllActive30 daysnull501003 (clinic placeholder)
Solo BasicSoloInactive, price 030 daysnull1002001
Solo ProSoloInactive, price 030 daysnull300unlimited11
Clinic, per doctorClinic and centreInactive, price 030 daysnull300unlimited5bought per doctor

Which limits are enforced

LimitEnforcedNote
Prescriptions per monthYesCounted per calendar month in Dhaka time; replays are never blocked
TemplatesYesA replay of an existing template is not a new one
Doctor seats (clinic, centre)YesInviting or accepting beyond paid seats answers 402
Compounder seatsNoStored and shown; the one-assistant rule for chambers is hard-coded
SMS per monthNoStored and shown, not counted yet

Proposed pricing model: per doctor seat, packaged by feature

Revenue follows the number of doctors, and what each doctor gets depends on a feature tier. Seats are already real in the code: a clinic buys doctor seats and a chamber is one seat. Feature tiers are not yet built: a plan stores a list of feature names, but no screen or rule is gated by it today. The tier names, the packaging below and every price are proposals for the product owner.

✓ includedAdd-on sold on topPlanned feature not built yet— not in tier
Feature or limitCorePlusProToday in code
Queue, prescribe, print, patient SMS link, offline✓✓✓Built
Prescriptions per monthCappedUnlimitedUnlimitedLimit enforced
Templates (kits)FewMoreUnlimitedLimit enforced
SMS included per monthSmallMediumMedium + packsStored, not counted
Assistant (compounder) seats015Stored, not enforced
Cross-doctor history with consent✓✓✓Built
Practice reports—✓✓Feature name seeded; reports not built
WhatsApp and email to patients—Add-on✓Planned
Multi-doctor workplace, roles, front desk——✓Built (clinic plan)
Diagnostic centre orders and results——Add-onPlanned
Extra SMS pack, extra assistant seatAdd-onAdd-onAdd-onNot built

Why per doctor

A clinic with more doctors earns more for DPMS, and a doctor who works in two places holds a seat in each. The seat check already blocks inviting past the paid number.

Why feature tiers

A solo doctor can start on Core and move up when reports or patient channels matter, with no new sales cycle. A tier change is a plan row, not a release.

What must be built

Check a plan's feature list at the point of use, add a tier column to the plan, enforce SMS and assistant limits, and price add-ons. Seats, limits, approval and payment already exist.

Revenue illustrator

Change the example numbers to see monthly recurring revenue from seats by tier plus add-ons. These are not DPMS prices and not a forecast; real prices are set by operators in the console.

Example inputs

Monthly recurring revenue

Core seats—
Plus seats—
Pro seats—
Total seats—
Add-ons—
Total per month—
—Per year at the same size—Excludes tax and gateway fees.
Security and privacy

Patient data, locked down by design.

Seven gates before data is touched, and two walls between workplaces

A health product is judged by what happens when something goes wrong. Isolation does not rely on one filter: the application filters every query by workplace and the database itself refuses rows from other workplaces.

1 Throttleper IP, per route2 Authenticatesigned token3 Workplaceid from token4 Roleroute roles5 Subscriptionread-only check6 Use-case rulesowner, BM&DC, limits7 Databaserow-level security429 too many401 sign in403 no workplace403 role402 read-only403 / 409 / 422no rowsEvery state change writes an audit row and an outbox event in the same transactionids and action names only; no patient names, phone numbers or diagnoses
The workplace comes from a server-signed token, not from a header the client can edit. A token is issued only after an active membership check, and membership is re-checked on every refresh, so a removed member loses access within 15 minutes.

Protected data

DataWhatHow
Patientname, phone, address, custom fieldsAES-256-GCM, phone also as keyed hash for lookup
Prescriptioncomplaints, diagnoses, advice, drugs and tests text, print snapshotAES-256-GCM bound to workplace, row and column
Operator loginauthenticator secretEncrypted, bound to the user, one use per code
Passwordsuser passwordbcrypt hash; sign-in lockout after repeated failures
Events, logs, SMSids and rx number onlyNo clear patient data leaves the database

Controls worth naming

  • Row-level security, forced. Enabled on patients, queue, prescriptions, templates, print layouts, share links and memberships. The app connects as a role that cannot bypass it. No workplace in scope means no rows.
  • Short-lived, rotating sessions. Refresh tokens are hashed and rotate on every use; replaying an old one revokes the device family.
  • Patient link hardening. Random 10-character code, last-four gate, attempts reserved before comparing, lockout that grows to 24 hours, identical 404 for all dead links, no medical data in the URL or SMS.
  • Operator access. Granted only from a trusted shell, never through the API, and protected by an authenticator code in deployed environments. Operators see subscriptions and payments, not patients.
  • Fail-closed deployment. The service refuses to start in a deployed environment with weak secrets, dev code echo, console SMS or header-trust tenancy.
Operations and investor metrics

Run a platform with a small team.

The operator console, and the numbers the same tables can answer

A small team can run the platform because approvals, pricing and support actions are screens, not scripts. The tables that bill customers and record prescriptions hold the figures investors ask for. No metrics dashboard exists yet, so these are queries today.

Console screens

  • Payments. Review reported bKash and Nagad payments; approve to renew or reject with a reason
  • Doctors (BM&DC). Queue of unverified numbers, oldest first; verify or reject with a reason
  • Workplaces. Find workplaces, approve or reject new clinics and centres, suspend, reactivate, override a subscription with a reason
  • Plans. Set price, period, limits and availability; edits are version-checked
  • Catalogue (API). Create, update and deactivate drugs and tests; bulk import from CSV or XLSX

Why operations stay light

  • Every action is audited. Reject, suspend and override each need a written reason.
  • Decisions happen once. A payment or an approval cannot be decided twice.
  • Prices and limits are data. No release is needed to change a plan.
  • Support can override safely. Put a workplace on a plan until a date, with a reason and a record.

Metrics and where each comes from

table source
MetricDefinitionSource tablesAvailability
Paying workplacesWorkplaces with status active, by plan and typesubscriptionstenantsQuery today
Monthly recurring revenueApproved payments per 30-day period; clinic amounts divided by seatspayment_recordssubscriptionsQuery today
Trial to paidWorkplaces with an approved payment ÷ trials started, by start monthsubscriptionspayment_recordstenantsQuery today
Prescriptions issuedIssued per day, month, doctor and workplaceprescriptionsQuery today
Active doctorsDoctors with at least one issued prescription in the monthprescriptionstenant_membersQuery today
ChurnWorkplaces moving to read-only without a later paymentsubscriptionsQuery today
Verification backlogDoctors waiting for BM&DC review and for how longusersQuery today
SMS deliveredMessages sent and failed by daynotification_messagesQuery today
Patients and repeat visitsNew charts, returning patients, consented cross-doctor readspatientsqueue_serialsperson_consentsQuery today
Expansion revenueSeat growth and plan upgradespayment_recordssubscriptionsNeeds history of plan changes
Technical architecture

Simple to run. Ready to scale.

A modular monolith with clear seams, built to split later

One deployable service keeps the team small and the system simple. Modules talk through ports, and lint rules fail the build if a business module reaches into another module's internals or into infrastructure. If one part needs to scale or be owned separately, it can be cut out along an existing seam.

Web app (PWA)Next.js 15, React 19, DexiePatient pages/rx/:code · /my-accessAPI: NestJS 11 modular monolithidentity: auth, user, workplaceintake: patient, queueclinical: prescription, template, printcatalog: drug, testbilling: subscription, operator toolsPlatform capabilitiesoutbox · notification · crypto · audit · numbering · importPostgreSQL 16row-level security, split schemaRedis + BullMQqueues, locks, cacheRabbitMQoutbox publish targetObject storage (S3)signatures, importsGreenwebSMSResendemail codesHTTPS
Side effects such as SMS leave the system only through the outbox: the event is stored in the same transaction as the data, then published and retried with backoff, then parked as dead letters if it keeps failing.

Stack

FrontendNext.js 15 (App Router), React 19, TypeScript strict, Tailwind v4, TanStack Query, Dexie, service worker, Zustand
BackendNestJS 11 on Fastify, TypeScript strict, Zod validation, Prisma 7
DataPostgreSQL 16 with a read-replica option, Redis, RabbitMQ
MessagingTransactional outbox, BullMQ notification pipeline, Greenweb SMS, Resend email
ContractOpenAPI document exported from the API; frontend types generated from it
QualityArchitecture boundaries enforced by lint, about 570 test cases in the backend and 126 in the frontend, two database integration suites, two black-box flow tests, CI on every change
OperationsLiveness and readiness endpoints, Prometheus metrics, Sentry, structured logs without patient data

Design rules that protect the product

  • Business never imports infrastructure. Raw database, queue and cache clients live only in infrastructure and platform code.
  • One path to change data. Aggregates enforce rules; a use case saves, writes the event and writes the audit row in one transaction.
  • Client-minted ids and versions. Make offline replays safe and conflicts visible.
  • Idempotent background work. Claims use database locks and leases; every state change is guarded, so redelivery never double-applies.
  • Scaling path. Stateless API nodes, a read replica for queries, more queue workers, monthly partitions for the outbox and audit tables when volume grows.

The SMS chain after a prescription is issued

Doctor appAPI and databaseBackgroundPatientIssueprescriptionSave prescriptionand outbox event,one transactionDispatcherpublishes theevent, retries onNotificationqueue rendersBangla textGreenweb sendsthe SMSOpens link,enters last 4digitsoutbox
If the SMS provider is down, the message retries with backoff and is parked visibly; the prescription itself is never affected.
Data model

A data model you can audit.

48 models, grouped so each part can change on its own

These diagrams show the business tables and their key columns. Fields ending in _enc are encrypted. A further set of platform tables (scheduler, recurring, batch, import, webhook, locking, idempotency, inbox) exists as shared capability and is not drawn.

Accounts, workplaces and money

AccountsMembership and moneyWorkplace and plansusersidPKemailphonepassword_hashbmdc_reg_nobmdc_statussignature_keyplatform_roletotp_secret_encrefresh_sessionsidPKuser_idFKtoken_hashfamily_iddevice_idotp_challengesidPKemailcode_hashattemptsexpires_atconsumed_attenant_memberstenant_idFKuser_idFKrolestatuspractisestenantsidPKtypenameapprovallicence_noaddressowner_idversionsubscriptionsidPKtenant_idFKplan_idFKstatuscurrent_period_endgrace_ends_atdoctor_seatsplansidPKnameprice_paisaperiod_dayslimitsaudienceper_doctoris_activepayment_recordsidPKtenant_idFKplan_idFKmethodtrx_idamount_paisaseatsstatus
A person owns an account; membership ties accounts to workplaces with a role; the subscription and payments belong to the workplace.

Patients, queue and prescriptions

Identity and chartVisit and prescriptionLines, link, templatespersonsidPKbarcodepatientsidPKtenant_idFKperson_idFKpatient_nobarcodename_encphone_encphone_hashage_yearsgenderqueue_serialsidPKtenant_idFKpatient_idFKdoctor_idFKserial_nochamber_datestatusvitalsfee_amountprescriptionsidPKtenant_idFKpatient_idFKdoctor_idFKqueue_serial_idFKrx_nostatusamends_idFKnext_visit_datediagnoses_encprint_snapshot_encprescription_itemsidPKprescription_idFKdrug_idFKdrug_brand_namedosagedurationprescribed_testsidPKprescription_idFKtest_idFKtest_nameprescription_accessidPKtenant_idFKprescription_idFKshort_codeexpires_atfailed_attemptslocked_untilrevoked_atprescription_templatesidPKtenant_idFKdoctor_idFKtitledrug_masteridPKbrand_namegeneric_namestrengthdosage_formcatalog_versiontest_masteridPKtest_namecategorycatalog_version
Lines on a prescription copy the drug or test text, so drug_id and test_id are optional references to the catalogue, not dependencies, and are not drawn. Doctor columns point to the account, not to a foreign key, because doctors work in several workplaces.

Consent, messages and platform records

Consent and patient pageEvents, messages, auditTemplates and numberingpersonsidPKbarcodeperson_consent_requestsidPKperson_idFKdoctor_idFKcode_hashattemptsexpires_atperson_consentsidPKperson_idFKdoctor_idFKgranted_atexpires_atrevoked_atperson_access_logidPKperson_idFKdoctor_idFKtenant_idFKactionatpatient_portal_requestsidPKphone_hashcode_hashattemptsexpires_atoutbox_messagesidPKevent_idtenant_idevent_typestatusattemptsavailable_atnotification_requestsidPKtenant_idnotification_typestatustotal_messagesnotification_messagesidPKnotification_request_idFKchanneladdressstatussent_atnotification_templatesidPKnotification_typechannellocalebodyaudit_logsidPKtenant_idactor_idactionentity_typeentity_idchangesnumber_sequencesidPKkeyprefixcurrent_value
Platform tables carry ids only and no patient data, so background workers can scan them across workplaces.

Rules the database enforces

TableRule
patientsUnique chart number and barcode per workplace; phone lookup by keyed hash; row-level security forced
personsBarcode unique across all workplaces
queue_serialsUnique (workplace, doctor, date, serial) is the safety net behind the numbering service
prescriptionsUnique (workplace, rx number); client id as primary key makes create idempotent; versioned updates
prescription_accessShort code unique; holds no patient data; attempt and lock state lives here
subscriptionsOne per workplace; status is a listing hint, access is recomputed from dates
payment_recordsUnique (method, transaction id), so one real payment cannot renew two workplaces
person_consentsLocked to the doctor they belong to; the patient page may only set revoked_at
audit_logs, person_access_logAppend-only for the application role
Prices and limitsStored in plans as data; activating a paid plan without a price is refused
Where we improve

Where we go next, ranked.

Twenty-one gaps, ranked, across business, product, technology and compliance

The clinical core is built and working. What stands between it and a paying pilot is mostly the business shell: prices, reminders, invoicing and operations. Priority P0 blocks a pilot, P1 should land in the first paid release, P2 follows once usage proves the need.

P0 blocks a pilotP1 first paid releaseP2 later
AreaWhere we areImprovementWhy it mattersPriority
BusinessPrices not set; every paid plan inactive at 0Set prices from 3 to 5 pilot workplaces, activate Solo and Clinic plans, decide trial rulesNo revenue until pricedP0
BusinessPayments are manual: the manager sends money and reports the transactionAdd an online gateway (bKash, Nagad or an aggregator) with webhook verification and automatic renewal; keep manual as a fallbackRemoves operator effort and delay at scaleP1
BusinessNo invoices, receipts or VAT documentsNumbered invoice and receipt per payment, tax fields, downloadableNeeded by clinics and for auditP1
BusinessNo renewal, trial-ending or failed-payment messages (only an in-app banner)Trial day 23, day 27 and expiry notices; grace and read-only messages by email, SMS and WhatsAppLargest lever for conversion and recoveryP0
BusinessPlans store a features list but nothing checks it; no tiersSeat plus feature-tier packaging: gate reports, patient channels and centre tools by the plan, add a tier column, price add-onsTurns one seat price into a ladderP1
BusinessPlan limits: SMS per month and compounder seats stored but not enforced; no add-ons, coupons or prorationEnforce all limits; add add-ons, coupons, seat proration and upgrade previewPlans must mean what they sayP1
ProductPatient reached by SMS only; patient has no email fieldChannel order SMS, then WhatsApp, then email: per-patient preference, encrypted email, delivery fallback, delivery receiptsHigher delivery and lower SMS costP1
ProductName search impossible because names are encryptedSearch by phone, barcode and patient number plus a client-side name search over cached recent patientsDaily friction at the front deskP1
ProductNo standalone patient profile page; reports and analytics missingPatient profile with history and files; doctor and clinic reports; metrics dashboard for operatorsRetention and clinic valueP1
ProductDiagnostic centre treated like a clinicTest orders from prescriptions, sample tracking, result entry, results back to the prescriber and patientMakes the centre a distinct productP2
ProductUI text is English only; Bangla only on printTranslation scaffolding (Bangla and English) before more screens are addedHarder to retrofit laterP1
ProductQueue is polled, not live; no allergy or dose warnings; no merge of duplicate personsLive queue for clinics, advisory warnings, tool to merge duplicate peopleClinic mode and safetyP2
TechnologyBackups and point-in-time restore not drilled; no alert on stalled outboxBackup and restore drill, alerts on dead-letter and stalled queues, runbooksRelease checklist item before pilotP0
TechnologyNo measured performance numbers (search time, bundle size, load)Set budgets and measure on a low-end phone; load test at expected volumeClaims need evidenceP1
TechnologyBrowser tests are scripts, not part of CI; no print snapshot testsCommit offline and print tests to CI with golden images, including Bangla conjunctsCatches regressions that unit tests cannotP1
TechnologyWebhook and recurring services listen on a path that no longer receives events; several platform services have no consumerMove them to the live event bus or remove them; keep the codebase honestDead code hides real behaviourP2
TechnologyOne process runs web, workers and the dispatcher; RabbitMQ has no recorded decisionSplit workers when load needs it; write the decision record for RabbitMQ or drop itOperational simplicityP2
Security and complianceBM&DC rule is verified-or-7-days; policy confirmation pendingConfirm the policy with counsel and the council; add automated checks if a source existsLegal validity of prescriptionsP0
Security and complianceBangladesh health-data and consent obligations not yet legally reviewed; consent wording openLegal review; final Bangla and English consent text; data residency decisionRequired before launchP0
Security and complianceSMS cost abuse limits are partial; Greenweb contract unverified; metrics endpoint public unless a token is setCountry allow-list and per-account SMS budget; confirm the live gateway contract; protect metrics at the gatewayCost and exposureP1
Security and complianceAudit coverage incomplete (catalogue imports, some views); no recovery codes for operator second factorComplete audit coverage; recovery codes and lockout for operators; per-workplace encryption keysTrust and recoverabilityP1

Sources: the product gap report kept in the backend documentation, checked against the current code. Priorities are a recommendation for the product owner to confirm.

Delivery

Three releases to revenue.

Three releases, and ten decisions to settle first

Release 1 makes the product safe to put in front of paying pilot doctors. Release 2 turns pilots into a billing business. Release 3 widens the product for clinics, centres and patients.

Release 1 · Pilot

Safe and priced

  • Set and activate plan prices
  • Trial and renewal reminders by email and SMS
  • Backup drill, stall alerts, runbooks
  • Legal review and consent wording
  • BM&DC policy confirmed
  • Print tests on real printers, Bangla included
Release 2 · Bill

Automate money

  • Online payment gateway and automatic renewal
  • Invoices, receipts, VAT
  • Enforce SMS and assistant limits
  • Seat plus feature tiers and add-ons
  • Operator metrics dashboard
  • WhatsApp then email for patients
  • Bangla and English interface
Release 3 · Grow

Clinics, centres, patients

  • Diagnostic centre orders and results
  • Live queue and shared visibility rules for clinics
  • Reports for doctors and managers
  • Add-ons, coupons, partner pricing
  • Server PDF and data export
  • Pad designer and custom fields

Decisions needed from the product owner

Plan prices and trial rulesSolo and per-doctor clinic prices, whether a payment method is needed to start a trial, and the annual discount, if any.
Payment gatewayWhich provider handles recurring collection for bKash, Nagad and cards, and who bears the fees.
BM&DC enforcementCurrent rule: verified doctors always issue, unverified ones for 7 days after submitting. Keep, shorten or tighten.
Hosting and data residencyBangladesh-hosted or a nearby region. This affects legal exposure and latency.
Patient channelsConfirm the order SMS, WhatsApp, email, and whether a patient may choose one or all.
Clinic default visibilityWhether doctors inside one clinic see each other's prescriptions by default.
Consent wording and expiryFinal Bangla and English text, and whether 12 months is right. Can a patient hide a single visit.
Brand and SMS senderThe brand name and domain decide the registered SMS sender id and the patient link address.
Name searchAccept search over cached recent patients, or add a searchable but less private name index.
Diagnostic centre scopeWhat a centre needs first: test ordering, sample tracking, result delivery, or billing.
Next step

Let's put DPMS in front of the first paying chambers.

The clinical core works end to end. Set prices, add trial and renewal reminders, drill backups, finish the legal review, then run a paid pilot with a few doctors.