Hi @Gassim
I have tried to find the source of the problem, but failed.
Moreover I have created the same situation on DHIS 2 Demo - Sierra Leone as the programs in version 40.3 were empty.
What to be achieved:
We have 2 organisations units groups: BADJIA_BAOMA and BB.
Depending on the orgUnit in some group we need to hide some program STAGES, in other word apply “prevent adding new events to stage” action type.
For the BADJIA_BAOMA orgunitgroup we need to hide stages: Diagnosis & treatment and Household investigation
For the BB orgunitgroup we need to hide stages: Case outcome and Diagnosis & treatment
For the first program rule: “Hide stage for BADJIA_BAOMA” it defined the orgUnit belongs to the BADJIA_BAOMA orgUnits Group and the result is below:
As you can see we have not exactly what we want.
Also I noticed the strange behaviour of the HIDEPROGRAMSTAGE action type, which can selectively hide or ignore stages.
Below the metadata to add into play instances (2.39 or 2.40)
{
“programRuleActions”: [
{
“created”: “2024-04-28T06:03:08.605”,
“programRule”: {
“id”: “uuYsMz7T2k6”
},
“programRuleActionType”: “HIDEPROGRAMSTAGE”,
“programStage”: {
“id”: “hYyB7FUS5eR”
},
“id”: “Dup2Mf8Lor3”
},
{
“created”: “2024-04-28T06:03:08.605”,
“programRule”: {
“id”: “ppi2vm1g0T8”
},
“programRuleActionType”: “HIDEPROGRAMSTAGE”,
“programStage”: {
“id”: “hYyB7FUS5eR”
},
“id”: “YwZn7pu992B”
},
{
“created”: “2024-04-28T06:03:08.605”,
“programRule”: {
“id”: “uuYsMz7T2k6”
},
“programRuleActionType”: “HIDEPROGRAMSTAGE”,
“programStage”: {
“id”: “eHvTba5ijAh”
},
“id”: “gseDGALK99B”
},
{
“created”: “2024-04-28T06:03:08.605”,
“programRule”: {
“id”: “ppi2vm1g0T8”
},
“programRuleActionType”: “HIDEPROGRAMSTAGE”,
“programStage”: {
“id”: “C0aLZo75dgJ”
},
“id”: “p6q2FhAL35h”
}
],
“organisationUnitGroups”: [
{
“code”: “BADJIA_BAOMA”,
“name”: “BADJIA_BAOMA”,
“created”: “2024-04-28T06:01:08.151”,
"sharing": {
"owner": "xE7jOejl9FI",
"external": false,
"users": {},
"userGroups": {},
"public": "rw------"
},
"id": "IZhMP5GYNcg",
"organisationUnits": [
{
"id": "ZpE2POxvl9P"
},
{
"id": "TSyzvBiovKh"
},
{
"id": "g8upMTyEZGZ"
},
{
"id": "MxKoMIVvl8b"
},
{
"id": "nX05QLraDhO"
},
{
"id": "azRICFoILuh"
},
{
"id": "Umh4HKqqFp6"
},
{
"id": "WAjjFMDJKcx"
},
{
"id": "KfUCAQoOIae"
},
{
"id": "pMEnu7BjqMz"
},
{
"id": "RzgSFJ9E46G"
},
{
"id": "bG0PlyD0iP3"
},
{
"id": "jNb63DIHuwU"
},
{
"id": "EuoA3Crpqts"
},
{
"id": "AnXoUM1tfNT"
},
{
"id": "DiszpKrYNg8"
},
{
"id": "egv5Es0QlQP"
}
]
},
{
"code": "BB",
"name": "Biriwa-Bombali",
"created": "2024-04-28T06:02:13.029",
"sharing": {
"owner": "xE7jOejl9FI",
"external": false,
"users": {},
"userGroups": {},
"public": "rw------"
},
"shortName": "BB",
"id": "Gu7iA32yvnJ",
"organisationUnits": [
{
"id": "gP6hn503KUX"
},
{
"id": "nDwbwJZQUYU"
},
{
"id": "OjTS752GbZE"
},
{
"id": "ZxuSbAmsLCn"
},
{
"id": "duGLGssecoD"
},
{
"id": "tEgxbwwrwUd"
},
{
"id": "C1zlHePEQe6"
},
{
"id": "OI0BQUurVFS"
},
{
"id": "dqHvtpUqLwB"
},
{
"id": "GQcsUZf81vP"
},
{
"id": "OuwX8H2CcRO"
},
{
"id": "XzmWizbR343"
},
{
"id": "wzvDhS0TkAF"
},
{
"id": "mepHuAA9l51"
},
{
"id": "aQoqXL4cZaF"
},
{
"id": "mt47bcb0Rcj"
},
{
"id": "wNYYRm2c9EK"
},
{
"id": "PybxeRWVSrI"
},
{
"id": "uNEhNuBUr0i"
},
{
"id": "Dbn6fyCgMBV"
},
{
"id": "Uwcj0mz78BV"
},
{
"id": "LZclRdyVk1t"
},
{
"id": "cgqkFdShPzg"
},
{
"id": "ObV5AR1NECl"
},
{
"id": "E7IDb3nNiW7"
}
]
}
],
"programRules": [
{
"name": "Hide stage for BADJIA_BAOMA",
"created": "2024-04-28T06:03:08.614",
"program": {
"id": "qDkgAbB5Jlk"
},
"programRuleActions": [
{
"id": "p6q2FhAL35h"
},
{
"id": "YwZn7pu992B"
}
],
"condition": "d2:inOrgUnitGroup( 'BADJIA_BAOMA' )",
"id": "ppi2vm1g0T8"
},
{
"name": "Hide stage for Bombali ",
"created": "2024-04-28T06:03:56.606",
"program": {
"id": "qDkgAbB5Jlk"
},
"programRuleActions": [
{
"id": "gseDGALK99B"
},
{
"id": "Dup2Mf8Lor3"
}
],
"condition": "d2:inOrgUnitGroup( 'BB' )",
"id": "uuYsMz7T2k6"
}
]
}
Could you have a look please?
Thank you