Difference between revisions of "learn:oncallAMP"
From MGH Learn Pathology
Line 1: | Line 1: | ||
− | {{#cargo_query:table=scheduleFACservice|fields=StaffAbbrev|where=YEAR(Date)={{#timel: Y|now }} AND scheduleFACservice.WeekNumber='{{#expr: {{#timel: W|now }} - 0}}' AND scheduleFACservice.DayNumber='7' AND TaskAbbrev='GI1'|format=template|template=text|no html}} | + | {{#vardefine:GIattending|{{#cargo_query:table=scheduleFACservice|fields=StaffAbbrev|where=YEAR(Date)={{#timel: Y|now }} AND scheduleFACservice.WeekNumber='{{#expr: {{#timel: W|now }} - 0}}' AND scheduleFACservice.DayNumber='7' AND TaskAbbrev='GI1'|format=template|template=text|no html}}}} |
+ | |||
+ | |||
+ | {{#vardefine:GIservice|{{#cargo_query:table=scheduleFACservice|fields=TaskAbbrev|where=YEAR(Date)={{#timel: Y|now }} AND scheduleFACservice.WeekNumber='{{#expr: {{#timel: W|now }} - 0}}' AND scheduleFACservice.DayNumber='7' AND StaffAbbrev='{{#var:GIattending}}'|format=template|template=text|no html}}}} | ||
+ | |||
+ | {{#var:GIservice}} | ||
+ | |||
+ | {{#cargo_query: table=scheduleFACservice,facultyMGH|join on=scheduleFACservice.StaffAbbrev=facultyMGH.copath_id | ||
+ | |fields=GROUP_CONCAT(scheduleFACservice.StaffAbbrev),scheduleFACservice.TaskAbbrev,GROUP_CONCAT(scheduleFACservice.StaffFullName),facultyMGH.pageid | ||
+ | |group by=scheduleFACservice.Color | ||
+ | |where=YEAR(Date)={{#time: Y|{{Timezone}}}} AND scheduleFACservice.TaskAbbrev='{{#explode:TaskAbbreviation|,|0}}' AND scheduleFACservice.DayNumber='{{#time:N|now}}' AND scheduleFACservice.WeekNumber='{{#expr: {{#time: W|{{Timezone}}}} - 0}}' | ||
+ | |default={{schtableempty|{{#explode:TaskAbbreviation|,|2}}}}|format=template|template=scheduleFaculty}} | ||