25.11 fb bsu rounds template#1654
Conversation
existing open case observation entry
…nto 25.7_fb_BehaviorRoundsDuplication
…at can be included in the current case.
…at can be included in the current case.
…ndsDuplication' into 25.11_fb_BSURoundsTemplate
|
WARNING: This PR appears to have the default title generated by GitHub. Please use something more descriptive. |
a new "Alopecia Regrowth" entry when "Alopecia Score" has a blank remark value.
labkey-martyp
left a comment
There was a problem hiding this comment.
Please see my comments.
| 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()); |
There was a problem hiding this comment.
I'm a little confused why you're inserting this manually. Isn't your feature to have this created automatically?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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'), |
There was a problem hiding this comment.
You're calling this against this.obsResults, which doesn't have this column in the selectRows column list above.
There was a problem hiding this comment.
thanks, I added that column to the query.
| //observation: row.getValue('observation'), | ||
| remark: row.getValue('remark') | ||
| }); | ||
| if (newobservation == "Alopecia Score" && newremark == null) { |
There was a problem hiding this comment.
It's possible to get newremark = "" here. I would add that to this if statement.
There was a problem hiding this comment.
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)){ |
There was a problem hiding this comment.
I understand you copied this over from EHR, but the parens are off here. == -1 should be outside indexOf()
There was a problem hiding this comment.
Thanks. I corrected the paren as you suggested
Provide a template tool to create an Alopecia score by uploading BSU open cases