Read/Write Acces to user's place and user's person doc from config

In many situation we need to persist some data in the database in order to store current state instead of calculate it from whole report history
is there a way for a connected user to write to his place couchdb doc from tasks or maybe with a transition ? for example a chw to be able to write

{
"id": "9fa0bde7-4e31-4e82-9d5e-161aac18fdad",
"_rev": "5-42c0f5354ba34ad9077a27eed6102984",
"name": "ASC-YAPI AKAHOUA SYLVESTRE",
"role": "chw",
"stock":[
{"parecetamol_500'"425},
{"amoxiciline_125":25}
 ]

every time that the chw submits a stock_receipt or a prescription _summary report ?

Currently I do not think there is any clean way to do this in the CHT. Even just considering the what it might look like to add support for the feature gets pretty complex.

A new Sentinel transition would be an easy place, but it would not work in an offline context. Updating a doc with a client-side transition would work offline, but run the risk of syncing conflicts if the same doc was updated on different devices… (not to mention it could potentially be stale after the client syncs new data from the server)

Hopefully someone else has a better idea here!

Pending a resolution to the last 50 issue, I wonder if providing access to other contact’s contact-summary data (as being contemplated here) might be a viable alternative?

Pending a resolution to the last 50 issue, I wonder if providing access to other contact’s contact-summary data (as being contemplated here) might be a viable alternative?

No, the other question is in other scope, if a chw has less than 5 tablets of parecetamol avoid it to do a patient_assement, so the patient_assessment form needs the stock of the chw that is in the contact summary, no related to 50 doc limitation

In the other hand and related to 50 docs limit, it is this question, if I do not have access to all reports of a contact, but I’m able to write the current stock in the database the next time i will read the stock from the database do not need to have access to all older reports

but run the risk of syncing conflicts if the same doc was updated on different devices… (not to mention it could potentially be stale after the client syncs new data from the server)

Yes but even now we have the availibity to open with the contact form the contact doc of a chw_area (or other) in two devices and edit the doc and sync

And, maybe this is a very bad idea, but in the _search function of the angular service where the 50 limit is hard writen if we modify this code and we keep the 50 limit for other places and we allow only for c40_chw_area 500 docs, we recompile the cht-core and work with this limitation would we have a very bad user experience, low performance, because the 500 docs are now in the chw_area instead of 50 ?