@.sd^/START,
IF{>/CONF[.notes.nursing.cats]#0S=.notes.nursing.cats 1,
   %open("NUR"),
   ^&(N)^nurdict},
IF{>/CONF[.notes.rad.depts]#0S=.notes.rad.depts 1,
   %open("RAD"),
   ^&(R)^raddict},
"HDR",@1,
"NOTES",@2,
"TRLR",@3,
END;

[1]::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>"^!;

[2]::NOTES
""^Q,
"<CodeSet>"^!,
"<CodeSetNumber>264</CodeSetNumber>"^!,
"<Codes>"^!,
IF{nurdict 1,
   DO{+[nurdict]NOC[nnc]^nnc 1,
      IF{('/CONF[.notes.nursing.cats]["all"])&('/CONF[.notes.nursing.cats][nnc]);
      ""^!,
      "<Display><![CDATA["_[nurdict]NOC[nnc]|1_"]]></Display>"^!,
      "<Mnemonic><![CDATA["_"NUR."_nnc_"]]></Mnemonic>"^!,
      "<Meaning><![CDATA["_"NUR."_nnc_"]]></Meaning>"^!,
      ""^!}}},
IF{raddict 1,
   DO{>[raddict]RD[rd]^rd 1,
      IF{("N"=&(R)RD[rd]|3)&("Y"=&(R)RD[rd]|0) "not rad & active",
         IF{('/CONF[.notes.rad.depts]["all"])&('/CONF[.notes.rad.depts][rd]);
            ""^!,
            "<Display><![CDATA["_[raddict]RD[rd]|1_"]]></Display>"^!,
            "<Mnemonic><![CDATA["_"RAD."_rd_"]]></Mnemonic>"^!,
            "<Meaning><![CDATA["_"RAD."_rd_"]]></Meaning>"^!,
            ""^!}}}},
""^!,
"<Display>Other Notes</Display>"^!,
"<Mnemonic>OTHER</Mnemonic>"^!,
"<Meaning>OTHER</Meaning>"^!,
""^!,
"</Codes>"^!,
"<Key>"_/START_"</Key>"^!,
"</CodeSet>"^!;

[3]::TRLR
"</CodeSets>"^!,
"</Payload>"^!,
"</ReplyMessage>"^!;
