USER
@USER.OPEN.PREFIXES,
@USER.HDR,
@USER.USERS,
@USER.PROVIDERS,
@USER.TRLR,
END;

USER.OPEN.PREFIXES
@misdir,
O(&,@misdict),
@pkdir

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

USER.USERS
"Y"^IS.USER,
""^gu,
DO{+&GU[gu]^gu IF{"Y"'=&GU[gu]|0;
&GU[gu]|13^ggg,
IF{ggg ggg^/DOC[ggg],&GGG[ggg]|1;&GU[gu]|1}^FULLNAME,
&GU[gu]MR|4^USERNAME,
IF{'USERNAME gu^USERNAME},
IF{ggg &GGG[ggg]UPD|0_.}_(&GU[gu]UPD|0)^UPDKEY,
@USER.PERSON}}

USER.PROVIDERS
"N"^IS.USER,
""^ggg,
DO{+&GGG[ggg]^ggg IF{/DOC[ggg];
"Y"'=&GGG[ggg]|0;
&GGG[ggg]|1^FULLNAME,
"PROVIDER."_ggg^USERNAME,
&GGG[ggg]UPD|0^UPDKEY,
@USER.PERSON}}

USER.PERSON
"<Prsnl>"^!,
"<FullName><![CDATA["_FULLNAME_"]]></FullName>"^!,
"<UserNumber>"_ggg_"</UserNumber>"^!,
"<Username>"_USERNAME_"</Username>"^!,
"<Position>"^!,
"<Display>"_IF{ggg "Provider";"User"}_"</Display>"^!,
IF{"Y"'=IS.USER;
"<PrsnlReltnTypes>"^!,
"<PrsnlReltnType>"^!,
"<Display>PatientKeeper</Display>"^!,
"<Mnemonic>PATIENTKEEPERDOC</Mnemonic>"^!,
"</PrsnlReltnType>"^!,
"</PrsnlReltnTypes>"^!},
"</Position>"^!,
"<Groups>"^!,
IF{&GGG[ggg]|14 "<Group>"^!,
"<Display><![CDATA["_&GGH[&GGG[ggg]|14]|1_"]]></Display>"^!,
"<Mnemonic><![CDATA[GRP."_&GGG[ggg]|14_"]]></Mnemonic>"^!,
"</Group>"^!},
""^FAC,
DO{+&GGG[ggg]FAC[FAC]^FAC IF{&GGG[ggg]FAC[FAC]|14^Q 1,
"<Group>"^!,
"<Display><![CDATA["_&GGH[Q]|1_"]]></Display>"^!,
"<Mnemonic><![CDATA[GRP."_Q_"]]></Mnemonic>"^!,
"</Group>"^!}},
""^GGH,
DO{+&GGG[ggg]P[GGH]^GGH "<Group>"^!,
"<Display><![CDATA["_&GGH[GGH]|1_"]]></Display>"^!,
"<Mnemonic><![CDATA[GRP."_GGH_"]]></Mnemonic>"^!,
"</Group>"^!},
"</Groups>"^!,
"<Key>"_UPDKEY_"</Key>"^!,
"</Prsnl>"^!

USER.TRLR
"</Prsnls>"^!,
"</Payload>"^!,
"</ReplyMessage>"^!
