PK.CODESETLABS
"CODESETLABS.SETUP",@1,
"CODESETLABS.NORMALCY",@3,
"CODESETLABS.COMPLETED",@5,
"CODESETLABS.TEARDOWN",@2,
END;

[1]::CODESETLABS.SETUP
%open("LAB"),
&(S1)SPARAM|4^LABNORMS.HI,
&(S1)SPARAM|5^LABNORMS.LO,
&(S1)SPARAM|6^LABNORMS.CRIT.HI,
&(S1)SPARAM|7^LABNORMS.CRIT.LO,
&(S1)SPARAM|11^LABNORMS.DELTA,
&(S1)SPARAM|8^LABNORMS.ALPHA.HI,
&(S1)SPARAM|20^LABNORMS.ALPHA.LO;

[2]::CODESETLABS.TEARDOWN
"nothing to do";

[3]::CODESETLABS.NORMALCY
"<CodeSet>"^!,
"<CodeSetNumber>7</CodeSetNumber>"^!,
"<CodeSetName>NormalcyStatus</CodeSetName>"^!,
"<Codes>"^!,
"High"^disp,
  LABNORMS.HI^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Low"^disp,
  LABNORMS.LO^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"High Critical"^disp,
  LABNORMS.CRIT.HI^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Low Critical"^disp,
  LABNORMS.CRIT.LO^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Delta Check"^disp,
  LABNORMS.DELTA^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Delta Check High"^disp,
  LABNORMS.DELTA_LABNORMS.HI^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Delta Check Low"^disp,
  LABNORMS.DELTA_LABNORMS.LO^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Delta Check High Critical"^disp,
  LABNORMS.DELTA_LABNORMS.CRIT.HI^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Delta Check Low Critical"^disp,
  LABNORMS.DELTA_LABNORMS.CRIT.LO^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Alpha Abnormal High"^disp,
  LABNORMS.ALPHA.HI^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Alpha Abnormal Low"^disp,
  LABNORMS.ALPHA.LO^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"Normal"^disp,
  "NORMAL"^mnem,
  "CODESETLABS.NORMALCY.VALUE",@4,
"</Codes>"^!,
"<Key/>"^!,
"</CodeSet>"^!;

[4]::CODESETLABS.NORMALCY.VALUE
IF{/NORMALCY.LIST[mnem];
   1^/NORMALCY.LIST[mnem],
   ""^!,
   "<Display><![CDATA["_disp_"]]></Display>"^!,
   "<Mnemonic><![CDATA[NORMALCY."_mnem_"]]></Mnemonic>"^!,
   "<Meaning><![CDATA["_disp_"]]></Meaning>"^!,
   ""^!};

[5]::CODESETLABS.COMPLETED
"<CodeSet>"^!,
"<CodeSetNumber>8</CodeSetNumber>"^!,
"<CodeSetName>Completed Status</CodeSetName>"^!,
"<Codes>"^!,
""^!,
"<Display>Cancelled</Display>"^!,
"<Mnemonic>COMPLETED.CAN</Mnemonic>"^!,
"<Meaning>Cancelled</Meaning>"^!,
""^!,
""^!,
"<Display>Ordered</Display>"^!,
"<Mnemonic>COMPLETED.ORD</Mnemonic>"^!,
"<Meaning>Ordered</Meaning>"^!,
""^!,
""^!,
"<Display>Collection Batch</Display>"^!,
"<Mnemonic>COMPLETED.COLB</Mnemonic>"^!,
"<Meaning>Collection Batch</Meaning>"^!,
""^!,
""^!,
"<Display>Received</Display>"^!,
"<Mnemonic>COMPLETED.RECD</Mnemonic>"^!,
"<Meaning>Received</Meaning>"^!,
""^!,
""^!,
"<Display>Worksheet</Display>"^!,
"<Mnemonic>COMPLETED.WKST</Mnemonic>"^!,
"<Meaning>Worksheet</Meaning>"^!,
""^!,
""^!,
"<Display>Unverified</Display>"^!,
"<Mnemonic>COMPLETED.UNV</Mnemonic>"^!,
"<Meaning>Unverified</Meaning>"^!,
""^!,
""^!,
"<Display>Resulted</Display>"^!,
"<Mnemonic>COMPLETED.RES</Mnemonic>"^!,
"<Meaning>Resulted</Meaning>"^!,
""^!,
""^!,
"<Display>Completed</Display>"^!,
"<Mnemonic>COMPLETED.COMP</Mnemonic>"^!,
"<Meaning>Complete</Meaning>"^!,
""^!,
"</Codes>"^!,
"<Key/>"^!,
"</CodeSet>"^!;
