Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
[x] Create a new table clinician_link; clinician_link.id String; clinician_link.name_id String FK to clinician.id
[x] Migration populating clinician_link.id == clinician_link.name_id == clinician.id for each clinician record
[x] Migration adding clinician_store_join.clinician_link_id and removing clinician_store_join.name_id
[x] Migration fixing up any sql views
[x] Update clinician at the repository layer to return related clinician records based on clinician_store_join.clinician_link_id rather than clinician_store_join.clinician_id
Is your feature request related to a problem? Please describe π
Open mSupply needs to support clinician merging using a "link" table.
Describe the solution you'd like π
Base: feature/merging
Using changes in the item_link + stock_line PR as a guide:
clinician_link
;clinician_link.id
String;clinician_link.name_id
String FK toclinician.id
clinician_link.id == clinician_link.name_id == clinician.id
for eachclinician
recordclinician_store_join.clinician_link_id
and removingclinician_store_join.name_id
clinician
at the repository layer to return relatedclinician
records based onclinician_store_join.clinician_link_id
rather thanclinician_store_join.clinician_id
Additional info
clinician_store_join
only has a "row" file, so not much to actually fix up for it directly! Main place it seems to be used is just for getting the clinicians for a particular store, which is inclinician.rs
: https://github.com/msupply-foundation/open-msupply/blob/28e5717f1796fa1901f500667433f8eb0741d6f9/server/repository/src/db_diesel/clinician.rs#L168-L171Describe alternatives you've considered π
Moneyworks Jobcode π§°
OMS:MERGE