-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[new script] [programs] Copy data values from old data elements to new data elements on specific tracker program's program stage #67
base: development
Are you sure you want to change the base?
Conversation
Not sure on which section should I add an example of this script on the README |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In-line comments:
src/data/DataElementsD2Repository.ts
Outdated
filter: { id: { in: ids } }, | ||
}, | ||
}); | ||
|
||
const { dataElements } = await metadata$.getData(); | ||
const dataElements = (await metadata$.getData()).dataElements; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why that change? the original looks more declarative to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed to me also. I made the change while testing because it was more comfortable for me but I forgot to reverse it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good, code-wise!
📌 References
📝 Implementation
Added script in order to copy data values from certain program stage without modyifing old values. It should just add new data values with same properties but with the data element id as the target data element specified (from the pair specified)
Source_DE1 ➝ Target_DE3
Source_DE2 ➝ Target_DE4
🔥 Testing
PS.: add
--post
to send the payloadDocker:
docker.eyeseetea.com/ocg/dhis2-data:2.37.8-pro
Added tests using Copilot Edits: