PK.RSLTSET
@HDR,
@OPEN.OE,
@RESULT.TYPES,
@TRLR,
END;

HDR
"<?xml version="_D(34)_1.0_D(34)_" ?>"^!,
"<ReplyMessage>"^!,
"<TransactionId>0</TransactionId>"^!,
"<Status>Success</Status>"^!,
"<StatusDescription>Step returned a Success status.</StatusDescription>"^!,
"<Payload>"^!,
"<CodeSets>"^!

OPEN.OE
IF{/CONF[.results.depts] "populate from dictionary",
  @admdir,
  O(&,@misdict),
  O(:,@admdata),
  @oedir,
  O(*,@oedata),
  O(\,@oedict),
  @pkdir}

RESULT.TYPES
"<CodeSet>"^!,
"<CodeSetNumber>264</CodeSetNumber>"^!,
"<Codes>"^!,
IF{/CONF[.results.source]="lab" "do lab modules",
  ""^!,
  "<Display>Blood Bank</Display>"^!,
  "<Mnemonic>BBK</Mnemonic>"^!,
  "<Meaning>BBK</Meaning>"^!,
  ""^!,  
  ""^!,
  "<Display>Microbiology</Display>"^!,
  "<Mnemonic>MICRO</Mnemonic>"^!,
  "<Meaning>MICRO</Meaning>"^!,
  ""^!,
  ""^!,
  "<Display>Pathology</Display>"^!,
  "<Mnemonic>AP</Mnemonic>"^!,
  "<Meaning>AP</Meaning>"^!,
  ""^!,
  ""^!,
  "<Display>Radiology</Display>"^!,
  "<Mnemonic>RAD</Mnemonic>"^!,
  "<Meaning>RAD</Meaning>"^!,
  ""^!},
IF{/CONF[.results.depts] "do departments",
  DO{+\PDR[ggn]^ggn IF{'/CONF[.results.depts]["all"]&'/CONF[.results.depts][ggn];
  &GGN[ggn] ""^!,
  "<Display><![CDATA["_&GGN[ggn]|1_"]]></Display>"^!,
  "<Mnemonic><![CDATA["_"OE."_ggn_"]]></Mnemonic>"^!,
  "<Meaning><![CDATA["_"OE."_ggn_"]]></Meaning>"^!,
  ""^!}}},
"</Codes>"^!,
"<Key>"_/START_"</Key>"^!,
"</CodeSet>"^!

TRLR
"</CodeSets>"^!,
"</Payload>"^!,
"</ReplyMessage>"^!
