Hi team,
i have an expression rule to get the doctors with count of patients assigned to them with the disease but i want to get the total patience count for that particular doctor with array of disease like eg:
swift:3:{cance,Gallstones,Emotional Disorder}, Please help me to achieve this format
substitute(substitute(substitute(substitute( substitute( substitute( a!queryEntity( entity: cons!PO_MEDICALINFO, query: a!query( logicalexpression: a!queryLogicalExpression( operator: "AND", filters: { a!queryFilter( field: "reasonForVisit", operator: "in", value:ri!reasonForVisit ), a!queryFilter( field:"appointmentDate", operator: "between", value: { todatetime(ri!createddatefrom), todatetime(ri!createddateto) }, applywhen: and( not(rule!APN_isEmpty(ri!createddatefrom)), not(rule!APN_isEmpty(ri!createddateto))) ), }, ignorefilterswithemptyvalues: true() ), aggregation: a!queryAggregation( aggregationColumns: { a!queryAggregationColumn( field: "reportingDoctor", isGrouping: true, ), a!queryAggregationColumn( field: "patientId", alias:"patientCount", aggregationFunction:"COUNT" ), a!queryAggregationColumn( field: "reasonForVisit", isGrouping: true ) }, ), pagingInfo: a!pagingInfo( startIndex: 1, batchSize: -1, sort: a!sortInfo( field: "patientCount", ascending: true() ) ) ), fetchTotalCount: true ).data,"patientCount",""),"reportingDoctor:",""),",",""),"[",""),"]",""),"reasonForVisit","")
Discussion posts and replies are publicly visible
thank you ajhick it helped me a lot, but in the end I have used a dummy CDT to pass my values into the grid
thanks you vimalkumars
ajhick said:Especially as I abstract away nested indexes into a rule I stole from Stefan
This principle works fine until you inherit a large project developed hastily by mainly junior devs who left behind dozens of interfaces with 5-layer-deep-nested index() calls (some of which being indexes and some of which being properties). Trust me that it becomes a significant pain, both to read and to untangle.
Given that using the name-appropriate rule (since there is one, though no idea why this is news to so many people), has at least "slight" advantages in readability, and literally no disadvantages, I see no reason to endorse having developers continue writing unclear code just to save from typing an extra 2 letters for their function call.