Steps to reproduce
- Create a new Lab request in Tamanu
- Sync to Senaite
- Add results to new Sample
- Publish Sample
- Sync to Tamanu
- Invalidate the sample in Senaite - this will invalidate the old sample and needs to create a new duplicate sample
- Add results to new sample
- Republish
- Check the result have been updated in Tamanu
Current behaviour
The PDF is recreated with an invalidated value but the new raw data is not sent across.
Expected behaviour
We need the updated analysis result data of the newly created sample to be sent across (as Observations) - the diagnostic report associated with the original ServiceRequest.
For this, I think we should implement: DiagnosticReport.status = amended for any Sample that is invalidated and a new one created. See here: https://hl7.org/fhir/R4B/valueset-diagnostic-report-status.html
For any DiagnosticReport received with an amended status, Tamanu should check the dateTime and ensure that it is updated in Tamanu only if the modified datetime is updated is newer than that originally received. Theoretically samples could be invalidated an unlimited number of times and as as there is no garantee the tasks are handled in order Tamanu may receive an older result after a newer one.
Steps to reproduce
Current behaviour
The PDF is recreated with an invalidated value but the new raw data is not sent across.
Expected behaviour
We need the updated analysis result data of the newly created sample to be sent across (as Observations) - the diagnostic report associated with the original ServiceRequest.
For this, I think we should implement:
DiagnosticReport.status = amendedfor any Sample that is invalidated and a new one created. See here: https://hl7.org/fhir/R4B/valueset-diagnostic-report-status.htmlFor any DiagnosticReport received with an amended status, Tamanu should check the dateTime and ensure that it is updated in Tamanu only if the modified datetime is updated is newer than that originally received. Theoretically samples could be invalidated an unlimited number of times and as as there is no garantee the tasks are handled in order Tamanu may receive an older result after a newer one.