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",
  "<Code>"^!,
  "<Display>Blood Bank</Display>"^!,
  "<Mnemonic>BBK</Mnemonic>"^!,
  "<Meaning>BBK</Meaning>"^!,
  "</Code>"^!,  
  "<Code>"^!,
  "<Display>Microbiology</Display>"^!,
  "<Mnemonic>MICRO</Mnemonic>"^!,
  "<Meaning>MICRO</Meaning>"^!,
  "</Code>"^!,
  "<Code>"^!,
  "<Display>Pathology</Display>"^!,
  "<Mnemonic>AP</Mnemonic>"^!,
  "<Meaning>AP</Meaning>"^!,
  "</Code>"^!,
  "<Code>"^!,
  "<Display>Radiology</Display>"^!,
  "<Mnemonic>RAD</Mnemonic>"^!,
  "<Meaning>RAD</Meaning>"^!,
  "</Code>"^!},
IF{/CONF[.results.depts] "do departments",
  DO{+\PDR[ggn]^ggn IF{'/CONF[.results.depts]["all"]&'/CONF[.results.depts][ggn];
  &GGN[ggn] "<Code>"^!,
  "<Display><![CDATA["_&GGN[ggn]|1_"]]></Display>"^!,
  "<Mnemonic><![CDATA["_"OE."_ggn_"]]></Mnemonic>"^!,
  "<Meaning><![CDATA["_"OE."_ggn_"]]></Meaning>"^!,
  "</Code>"^!}}},
"</Codes>"^!,
"<Key>"_/START_"</Key>"^!,
"</CodeSet>"^!

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