sqlstored-proceduresintersystems-cache

Dividing data -cache


[report]1

the attached code shows the result of each ward and it works well. I want just to divide the 5c ward into two wards in the report while it is one ward in the system. this ward is a mixed ward(5c) and I want to calculate the beds differently. I want to separate the beds of the 5c ward into two wards (5c-pediatric which has the first 6 beds of 5c and 5c-surgery which has the last 6 beds of 5c). I tried but I could not.

the the below shows each ward data. the desired report is to divide only 5c ward into 2 wards, we differeante the beds by the name if the bed name has pediatric means belong to pediatric and if the bed name has surgey means the bed belong to surgey

[the output of report]2


Solution

  • This question is more related to the internal InterSystems TrakCare structures rather than general SQL. Given the query you have you can't divide a ward into two because your query will return ward IDs and all further processing is done inside GetTotalRegular and ProcessData procedures presumably based on current ward ID. So you need to look into what those procedures are doing and in case of ward 5C process bed data into two rows or temporary globals rather than just one.