Some hints about how obsnow, obsprev, and obsany functions work, plus the often misunderstood obsnow (default previous) connection setting.
1) OBSANY - returns either the current value in the update or the last signed value from a previous update. The key here is the signed part, meaning if you have a chart with one or more unsigned documents, it may be possible to not bring forward the most 'recent' value. This is by design as unsigned data is not permanent and can be changed in the associated update until it is signed. If data is not a permanent part of the chart, in most circumstances it should not be allowed to be brought forward into a later update. There are exceptions, of course, but I would suggest running it by your legal team before employing them, especially with forensic database auditing being added to malpractice investigations.
2) OBSPREV - returns the last signed obsterm value, similar to obsany - same concerns apply.
3) OBSNOW - returns the current value assigned to the obsterm in an unsigned status.
4) OBSNOW (default previous) - behaves like OBSANY with one critical difference - if the OBSNOW value is exactly the same as OBSPREV value, the obsterm is NOT updated meaning the OBSPREV value remains the last data of record. This connection is popular since it permits review of the previous data without user interaction, however it makes documenting collected but unchanged data a bit more involved. There are two common methods of forcing the value to update using the same value via MEL code:
- Use an OBSNOW connection and an action button to push the obsprevious value to it. This is the simplest approach but does not offer easy review of the previous value. Adding a data display or additional code that permits review prior to insertion may be desired.
- When storing the new value in the connection, also send a 'OBSMODIFIERNOW' command along with it. Care must be taken to only send this command once and it is a tedious manual process to remove it, so care must be taken to activate it. Due to the challenges associated with this approach, it is less desirable, but it is a viable option in some instances.
Hope this helps.
Posted : October 24, 2016 1:09 am