Skip to content

25.11 fb bsu rounds template#1654

Open
Ohsudev wants to merge 18 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_BSURoundsTemplate
Open

25.11 fb bsu rounds template#1654
Ohsudev wants to merge 18 commits intorelease25.11-SNAPSHOTfrom
25.11_fb_BSURoundsTemplate

Conversation

@Ohsudev
Copy link
Copy Markdown
Collaborator

@Ohsudev Ohsudev commented Mar 13, 2026

Provide a template tool to create an Alopecia score by uploading BSU open cases

@Ohsudev Ohsudev requested a review from kollil March 13, 2026 16:36
@github-actions
Copy link
Copy Markdown

WARNING: This PR appears to have the default title generated by GitHub. Please use something more descriptive.

Copy link
Copy Markdown
Contributor

@labkey-martyp labkey-martyp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments.

Comment on lines +1803 to 1812
Map<String, Object> row2 = new HashMap<>();
row2.put("Id", SUBJECTS[0]);
row2.put("category", "Alopecia Regrowth");
row2.put("date", prepareDate(new Date(), -4, 0));
row2.put("caseid", caseId);
row2.put("observation", "Yes");
row2.put("objectid", generateGUID());
row2.put("taskid", generateGUID()); //required for latestObservationsForCase.sql to work
insertRowsCommand.addRow(row2);
insertRowsCommand.execute(getApiHelper().getConnection(), getContainerPath());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a little confused why you're inserting this manually. Isn't your feature to have this created automatically?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally, when BSU open cases are loaded onto the form their entries appear on the main entry form. I updated the program so that every instances of "Alopecia Score", and they have
no remark information associated those entries I rewrote the program so that an "Alopecia Regrowth" will
be added automatically on the main form for every "Alopecia Score" instances that appear on the main
form.
For example: 34567 4/3/2026. Alopecia Score No remark showing}. ---> original part of open case entry
34567. 4/3/3026. Alopecia Regrowth ---> this part gets added when open case are added
on the main form.

That example repeats on the main form for BSU Prime users to enter the appropriate values. They will both
contain the same task id, and same case id for both, its just "Alopecia Reqrowth" was programmed to be included to that set.

row2.put("caseid", caseId);
row2.put("observation", "Yes");
row2.put("objectid", generateGUID());
row2.put("taskid", generateGUID()); //required for latestObservationsForCase.sql to work
Copy link
Copy Markdown
Contributor

@labkey-martyp labkey-martyp Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comment above about the purpose of this test code. But if I'm misunderstanding and you do need it, I assume you would want the same taskid on this row as the row above so they show in the same form.

caseid: row.getValue('caseid'),
category: row.getValue('category'),
area: row.getValue('area'),
allProblemCategories:row.getValue('allProblemCategories'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're calling this against this.obsResults, which doesn't have this column in the selectRows column list above.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, I added that column to the query.

//observation: row.getValue('observation'),
remark: row.getValue('remark')
});
if (newobservation == "Alopecia Score" && newremark == null) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to get newremark = "" here. I would add that to this if statement.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added that line you suggested to "if" structure.

var distinctCaseIds = [];
if (caseRecords && caseRecords.length){
Ext4.Array.forEach(caseRecords, function(cr){
if (distinctCaseIds.indexOf(cr.get('caseid') == -1)){
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand you copied this over from EHR, but the parens are off here. == -1 should be outside indexOf()

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I corrected the paren as you suggested

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants