--- alias: meddev-feature-dcpreventchangereadings render_macros: false --- # Data Collection - Prevent User from Removing/Correcting Readings ## Overview In the current Data Collections module, there is no way to restrict removing or correcting previously posted reading values, there are use cases where operators must not change values previously posted on the same Data Collection instance. ### Concept The feature provides a mechanism to prevent change values previously posted on the same Data Collection instance and allow configuration administrators to enable or disable this restriction --- ## Enabling Prevent Change Readings To use Prevent Change Readings function, the following conditions should be followed: - Data Collection attribute `MedDevPreventChangeReadings` has been set to true. - If Data Collection attribute `OverridePreventChangeReadingsRole` has value, the current user should not belong to the role specified in `OverridePreventChangeReadingsRole`. ![Enable Prevent Change Readings](features.images/dcpreventchangereadings-enable.png) ## Example Scenario This section includes an example of data collection instance post data, the current user does not belong to the role specified in `OverridePreventChangeReadingsRole`. ### Scenario Setup In the example that follows, it is assumed that: - Data Collection attribute `MedDevPreventChangeReadings` has been set to true. - The current user does not belong to the role specified in `OverridePreventChangeReadingsRole`. ### Prevent Change Readings - Standard Post For this scenario, when user wants to post data with a changed or removed value on a PreventChangeReadings data collection: ![DC Set Role](features.images/dcpreventchangereadings-setrole.png) ![User Does't have Role](features.images/dcpreventchangereadings-notbelongrole.png) When the user attempts to post Data Collection Instance (Generic or Inspection) with a changed value for that data point, the system blocks the post and returns an error listing the affected data points (Parameter / Sample / Reading). ![Throw Error](features.images/dcpreventchangereadings-throwerror.png) ### Prevent Change Readings - Process Material For this scenario, when user wants to post data with a changed or removed value on a PreventChangeReadings Data Collection in a process Material operation: The material step should have a Data Collection, and the attribute configuration is as described above: ![Material Step DC](features.images/dcpreventchangereadings-materialstep.png) - The user can post data through Post Data button: ![Material Post Data](features.images/dcpreventchangereadings-materialpostdata.png) ![Material Post Data Page](features.images/dcpreventchangereadings-materialpostdatapage.png) When the user attempts to change or remove data points value, the system blocks the post and returns an error listing the affected data points (Parameter / Sample / Reading). ![Material Post Data Error](features.images/dcpreventchangereadings-materialpostdataerror.png) - The user can also post data when performing Track-Out operation. ![Material Track-Out](features.images/dcpreventchangereadings-materialtrackout.png) When the user attempts to change or remove data points value, the system blocks the post and returns an error listing the affected data points (Parameter / Sample / Reading). ![Material Track-Out Error](features.images/dcpreventchangereadingsmaterialtrackouterror.png)