openhealthcare / elcid-rfh

The elCID instance for the Royal Free
Other
1 stars 3 forks source link

Use the blood culture sets created*/updated*/previous_mrn for the isolates #1467

Open fredkingham opened 1 year ago

fredkingham commented 1 year ago

As discussed for the purposes of created/updated/previous_mrn the blood culture set and its related isolates are considered the same thing.

If a blood culture set and an isolate are merged, all of them should show the previous mrn field in the footer and the created/updated value.

If the blood culture isolate is updated or deleted, we should change the updated/previous_mrn fields on the set.

This PR does 5 things.

  1. Removes the TrackedModel field on the isolate and copies over the updated information from the isolate to the set if the isolate has been updated more recently.
  2. Changes the blood culture isolate form object to have the created/updated/previous_mrn information
  3. Changes the update_from_dict method on the isolate to update the set
  4. Changes the destroy method, so that if we delete an isolate the set is given a new updated timestamp and has the previous mrn removed
  5. Makes sure that after we save an isolate, the set is updated.

I have not added js tests as there are no tests for this. (Not a good reason but I'm happy to do tests as a seperate PR. I kinda feel this is big enough already.

This depends on https://github.com/openhealthcare/elcid-rfh/pull/1465 to show the created/updated/previous_mrn in the modal footer.