PSOERXII ;ALB/BWF - eRx Utilities/RPC's ; 12/6/2019 1:14pm
;;7.0;OUTPATIENT PHARMACY;**581,635**;DEC 1997;Build 19
;
Q
SIG(ERXIEN,MIEN,SIGTEXT) ;
N SCNT,SIGARY
K ^TMP($J,"SIG")
D TXT2ARY^PSOERXD1(.SIGARY,SIGTEXT,,80)
S SCNT=0 F S SCNT=$O(SIGARY(SCNT)) Q:SCNT="" D
.S ^TMP($J,"SIG",SCNT)=$G(SIGARY(SCNT))
D WP^DIE(52.49311,MIEN_","_ERXIEN_",",8,"KA","^TMP($J,""SIG"")")
K ^TMP($J,"SIG")
Q
IFU(ERXIEN,MIEN,MTYPE,MEDTYPE) ;
N GLIFU,IFU1,IFU1CNT,IFUIENS,IFUIPC,IFUIPQ,IFUIPT,IFUIC,IFUIQ,IFUIT,IFUIVC,IFUIVQ,IFU1IVC
N IVM,IVU1IVQ,IVUIVT,IVUC,IVUQ,IVUT,IVUOMC,IVUOMQ,IVUOMT,FDA,IFU1IVQ,IFU1IVT,IFUIVT,IFUSF
S GLIFU=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"IndicationForUse",0))
S IFUSF=52.4931113
S IFU1=-1 F S IFU1=$O(@GLIFU@(IFU1)) Q:IFU1="" D
.S IFU1CNT=$G(IFU1CNT)+1
.S IFUIENS="+"_IFU1CNT_","_MIEN_","_ERXIEN_","
.S FDA(IFUSF,IFUIENS,.01)=IFU1CNT
.S IFUIPC=$G(@GLIFU@("IndicationPrecursor",0,"Code",0)),FDA(IFUSF,IFUIENS,1)=IFUIPC
.S IFUIPQ=$G(@GLIFU@("IndicationPrecursor",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,2)=IFUIPQ
.S IFUIPT=$G(@GLIFU@("IndicationPrecursor",0,"Text",0)),FDA(IFUSF,IFUIENS,3)=IFUIPT
.S IFUIC=$G(@GLIFU@("Indication",0,"Code",0)),FDA(IFUSF,IFUIENS,4)=IFUIC
.S IFUIQ=$G(@GLIFU@("Indication",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,5)=IFUIQ
.S IFUIT=$G(@GLIFU@("Indication",0,"Text",0)),FDA(IFUSF,IFUIENS,6)=IFUIT
.S IFUIVC=$G(@GLIFU@("IndicationValue",0,"Code",0)),FDA(IFUSF,IFUIENS,7)=IFUIVC
.S IFUIVQ=$G(@GLIFU@("IndicationValue",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,8)=IFUIVQ
.S IFUIVT=$G(@GLIFU@("IndicationValue",0,"Text",0)),FDA(IFUSF,IFUIENS,9)=IFUIVT
.S IFU1IVC=$G(@GLIFU@("IndicationValue",1,"Code",0)),FDA(IFUSF,IFUIENS,11)=IFU1IVC
.S IVM=$G(@GLIFU@("IndicationVariableModifier",0)),FDA(IFUSF,IFUIENS,10)=IVM
.S IFU1IVQ=$G(@GLIFU@("IndicationValue",1,"Qualifier",0)),FDA(IFUSF,IFUIENS,12)=IFU1IVQ
.S IFU1IVT=$G(@GLIFU@("IndicationValue",1,"Text",0)),FDA(IFUSF,IFUIENS,13)=IFU1IVT
.S IVUC=$G(@GLIFU@("IndicationValueUnit",0,"Code",0)),FDA(IFUSF,IFUIENS,14)=IVUC
.S IVUQ=$G(@GLIFU@("IndicationValueUnit",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,15)=IVUQ
.S IVUT=$G(@GLIFU@("IndicationValueUnit",0,"Text",0)),FDA(IFUSF,IFUIENS,16)=IVUT
.S IVUOMC=$G(@GLIFU@("IndicationValueUnitOfMeasure",0,"Code",0)),FDA(IFUSF,IFUIENS,17)=IVUOMC
.S IVUOMQ=$G(@GLIFU@("IndicationValueUnitOfMeasure",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,18)=IVUOMQ
.S IVUOMT=$G(@GLIFU@("IndicationValueUnitOfMeasure",0,"Text",0)),FDA(IFUSF,IFUIENS,19)=IVUOMT
.D CFDA^PSOERXIU(.FDA)
.D UPDATE^DIE(,"FDA") K FDA
Q
MDR(ERXIEN,MIEN,MTYPE,MEDTYPE) ;
N GL,MDRF,MDRIENS,MDR,MDRMEDF,MDRCFT,MDRDUC,MDRDUQ,MDRDUT,MDRDV,MDRFC,MDRFQ,MDRFT,MDRNV,MDRUC,MDRUT,MDRUQ,MDRCNT
S MDRMEDF=52.4931114
S MDRCNT=0
S GL=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0))
S MDR=-1 F S MDR=$O(@GL@("MaximumDoseRestriction",MDR)) Q:MDR="" D
.S MDRCNT=$G(MDRCNT)+1
.S MDRIENS="+"_MDRCNT_","_MIEN_","_ERXIEN_","
.S MDRCFT=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionClarifyingFreeText",0))
.S MDRDUC=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Code",0))
.S MDRDUQ=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Qualifier",0))
.S MDRDUT=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Text",0))
.S MDRDV=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationValue",0))
.S MDRFC=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Code",0))
.S MDRFQ=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Qualifier",0))
.S MDRFT=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Text",0))
.S MDRNV=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionNumericValue",0))
.S MDRUC=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Code",0))
.S MDRUT=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Text",0))
.S MDRUQ=$G(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Qualifier",0))
.S FDA(MDRMEDF,MDRIENS,.01)=MDRCNT
.S FDA(MDRMEDF,MDRIENS,1)=MDRNV
.S FDA(MDRMEDF,MDRIENS,2)=MDRUC
.S FDA(MDRMEDF,MDRIENS,3)=MDRUQ
.S FDA(MDRMEDF,MDRIENS,4)=MDRUT
.S FDA(MDRMEDF,MDRIENS,5)=MDRDV
.S FDA(MDRMEDF,MDRIENS,6)=MDRDUC
.S FDA(MDRMEDF,MDRIENS,7)=MDRDUQ
.S FDA(MDRMEDF,MDRIENS,8)=MDRDUT
.S FDA(MDRMEDF,MDRIENS,9)=MDRFC
.S FDA(MDRMEDF,MDRIENS,10)=MDRFQ
.S FDA(MDRMEDF,MDRIENS,11)=MDRFT
.S FDA(MDRMEDF,MDRIENS,12)=MDRCFT
D CFDA^PSOERXIU(.FDA)
D UPDATE^DIE(,"FDA")
Q
MDRSF(GLINS,ERXIEN,MIEN,NINSIEN) ;
N MDR,MDRCNT,MDRCFT,MDRDUC,MDRDUQ,MDRDUT,MDRDV,MDRFC,MDRFQ,MDRFT,MDRDV2,MDRCNT,MDRINS
S MDRCNT=0,MDRINS=52.493111275
S MDR=-1 F S MDR=$O(@GLINS@("MaximumDoseRestriction",MDR)) Q:MDR="" D
.S MDRCNT=$G(MDRCNT)+1
.S MDRIENS="+"_MDRCNT_","_NINSIEN_","_MIEN_","_ERXIEN_","
.S MDRCFT=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionClarifyingFreeText",0))
.S MDRDUC=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Code",0))
.S MDRDUQ=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Qualifier",0))
.S MDRDUT=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Text",0))
.S MDRDV=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationValue",0))
.S MDRFC=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Code",0))
.S MDRFQ=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Qualifier",0))
.S MDRFT=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Text",0))
.S MDRNV=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionNumericValue",0))
.S MDRUC=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Code",0))
.S MDRUT=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Text",0))
.S MDRUQ=$G(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Qualifier",0))
.S FDA(MDRINS,MDRIENS,.01)=MDRCNT,FDA(MDRINS,MDRIENS,1)=MDRNV,FDA(MDRINS,MDRIENS,2)=MDRUC
.S FDA(MDRINS,MDRIENS,3)=MDRUQ,FDA(MDRINS,MDRIENS,4)=MDRUT,FDA(MDRINS,MDRIENS,5)=MDRDV
.S FDA(MDRINS,MDRIENS,6)=MDRDUC,FDA(MDRINS,MDRIENS,7)=MDRDUQ,FDA(MDRINS,MDRIENS,8)=MDRDUT
.S FDA(MDRINS,MDRIENS,9)=MDRFC,FDA(MDRINS,MDRIENS,10)=MDRFQ,FDA(MDRINS,MDRIENS,11)=MDRFT,FDA(MDRINS,MDRIENS,12)=MDRCFT
.D CFDA^PSOERXIU(.FDA)
.D UPDATE^DIE(,"FDA") K FDA
Q
INSIFU(ERXIEN,MIEN,MTYPE,MEDTYPE,INS,INSIEN) ;
N GLIFU,GLIFU2,IFU1,IFU1CNT,IFUIENS,IFUIPC,IFUIPQ,IFUIPT,IFUIC,IFUIQ,IFUIT,IFUIVC,IFUIVQ,IFU1IVC
N IVM,IVU1IVQ,IVUIVT,IVUC,IVUQ,IVUT,IVUOMC,IVUOMQ,IVUOMT,FDA,IFU1IVQ,IFU1IVT,IFUIVT,IFUSF
S GLIFU=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"Instruction",INS,"IndicationForUse"))
S IFUSF=52.493111267
S IFU1=-1 F S IFU1=$O(@GLIFU@(IFU1)) Q:IFU1="" D
.S GLIFU2=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"Instruction",INS,"IndicationForUse",IFU1))
.S IFU1CNT=$G(IFU1CNT)+1
.S IFUIENS="+"_IFU1CNT_","_INSIEN_","_MIEN_","_ERXIEN_","
.S FDA(IFUSF,IFUIENS,.01)=IFU1CNT
.S IFUIPC=$G(@GLIFU2@("IndicationPrecursor",0,"Code",0)),FDA(IFUSF,IFUIENS,1)=IFUIPC
.S IFUIPQ=$G(@GLIFU2@("IndicationPrecursor",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,2)=IFUIPQ
.S IFUIPT=$G(@GLIFU2@("IndicationPrecursor",0,"Text",0)),FDA(IFUSF,IFUIENS,3)=IFUIPT
.S IFUIC=$G(@GLIFU2@("Indication",0,"Code",0)),FDA(IFUSF,IFUIENS,4)=IFUIC
.S IFUIQ=$G(@GLIFU2@("Indication",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,5)=IFUIQ
.S IFUIT=$G(@GLIFU2@("Indication",0,"Text",0)),FDA(IFUSF,IFUIENS,6)=IFUIT
.S IFUIVC=$G(@GLIFU2@("IndicationValue",0,"Code",0)),FDA(IFUSF,IFUIENS,7)=IFUIVC
.S IFUIVQ=$G(@GLIFU2@("IndicationValue",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,8)=IFUIVQ
.S IFUIVT=$G(@GLIFU2@("IndicationValue",0,"Text",0)),FDA(IFUSF,IFUIENS,9)=IFUIVT
.S IFU1IVC=$G(@GLIFU2@("IndicationValue",1,"Code",0)),FDA(IFUSF,IFUIENS,11)=IFU1IVC
.S IVM=$G(@GLIFU2@("IndicationVariableModifier",0)),FDA(IFUSF,IFUIENS,10)=IVM
.S IFU1IVQ=$G(@GLIFU2@("IndicationValue",1,"Qualifier",0)),FDA(IFUSF,IFUIENS,12)=IFU1IVQ
.S IFU1IVT=$G(@GLIFU2@("IndicationValue",1,"Text",0)),FDA(IFUSF,IFUIENS,13)=IFU1IVT
.S IVUC=$G(@GLIFU2@("IndicationValueUnit",0,"Code",0)),FDA(IFUSF,IFUIENS,14)=IVUC
.S IVUQ=$G(@GLIFU2@("IndicationValueUnit",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,15)=IVUQ
.S IVUT=$G(@GLIFU2@("IndicationValueUnit",0,"Text",0)),FDA(IFUSF,IFUIENS,16)=IVUT
.S IVUOMC=$G(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Code",0)),FDA(IFUSF,IFUIENS,17)=IVUOMC
.S IVUOMQ=$G(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Qualifier",0)),FDA(IFUSF,IFUIENS,18)=IVUOMQ
.S IVUOMT=$G(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Text",0)),FDA(IFUSF,IFUIENS,19)=IVUOMT
.D CFDA^PSOERXIU(.FDA)
.D UPDATE^DIE(,"FDA") K FDA
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOERXII 8977 printed Oct 16, 2024@18:29:22 Page 2
PSOERXII ;ALB/BWF - eRx Utilities/RPC's ; 12/6/2019 1:14pm
+1 ;;7.0;OUTPATIENT PHARMACY;**581,635**;DEC 1997;Build 19
+2 ;
+3 QUIT
SIG(ERXIEN,MIEN,SIGTEXT) ;
+1 NEW SCNT,SIGARY
+2 KILL ^TMP($JOB,"SIG")
+3 DO TXT2ARY^PSOERXD1(.SIGARY,SIGTEXT,,80)
+4 SET SCNT=0
FOR
SET SCNT=$ORDER(SIGARY(SCNT))
if SCNT=""
QUIT
Begin DoDot:1
+5 SET ^TMP($JOB,"SIG",SCNT)=$GET(SIGARY(SCNT))
End DoDot:1
+6 DO WP^DIE(52.49311,MIEN_","_ERXIEN_",",8,"KA","^TMP($J,""SIG"")")
+7 KILL ^TMP($JOB,"SIG")
+8 QUIT
IFU(ERXIEN,MIEN,MTYPE,MEDTYPE) ;
+1 NEW GLIFU,IFU1,IFU1CNT,IFUIENS,IFUIPC,IFUIPQ,IFUIPT,IFUIC,IFUIQ,IFUIT,IFUIVC,IFUIVQ,IFU1IVC
+2 NEW IVM,IVU1IVQ,IVUIVT,IVUC,IVUQ,IVUT,IVUOMC,IVUOMQ,IVUOMT,FDA,IFU1IVQ,IFU1IVT,IFUIVT,IFUSF
+3 SET GLIFU=$NAME(^TMP($JOB,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"IndicationForUse",0))
+4 SET IFUSF=52.4931113
+5 SET IFU1=-1
FOR
SET IFU1=$ORDER(@GLIFU@(IFU1))
if IFU1=""
QUIT
Begin DoDot:1
+6 SET IFU1CNT=$GET(IFU1CNT)+1
+7 SET IFUIENS="+"_IFU1CNT_","_MIEN_","_ERXIEN_","
+8 SET FDA(IFUSF,IFUIENS,.01)=IFU1CNT
+9 SET IFUIPC=$GET(@GLIFU@("IndicationPrecursor",0,"Code",0))
SET FDA(IFUSF,IFUIENS,1)=IFUIPC
+10 SET IFUIPQ=$GET(@GLIFU@("IndicationPrecursor",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,2)=IFUIPQ
+11 SET IFUIPT=$GET(@GLIFU@("IndicationPrecursor",0,"Text",0))
SET FDA(IFUSF,IFUIENS,3)=IFUIPT
+12 SET IFUIC=$GET(@GLIFU@("Indication",0,"Code",0))
SET FDA(IFUSF,IFUIENS,4)=IFUIC
+13 SET IFUIQ=$GET(@GLIFU@("Indication",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,5)=IFUIQ
+14 SET IFUIT=$GET(@GLIFU@("Indication",0,"Text",0))
SET FDA(IFUSF,IFUIENS,6)=IFUIT
+15 SET IFUIVC=$GET(@GLIFU@("IndicationValue",0,"Code",0))
SET FDA(IFUSF,IFUIENS,7)=IFUIVC
+16 SET IFUIVQ=$GET(@GLIFU@("IndicationValue",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,8)=IFUIVQ
+17 SET IFUIVT=$GET(@GLIFU@("IndicationValue",0,"Text",0))
SET FDA(IFUSF,IFUIENS,9)=IFUIVT
+18 SET IFU1IVC=$GET(@GLIFU@("IndicationValue",1,"Code",0))
SET FDA(IFUSF,IFUIENS,11)=IFU1IVC
+19 SET IVM=$GET(@GLIFU@("IndicationVariableModifier",0))
SET FDA(IFUSF,IFUIENS,10)=IVM
+20 SET IFU1IVQ=$GET(@GLIFU@("IndicationValue",1,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,12)=IFU1IVQ
+21 SET IFU1IVT=$GET(@GLIFU@("IndicationValue",1,"Text",0))
SET FDA(IFUSF,IFUIENS,13)=IFU1IVT
+22 SET IVUC=$GET(@GLIFU@("IndicationValueUnit",0,"Code",0))
SET FDA(IFUSF,IFUIENS,14)=IVUC
+23 SET IVUQ=$GET(@GLIFU@("IndicationValueUnit",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,15)=IVUQ
+24 SET IVUT=$GET(@GLIFU@("IndicationValueUnit",0,"Text",0))
SET FDA(IFUSF,IFUIENS,16)=IVUT
+25 SET IVUOMC=$GET(@GLIFU@("IndicationValueUnitOfMeasure",0,"Code",0))
SET FDA(IFUSF,IFUIENS,17)=IVUOMC
+26 SET IVUOMQ=$GET(@GLIFU@("IndicationValueUnitOfMeasure",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,18)=IVUOMQ
+27 SET IVUOMT=$GET(@GLIFU@("IndicationValueUnitOfMeasure",0,"Text",0))
SET FDA(IFUSF,IFUIENS,19)=IVUOMT
+28 DO CFDA^PSOERXIU(.FDA)
+29 DO UPDATE^DIE(,"FDA")
KILL FDA
End DoDot:1
+30 QUIT
MDR(ERXIEN,MIEN,MTYPE,MEDTYPE) ;
+1 NEW GL,MDRF,MDRIENS,MDR,MDRMEDF,MDRCFT,MDRDUC,MDRDUQ,MDRDUT,MDRDV,MDRFC,MDRFQ,MDRFT,MDRNV,MDRUC,MDRUT,MDRUQ,MDRCNT
+2 SET MDRMEDF=52.4931114
+3 SET MDRCNT=0
+4 SET GL=$NAME(^TMP($JOB,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0))
+5 SET MDR=-1
FOR
SET MDR=$ORDER(@GL@("MaximumDoseRestriction",MDR))
if MDR=""
QUIT
Begin DoDot:1
+6 SET MDRCNT=$GET(MDRCNT)+1
+7 SET MDRIENS="+"_MDRCNT_","_MIEN_","_ERXIEN_","
+8 SET MDRCFT=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionClarifyingFreeText",0))
+9 SET MDRDUC=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Code",0))
+10 SET MDRDUQ=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Qualifier",0))
+11 SET MDRDUT=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Text",0))
+12 SET MDRDV=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationValue",0))
+13 SET MDRFC=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Code",0))
+14 SET MDRFQ=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Qualifier",0))
+15 SET MDRFT=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Text",0))
+16 SET MDRNV=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionNumericValue",0))
+17 SET MDRUC=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Code",0))
+18 SET MDRUT=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Text",0))
+19 SET MDRUQ=$GET(@GL@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Qualifier",0))
+20 SET FDA(MDRMEDF,MDRIENS,.01)=MDRCNT
+21 SET FDA(MDRMEDF,MDRIENS,1)=MDRNV
+22 SET FDA(MDRMEDF,MDRIENS,2)=MDRUC
+23 SET FDA(MDRMEDF,MDRIENS,3)=MDRUQ
+24 SET FDA(MDRMEDF,MDRIENS,4)=MDRUT
+25 SET FDA(MDRMEDF,MDRIENS,5)=MDRDV
+26 SET FDA(MDRMEDF,MDRIENS,6)=MDRDUC
+27 SET FDA(MDRMEDF,MDRIENS,7)=MDRDUQ
+28 SET FDA(MDRMEDF,MDRIENS,8)=MDRDUT
+29 SET FDA(MDRMEDF,MDRIENS,9)=MDRFC
+30 SET FDA(MDRMEDF,MDRIENS,10)=MDRFQ
+31 SET FDA(MDRMEDF,MDRIENS,11)=MDRFT
+32 SET FDA(MDRMEDF,MDRIENS,12)=MDRCFT
End DoDot:1
+33 DO CFDA^PSOERXIU(.FDA)
+34 DO UPDATE^DIE(,"FDA")
+35 QUIT
MDRSF(GLINS,ERXIEN,MIEN,NINSIEN) ;
+1 NEW MDR,MDRCNT,MDRCFT,MDRDUC,MDRDUQ,MDRDUT,MDRDV,MDRFC,MDRFQ,MDRFT,MDRDV2,MDRCNT,MDRINS
+2 SET MDRCNT=0
SET MDRINS=52.493111275
+3 SET MDR=-1
FOR
SET MDR=$ORDER(@GLINS@("MaximumDoseRestriction",MDR))
if MDR=""
QUIT
Begin DoDot:1
+4 SET MDRCNT=$GET(MDRCNT)+1
+5 SET MDRIENS="+"_MDRCNT_","_NINSIEN_","_MIEN_","_ERXIEN_","
+6 SET MDRCFT=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionClarifyingFreeText",0))
+7 SET MDRDUC=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Code",0))
+8 SET MDRDUQ=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Qualifier",0))
+9 SET MDRDUT=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationUnit",0,"Text",0))
+10 SET MDRDV=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionDurationValue",0))
+11 SET MDRFC=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Code",0))
+12 SET MDRFQ=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Qualifier",0))
+13 SET MDRFT=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionForm",0,"Text",0))
+14 SET MDRNV=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionNumericValue",0))
+15 SET MDRUC=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Code",0))
+16 SET MDRUT=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Text",0))
+17 SET MDRUQ=$GET(@GLINS@("MaximumDoseRestriction",MDR,"MaximumDoseRestrictionUnits",0,"Qualifier",0))
+18 SET FDA(MDRINS,MDRIENS,.01)=MDRCNT
SET FDA(MDRINS,MDRIENS,1)=MDRNV
SET FDA(MDRINS,MDRIENS,2)=MDRUC
+19 SET FDA(MDRINS,MDRIENS,3)=MDRUQ
SET FDA(MDRINS,MDRIENS,4)=MDRUT
SET FDA(MDRINS,MDRIENS,5)=MDRDV
+20 SET FDA(MDRINS,MDRIENS,6)=MDRDUC
SET FDA(MDRINS,MDRIENS,7)=MDRDUQ
SET FDA(MDRINS,MDRIENS,8)=MDRDUT
+21 SET FDA(MDRINS,MDRIENS,9)=MDRFC
SET FDA(MDRINS,MDRIENS,10)=MDRFQ
SET FDA(MDRINS,MDRIENS,11)=MDRFT
SET FDA(MDRINS,MDRIENS,12)=MDRCFT
+22 DO CFDA^PSOERXIU(.FDA)
+23 DO UPDATE^DIE(,"FDA")
KILL FDA
End DoDot:1
+24 QUIT
INSIFU(ERXIEN,MIEN,MTYPE,MEDTYPE,INS,INSIEN) ;
+1 NEW GLIFU,GLIFU2,IFU1,IFU1CNT,IFUIENS,IFUIPC,IFUIPQ,IFUIPT,IFUIC,IFUIQ,IFUIT,IFUIVC,IFUIVQ,IFU1IVC
+2 NEW IVM,IVU1IVQ,IVUIVT,IVUC,IVUQ,IVUT,IVUOMC,IVUOMQ,IVUOMT,FDA,IFU1IVQ,IFU1IVT,IFUIVT,IFUSF
+3 SET GLIFU=$NAME(^TMP($JOB,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"Instruction",INS,"IndicationForUse"))
+4 SET IFUSF=52.493111267
+5 SET IFU1=-1
FOR
SET IFU1=$ORDER(@GLIFU@(IFU1))
if IFU1=""
QUIT
Begin DoDot:1
+6 SET GLIFU2=$NAME(^TMP($JOB,"PSOERXO1","Message",0,"Body",0,MTYPE,0,MEDTYPE,0,"Sig",0,"Instruction",INS,"IndicationForUse",IFU1))
+7 SET IFU1CNT=$GET(IFU1CNT)+1
+8 SET IFUIENS="+"_IFU1CNT_","_INSIEN_","_MIEN_","_ERXIEN_","
+9 SET FDA(IFUSF,IFUIENS,.01)=IFU1CNT
+10 SET IFUIPC=$GET(@GLIFU2@("IndicationPrecursor",0,"Code",0))
SET FDA(IFUSF,IFUIENS,1)=IFUIPC
+11 SET IFUIPQ=$GET(@GLIFU2@("IndicationPrecursor",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,2)=IFUIPQ
+12 SET IFUIPT=$GET(@GLIFU2@("IndicationPrecursor",0,"Text",0))
SET FDA(IFUSF,IFUIENS,3)=IFUIPT
+13 SET IFUIC=$GET(@GLIFU2@("Indication",0,"Code",0))
SET FDA(IFUSF,IFUIENS,4)=IFUIC
+14 SET IFUIQ=$GET(@GLIFU2@("Indication",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,5)=IFUIQ
+15 SET IFUIT=$GET(@GLIFU2@("Indication",0,"Text",0))
SET FDA(IFUSF,IFUIENS,6)=IFUIT
+16 SET IFUIVC=$GET(@GLIFU2@("IndicationValue",0,"Code",0))
SET FDA(IFUSF,IFUIENS,7)=IFUIVC
+17 SET IFUIVQ=$GET(@GLIFU2@("IndicationValue",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,8)=IFUIVQ
+18 SET IFUIVT=$GET(@GLIFU2@("IndicationValue",0,"Text",0))
SET FDA(IFUSF,IFUIENS,9)=IFUIVT
+19 SET IFU1IVC=$GET(@GLIFU2@("IndicationValue",1,"Code",0))
SET FDA(IFUSF,IFUIENS,11)=IFU1IVC
+20 SET IVM=$GET(@GLIFU2@("IndicationVariableModifier",0))
SET FDA(IFUSF,IFUIENS,10)=IVM
+21 SET IFU1IVQ=$GET(@GLIFU2@("IndicationValue",1,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,12)=IFU1IVQ
+22 SET IFU1IVT=$GET(@GLIFU2@("IndicationValue",1,"Text",0))
SET FDA(IFUSF,IFUIENS,13)=IFU1IVT
+23 SET IVUC=$GET(@GLIFU2@("IndicationValueUnit",0,"Code",0))
SET FDA(IFUSF,IFUIENS,14)=IVUC
+24 SET IVUQ=$GET(@GLIFU2@("IndicationValueUnit",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,15)=IVUQ
+25 SET IVUT=$GET(@GLIFU2@("IndicationValueUnit",0,"Text",0))
SET FDA(IFUSF,IFUIENS,16)=IVUT
+26 SET IVUOMC=$GET(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Code",0))
SET FDA(IFUSF,IFUIENS,17)=IVUOMC
+27 SET IVUOMQ=$GET(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Qualifier",0))
SET FDA(IFUSF,IFUIENS,18)=IVUOMQ
+28 SET IVUOMT=$GET(@GLIFU2@("IndicationValueUnitOfMeasure",0,"Text",0))
SET FDA(IFUSF,IFUIENS,19)=IVUOMT
+29 DO CFDA^PSOERXIU(.FDA)
+30 DO UPDATE^DIE(,"FDA")
KILL FDA
End DoDot:1
+31 QUIT