Batch active/inactive
Greetings...
Working on migrating our clinic to 2.0.
I spent the weekend writing a script that updates archetypes to our customized versions prior to archload. All seems to work well (if you haven't used xmlstarlet, I highly recommend it) except that I noticed that the active checkbox in Edit Product Batch is missing. Went roundy about this before seeing that it is a feature of 2.0. My understanding is that by default now, the active status of a batch number is controlled strictly by the batch expiry date. Is that correct?
If so, then not sure why this change was made. While something that is expired should be inactive, a batch number could be inactive simply because a new batch has been shipped to us. My understanding from the techs is that they have been inactivating a batch number once the stock is depleted... and this could be well before the expiry date. Not deactivating the batch would yield two active batch numbers when invoicing.
We did find the active checkbox useful, so just wondering if there would be any problems encountered in our setting hidden = "false" for it again. Or am I missing something here and there is some other way to remove an old batch number without fudging the expiry date.
Thanks,
Sam
Re: Batch active/inactive
The active field has always been hidden, and was part of the original 1.8 release:
You do raise a good point however. It shouldn't be necessary to fudge the expiry date to exclude batches that are no longer on the shelves.
Raised as https://openvpms.atlassian.net/browse/OVPMS-2044
Re: Batch active/inactive
OK, now I'm really confused (again)...
I did modify entity.batchProduct for our 1.9.2 some time ago to give us some more information for our vaccination certificates, but did not touch the active node. This is what we are currently seeing on the screen and using (see attached jpg) - note the visible active checkbox. And yet, when I look at the archetype in the OVPMS archetype editor, the active node is "hidden" (also see attached). My 1.9.2 entity.batchProduct.adl is also attached, and sure enough, shows the node as hidden=true. I would have inserted the .adl via the Import button and not through archload.
So I'm not sure why the checkbox is showing up. While we're glad that it has been appearing, I'm now not sure where it is coming from.
I do remember having issues with inactive batch numbers quite a while ago, but those were addressed though a code fix. And I'm not doing anything with that part of the code any more. My only code change now is for medical record order... so I don't think the issue is related to the old problem. But still not sure why with the same archetype file, I see the checkbox in 1.9.2, but don't see it in 2.0. That's why I thought it was a new 2.0 "feature".
If you don't see it causing any harm, I'm happy to just unhide the active checkbox in 2.0 and carry on as we have been. If you see problems with that approach... please let me know.
Thanks,
Sam
Re: Batch active/inactive
The reason you see the Active flag for Product Batches in 1.9 is due to a bug in the layout code that didn't exclude hidden nodes (see ArchetypeNodes).
This was corrected for 2.0.
You should be able to set hidden="false" and be OK.
Re: Batch active/inactive
Excellent. I'll modify my script.
Thanks again,
Sam