PSOERXX5 ;ALB/BWF - eRx xml utilities ; 8/3/2016 5:14pm
;;7.0;OUTPATIENT PHARMACY;**467,508,551**;DEC 1997;Build 37
;
Q
STRUCSIG(GBL,IENS) ;
N SSPN,MSM,SV,FMTV,SFTSI,SFT,DCI,DDM,DDMCQ,DDMC,DDMMT,DDMMCQ,DDMMC,MDRFLG,MDVAR
N DQ,DFT,DFCQ,DFC,DRM,DBMV,DBUM,DBUMCQ,DBUC,BMQ,BMV,CDM,CDUMT,CDUMCQ,CDUMC,DBRM
N VN,VNCQ,VUMT,VUMCQ,VUMC,MVM,RAT,RACQ,RAC,MRAM,SAT,SACQ,SAC,MATM,RM,RUMT,INDFLG,INDVAR
N RUMCQ,RUMC,TPBT,TPBCQ,TPBC,FNV,FUT,FUCQ,FUC,VFM,INV,IUT,IUCQ,IUC,OR,DNV,DTEXT,DTCQ
N DTC,MDRNV,MDRUT,MDRCQ,MDRUC,MDRVN,MDRVUT,MDRVUCQ,MDRVUC,MDRVDM,IPT,IPCQ,IPC,IT
N F,ITCQ,ITC,IVT,IVU,IVUMT,IVUMCQ,IVUMC,IVM,STOPI,PDAT,ATC,ATCQ,ATT,TMATM,VIM,VNC,VQ
N DOSEVAR,DOSEFLG,DCALFLG,DCALVAR,VFLG,VVAR,ROAFLG,ROAVAR,SOAFLG,SOAVAR,TIMFLG,TIMVAR,DURFLG,DURVAR
S F=52.4911
D GETS^DIQ(F,IENS,"**","IE","PDAT")
D CONVXML^PSOERXX1("PDAT")
S SSPN=$G(PDAT(F,IENS,.01,"E")),MSM=$G(PDAT(F,IENS,.02,"I")),SV=$G(PDAT(F,IENS,.03,"E"))
S FMTV=$G(PDAT(F,IENS,.04,"E")),SFTSI=$G(PDAT(F,IENS,.05,"E")),SFT=$G(PDAT(F,IENS,1,"E"))
S DCI=$G(PDAT(F,IENS,2.1,"E")),DDM=$G(PDAT(F,IENS,2.2,"E")),DDMCQ=$G(PDAT(F,IENS,2.3,"I"))
S DDMC=$G(PDAT(F,IENS,2.4,"E")),DDMMT=$G(PDAT(F,IENS,2.5,"E")),DDMMCQ=$G(PDAT(F,IENS,2.7,"I")),DDMMC=$G(PDAT(F,IENS,2.6,"E"))
S DQ=$G(PDAT(F,IENS,3.1,"E")),DFT=$G(PDAT(F,IENS,3.2,"E")),DFCQ=$G(PDAT(F,IENS,3.4,"I")),DFC=$G(PDAT(F,IENS,3.3,"E"))
S DRM=$G(PDAT(F,IENS,3.5,"I")),DBMV=$G(PDAT(F,IENS,4.1,"E")),DBUM=$G(PDAT(F,IENS,4.2,"E")),DBUMCQ=$G(PDAT(F,IENS,4.4,"I"))
S DBUC=$G(PDAT(F,IENS,4.3,"E")),BMQ=$G(PDAT(F,IENS,4.5,"I")),BMV=$G(PDAT(F,IENS,4.6,"E")),CDM=$G(PDAT(F,IENS,4.7,"E"))
S CDUMT=$G(PDAT(F,IENS,4.8,"E")),CDUMCQ=$G(PDAT(F,IENS,4.11,"I")),CDUMC=$G(PDAT(F,IENS,4.9,"E")),DBRM=$G(PDAT(F,IENS,4.12,"I"))
S VN=$G(PDAT(F,IENS,5.1,"E")),VNC=$G(PDAT(F,IENS,5.2,"E")),VNCQ=$G(PDAT(F,IENS,5.3,"I")),VQ=$G(PDAT(F,IENS,5.4,"E"))
S VUMT=$G(PDAT(F,IENS,5.5,"E")),VUMCQ=$G(PDAT(F,IENS,5.7,"I")),VUMC=$G(PDAT(F,IENS,5.6,"E")),MVM=$G(PDAT(F,IENS,5.8,"I"))
S RAT=$G(PDAT(F,IENS,6.1,"E")),RACQ=$G(PDAT(F,IENS,6.3,"I")),RAC=$G(PDAT(F,IENS,6.2,"E")),MRAM=$G(PDAT(F,IENS,6.4,"I"))
S SAT=$G(PDAT(F,IENS,6.5,"E")),SACQ=$G(PDAT(F,IENS,6.7,"I")),SAC=$G(PDAT(F,IENS,6.7,"I")),MATM=$G(PDAT(F,IENS,6.8,"I"))
S ATT=$G(PDAT(F,IENS,7.1,"E")),ATCQ=$G(PDAT(F,IENS,7.3,"I")),ATC=$G(PDAT(F,IENS,7.2,"E")),TMATM=$G(PDAT(F,IENS,7.4,"I"))
S RM=$G(PDAT(F,IENS,7.5,"E")),RUMT=$G(PDAT(F,IENS,7.6,"E")),RUMCQ=$G(PDAT(F,IENS,7.8,"I")),RUMC=$G(PDAT(F,IENS,7.7,"E"))
S TPBT=$G(PDAT(F,IENS,8.1,"E")),TPBCQ=$G(PDAT(F,IENS,8.3,"I")),TPBC=$G(PDAT(F,IENS,8.2,"E")),FNV=$G(PDAT(F,IENS,8.4,"E"))
S FUT=$G(PDAT(F,IENS,8.5,"E")),FUCQ=$G(PDAT(F,IENS,8.7,"I")),FUC=$G(PDAT(F,IENS,8.6,"E")),VFM=$G(PDAT(F,IENS,8.8,"I")),INV=$G(PDAT(F,IENS,9.1,"E"))
S IUT=$G(PDAT(F,IENS,9.2,"E")),IUCQ=$G(PDAT(F,IENS,9.4,"I")),IUC=$G(PDAT(F,IENS,9.3,"E")),VIM=$G(PDAT(F,IENS,9.5,"I"))
S DNV=$G(PDAT(F,IENS,9.6,"E")),DTEXT=$G(PDAT(F,IENS,9.7,"E")),DTCQ=$G(PDAT(F,IENS,9.9,"I")),DTC=$G(PDAT(F,IENS,9.8,"E"))
S MDRNV=$G(PDAT(F,IENS,10.1,"E")),MDRUT=$G(PDAT(F,IENS,10.2,"E")),MDRCQ=$G(PDAT(F,IENS,10.3,"I")),MDRUC=$G(PDAT(F,IENS,10.4,"E"))
S MDRVN=$G(PDAT(F,IENS,10.5,"E")),MDRVUT=$G(PDAT(F,IENS,10.6,"E")),MDRVUCQ=$G(PDAT(F,IENS,10.8,"I")),MDRVUC=$G(PDAT(F,IENS,10.7,"E"))
S MDRVDM=$G(PDAT(F,IENS,10.9,"I")),IPT=$G(PDAT(F,IENS,11.1,"E")),IPCQ=$G(PDAT(F,IENS,11.3,"I")),IPC=$G(PDAT(F,IENS,11.2,"E"))
S IT=$G(PDAT(F,IENS,11.4,"E")),ITCQ=$G(PDAT(F,IENS,11.6,"I")),ITC=$G(PDAT(F,IENS,11.5,"E")),IVT=$G(PDAT(F,IENS,12.1,"E"))
S IVU=$G(PDAT(F,IENS,12.2,"E")),IVUMT=$G(PDAT(F,IENS,12.3,"E")),IVUMCQ=$G(PDAT(F,IENS,12.5,"I"))
S IVUMC=$G(PDAT(F,IENS,12.4,"E")),IVM=$G(PDAT(F,IENS,12.6,"I")),STOPI=$G(PDAT(F,IENS,12.7,"I"))
D C S @GBL@(CNT,0)="<StructuredSIG>"
D C S @GBL@(CNT,0)="<RepeatingSIG>"
D C S @GBL@(CNT,0)="<SigSequencePositionNumber>"_SSPN_"</SigSequencePositionNumber>"
I $L(MSM) D C S @GBL@(CNT,0)="<MultipleSigModifier>"_MSM_"</MultipleSigModifier>"
D C S @GBL@(CNT,0)="</RepeatingSIG>"
D C S @GBL@(CNT,0)="<CodeSystem>"
I $L(SV) D C S @GBL@(CNT,0)="<SNOMEDVersion>"_SV_"</SNOMEDVersion>"
I $L(FMTV) D C S @GBL@(CNT,0)="<FMTVersion>"_FMTV_"</FMTVersion>"
D C S @GBL@(CNT,0)="</CodeSystem>"
D C S @GBL@(CNT,0)="<FreeText>"
I $L(SFTSI) D C S @GBL@(CNT,0)="<SigFreeTextStringIndicator>"_SFTSI_"</SigFreeTextStringIndicator>"
I $L(SFT) D C S @GBL@(CNT,0)="<SigFreeText>"_SFT_"</SigFreeText>"
D C S @GBL@(CNT,0)="</FreeText>"
S DOSEFLG=0
F DOSEVAR="DCI","DDM","DDMCQ","DDMC","DDMMT","DDMMCQ","DDMMC","DQ","DFT","DFCQ","DFC","DRM" D
.I $L(@DOSEVAR) S DOSEFLG=1
I DOSEFLG D C S @GBL@(CNT,0)="<Dose>"
I $L(DCI) D C S @GBL@(CNT,0)="<DoseCompositeIndicator>"_DCI_"</DoseCompositeIndicator>"
I $L(DDM) D C S @GBL@(CNT,0)="<DoseDeliveryMethodText>"_DDM_"</DoseDeliveryMethodText>"
I $L(DDMCQ) D C S @GBL@(CNT,0)="<DoseDeliveryMethodCodeQualifier>"_DDMCQ_"</DoseDeliveryMethodCodeQualifier>"
I $L(DDMC) D C S @GBL@(CNT,0)="<DoseDeliveryMethodCode>"_DDMC_"</DoseDeliveryMethodCode>"
I $L(DDMMT) D C S @GBL@(CNT,0)="<DoseDeliveryMethodModifierText>"_DDMMT_"</DoseDeliveryMethodModifierText>"
I $L(DDMMCQ) D C S @GBL@(CNT,0)="<DoseDeliveryMethodModifierCodeQualifier>"_DDMMCQ_"</DoseDeliveryMethodModifierCodeQualifier>"
I $L(DDMMC) D C S @GBL@(CNT,0)="<DoseDeliveryMethodModifierCode>"_DDMMC_"</DoseDeliveryMethodModifierCode>"
I $L(DQ) D C S @GBL@(CNT,0)="<DoseQuantity>"_DQ_"</DoseQuantity>"
I $L(DFT) D C S @GBL@(CNT,0)="<DoseFormText>"_DFT_"</DoseFormText>"
I $L(DFCQ) D C S @GBL@(CNT,0)="<DoseFormCodeQualifier>"_DFCQ_"</DoseFormCodeQualifier>"
I $L(DFC) D C S @GBL@(CNT,0)="<DoseFormCode>"_DFC_"</DoseFormCode>"
I $L(DRM) D C S @GBL@(CNT,0)="<DoseRangeModifier>"_DRM_"</DoseRangeModifier>"
I DOSEFLG D C S @GBL@(CNT,0)="</Dose>"
S DCALFLG=0
F DCALVAR="DBMV","DBUM","DBUMCQ","DBUC","BMQ","BMV","CDM","CDUMT","CDUMCQ","CDUMC","DBRM" D
.I $L(@DCALVAR) S DCALFLG=1
I DCALFLG D C S @GBL@(CNT,0)="<DoseCalculation>"
I $L(DBMV) D C S @GBL@(CNT,0)="<DosingBasisNumericValue>"_DBMV_"</DosingBasisNumericValue>"
I $L(DBUM) D C S @GBL@(CNT,0)="<DosingBasisUnitofMeasureText>"_DBUM_"</DosingBasisUnitofMeasureText>"
I $L(DBUMCQ) D C S @GBL@(CNT,0)="<DosingBasisUnitofMeasureCodeQualifier>"_DBUMCQ_"</DosingBasisUnitofMeasureCodeQualifier>"
I $L(DBUC) D C S @GBL@(CNT,0)="<DosingBasisUnitofMeasureCode>"_DBUC_"</DosingBasisUnitofMeasureCode>"
I $L(BMQ) D C S @GBL@(CNT,0)="<BodyMetricQualifier>"_BMQ_"</BodyMetricQualifier>"
I $L(BMV) D C S @GBL@(CNT,0)="<BodyMetricValue>"_BMV_"</BodyMetricValue>"
I $L(CDM) D C S @GBL@(CNT,0)="<CalculatedDoseNumeric>"_CDM_"</CalculatedDoseNumeric>"
I $L(CDUMT) D C S @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureText>"_CDUMT_"</CalculatedDoseUnitofMeasureText>"
I $L(CDUMCQ) D C S @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureCodeQualifier>"_CDUMCQ_"</CalculatedDoseUnitofMeasureCodeQualifier>"
I $L(CDUMC) D C S @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureCode>"_CDUMC_"</CalculatedDoseUnitofMeasureCode>"
I $L(DBRM) D C S @GBL@(CNT,0)="<DosingBasisRangeModifier>"_DBRM_"</DosingBasisRangeModifier>"
I DCALFLG D C S @GBL@(CNT,0)="</DoseCalculation>"
S VFLG=0
F VVAR="VN","VNCQ","VNC","VQ","VUMT","VUMCQ","VUMC","MVM" D
.I $L(@VVAR) S VFLG=1
I VFLG D C S @GBL@(CNT,0)="<Vehicle>"
I $L(VN) D C S @GBL@(CNT,0)="<VehicleName>"_VN_"</VehicleName>"
I $L(VNCQ) D C S @GBL@(CNT,0)="<VehicleNameCodeQualifier>"_VNCQ_"</VehicleNameCodeQualifier>"
I $L(VNC) D C S @GBL@(CNT,0)="<VehicleNameCode>"_VNC_"</VehicleNameCode>"
I $L(VQ) D C S @GBL@(CNT,0)="<VehicleQuantity>"_VQ_"</VehicleQuantity>"
I $L(VUMT) D C S @GBL@(CNT,0)="<VehicleUnitOfMeasureText>"_VUMT_"</VehicleUnitOfMeasureText>"
I $L(VUMCQ) D C S @GBL@(CNT,0)="<VehicleUnitOfMeasureCodeQualifier>"_VUMCQ_"</VehicleUnitOfMeasureCodeQualifier>"
I $L(VUMC) D C S @GBL@(CNT,0)="<VehicleUnitOfMeasureCode>"_VUMC_"</VehicleUnitOfMeasureCode>"
I $L(MVM) D C S @GBL@(CNT,0)="<MultipleVehicleModifier>"_MVM_"</MultipleVehicleModifier>"
I VFLG D C S @GBL@(CNT,0)="</Vehicle>"
S ROAFLG=0
F ROAVAR="RAT","RACQ","RAC","MRAM" D
.I $L(@ROAVAR) S ROAFLG=1
I ROAFLG D C S @GBL@(CNT,0)="<RouteofAdministration>"
I $L(RAT) D C S @GBL@(CNT,0)="<RouteofAdministrationText>"_RAT_"</RouteofAdministrationText>"
I $L(RACQ) D C S @GBL@(CNT,0)="<RouteofAdministrationCodeQualifier>"_RACQ_"</RouteofAdministrationCodeQualifier>"
I $L(RAC) D C S @GBL@(CNT,0)="<RouteofAdministrationCode>"_RAC_"</RouteofAdministrationCode>"
I $L(MRAM) D C S @GBL@(CNT,0)="<MultipleRouteofAdministrationModifier>"_MRAM_"</MultipleRouteofAdministrationModifier>"
I ROAFLG D C S @GBL@(CNT,0)="</RouteofAdministration>"
S SOAFLG=0
F SOAVAR="SAT","SACQ","SAC","MATM" D
.I $L(@SOAVAR) S SOAFLG=1
I SOAFLG D C S @GBL@(CNT,0)="<SiteofAdministration>"
I $L(SAT) D C S @GBL@(CNT,0)="<SiteofAdministrationText>"_SAT_"</SiteofAdministrationText>"
I $L(SACQ) D C S @GBL@(CNT,0)="<SiteofAdministrationCodeQualifier>"_SACQ_"</SiteofAdministrationCodeQualifier>"
I $L(SAC) D C S @GBL@(CNT,0)="<SiteofAdministrationCode>"_SAC_"</SiteofAdministrationCode>"
I $L(MATM) D C S @GBL@(CNT,0)="<MultipleAdministrationTimingModifier>"_MATM_"</MultipleAdministrationTimingModifier>"
I SOAFLG D C S @GBL@(CNT,0)="</SiteofAdministration>"
S TIMFLG=0
F TIMVAR="ATT","ATCQ","ATC","TMATM","RM","RUMT","RUMCQ","RUMC","TPBT","TPBCQ","TPBC","FNV","FUT","FUCQ","FUC","VFM","INV","IUT","IUCQ","IUC","VIM" D
.I $L(@TIMVAR) S TIMFLG=1
I TIMFLG D C S @GBL@(CNT,0)="<Timing>"
I $L(ATT) D C S @GBL@(CNT,0)="<AdministrationTimingText>"_ATT_"</AdministrationTimingText>"
I $L(ATCQ) D C S @GBL@(CNT,0)="<AdministrationTimingCodeQualifier>"_ATCQ_"</AdministrationTimingCodeQualifier>"
I $L(ATC) D C S @GBL@(CNT,0)="<AdministrationTimingCode>"_ATC_"</AdministrationTimingCode>"
I $L(TMATM) D C S @GBL@(CNT,0)="<MultipleAdministrationTimingModifier>"_TMATM_"</MultipleAdministrationTimingModifier>"
I $L(RM) D C S @GBL@(CNT,0)="<RateofAdministration>"_RM_"</RateofAdministration>"
I $L(RUMT) D C S @GBL@(CNT,0)="<RateUnitofMeasureText>"_RUMT_"</RateUnitofMeasureText>"
I $L(RUMCQ) D C S @GBL@(CNT,0)="<RateUnitofMeasureCodeQualifier>"_RUMCQ_"</RateUnitofMeasureCodeQualifier>"
I $L(RUMC) D C S @GBL@(CNT,0)="<RateUnitofMeasureCode>"_RUMC_"</RateUnitofMeasureCode>"
I $L(TPBT) D C S @GBL@(CNT,0)="<TimePeriodBasisText>"_TPBT_"</TimePeriodBasisText>"
I $L(TPBCQ) D C S @GBL@(CNT,0)="<TimePeriodBasisCodeQualifier>"_TPBCQ_"</TimePeriodBasisCodeQualifier>"
I $L(TPBC) D C S @GBL@(CNT,0)="<TimePeriodBasisCode>"_TPBC_"</TimePeriodBasisCode>"
I $L(FNV) D C S @GBL@(CNT,0)="<FrequencyNumericValue>"_FNV_"</FrequencyNumericValue>"
I $L(FUT) D C S @GBL@(CNT,0)="<FrequencyUnitsText>"_FUT_"</FrequencyUnitsText>"
I $L(FUCQ) D C S @GBL@(CNT,0)="<FrequencyUnitsCodeQualifier>"_FUCQ_"</FrequencyUnitsCodeQualifier>"
I $L(FUC) D C S @GBL@(CNT,0)="<FrequencyUnitsCode>"_FUC_"</FrequencyUnitsCode>"
I $L(VFM) D C S @GBL@(CNT,0)="<VariableFrequencyModifier>"_VFM_"</VariableFrequencyModifier>"
I $L(INV) D C S @GBL@(CNT,0)="<IntervalNumericValue>"_INV_"</IntervalNumericValue>"
I $L(IUT) D C S @GBL@(CNT,0)="<IntervalUnitsText>"_IUT_"</IntervalUnitsText>"
I $L(IUCQ) D C S @GBL@(CNT,0)="<IntervalUnitsCodeQualifier>"_IUCQ_"</IntervalUnitsCodeQualifier>"
I $L(IUC) D C S @GBL@(CNT,0)="<IntervalUnitsCode>"_IUC_"</IntervalUnitsCode>"
I $L(VIM) D C S @GBL@(CNT,0)="<VariableIntervalModifier>"_VIM_"</VariableIntervalModifier>"
I TIMFLG D C S @GBL@(CNT,0)="</Timing>"
S DURFLG=0
F DURVAR="DNV","DTEXT","DTCQ","DTC" D
.I $L(@DURVAR) S DURFLG=1
;/BLB/ PSO*7.0*551 - BEGIN CHANGE
I DURFLG D C S @GBL@(CNT,0)="<Duration>"
I $L(DNV) D C S @GBL@(CNT,0)="<DurationNumericValue>"_DNV_"</DurationNumericValue>"
I $L(DTEXT) D C S @GBL@(CNT,0)="<DurationText>"_DTEXT_"</DurationText>"
I $L(DTCQ) D C S @GBL@(CNT,0)="<DurationTextCodeQualifier>"_DTCQ_"</DurationTextCodeQualifier>"
I $L(DTC) D C S @GBL@(CNT,0)="<DurationTextCode>"_DTC_"</DurationTextCode>"
I DURFLG D C S @GBL@(CNT,0)="</Duration>"
;/BLB/ PSO*7.0*551 - END CHANGE
S MDRFLG=0
F MDVAR="MDRNV","MDRUT","MDRCQ","MDRUC","MDRVN","MDRVUT","MDRVUCQ","MDRVUC","MDRVDM" D
.I $L(@MDVAR) S MDRFLG=1
I MDRFLG D C S @GBL@(CNT,0)="<MaximumDoseRestriction>"
I $L(MDRNV) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionNumericValue>"_MDRNV_"</MaximumDoseRestrictionNumericValue>"
I $L(MDRUT) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionUnitsText>"_MDRUT_"</MaximumDoseRestrictionUnitsText>"
I $L(MDRCQ) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionCodeQualifier>"_MDRCQ_"</MaximumDoseRestrictionCodeQualifier>"
I $L(MDRUC) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionUnitsCode>"_MDRUC_"</MaximumDoseRestrictionUnitsCode>"
I $L(MDRVN) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionVariableNumericValue>"_MDRVN_"</MaximumDoseRestrictionVariableNumericValue>"
I $L(MDRVUT) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsText>"_MDRVUT_"</MaximumDoseRestrictionVariableUnitsText>"
I $L(MDRVUCQ) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsCodeQualifier>"_MDRVUCQ_"</MaximumDoseRestrictionVariableUnitsCodeQualifier>"
I $L(MDRVUC) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsCode>"_MDRVUC_"</MaximumDoseRestrictionVariableUnitsCode>"
I $L(MDRVDM) D C S @GBL@(CNT,0)="<MaximumDoseRestrictionVariableDurationModifier>"_MDRVDM_"</MaximumDoseRestrictionVariableDurationModifier>"
I MDRFLG D C S @GBL@(CNT,0)="</MaximumDoseRestriction>"
S INDFLG=0
F INDVAR="IPT","IPCQ","IPC","IT","ITCQ","ITC","IVT","IVU","IVUMT","IVUMCQ","IVM" D
.I $L(@INDVAR) S INDFLG=1
I INDFLG D C S @GBL@(CNT,0)="<Indication>"
I $L(IPT) D C S @GBL@(CNT,0)="<IndicationPrecursorText>"_IPT_"</IndicationPrecursorText>"
I $L(IPCQ) D C S @GBL@(CNT,0)="<IndicationPrecursorCodeQualifier>"_IPCQ_"</IndicationPrecursorCodeQualifier>"
I $L(IPC) D C S @GBL@(CNT,0)="<IndicationPrecursorCode>"_IPC_"</IndicationPrecursorCode>"
I $L(IT) D C S @GBL@(CNT,0)="<IndicationText>"_IT_"</IndicationText>"
I $L(ITCQ) D C S @GBL@(CNT,0)="<IndicationTextCodeQualifier>"_ITCQ_"</IndicationTextCodeQualifier>"
I $L(ITC) D C S @GBL@(CNT,0)="<IndicationTextCode>"_ITC_"</IndicationTextCode>"
I $L(IVT) D C S @GBL@(CNT,0)="<IndicationValueText>"_IVT_"</IndicationValueText>"
I $L(IVU) D C S @GBL@(CNT,0)="<IndicationValueUnit>"_IVU_"</IndicationValueUnit>"
I $L(IVUMT) D C S @GBL@(CNT,0)="<IndicationValueUnitofMeasureText>"_IVUMT_"</IndicationValueUnitofMeasureText>"
I $L(IVUMCQ) D C S @GBL@(CNT,0)="<IndicationValueUnitofMeasureCodeQualifier>"_IVUMCQ_"</IndicationValueUnitofMeasureCodeQualifier>"
I $L(IVUMC) D C S @GBL@(CNT,0)="<IndicationValueUnitofMeasureCode>"_IVUMC_"</IndicationValueUnitofMeasureCode>"
I $L(IVM) D C S @GBL@(CNT,0)="<IndicationVariableModifier>"_IVM_"</IndicationVariableModifier>"
I INDFLG D C S @GBL@(CNT,0)="</Indication>"
I $L(STOPI) D
.D C S @GBL@(CNT,0)="<Stop>"
.D C S @GBL@(CNT,0)="<StopIndicator>"_STOPI_"</StopIndicator>"
.D C S @GBL@(CNT,0)="</Stop>"
D C S @GBL@(CNT,0)="</StructuredSIG>"
Q
C ;
S CNT=$G(CNT)+1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HPSOERXX5 15097 printed Nov 22, 2024@17:39:16 Page 2
PSOERXX5 ;ALB/BWF - eRx xml utilities ; 8/3/2016 5:14pm
+1 ;;7.0;OUTPATIENT PHARMACY;**467,508,551**;DEC 1997;Build 37
+2 ;
+3 QUIT
STRUCSIG(GBL,IENS) ;
+1 NEW SSPN,MSM,SV,FMTV,SFTSI,SFT,DCI,DDM,DDMCQ,DDMC,DDMMT,DDMMCQ,DDMMC,MDRFLG,MDVAR
+2 NEW DQ,DFT,DFCQ,DFC,DRM,DBMV,DBUM,DBUMCQ,DBUC,BMQ,BMV,CDM,CDUMT,CDUMCQ,CDUMC,DBRM
+3 NEW VN,VNCQ,VUMT,VUMCQ,VUMC,MVM,RAT,RACQ,RAC,MRAM,SAT,SACQ,SAC,MATM,RM,RUMT,INDFLG,INDVAR
+4 NEW RUMCQ,RUMC,TPBT,TPBCQ,TPBC,FNV,FUT,FUCQ,FUC,VFM,INV,IUT,IUCQ,IUC,OR,DNV,DTEXT,DTCQ
+5 NEW DTC,MDRNV,MDRUT,MDRCQ,MDRUC,MDRVN,MDRVUT,MDRVUCQ,MDRVUC,MDRVDM,IPT,IPCQ,IPC,IT
+6 NEW F,ITCQ,ITC,IVT,IVU,IVUMT,IVUMCQ,IVUMC,IVM,STOPI,PDAT,ATC,ATCQ,ATT,TMATM,VIM,VNC,VQ
+7 NEW DOSEVAR,DOSEFLG,DCALFLG,DCALVAR,VFLG,VVAR,ROAFLG,ROAVAR,SOAFLG,SOAVAR,TIMFLG,TIMVAR,DURFLG,DURVAR
+8 SET F=52.4911
+9 DO GETS^DIQ(F,IENS,"**","IE","PDAT")
+10 DO CONVXML^PSOERXX1("PDAT")
+11 SET SSPN=$GET(PDAT(F,IENS,.01,"E"))
SET MSM=$GET(PDAT(F,IENS,.02,"I"))
SET SV=$GET(PDAT(F,IENS,.03,"E"))
+12 SET FMTV=$GET(PDAT(F,IENS,.04,"E"))
SET SFTSI=$GET(PDAT(F,IENS,.05,"E"))
SET SFT=$GET(PDAT(F,IENS,1,"E"))
+13 SET DCI=$GET(PDAT(F,IENS,2.1,"E"))
SET DDM=$GET(PDAT(F,IENS,2.2,"E"))
SET DDMCQ=$GET(PDAT(F,IENS,2.3,"I"))
+14 SET DDMC=$GET(PDAT(F,IENS,2.4,"E"))
SET DDMMT=$GET(PDAT(F,IENS,2.5,"E"))
SET DDMMCQ=$GET(PDAT(F,IENS,2.7,"I"))
SET DDMMC=$GET(PDAT(F,IENS,2.6,"E"))
+15 SET DQ=$GET(PDAT(F,IENS,3.1,"E"))
SET DFT=$GET(PDAT(F,IENS,3.2,"E"))
SET DFCQ=$GET(PDAT(F,IENS,3.4,"I"))
SET DFC=$GET(PDAT(F,IENS,3.3,"E"))
+16 SET DRM=$GET(PDAT(F,IENS,3.5,"I"))
SET DBMV=$GET(PDAT(F,IENS,4.1,"E"))
SET DBUM=$GET(PDAT(F,IENS,4.2,"E"))
SET DBUMCQ=$GET(PDAT(F,IENS,4.4,"I"))
+17 SET DBUC=$GET(PDAT(F,IENS,4.3,"E"))
SET BMQ=$GET(PDAT(F,IENS,4.5,"I"))
SET BMV=$GET(PDAT(F,IENS,4.6,"E"))
SET CDM=$GET(PDAT(F,IENS,4.7,"E"))
+18 SET CDUMT=$GET(PDAT(F,IENS,4.8,"E"))
SET CDUMCQ=$GET(PDAT(F,IENS,4.11,"I"))
SET CDUMC=$GET(PDAT(F,IENS,4.9,"E"))
SET DBRM=$GET(PDAT(F,IENS,4.12,"I"))
+19 SET VN=$GET(PDAT(F,IENS,5.1,"E"))
SET VNC=$GET(PDAT(F,IENS,5.2,"E"))
SET VNCQ=$GET(PDAT(F,IENS,5.3,"I"))
SET VQ=$GET(PDAT(F,IENS,5.4,"E"))
+20 SET VUMT=$GET(PDAT(F,IENS,5.5,"E"))
SET VUMCQ=$GET(PDAT(F,IENS,5.7,"I"))
SET VUMC=$GET(PDAT(F,IENS,5.6,"E"))
SET MVM=$GET(PDAT(F,IENS,5.8,"I"))
+21 SET RAT=$GET(PDAT(F,IENS,6.1,"E"))
SET RACQ=$GET(PDAT(F,IENS,6.3,"I"))
SET RAC=$GET(PDAT(F,IENS,6.2,"E"))
SET MRAM=$GET(PDAT(F,IENS,6.4,"I"))
+22 SET SAT=$GET(PDAT(F,IENS,6.5,"E"))
SET SACQ=$GET(PDAT(F,IENS,6.7,"I"))
SET SAC=$GET(PDAT(F,IENS,6.7,"I"))
SET MATM=$GET(PDAT(F,IENS,6.8,"I"))
+23 SET ATT=$GET(PDAT(F,IENS,7.1,"E"))
SET ATCQ=$GET(PDAT(F,IENS,7.3,"I"))
SET ATC=$GET(PDAT(F,IENS,7.2,"E"))
SET TMATM=$GET(PDAT(F,IENS,7.4,"I"))
+24 SET RM=$GET(PDAT(F,IENS,7.5,"E"))
SET RUMT=$GET(PDAT(F,IENS,7.6,"E"))
SET RUMCQ=$GET(PDAT(F,IENS,7.8,"I"))
SET RUMC=$GET(PDAT(F,IENS,7.7,"E"))
+25 SET TPBT=$GET(PDAT(F,IENS,8.1,"E"))
SET TPBCQ=$GET(PDAT(F,IENS,8.3,"I"))
SET TPBC=$GET(PDAT(F,IENS,8.2,"E"))
SET FNV=$GET(PDAT(F,IENS,8.4,"E"))
+26 SET FUT=$GET(PDAT(F,IENS,8.5,"E"))
SET FUCQ=$GET(PDAT(F,IENS,8.7,"I"))
SET FUC=$GET(PDAT(F,IENS,8.6,"E"))
SET VFM=$GET(PDAT(F,IENS,8.8,"I"))
SET INV=$GET(PDAT(F,IENS,9.1,"E"))
+27 SET IUT=$GET(PDAT(F,IENS,9.2,"E"))
SET IUCQ=$GET(PDAT(F,IENS,9.4,"I"))
SET IUC=$GET(PDAT(F,IENS,9.3,"E"))
SET VIM=$GET(PDAT(F,IENS,9.5,"I"))
+28 SET DNV=$GET(PDAT(F,IENS,9.6,"E"))
SET DTEXT=$GET(PDAT(F,IENS,9.7,"E"))
SET DTCQ=$GET(PDAT(F,IENS,9.9,"I"))
SET DTC=$GET(PDAT(F,IENS,9.8,"E"))
+29 SET MDRNV=$GET(PDAT(F,IENS,10.1,"E"))
SET MDRUT=$GET(PDAT(F,IENS,10.2,"E"))
SET MDRCQ=$GET(PDAT(F,IENS,10.3,"I"))
SET MDRUC=$GET(PDAT(F,IENS,10.4,"E"))
+30 SET MDRVN=$GET(PDAT(F,IENS,10.5,"E"))
SET MDRVUT=$GET(PDAT(F,IENS,10.6,"E"))
SET MDRVUCQ=$GET(PDAT(F,IENS,10.8,"I"))
SET MDRVUC=$GET(PDAT(F,IENS,10.7,"E"))
+31 SET MDRVDM=$GET(PDAT(F,IENS,10.9,"I"))
SET IPT=$GET(PDAT(F,IENS,11.1,"E"))
SET IPCQ=$GET(PDAT(F,IENS,11.3,"I"))
SET IPC=$GET(PDAT(F,IENS,11.2,"E"))
+32 SET IT=$GET(PDAT(F,IENS,11.4,"E"))
SET ITCQ=$GET(PDAT(F,IENS,11.6,"I"))
SET ITC=$GET(PDAT(F,IENS,11.5,"E"))
SET IVT=$GET(PDAT(F,IENS,12.1,"E"))
+33 SET IVU=$GET(PDAT(F,IENS,12.2,"E"))
SET IVUMT=$GET(PDAT(F,IENS,12.3,"E"))
SET IVUMCQ=$GET(PDAT(F,IENS,12.5,"I"))
+34 SET IVUMC=$GET(PDAT(F,IENS,12.4,"E"))
SET IVM=$GET(PDAT(F,IENS,12.6,"I"))
SET STOPI=$GET(PDAT(F,IENS,12.7,"I"))
+35 DO C
SET @GBL@(CNT,0)="<StructuredSIG>"
+36 DO C
SET @GBL@(CNT,0)="<RepeatingSIG>"
+37 DO C
SET @GBL@(CNT,0)="<SigSequencePositionNumber>"_SSPN_"</SigSequencePositionNumber>"
+38 IF $LENGTH(MSM)
DO C
SET @GBL@(CNT,0)="<MultipleSigModifier>"_MSM_"</MultipleSigModifier>"
+39 DO C
SET @GBL@(CNT,0)="</RepeatingSIG>"
+40 DO C
SET @GBL@(CNT,0)="<CodeSystem>"
+41 IF $LENGTH(SV)
DO C
SET @GBL@(CNT,0)="<SNOMEDVersion>"_SV_"</SNOMEDVersion>"
+42 IF $LENGTH(FMTV)
DO C
SET @GBL@(CNT,0)="<FMTVersion>"_FMTV_"</FMTVersion>"
+43 DO C
SET @GBL@(CNT,0)="</CodeSystem>"
+44 DO C
SET @GBL@(CNT,0)="<FreeText>"
+45 IF $LENGTH(SFTSI)
DO C
SET @GBL@(CNT,0)="<SigFreeTextStringIndicator>"_SFTSI_"</SigFreeTextStringIndicator>"
+46 IF $LENGTH(SFT)
DO C
SET @GBL@(CNT,0)="<SigFreeText>"_SFT_"</SigFreeText>"
+47 DO C
SET @GBL@(CNT,0)="</FreeText>"
+48 SET DOSEFLG=0
+49 FOR DOSEVAR="DCI","DDM","DDMCQ","DDMC","DDMMT","DDMMCQ","DDMMC","DQ","DFT","DFCQ","DFC","DRM"
Begin DoDot:1
+50 IF $LENGTH(@DOSEVAR)
SET DOSEFLG=1
End DoDot:1
+51 IF DOSEFLG
DO C
SET @GBL@(CNT,0)="<Dose>"
+52 IF $LENGTH(DCI)
DO C
SET @GBL@(CNT,0)="<DoseCompositeIndicator>"_DCI_"</DoseCompositeIndicator>"
+53 IF $LENGTH(DDM)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodText>"_DDM_"</DoseDeliveryMethodText>"
+54 IF $LENGTH(DDMCQ)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodCodeQualifier>"_DDMCQ_"</DoseDeliveryMethodCodeQualifier>"
+55 IF $LENGTH(DDMC)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodCode>"_DDMC_"</DoseDeliveryMethodCode>"
+56 IF $LENGTH(DDMMT)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodModifierText>"_DDMMT_"</DoseDeliveryMethodModifierText>"
+57 IF $LENGTH(DDMMCQ)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodModifierCodeQualifier>"_DDMMCQ_"</DoseDeliveryMethodModifierCodeQualifier>"
+58 IF $LENGTH(DDMMC)
DO C
SET @GBL@(CNT,0)="<DoseDeliveryMethodModifierCode>"_DDMMC_"</DoseDeliveryMethodModifierCode>"
+59 IF $LENGTH(DQ)
DO C
SET @GBL@(CNT,0)="<DoseQuantity>"_DQ_"</DoseQuantity>"
+60 IF $LENGTH(DFT)
DO C
SET @GBL@(CNT,0)="<DoseFormText>"_DFT_"</DoseFormText>"
+61 IF $LENGTH(DFCQ)
DO C
SET @GBL@(CNT,0)="<DoseFormCodeQualifier>"_DFCQ_"</DoseFormCodeQualifier>"
+62 IF $LENGTH(DFC)
DO C
SET @GBL@(CNT,0)="<DoseFormCode>"_DFC_"</DoseFormCode>"
+63 IF $LENGTH(DRM)
DO C
SET @GBL@(CNT,0)="<DoseRangeModifier>"_DRM_"</DoseRangeModifier>"
+64 IF DOSEFLG
DO C
SET @GBL@(CNT,0)="</Dose>"
+65 SET DCALFLG=0
+66 FOR DCALVAR="DBMV","DBUM","DBUMCQ","DBUC","BMQ","BMV","CDM","CDUMT","CDUMCQ","CDUMC","DBRM"
Begin DoDot:1
+67 IF $LENGTH(@DCALVAR)
SET DCALFLG=1
End DoDot:1
+68 IF DCALFLG
DO C
SET @GBL@(CNT,0)="<DoseCalculation>"
+69 IF $LENGTH(DBMV)
DO C
SET @GBL@(CNT,0)="<DosingBasisNumericValue>"_DBMV_"</DosingBasisNumericValue>"
+70 IF $LENGTH(DBUM)
DO C
SET @GBL@(CNT,0)="<DosingBasisUnitofMeasureText>"_DBUM_"</DosingBasisUnitofMeasureText>"
+71 IF $LENGTH(DBUMCQ)
DO C
SET @GBL@(CNT,0)="<DosingBasisUnitofMeasureCodeQualifier>"_DBUMCQ_"</DosingBasisUnitofMeasureCodeQualifier>"
+72 IF $LENGTH(DBUC)
DO C
SET @GBL@(CNT,0)="<DosingBasisUnitofMeasureCode>"_DBUC_"</DosingBasisUnitofMeasureCode>"
+73 IF $LENGTH(BMQ)
DO C
SET @GBL@(CNT,0)="<BodyMetricQualifier>"_BMQ_"</BodyMetricQualifier>"
+74 IF $LENGTH(BMV)
DO C
SET @GBL@(CNT,0)="<BodyMetricValue>"_BMV_"</BodyMetricValue>"
+75 IF $LENGTH(CDM)
DO C
SET @GBL@(CNT,0)="<CalculatedDoseNumeric>"_CDM_"</CalculatedDoseNumeric>"
+76 IF $LENGTH(CDUMT)
DO C
SET @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureText>"_CDUMT_"</CalculatedDoseUnitofMeasureText>"
+77 IF $LENGTH(CDUMCQ)
DO C
SET @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureCodeQualifier>"_CDUMCQ_"</CalculatedDoseUnitofMeasureCodeQualifier>"
+78 IF $LENGTH(CDUMC)
DO C
SET @GBL@(CNT,0)="<CalculatedDoseUnitofMeasureCode>"_CDUMC_"</CalculatedDoseUnitofMeasureCode>"
+79 IF $LENGTH(DBRM)
DO C
SET @GBL@(CNT,0)="<DosingBasisRangeModifier>"_DBRM_"</DosingBasisRangeModifier>"
+80 IF DCALFLG
DO C
SET @GBL@(CNT,0)="</DoseCalculation>"
+81 SET VFLG=0
+82 FOR VVAR="VN","VNCQ","VNC","VQ","VUMT","VUMCQ","VUMC","MVM"
Begin DoDot:1
+83 IF $LENGTH(@VVAR)
SET VFLG=1
End DoDot:1
+84 IF VFLG
DO C
SET @GBL@(CNT,0)="<Vehicle>"
+85 IF $LENGTH(VN)
DO C
SET @GBL@(CNT,0)="<VehicleName>"_VN_"</VehicleName>"
+86 IF $LENGTH(VNCQ)
DO C
SET @GBL@(CNT,0)="<VehicleNameCodeQualifier>"_VNCQ_"</VehicleNameCodeQualifier>"
+87 IF $LENGTH(VNC)
DO C
SET @GBL@(CNT,0)="<VehicleNameCode>"_VNC_"</VehicleNameCode>"
+88 IF $LENGTH(VQ)
DO C
SET @GBL@(CNT,0)="<VehicleQuantity>"_VQ_"</VehicleQuantity>"
+89 IF $LENGTH(VUMT)
DO C
SET @GBL@(CNT,0)="<VehicleUnitOfMeasureText>"_VUMT_"</VehicleUnitOfMeasureText>"
+90 IF $LENGTH(VUMCQ)
DO C
SET @GBL@(CNT,0)="<VehicleUnitOfMeasureCodeQualifier>"_VUMCQ_"</VehicleUnitOfMeasureCodeQualifier>"
+91 IF $LENGTH(VUMC)
DO C
SET @GBL@(CNT,0)="<VehicleUnitOfMeasureCode>"_VUMC_"</VehicleUnitOfMeasureCode>"
+92 IF $LENGTH(MVM)
DO C
SET @GBL@(CNT,0)="<MultipleVehicleModifier>"_MVM_"</MultipleVehicleModifier>"
+93 IF VFLG
DO C
SET @GBL@(CNT,0)="</Vehicle>"
+94 SET ROAFLG=0
+95 FOR ROAVAR="RAT","RACQ","RAC","MRAM"
Begin DoDot:1
+96 IF $LENGTH(@ROAVAR)
SET ROAFLG=1
End DoDot:1
+97 IF ROAFLG
DO C
SET @GBL@(CNT,0)="<RouteofAdministration>"
+98 IF $LENGTH(RAT)
DO C
SET @GBL@(CNT,0)="<RouteofAdministrationText>"_RAT_"</RouteofAdministrationText>"
+99 IF $LENGTH(RACQ)
DO C
SET @GBL@(CNT,0)="<RouteofAdministrationCodeQualifier>"_RACQ_"</RouteofAdministrationCodeQualifier>"
+100 IF $LENGTH(RAC)
DO C
SET @GBL@(CNT,0)="<RouteofAdministrationCode>"_RAC_"</RouteofAdministrationCode>"
+101 IF $LENGTH(MRAM)
DO C
SET @GBL@(CNT,0)="<MultipleRouteofAdministrationModifier>"_MRAM_"</MultipleRouteofAdministrationModifier>"
+102 IF ROAFLG
DO C
SET @GBL@(CNT,0)="</RouteofAdministration>"
+103 SET SOAFLG=0
+104 FOR SOAVAR="SAT","SACQ","SAC","MATM"
Begin DoDot:1
+105 IF $LENGTH(@SOAVAR)
SET SOAFLG=1
End DoDot:1
+106 IF SOAFLG
DO C
SET @GBL@(CNT,0)="<SiteofAdministration>"
+107 IF $LENGTH(SAT)
DO C
SET @GBL@(CNT,0)="<SiteofAdministrationText>"_SAT_"</SiteofAdministrationText>"
+108 IF $LENGTH(SACQ)
DO C
SET @GBL@(CNT,0)="<SiteofAdministrationCodeQualifier>"_SACQ_"</SiteofAdministrationCodeQualifier>"
+109 IF $LENGTH(SAC)
DO C
SET @GBL@(CNT,0)="<SiteofAdministrationCode>"_SAC_"</SiteofAdministrationCode>"
+110 IF $LENGTH(MATM)
DO C
SET @GBL@(CNT,0)="<MultipleAdministrationTimingModifier>"_MATM_"</MultipleAdministrationTimingModifier>"
+111 IF SOAFLG
DO C
SET @GBL@(CNT,0)="</SiteofAdministration>"
+112 SET TIMFLG=0
+113 FOR TIMVAR="ATT","ATCQ","ATC","TMATM","RM","RUMT","RUMCQ","RUMC","TPBT","TPBCQ","TPBC","FNV","FUT","FUCQ","FUC","VFM","INV","IUT","IUCQ","IUC","VIM"
Begin DoDot:1
+114 IF $LENGTH(@TIMVAR)
SET TIMFLG=1
End DoDot:1
+115 IF TIMFLG
DO C
SET @GBL@(CNT,0)="<Timing>"
+116 IF $LENGTH(ATT)
DO C
SET @GBL@(CNT,0)="<AdministrationTimingText>"_ATT_"</AdministrationTimingText>"
+117 IF $LENGTH(ATCQ)
DO C
SET @GBL@(CNT,0)="<AdministrationTimingCodeQualifier>"_ATCQ_"</AdministrationTimingCodeQualifier>"
+118 IF $LENGTH(ATC)
DO C
SET @GBL@(CNT,0)="<AdministrationTimingCode>"_ATC_"</AdministrationTimingCode>"
+119 IF $LENGTH(TMATM)
DO C
SET @GBL@(CNT,0)="<MultipleAdministrationTimingModifier>"_TMATM_"</MultipleAdministrationTimingModifier>"
+120 IF $LENGTH(RM)
DO C
SET @GBL@(CNT,0)="<RateofAdministration>"_RM_"</RateofAdministration>"
+121 IF $LENGTH(RUMT)
DO C
SET @GBL@(CNT,0)="<RateUnitofMeasureText>"_RUMT_"</RateUnitofMeasureText>"
+122 IF $LENGTH(RUMCQ)
DO C
SET @GBL@(CNT,0)="<RateUnitofMeasureCodeQualifier>"_RUMCQ_"</RateUnitofMeasureCodeQualifier>"
+123 IF $LENGTH(RUMC)
DO C
SET @GBL@(CNT,0)="<RateUnitofMeasureCode>"_RUMC_"</RateUnitofMeasureCode>"
+124 IF $LENGTH(TPBT)
DO C
SET @GBL@(CNT,0)="<TimePeriodBasisText>"_TPBT_"</TimePeriodBasisText>"
+125 IF $LENGTH(TPBCQ)
DO C
SET @GBL@(CNT,0)="<TimePeriodBasisCodeQualifier>"_TPBCQ_"</TimePeriodBasisCodeQualifier>"
+126 IF $LENGTH(TPBC)
DO C
SET @GBL@(CNT,0)="<TimePeriodBasisCode>"_TPBC_"</TimePeriodBasisCode>"
+127 IF $LENGTH(FNV)
DO C
SET @GBL@(CNT,0)="<FrequencyNumericValue>"_FNV_"</FrequencyNumericValue>"
+128 IF $LENGTH(FUT)
DO C
SET @GBL@(CNT,0)="<FrequencyUnitsText>"_FUT_"</FrequencyUnitsText>"
+129 IF $LENGTH(FUCQ)
DO C
SET @GBL@(CNT,0)="<FrequencyUnitsCodeQualifier>"_FUCQ_"</FrequencyUnitsCodeQualifier>"
+130 IF $LENGTH(FUC)
DO C
SET @GBL@(CNT,0)="<FrequencyUnitsCode>"_FUC_"</FrequencyUnitsCode>"
+131 IF $LENGTH(VFM)
DO C
SET @GBL@(CNT,0)="<VariableFrequencyModifier>"_VFM_"</VariableFrequencyModifier>"
+132 IF $LENGTH(INV)
DO C
SET @GBL@(CNT,0)="<IntervalNumericValue>"_INV_"</IntervalNumericValue>"
+133 IF $LENGTH(IUT)
DO C
SET @GBL@(CNT,0)="<IntervalUnitsText>"_IUT_"</IntervalUnitsText>"
+134 IF $LENGTH(IUCQ)
DO C
SET @GBL@(CNT,0)="<IntervalUnitsCodeQualifier>"_IUCQ_"</IntervalUnitsCodeQualifier>"
+135 IF $LENGTH(IUC)
DO C
SET @GBL@(CNT,0)="<IntervalUnitsCode>"_IUC_"</IntervalUnitsCode>"
+136 IF $LENGTH(VIM)
DO C
SET @GBL@(CNT,0)="<VariableIntervalModifier>"_VIM_"</VariableIntervalModifier>"
+137 IF TIMFLG
DO C
SET @GBL@(CNT,0)="</Timing>"
+138 SET DURFLG=0
+139 FOR DURVAR="DNV","DTEXT","DTCQ","DTC"
Begin DoDot:1
+140 IF $LENGTH(@DURVAR)
SET DURFLG=1
End DoDot:1
+141 ;/BLB/ PSO*7.0*551 - BEGIN CHANGE
+142 IF DURFLG
DO C
SET @GBL@(CNT,0)="<Duration>"
+143 IF $LENGTH(DNV)
DO C
SET @GBL@(CNT,0)="<DurationNumericValue>"_DNV_"</DurationNumericValue>"
+144 IF $LENGTH(DTEXT)
DO C
SET @GBL@(CNT,0)="<DurationText>"_DTEXT_"</DurationText>"
+145 IF $LENGTH(DTCQ)
DO C
SET @GBL@(CNT,0)="<DurationTextCodeQualifier>"_DTCQ_"</DurationTextCodeQualifier>"
+146 IF $LENGTH(DTC)
DO C
SET @GBL@(CNT,0)="<DurationTextCode>"_DTC_"</DurationTextCode>"
+147 IF DURFLG
DO C
SET @GBL@(CNT,0)="</Duration>"
+148 ;/BLB/ PSO*7.0*551 - END CHANGE
+149 SET MDRFLG=0
+150 FOR MDVAR="MDRNV","MDRUT","MDRCQ","MDRUC","MDRVN","MDRVUT","MDRVUCQ","MDRVUC","MDRVDM"
Begin DoDot:1
+151 IF $LENGTH(@MDVAR)
SET MDRFLG=1
End DoDot:1
+152 IF MDRFLG
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestriction>"
+153 IF $LENGTH(MDRNV)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionNumericValue>"_MDRNV_"</MaximumDoseRestrictionNumericValue>"
+154 IF $LENGTH(MDRUT)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionUnitsText>"_MDRUT_"</MaximumDoseRestrictionUnitsText>"
+155 IF $LENGTH(MDRCQ)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionCodeQualifier>"_MDRCQ_"</MaximumDoseRestrictionCodeQualifier>"
+156 IF $LENGTH(MDRUC)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionUnitsCode>"_MDRUC_"</MaximumDoseRestrictionUnitsCode>"
+157 IF $LENGTH(MDRVN)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionVariableNumericValue>"_MDRVN_"</MaximumDoseRestrictionVariableNumericValue>"
+158 IF $LENGTH(MDRVUT)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsText>"_MDRVUT_"</MaximumDoseRestrictionVariableUnitsText>"
+159 IF $LENGTH(MDRVUCQ)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsCodeQualifier>"_MDRVUCQ_"</MaximumDoseRestrictionVariableUnitsCodeQualifier>"
+160 IF $LENGTH(MDRVUC)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionVariableUnitsCode>"_MDRVUC_"</MaximumDoseRestrictionVariableUnitsCode>"
+161 IF $LENGTH(MDRVDM)
DO C
SET @GBL@(CNT,0)="<MaximumDoseRestrictionVariableDurationModifier>"_MDRVDM_"</MaximumDoseRestrictionVariableDurationModifier>"
+162 IF MDRFLG
DO C
SET @GBL@(CNT,0)="</MaximumDoseRestriction>"
+163 SET INDFLG=0
+164 FOR INDVAR="IPT","IPCQ","IPC","IT","ITCQ","ITC","IVT","IVU","IVUMT","IVUMCQ","IVM"
Begin DoDot:1
+165 IF $LENGTH(@INDVAR)
SET INDFLG=1
End DoDot:1
+166 IF INDFLG
DO C
SET @GBL@(CNT,0)="<Indication>"
+167 IF $LENGTH(IPT)
DO C
SET @GBL@(CNT,0)="<IndicationPrecursorText>"_IPT_"</IndicationPrecursorText>"
+168 IF $LENGTH(IPCQ)
DO C
SET @GBL@(CNT,0)="<IndicationPrecursorCodeQualifier>"_IPCQ_"</IndicationPrecursorCodeQualifier>"
+169 IF $LENGTH(IPC)
DO C
SET @GBL@(CNT,0)="<IndicationPrecursorCode>"_IPC_"</IndicationPrecursorCode>"
+170 IF $LENGTH(IT)
DO C
SET @GBL@(CNT,0)="<IndicationText>"_IT_"</IndicationText>"
+171 IF $LENGTH(ITCQ)
DO C
SET @GBL@(CNT,0)="<IndicationTextCodeQualifier>"_ITCQ_"</IndicationTextCodeQualifier>"
+172 IF $LENGTH(ITC)
DO C
SET @GBL@(CNT,0)="<IndicationTextCode>"_ITC_"</IndicationTextCode>"
+173 IF $LENGTH(IVT)
DO C
SET @GBL@(CNT,0)="<IndicationValueText>"_IVT_"</IndicationValueText>"
+174 IF $LENGTH(IVU)
DO C
SET @GBL@(CNT,0)="<IndicationValueUnit>"_IVU_"</IndicationValueUnit>"
+175 IF $LENGTH(IVUMT)
DO C
SET @GBL@(CNT,0)="<IndicationValueUnitofMeasureText>"_IVUMT_"</IndicationValueUnitofMeasureText>"
+176 IF $LENGTH(IVUMCQ)
DO C
SET @GBL@(CNT,0)="<IndicationValueUnitofMeasureCodeQualifier>"_IVUMCQ_"</IndicationValueUnitofMeasureCodeQualifier>"
+177 IF $LENGTH(IVUMC)
DO C
SET @GBL@(CNT,0)="<IndicationValueUnitofMeasureCode>"_IVUMC_"</IndicationValueUnitofMeasureCode>"
+178 IF $LENGTH(IVM)
DO C
SET @GBL@(CNT,0)="<IndicationVariableModifier>"_IVM_"</IndicationVariableModifier>"
+179 IF INDFLG
DO C
SET @GBL@(CNT,0)="</Indication>"
+180 IF $LENGTH(STOPI)
Begin DoDot:1
+181 DO C
SET @GBL@(CNT,0)="<Stop>"
+182 DO C
SET @GBL@(CNT,0)="<StopIndicator>"_STOPI_"</StopIndicator>"
+183 DO C
SET @GBL@(CNT,0)="</Stop>"
End DoDot:1
+184 DO C
SET @GBL@(CNT,0)="</StructuredSIG>"
+185 QUIT
C ;
+1 SET CNT=$GET(CNT)+1
+2 QUIT