Oushodh logooushodh
INTEGRATION

Moving your existing data

You already hold a medicine list: in a POS, an ERP, a spreadsheet or a database of your own. This guide moves it onto Oushodh IDs, step by step, without changing a record you hold, and with a way back at every step.

What moves, and what stays

Moving to Oushodh does not replace your records. Each of your items gains one thing, the uuid of the Oushodh medicine it is, and the screens that show medicine details read them live from the API.

  • Item codes, SKUs and barcodesAFTER THE MOVEStay as they are. The uuid sits beside them.
  • Stock counts, selling prices and suppliersAFTER THE MOVEStay yours. The API never changes them.
  • Sales, invoices and prescriptionsAFTER THE MOVEStay as they were on the day, names and prices included.
  • The brand, strength, form and maker typed on each itemAFTER THE MOVEStay. They are read once, to find the match.
  • Medicine details a screen shows: generic, MRP, monographAFTER THE MOVERead live with GET /v1/medicines/{uuid} once the item is mapped. Never copied into your tables.
Flowchart for moving an existing medicine list: back up and add two empty columns, a trial run on a test key, match every item, people decide the rest, then switch screens to live details behind a setting. Turning the setting off undoes the switch.
Five steps, and a way back at each one.

Back up, then add two columns

Take a backup of the item table first. Then add two empty columns, and leave every existing column alone, so the old screens keep working while you move.

  • oushodh_uuid: the medicine's uuid, empty until the item is matched. Index it.
  • match_status: empty until the item is searched, then matched, review or none.
  • Optional: oushodh_id, if people will see the Oushodh ID beside your own code.

A spreadsheet works the same way: export the item list to CSV and add the same columns. Moving your medicine list has a script that fills them from a CSV.

Choose how the IDs look

Every medicine has an ID in each ID profile, and your keys answer in the profile you choose when you create them. If your staff will see Oushodh IDs beside your own item codes, make a profile whose prefix cannot be mistaken for yours.

The ID profiles page in the member portal: the shared Oushodh standard profile with eight-digit IDs, and a Pharmacy profile whose IDs start at PH-000001, used by two keys.
ID profiles: one per ID format.
The Create an ID profile dialog: the name Migrated POS, the prefix OM-, six digits and the first number 1, with a preview of OM-000001, OM-000002 and the last ID, and the note that the format cannot change.
A prefix of OM- keeps Oushodh IDs apart from your own codes.

A profile cannot change once it is made, so the IDs you store stay valid. Store the uuid as the key either way: IDs has the detail.

Run a trial on a test key

Make a test app and a key for it in the portal, as in the quickstart; it needs no plan. A test app's keys run at up to 10 requests a minute and share 5,000 requests a month (100 on the free tier), enough for a trial of a few hundred items.

Take a sample that looks like your whole list: common brands, liquids and injections, items typed in short forms, and a few that are not medicines at all. Run the match on the sample only, and check what it saved.

Explore with the search napa: 20 of 30 matches, the Napa brands first, each row a brand and strength with its generic, dosage form, maker, MRP and ID.
Explore shows what a search answers, to check a match by eye.

Look at three numbers: how many items matched on their own, how many went to review, and how many found nothing. Many items with nothing usually mean short forms in your records, such as Tab or Syp. Expand them in your own code, and run the sample again.

Match every item

Run the match on the whole list with a key of your production app, at a quiet hour. Each item is one search:

  • Search the item's brand with GET /v1/medicines/search, and compare each answer's strength, dosage_form and maker with your item: manufacturer.name, or one of its names.
  • Exactly one fits: save its uuid and set match_status to matched.
  • Several fit: set review, and keep the candidates' uuids for the person who decides.
  • None fits: set none.

Work only on rows whose match_status is empty, so a run that stops can start again where it left off. On a 429 answer, wait the seconds in Retry-After, then go on. A Developer key makes up to 60 requests a minute, so 3,000 items take at least 50 minutes and use 3,000 of the month's 50,000 requests. Usage shows the run as it goes:

The Usage page: requests this month against the plan's 250,000, a chart of requests a day, and a table of requests, share and rate-limited calls for each key.
Usage, by key: the match run shows as one day's requests.

Match only the items you hold. Under the terms of use, paging through the whole list, or fetching far more medicines than your apps use, counts as collecting the data.

Let people decide the rest

A review screen lists the items marked review. For each, it gets the candidates with GET /v1/medicines/{uuid} when it opens, and shows them beside your own record. A person picks one, or none.

Items marked none need a person too. Some are not medicines. Some are spelled so differently that a search by the generic or another spelling finds them. Others are not in the data yet: they keep working in your system, unmapped, and a later search may find them.

Never save the first search result because it comes first. Rank says which name matched best, not which medicine is on your shelf.

Switch the screens over

Put the switch behind a setting, and turn it on for one shop, one ward or one screen first.

  • A mapped item shows its details from GET /v1/medicines/{uuid}, called by your server when the screen opens.
  • An unmapped item shows your own record, as it does today.
  • If the API answers with an error or does not answer, show your own record and log the error. Never stop a sale for it.

To go back, turn the setting off. Nothing you held was changed, so the old screens work as before. When every screen has run on the new path for a while, drop the old code path, not your data.

Notice changes after the move

Medicines change: a new MRP, a corrected name. Updates in the portal lists each change to the data, with how many medicines were added and changed.

The Updates page: each time the medicine data changed, with the date it went live, the number of medicines, and how many were added and changed, and the note to pass updated_since to GET /v1/medicines.
Updates: when the data last changed.

Your own check uses GET /v1/meta and updated_since, and flags only the items whose uuid is in your table: Notice changes has the steps.

Checklist

  • A backup of the item table, taken before any change.
  • Two new columns; no existing column changed.
  • An ID profile chosen, and a key in it for each app.
  • A trial on a test key, and short forms expanded.
  • Every item matched, in review, or marked none.
  • Screens switched behind a setting, with your own record as the fallback.
  • A change check that flags your mapped items.
Add the columnsSQL
ALTER TABLE items ADD COLUMN oushodh_uuid CHAR(36) NULL;
ALTER TABLE items ADD COLUMN match_status VARCHAR(8) NULL;
CREATE INDEX items_oushodh_uuid ON items (oushodh_uuid);
Search one itemcurl
curl -G https://api.oushodh.dev/v1/medicines/search \
  -H "Authorization: Bearer $OUSHODH_KEY" \
  -d q=napa -d limit=50
Show a mapped itemcurl
curl https://api.oushodh.dev/v1/medicines/01a1ba6f-f4d6-7143-ac84-9376f520eef8 \
  -H "Authorization: Bearer $OUSHODH_KEY"