GMTSP144 ;ISP/RFR - Post Install GMTS*2.7*144 ;Jul 26, 2023@14:16
;;2.7;Health Summary;**144**;Oct 20, 1995;Build 17
Q
POST ;POST-INSTALL ITEMS
D CI
N GMTSTYS,GMTSTI,GMTSINST
S GMTSTYS="TYPEPRO;TYPEGEN;TYPESO;OBJPRO;OBJGEN;OBJSO"
F GMTSTI=1:1 Q:'$L($P(GMTSTYS,";",GMTSTI)) D Q:'$G(GMTSINST)
.S GMTSINST=$$INSDATA^GMTSXPD6($P(GMTSTYS,";",GMTSTI),"GMTSP144")
Q
CI ; Component Install/Update
N GMTSIN,GMTSLIM,GMTSINST,GMTSTL,GMTSINST,GMTSTOT,GMTSBLD,GMTSCPS,GMTSCP
N GMTSCI
S GMTSCPS="DEMP;DEMG"
F GMTSCI=1:1 Q:'$L($P(GMTSCPS,";",GMTSCI)) D
. S GMTSCP=$P(GMTSCPS,";",GMTSCI) K GMTSIN
. D ARRAY Q:'$D(GMTSIN)
. I $L($G(GMTSIN("TIM"))),+($G(GMTSIN(0)))>0 S GMTSLIM(+($G(GMTSIN(0))),"TIM")=$G(GMTSIN("TIM"))
. I $L($G(GMTSIN("OCC"))),+($G(GMTSIN(0)))>0 S GMTSLIM(+($G(GMTSIN(0))),"OCC")=$G(GMTSIN("OCC"))
. S GMTSINST=$$ADD^GMTSXPD1(.GMTSIN),GMTSTOT=+($G(GMTSTOT))+($G(GMTSINST))
N GMTSO,GMTSN,GMTSNAMES,GMTSNAME
S GMTSO("IEN")=272
S GMTSNAMES("MAS DEMOGRAPHICS OTHER")="CDEM"
S GMTSNAMES("MAS DEM. SEXUAL ORIENTATION")="DEMS"
S GMTSN("NAME")="MAS DEM SEXUAL ORIENTATION",GMTSN("ABBR")="DEMS"
S GMTSNAME="" F S GMTSNAME=$O(GMTSNAMES(GMTSNAME)) Q:GMTSNAME="" D
.I GMTSNAME'=$P($G(^GMT(142.1,GMTSO("IEN"),0)),U,1) Q
.S GMTSO("NAME")=GMTSNAME,GMTSO("ABBR")=GMTSNAMES(GMTSNAME)
.S GMTSINST=$$RENAME^GMTSXPD1(.GMTSO,.GMTSN)
N GMTSFDA,GMTSERROR,GMTSMESSAGE,GMTSLINE
D BMES^XPDUTL(" Adding DEFAULT HEADER value to "_GMTSN("NAME")_"...")
S GMTSFDA(142.1,GMTSO("IEN")_",",9)="Sexual Orientation"
D FILE^DIE("E","GMTSFDA","GMTSERROR")
I $D(GMTSERROR) D
.D MSG^DIALOG("WE",.GMTSMESSAGE,($G(IOM,80)-7),,"GMTSERROR")
.D MES^XPDUTL(" Error:")
.F GMTSLINE=1:1:GMTSMESSAGE D
..D MES^XPDUTL(" "_GMTSMESSAGE(GMTSLINE))
I '$D(GMTSERROR) D MES^XPDUTL(" Successfully updated the value")
; Rebuild Ad Hoc Health Summary Type
D:+($G(GMTSTOT))>0 BUILD^GMTSXPD3
D LIM
I +$$ROK("GMTSXPS1")>0 D
. N GMTSHORT S GMTSHORT=1,GMTSINST="",GMTSBLD="GMTS*2.7*144" D SEND^GMTSXPS1
Q
ARRAY ; Build Array
K GMTSIN N GMTSI,GMTSTXT,GMTSEX,GMTSFLD,GMTSUB,GMTSVAL,GMTSPDX S GMTSPDX=1,GMTSCP=$G(GMTSCP) Q:'$L(GMTSCP)
F GMTSI=1:1 D Q:'$L(GMTSTXT)
. S GMTSTXT="",GMTSEX="S GMTSTXT=$T("_GMTSCP_"+"_GMTSI_")" X GMTSEX S:$L(GMTSTXT,";")'>3 GMTSTXT="" Q:'$L(GMTSTXT)
. S GMTSFLD=$P(GMTSTXT,";",2),GMTSUB=$P(GMTSTXT,";",3),GMTSVAL=$P(GMTSTXT,";",4)
. S:$E(GMTSFLD,1)=1&(+GMTSFLD<2) GMTSVAL=$P(GMTSTXT,";",4,5)
. S:$E(GMTSFLD,1)=" "!('$L(GMTSFLD)) GMTSTXT="" Q:GMTSTXT=""
. S:$L(GMTSFLD)&('$L(GMTSUB)) GMTSIN(GMTSFLD)=GMTSVAL Q:$L(GMTSFLD)&('$L(GMTSUB)) S:$L(GMTSFLD)&($L(GMTSUB)) GMTSIN(GMTSFLD,GMTSUB)=GMTSVAL
. S:$G(GMTSFLD)=7&(+($G(GMTSUB))>0) GMTSPDX=0
K:+($G(GMTSPDX))=0 GMTSIN("PDX")
Q
LIM ; Limits
N GMTSI,GMTST,GMTSO,GMTSA S GMTSI=0 F S GMTSI=$O(GMTSLIM(GMTSI)) Q:+GMTSI=0 D
. S GMTSA=$P($G(^GMT(142.1,+($G(GMTSI)),0)),"^",3),GMTST=$G(GMTSLIM(+GMTSI,"TIM")) S:'$L(GMTST) GMTST=$S(GMTSA="Y ":"1Y ",1:"")
. S GMTSA=$P($G(^GMT(142.1,+($G(GMTSI)),0)),"^",5),GMTSO=$G(GMTSLIM(+GMTSI,"OCC")) S:'$L(GMTSO) GMTSO=$S(GMTSA="Y ":"10 ",1:"")
. D TO^GMTSXPD3(GMTSI,GMTST,GMTSO)
Q
ROK(X) ; Routine OK
S X=$G(X) Q:'$L(X) 0 N GMTSEX,GMTSTXT S GMTSEX="S GMTSTXT=$T(+1^"_X_")" X GMTSEX
Q:'$L(GMTSTXT) 0 Q 1
;
DEMP ; Pronoun(s) Component Data
;0;;273
;.01;;MAS DEMOGRAPHICS PRONOUNS
;1;;PRONOUN;GMTSDEMC
;1.1;;1
;1.1;1;
;2;;
;3;;DEMP
;3.5;;1
;3.5;1;This component displays a patient's pronouns.
;4;;
;5;;
;6;;
;7;;0
;8;;
;9;;Pronoun(s)
;10;;
;11;;
;12;;
;13;;VA
;14;;
;PDX;;1
;
Q
;
DEMG ; Gender Identity Component Data
;0;;274
;.01;;MAS DEMOGRAPHICS GENDER ID
;1;;SIGI;GMTSDEMC
;1.1;;1
;1.1;1;
;2;;
;3;;DEMG
;3.5;;1
;3.5;1;This component displays a patient's self-identified gender identity.
;4;;
;5;;
;6;;
;7;;0
;8;;
;9;;Gender Identity
;10;;
;11;;
;12;;
;13;;VA
;14;;
;PDX;;1
;
Q
;
TYPEPRO ;Pronouns Type Data
;;142;.01;VA-MAS DEM PRONOUNS
;;142;.08;no
;;142.01;.01;5
;;142.01;1;MAS DEMOGRAPHICS PRONOUNS
;;142.01;5;Pronoun(s)
;;
Q
;
TYPEGEN ;Gender Identity Type Data
;;142;.01;VA-MAS DEM GENDER IDENTITY
;;142;.08;no
;;142.01;.01;5
;;142.01;1;MAS DEMOGRAPHICS GENDER ID
;;142.01;5;Gender Identity
;;
Q
;
TYPESO ;Sexual Orientation Type Data
;;142;.01;VA-MAS DEM SEXUAL ORIENTATION
;;142;.08;no
;;142.01;.01;5
;;142.01;1;MAS DEM SEXUAL ORIENTATION
;;142.01;5;Sexual Orientation
;;
Q
;
OBJPRO ;Pronouns Object Data
;;142.5;.01;VA-MAS DEM PRONOUNS (TIU)
;;142.5;.03;VA-MAS DEM PRONOUNS
;;142.5;.05;NO
;;142.5;.06;YES
;;142.5;.07;NO
;;142.5;.08;NO
;;142.5;.09;NO
;;142.5;.1;NO
;;142.5;.11;NO
;;142.5;.12;NO
;;142.5;.13;NO
;;142.5;.14;NO
;;142.5;.15;NO
;;142.5;.16;NO
;;142.5;1;This object displays the patient's preferred pronoun(s).
;;
Q
;
OBJGEN ;Gender Identity Object Data
;;142.5;.01;VA-MAS DEM GENDER IDENTITY (TIU)
;;142.5;.03;VA-MAS DEM GENDER IDENTITY
;;142.5;.05;NO
;;142.5;.06;YES
;;142.5;.07;NO
;;142.5;.08;NO
;;142.5;.09;NO
;;142.5;.1;NO
;;142.5;.11;NO
;;142.5;.12;NO
;;142.5;.13;NO
;;142.5;.14;NO
;;142.5;.15;NO
;;142.5;.16;NO
;;142.5;1;This object displays the patient's self-identified gender identity.
;;
Q
;
OBJSO ;Sexual Orientation Object Data
;;142.5;.01;VA-MAS DEM SEXUAL ORIENTATION (TIU)
;;142.5;.03;VA-MAS DEM SEXUAL ORIENTATION
;;142.5;.05;NO
;;142.5;.06;YES
;;142.5;.07;NO
;;142.5;.08;NO
;;142.5;.09;NO
;;142.5;.1;NO
;;142.5;.11;NO
;;142.5;.12;NO
;;142.5;.13;NO
;;142.5;.14;NO
;;142.5;.15;NO
;;142.5;.16;NO
;;142.5;1;This object displays the patient's current and historical sexual
;;142.5;1;orientations.
;;
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMTSP144 5797 printed Dec 13, 2024@01:58:48 Page 2
GMTSP144 ;ISP/RFR - Post Install GMTS*2.7*144 ;Jul 26, 2023@14:16
+1 ;;2.7;Health Summary;**144**;Oct 20, 1995;Build 17
+2 QUIT
POST ;POST-INSTALL ITEMS
+1 DO CI
+2 NEW GMTSTYS,GMTSTI,GMTSINST
+3 SET GMTSTYS="TYPEPRO;TYPEGEN;TYPESO;OBJPRO;OBJGEN;OBJSO"
+4 FOR GMTSTI=1:1
if '$LENGTH($PIECE(GMTSTYS,";",GMTSTI))
QUIT
Begin DoDot:1
+5 SET GMTSINST=$$INSDATA^GMTSXPD6($PIECE(GMTSTYS,";",GMTSTI),"GMTSP144")
End DoDot:1
if '$GET(GMTSINST)
QUIT
+6 QUIT
CI ; Component Install/Update
+1 NEW GMTSIN,GMTSLIM,GMTSINST,GMTSTL,GMTSINST,GMTSTOT,GMTSBLD,GMTSCPS,GMTSCP
+2 NEW GMTSCI
+3 SET GMTSCPS="DEMP;DEMG"
+4 FOR GMTSCI=1:1
if '$LENGTH($PIECE(GMTSCPS,";",GMTSCI))
QUIT
Begin DoDot:1
+5 SET GMTSCP=$PIECE(GMTSCPS,";",GMTSCI)
KILL GMTSIN
+6 DO ARRAY
if '$DATA(GMTSIN)
QUIT
+7 IF $LENGTH($GET(GMTSIN("TIM")))
IF +($GET(GMTSIN(0)))>0
SET GMTSLIM(+($GET(GMTSIN(0))),"TIM")=$GET(GMTSIN("TIM"))
+8 IF $LENGTH($GET(GMTSIN("OCC")))
IF +($GET(GMTSIN(0)))>0
SET GMTSLIM(+($GET(GMTSIN(0))),"OCC")=$GET(GMTSIN("OCC"))
+9 SET GMTSINST=$$ADD^GMTSXPD1(.GMTSIN)
SET GMTSTOT=+($GET(GMTSTOT))+($GET(GMTSINST))
End DoDot:1
+10 NEW GMTSO,GMTSN,GMTSNAMES,GMTSNAME
+11 SET GMTSO("IEN")=272
+12 SET GMTSNAMES("MAS DEMOGRAPHICS OTHER")="CDEM"
+13 SET GMTSNAMES("MAS DEM. SEXUAL ORIENTATION")="DEMS"
+14 SET GMTSN("NAME")="MAS DEM SEXUAL ORIENTATION"
SET GMTSN("ABBR")="DEMS"
+15 SET GMTSNAME=""
FOR
SET GMTSNAME=$ORDER(GMTSNAMES(GMTSNAME))
if GMTSNAME=""
QUIT
Begin DoDot:1
+16 IF GMTSNAME'=$PIECE($GET(^GMT(142.1,GMTSO("IEN"),0)),U,1)
QUIT
+17 SET GMTSO("NAME")=GMTSNAME
SET GMTSO("ABBR")=GMTSNAMES(GMTSNAME)
+18 SET GMTSINST=$$RENAME^GMTSXPD1(.GMTSO,.GMTSN)
End DoDot:1
+19 NEW GMTSFDA,GMTSERROR,GMTSMESSAGE,GMTSLINE
+20 DO BMES^XPDUTL(" Adding DEFAULT HEADER value to "_GMTSN("NAME")_"...")
+21 SET GMTSFDA(142.1,GMTSO("IEN")_",",9)="Sexual Orientation"
+22 DO FILE^DIE("E","GMTSFDA","GMTSERROR")
+23 IF $DATA(GMTSERROR)
Begin DoDot:1
+24 DO MSG^DIALOG("WE",.GMTSMESSAGE,($GET(IOM,80)-7),,"GMTSERROR")
+25 DO MES^XPDUTL(" Error:")
+26 FOR GMTSLINE=1:1:GMTSMESSAGE
Begin DoDot:2
+27 DO MES^XPDUTL(" "_GMTSMESSAGE(GMTSLINE))
End DoDot:2
End DoDot:1
+28 IF '$DATA(GMTSERROR)
DO MES^XPDUTL(" Successfully updated the value")
+29 ; Rebuild Ad Hoc Health Summary Type
+30 if +($GET(GMTSTOT))>0
DO BUILD^GMTSXPD3
+31 DO LIM
+32 IF +$$ROK("GMTSXPS1")>0
Begin DoDot:1
+33 NEW GMTSHORT
SET GMTSHORT=1
SET GMTSINST=""
SET GMTSBLD="GMTS*2.7*144"
DO SEND^GMTSXPS1
End DoDot:1
+34 QUIT
ARRAY ; Build Array
+1 KILL GMTSIN
NEW GMTSI,GMTSTXT,GMTSEX,GMTSFLD,GMTSUB,GMTSVAL,GMTSPDX
SET GMTSPDX=1
SET GMTSCP=$GET(GMTSCP)
if '$LENGTH(GMTSCP)
QUIT
+2 FOR GMTSI=1:1
Begin DoDot:1
+3 SET GMTSTXT=""
SET GMTSEX="S GMTSTXT=$T("_GMTSCP_"+"_GMTSI_")"
XECUTE GMTSEX
if $LENGTH(GMTSTXT,";")'>3
SET GMTSTXT=""
if '$LENGTH(GMTSTXT)
QUIT
+4 SET GMTSFLD=$PIECE(GMTSTXT,";",2)
SET GMTSUB=$PIECE(GMTSTXT,";",3)
SET GMTSVAL=$PIECE(GMTSTXT,";",4)
+5 if $EXTRACT(GMTSFLD,1)=1&(+GMTSFLD<2)
SET GMTSVAL=$PIECE(GMTSTXT,";",4,5)
+6 if $EXTRACT(GMTSFLD,1)=" "!('$LENGTH(GMTSFLD))
SET GMTSTXT=""
if GMTSTXT=""
QUIT
+7 if $LENGTH(GMTSFLD)&('$LENGTH(GMTSUB))
SET GMTSIN(GMTSFLD)=GMTSVAL
if $LENGTH(GMTSFLD)&('$LENGTH(GMTSUB))
QUIT
if $LENGTH(GMTSFLD)&($LENGTH(GMTSUB))
SET GMTSIN(GMTSFLD,GMTSUB)=GMTSVAL
+8 if $GET(GMTSFLD)=7&(+($GET(GMTSUB))>0)
SET GMTSPDX=0
End DoDot:1
if '$LENGTH(GMTSTXT)
QUIT
+9 if +($GET(GMTSPDX))=0
KILL GMTSIN("PDX")
+10 QUIT
LIM ; Limits
+1 NEW GMTSI,GMTST,GMTSO,GMTSA
SET GMTSI=0
FOR
SET GMTSI=$ORDER(GMTSLIM(GMTSI))
if +GMTSI=0
QUIT
Begin DoDot:1
+2 SET GMTSA=$PIECE($GET(^GMT(142.1,+($GET(GMTSI)),0)),"^",3)
SET GMTST=$GET(GMTSLIM(+GMTSI,"TIM"))
if '$LENGTH(GMTST)
SET GMTST=$SELECT(GMTSA="Y ":"1Y ",1:"")
+3 SET GMTSA=$PIECE($GET(^GMT(142.1,+($GET(GMTSI)),0)),"^",5)
SET GMTSO=$GET(GMTSLIM(+GMTSI,"OCC"))
if '$LENGTH(GMTSO)
SET GMTSO=$SELECT(GMTSA="Y ":"10 ",1:"")
+4 DO TO^GMTSXPD3(GMTSI,GMTST,GMTSO)
End DoDot:1
+5 QUIT
ROK(X) ; Routine OK
+1 SET X=$GET(X)
if '$LENGTH(X)
QUIT 0
NEW GMTSEX,GMTSTXT
SET GMTSEX="S GMTSTXT=$T(+1^"_X_")"
XECUTE GMTSEX
+2 if '$LENGTH(GMTSTXT)
QUIT 0
QUIT 1
+3 ;
DEMP ; Pronoun(s) Component Data
+1 ;0;;273
+2 ;.01;;MAS DEMOGRAPHICS PRONOUNS
+3 ;1;;PRONOUN;GMTSDEMC
+4 ;1.1;;1
+5 ;1.1;1;
+6 ;2;;
+7 ;3;;DEMP
+8 ;3.5;;1
+9 ;3.5;1;This component displays a patient's pronouns.
+10 ;4;;
+11 ;5;;
+12 ;6;;
+13 ;7;;0
+14 ;8;;
+15 ;9;;Pronoun(s)
+16 ;10;;
+17 ;11;;
+18 ;12;;
+19 ;13;;VA
+20 ;14;;
+21 ;PDX;;1
+22 ;
+23 QUIT
+24 ;
DEMG ; Gender Identity Component Data
+1 ;0;;274
+2 ;.01;;MAS DEMOGRAPHICS GENDER ID
+3 ;1;;SIGI;GMTSDEMC
+4 ;1.1;;1
+5 ;1.1;1;
+6 ;2;;
+7 ;3;;DEMG
+8 ;3.5;;1
+9 ;3.5;1;This component displays a patient's self-identified gender identity.
+10 ;4;;
+11 ;5;;
+12 ;6;;
+13 ;7;;0
+14 ;8;;
+15 ;9;;Gender Identity
+16 ;10;;
+17 ;11;;
+18 ;12;;
+19 ;13;;VA
+20 ;14;;
+21 ;PDX;;1
+22 ;
+23 QUIT
+24 ;
TYPEPRO ;Pronouns Type Data
+1 ;;142;.01;VA-MAS DEM PRONOUNS
+2 ;;142;.08;no
+3 ;;142.01;.01;5
+4 ;;142.01;1;MAS DEMOGRAPHICS PRONOUNS
+5 ;;142.01;5;Pronoun(s)
+6 ;;
+7 QUIT
+8 ;
TYPEGEN ;Gender Identity Type Data
+1 ;;142;.01;VA-MAS DEM GENDER IDENTITY
+2 ;;142;.08;no
+3 ;;142.01;.01;5
+4 ;;142.01;1;MAS DEMOGRAPHICS GENDER ID
+5 ;;142.01;5;Gender Identity
+6 ;;
+7 QUIT
+8 ;
TYPESO ;Sexual Orientation Type Data
+1 ;;142;.01;VA-MAS DEM SEXUAL ORIENTATION
+2 ;;142;.08;no
+3 ;;142.01;.01;5
+4 ;;142.01;1;MAS DEM SEXUAL ORIENTATION
+5 ;;142.01;5;Sexual Orientation
+6 ;;
+7 QUIT
+8 ;
OBJPRO ;Pronouns Object Data
+1 ;;142.5;.01;VA-MAS DEM PRONOUNS (TIU)
+2 ;;142.5;.03;VA-MAS DEM PRONOUNS
+3 ;;142.5;.05;NO
+4 ;;142.5;.06;YES
+5 ;;142.5;.07;NO
+6 ;;142.5;.08;NO
+7 ;;142.5;.09;NO
+8 ;;142.5;.1;NO
+9 ;;142.5;.11;NO
+10 ;;142.5;.12;NO
+11 ;;142.5;.13;NO
+12 ;;142.5;.14;NO
+13 ;;142.5;.15;NO
+14 ;;142.5;.16;NO
+15 ;;142.5;1;This object displays the patient's preferred pronoun(s).
+16 ;;
+17 QUIT
+18 ;
OBJGEN ;Gender Identity Object Data
+1 ;;142.5;.01;VA-MAS DEM GENDER IDENTITY (TIU)
+2 ;;142.5;.03;VA-MAS DEM GENDER IDENTITY
+3 ;;142.5;.05;NO
+4 ;;142.5;.06;YES
+5 ;;142.5;.07;NO
+6 ;;142.5;.08;NO
+7 ;;142.5;.09;NO
+8 ;;142.5;.1;NO
+9 ;;142.5;.11;NO
+10 ;;142.5;.12;NO
+11 ;;142.5;.13;NO
+12 ;;142.5;.14;NO
+13 ;;142.5;.15;NO
+14 ;;142.5;.16;NO
+15 ;;142.5;1;This object displays the patient's self-identified gender identity.
+16 ;;
+17 QUIT
+18 ;
OBJSO ;Sexual Orientation Object Data
+1 ;;142.5;.01;VA-MAS DEM SEXUAL ORIENTATION (TIU)
+2 ;;142.5;.03;VA-MAS DEM SEXUAL ORIENTATION
+3 ;;142.5;.05;NO
+4 ;;142.5;.06;YES
+5 ;;142.5;.07;NO
+6 ;;142.5;.08;NO
+7 ;;142.5;.09;NO
+8 ;;142.5;.1;NO
+9 ;;142.5;.11;NO
+10 ;;142.5;.12;NO
+11 ;;142.5;.13;NO
+12 ;;142.5;.14;NO
+13 ;;142.5;.15;NO
+14 ;;142.5;.16;NO
+15 ;;142.5;1;This object displays the patient's current and historical sexual
+16 ;;142.5;1;orientations.
+17 ;;
+18 QUIT
+19 ;