Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: PSOERXA1

PSOERXA1.m

Go to the documentation of this file.
  1. PSOERXA1 ;ALB/BWF - eRx Utilities/RPC's ; 8/3/2016 5:14pm
  1. ;;7.0;OUTPATIENT PHARMACY;**467,520,508,551,581,617,743**;DEC 1997;Build 24
  1. ;
  1. Q
  1. ; File incoming XML into appropriate file
  1. ; XML - xml text
  1. ; PRCHK - provider check information
  1. ; PACHK - patient check information
  1. ; DACHK - drug auto check
  1. ; STATION - station #
  1. ; DIV - institution name^NPI
  1. ; ERXHID - eRx processing hub id^CANCEL/CHANGE REQUEST DENIED BY HUB (1=YES)
  1. ; ERXVALS - code values for NIST codes
  1. ; XML2 - structured sig from the medication prescribed segment
  1. ; VADAT - DUZ^RXIEN
  1. INCERX(RES,XML,PRCHK,PACHK,DACHK,STATION,DIV,ERXHID,ERXVALS,XML2,VADAT) ;
  1. N CURREC,FDA,EIEN,ERRTXT,ERRSEQ,PACNT,PASCNT,PAICN,PAIEN,VAINST,NPI,VAOI,VPATINST,NEWVAL
  1. S NPI=$P($G(DIV),U,2)
  1. S CURREC=$$PARSE(.XML,.ERXVALS,NPI,.XML2)
  1. I $P(CURREC,U)<1 D Q
  1. .I $L($P(CURREC,U,2)) S RES=CURREC Q
  1. .S RES="0^XML received. Error creating or finding associated record in the ERX Holding queue." Q
  1. S EIEN=CURREC
  1. S CURREC=CURREC_","
  1. ; if this is an outbound message, file the users DUZ and quit back the response. no drug, patient, or provider auto checks will occur
  1. I $D(VADAT) D Q
  1. .I $P($G(VADAT),U)>1 D
  1. ..S FDA(52.49,CURREC,51.1)=DUZ D FILE^DIE(,"FDA") K FDA
  1. .I $P(VADAT,U,2) D
  1. ..S FDA(52.49,CURREC,.13)=$P(VADAT,U,2) D FILE^DIE(,"FDA") K FDA
  1. .S RES="1^Erx Received."
  1. ; Process auto-validation results. only log positive results for now
  1. K FDA
  1. I $P($G(VADAT),U) S RES="1^Message Filed." Q
  1. I $G(DACHK("success"))="true" D
  1. .I $G(DACHK("IEN")) D
  1. ..;Saving the eRx Audit Log For Auto-Matched Drug
  1. ..S NEWVAL(1)=$$GET1^DIQ(50,DACHK("IEN"),.01)_" (NDC#: "_$$GETNDC^PSSNDCUT(DACHK("IEN"))_")"
  1. ..D AUDLOG^PSOERXUT(+CURREC,"DRUG",$$PROXYDUZ^PSOERXUT(),.NEWVAL)
  1. ..;Setting Matched Drug and Auto Match info
  1. ..S FDA(52.49,CURREC,1.4)=1
  1. ..S FDA(52.49,CURREC,3.2)=DACHK("IEN")
  1. ..S FDA(52.49,CURREC,44)=1
  1. ..S VAOI=$$GET1^DIQ(50,DACHK("IEN"),2.1,"I")
  1. ..S VPATINST=$$GET1^DIQ(50.7,VAOI,7,"E")
  1. ..I $L(VPATINST) S FDA(52.49,CURREC,27)=VPATINST
  1. I $G(DACHK("success"))="false" D
  1. .S ERRTXT=$G(DACHK("error"))
  1. .S ERRSEQ=$$ERRSEQ^PSOERXU1(EIEN) Q:'ERRSEQ
  1. .D FILERR^PSOERXU1(CURREC,ERRSEQ,"D","E",ERRTXT)
  1. I $G(PRCHK("success"))="true" D
  1. .I PRCHK("IEN") D
  1. ..S FDA(52.49,CURREC,1.2)=1
  1. ..S FDA(52.49,CURREC,2.3)=PRCHK("IEN")
  1. ..;Saving the eRx Audit Log for the Auto-Matched Provider
  1. ..S NEWVAL(1)=$$GET1^DIQ(200,PRCHK("IEN"),.01)_" (DEA#: "_$P($$VADEA^PSOERXU8(PRCHK("IEN"),CURREC),"^",2)_")" ; PSO*7*743
  1. ..D AUDLOG^PSOERXUT(+CURREC,"PROVIDER",$$PROXYDUZ^PSOERXUT(),.NEWVAL)
  1. I $G(PRCHK("success"))="false" D
  1. .S ERRTXT=$G(PRCHK("error"))
  1. .S ERRSEQ=$$ERRSEQ^PSOERXU1(EIEN) Q:'ERRSEQ
  1. .D FILERR^PSOERXU1(CURREC,ERRSEQ,"PR","E",ERRTXT)
  1. I $G(PACHK("MVIerror"))']"" D
  1. .S PAICN=+$P($G(PACHK("ICN")),"V")
  1. .I PAICN D
  1. ..S (PAIEN,PACNT)=0 F S PAIEN=$O(^DPT("AICN",PAICN,PAIEN)) Q:'PAIEN D
  1. ...S PACNT=PACNT+1
  1. ...; revisit in future build - if we find more than one match in the local system, do we log some sort of an error?
  1. .I $G(PACNT)=1 D Q
  1. ..S FDA(52.49,CURREC,1.6)=1
  1. ..S FDA(52.49,CURREC,.05)=$O(^DPT("AICN",PAICN,0))
  1. .I $L(PACHK("ssn")) D
  1. ..S (PASCNT,PAIEN)=0 F S PAIEN=$O(^DPT("SSN",$TR(PACHK("ssn"),"-",""),PAIEN)) Q:'PAIEN D
  1. ...S PASCNT=PASCNT+1
  1. .I $G(PASCNT)=1 D Q
  1. ..S FDA(52.49,CURREC,1.6)=1
  1. ..S FDA(52.49,CURREC,.05)=$O(^DPT("SSN",$TR(PACHK("ssn"),"-",""),0))
  1. I $D(FDA) D FILE^DIE(,"FDA") K FDA
  1. ;
  1. ;Saving the eRx Audit Log For Auto-Matched Patient
  1. I $G(FDA(52.49,CURREC,.05)) D
  1. .N DFN,VADM S DFN=+FDA(52.49,CURREC,.05) D DEM^VADPT
  1. .S NEWVAL(1)=$$GET1^DIQ(2,DFN,.01)_" (L4SSN: "_$P($P(VADM(2),"^",2),"-",3)_" | DOB: "_$P(VADM(3),"^",2)_")"
  1. .D AUDLOG^PSOERXUT(+CURREC,"PATIENT",$$PROXYDUZ^PSOERXUT(),.NEWVAL)
  1. ;
  1. I $D(FDA) D FILE^DIE(,"FDA") K FDA
  1. I $G(PACHK("success"))="false" D
  1. .; file e&e error
  1. .S ERRTXT=$G(PACHK("EandEerror")) I ERRTXT]"" D
  1. ..S ERRSEQ=$$ERRSEQ^PSOERXU1(EIEN) Q:'ERRSEQ
  1. ..D FILERR^PSOERXU1(CURREC,ERRSEQ,"PA","E",ERRTXT)
  1. .; file mvi error
  1. .S ERRTXT=$G(PACHK("MVIerror")) I ERRTXT]"" D
  1. ..S ERRSEQ=$$ERRSEQ^PSOERXU1(EIEN) Q:'ERRSEQ
  1. ..D FILERR^PSOERXU1(CURREC,ERRSEQ,"PA","E",ERRTXT)
  1. S RES="1^Erx Received."
  1. Q
  1. PARSE(STREAM,ERXVALS,NPI,STREAM2) ;
  1. N %XML,GL,VAINST,MTYPE,HUBDENY
  1. S GL=$NA(^TMP($J,"PSOERXO1"))
  1. K @GL
  1. N STATUS,READER,XOBERR,S,ATTR,READER2,XOBERR2,STATUS2
  1. S STREAM=$TR(STREAM,"^","")
  1. I $L(STREAM2) S STREAM2=$TR(STREAM2,"^","")
  1. S STATUS=##class(%XML.TextReader).ParseStream(STREAM,.READER,,,,,1)
  1. I $L(STREAM2) S STATUS2=##class(%XML.TextReader).ParseStream(STREAM2,.READER2,,,,,1)
  1. I $$STATCHK^XOBWLIB(STATUS,.XOBERR,1) D
  1. .N BREAK
  1. .S BREAK=0 F Q:BREAK||READER.EOF||'READER.Read() D
  1. ..N X,PUSHED,PARENT
  1. ..I READER.AttributeCount D
  1. ...S PARENT=READER.LocalName
  1. ...D SPUSH(.S,PARENT) S PUSHED=1
  1. ...F ATTR=1:1:READER.AttributeCount D
  1. ....D READER.MoveToAttributeIndex(ATTR)
  1. ....I READER.NodeType="attribute" D APUT(.S,READER.Value,READER.LocalName)
  1. ..I READER.NodeType="element",'$G(PUSHED) D SPUSH(.S,READER.LocalName)
  1. ..; PSO*7*508 - if the type is an element, and is an empty element, put it in the global.
  1. ..I READER.NodeType="element",READER.IsEmptyElement D SPUT(.S,"")
  1. ..I READER.NodeType="endelement" D SPOP(.S,.X)
  1. ..I READER.NodeType="chars" D SPUT(.S,READER.Value)
  1. I $D(STATUS2) D
  1. .I $$STATCHK^XOBWLIB(STATUS2,.XOBERR2,1) D
  1. ..N BREAK,S
  1. ..S BREAK=0 F Q:BREAK||READER2.EOF||'READER2.Read() D
  1. ...N X,PUSHED,PARENT
  1. ...I READER2.AttributeCount D
  1. ....S PARENT=READER2.LocalName
  1. ....D SPUSH(.S,PARENT) S PUSHED=1
  1. ....F ATTR=1:1:READER2.AttributeCount D
  1. .....D READER2.MoveToAttributeIndex(ATTR)
  1. .....I READER2.NodeType="attribute" D APUT(.S,READER2.Value,READER2.LocalName)
  1. ...I READER2.NodeType="element",'$G(PUSHED) D SPUSH(.S,READER2.LocalName)
  1. ...; PSO*7*508 - if the type is an element, and is an empty element, put it in the global.
  1. ...I READER.NodeType="element",READER.IsEmptyElement D SPUT(.S,"")
  1. ...I READER2.NodeType="endelement" D SPOP(.S,.X)
  1. ...I READER2.NodeType="chars" D SPUT(.S,READER2.Value)
  1. S MTYPE=$O(^TMP($J,"PSOERXO1","Message",0,"Body",0,"")) Q:MTYPE']"" "0^Message type could not be identified."
  1. I '$L(NPI) S NPI=$G(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,"Pharmacy",0,"Identification",0,"NPI",0))
  1. I '$L(NPI) Q "0^Missing NPI. Institution could not be resolved. eRx not filed."
  1. S VAINST=$$FIND1^DIC(4,,"O",NPI,"ANPI")
  1. I '$G(VAINST) Q "0^Institution could not be resolved. eRx not filed."
  1. N NERXIEN,ERR,PATIEN
  1. S NERXIEN=$$HDR^PSOERXA3(MTYPE)
  1. I $P(NERXIEN,U)<1 Q NERXIEN
  1. I $G(VAINST) S FDA(52.49,NERXIEN_",",24.1)=VAINST D FILE^DIE(,"FDA") K FDA
  1. ; if message type is 'Error', do not try to file the other components.
  1. I MTYPE["Error" D Q NERXIEN
  1. .S PATIEN=$$GETPAT^PSOERXU5(NERXIEN) Q:'PATIEN
  1. .S FDA(52.49,NERXIEN_",",.04)=PATIEN D FILE^DIE(,"FDA") K FDA
  1. D PAT(NERXIEN,MTYPE),BFC^PSOERXA5(NERXIEN),PHR^PSOERXA2(NERXIEN,MTYPE),PRE^PSOERXA2(NERXIEN,MTYPE)
  1. D MED^PSOERXA3(NERXIEN,.ERXVALS,MTYPE),OBS(NERXIEN,MTYPE),SUP^PSOERXA2(NERXIEN,MTYPE)
  1. D MEDDISP^PSOERXA5(NERXIEN,MTYPE)
  1. I MTYPE="RefillResponse" D REFRESP^PSOERXA5(NERXIEN,MTYPE)
  1. I MTYPE["Cancel" D
  1. .S HUBDENY=$P(ERXHID,U,2)
  1. .D CANRX^PSOERXA5(NERXIEN,MTYPE,HUBDENY,VAINST)
  1. ; facility/request have no where to go at this point in time??
  1. D FAC^PSOERXA2(NERXIEN)
  1. Q NERXIEN
  1. ;
  1. OBS(ERXIEN,MTYPE) ; Observation
  1. N GL,I,LAST,DIM,MSOURCE,MUNIT,OBSDT,MVAL,OBSNOTE,OBSCNT,F,EIENS,FDA,MDQUAL
  1. S GL=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,"Observation",0))
  1. S F=52.4914,EIENS=ERXIEN_","
  1. S I=-1,OBSCNT=0 F S I=$O(@GL@("Measurement",I)) Q:I="" D
  1. .S OBSCNT=OBSCNT+1,FDA(F,"+1,"_EIENS,.01)=OBSCNT
  1. .S DIM=$G(@GL@("Measurement",I,"Dimension",0)),FDA(F,"+1,"_EIENS,.02)=DIM
  1. .S MDQUAL=$G(@GL@("Measurement",I,"MeasurementDataQualifier",0)),FDA(F,"+1,"_EIENS,.05)=MDQUAL
  1. .S MSOURCE=$G(@GL@("Measurement",I,"MeasurementSourceCode",0)),FDA(F,"+1,"_EIENS,.06)=MSOURCE
  1. .S MUNIT=$G(@GL@("Measurement",I,"MeasurementUnitCode",0)),FDA(F,"+1,"_EIENS,.07)=MUNIT
  1. .S OBSDT=$G(@GL@("Measurement",I,"ObservationDate",0,"Date",0)),OBSDT=$$CONVDTTM^PSOERXA1(OBSDT),FDA(F,"+1,"_EIENS,.04)=OBSDT
  1. .S MVAL=$G(@GL@("Measurement",I,"Value",0)),FDA(F,"+1,"_EIENS,.03)=MVAL
  1. .D UPDATE^DIE(,"FDA") K FDA
  1. S OBSNOTE=$G(@GL@("ObservationNotes",0)),FDA(52.49,EIENS,15)=OBSNOTE D FILE^DIE(,"FDA") K FDA
  1. Q
  1. PAT(ERXIEN,MTYPE) ; patient
  1. N GL,AL1,AL2,CITY,STATE,ZIP,LN,FN,MN,PREF,SUFF,COMQUAL,COMVAL,PLQUAL,DOB,GEN,PRELATE,IDDONE,CDONE,I,C,CQUAL,CVAL
  1. N IDNM,IDVAL,PFN,ERXPAT,NEWPAT,F,EIENS,FDA,IDFND,SRCH,PIENS,NPIEN,PATSSN,PREL,SIEN
  1. S F=52.46
  1. S EIENS=ERXIEN_","
  1. S GL=$NA(^TMP($J,"PSOERXO1","Message",0,"Body",0,MTYPE,0,"Patient",0))
  1. S PREL=$G(@GL@("PatientRelationship",0))
  1. S FN=$$UP^XLFSTR($G(@GL@("Name",0,"FirstName",0)))
  1. S LN=$$UP^XLFSTR($G(@GL@("Name",0,"LastName",0)))
  1. S MN=$$UP^XLFSTR($G(@GL@("Name",0,"MiddleName",0)))
  1. S PFN=LN_","_FN_$S(MN]"":" "_MN,1:"")
  1. S SUFF=$$UP^XLFSTR($G(@GL@("Name",0,"Suffix",0)))
  1. S PREF=$$UP^XLFSTR($G(@GL@("Name",0,"Prefix",0)))
  1. S PRELATE=$G(@GL@("PatientRelationship",0))
  1. S GEN=$G(@GL@("Gender",0))
  1. S DOB=$G(@GL@("DateOfBirth",0,"Date",0)),DOB=$$CONVDTTM^PSOERXA1(DOB)
  1. I DOB<1 S DOB=""
  1. S AL1=$G(@GL@("Address",0,"AddressLine1",0))
  1. S AL2=$G(@GL@("Address",0,"AddressLine2",0))
  1. S CITY=$G(@GL@("Address",0,"City",0))
  1. S STATE=$G(@GL@("Address",0,"State",0))
  1. S ZIP=$G(@GL@("Address",0,"ZipCode",0))
  1. S SIEN=$$STRES^PSOERXA2(ZIP,STATE)
  1. ; need to check for SSN before trying to match the patient. This needs to be stored in an array for later processing
  1. ; check 52.46 for a match before filing
  1. S PATSSN=$G(@GL@("Identification",0,"SocialSecurity",0))
  1. S ERXPAT=$$FINDPAT^PSOERXU2(PFN,DOB,GEN,$G(PATSSN),$G(AL1)) S PIENS=$S(ERXPAT:ERXPAT_",",1:"+1,")
  1. ; first, lets set up the main part
  1. S FDA(F,PIENS,.01)=PFN,FDA(F,PIENS,.02)=LN,FDA(F,PIENS,.03)=FN,FDA(F,PIENS,.04)=MN,FDA(F,PIENS,.05)=SUFF,FDA(F,PIENS,.06)=PREF
  1. S FDA(F,PIENS,.07)=GEN,FDA(F,PIENS,.08)=DOB
  1. S FDA(F,PIENS,1.4)=PATSSN,FDA(F,PIENS,1.7)=PREL
  1. S FDA(F,PIENS,3.1)=AL1,FDA(F,PIENS,3.2)=AL2,FDA(F,PIENS,3.3)=CITY
  1. S FDA(F,PIENS,3.4)=SIEN
  1. S FDA(F,PIENS,3.5)=ZIP
  1. I PIENS["+" D Q
  1. .D UPDATE^DIE(,"FDA","NEWPAT") K FDA
  1. .S NPIEN=$O(NEWPAT(0)),NPIEN=$G(NEWPAT(NPIEN))
  1. .Q:'NPIEN
  1. .S NPIEN=NPIEN
  1. .D PATC(NPIEN)
  1. .S FDA(52.49,EIENS,.04)=NPIEN D FILE^DIE(,"FDA") K FDA
  1. D FILE^DIE(,"FDA") K FDA D PATC(ERXPAT)
  1. S FDA(52.49,EIENS,.04)=ERXPAT D FILE^DIE(,"FDA") K FDA
  1. Q
  1. PATC(IEN) ; patient communication
  1. N IENS,CQUAL,CVAL,COMARY,FDA,SRCH,IDFND,IDNM,IDVAL,IDARY,PATSSN
  1. Q:'IEN
  1. S IENS=IEN_","
  1. ; Kill off existing communication values
  1. K ^PS(52.46,IEN,3)
  1. S C=-1 F S C=$O(@GL@("CommunicationNumbers",0,"Communication",C)) Q:C="" D
  1. .S CQUAL=$G(@GL@("CommunicationNumbers",0,"Communication",C,"Qualifier",0))
  1. .S CVAL=$G(@GL@("CommunicationNumbers",0,"Communication",C,"Number",0))
  1. .S COMARY(CQUAL)=CVAL
  1. .S FDA(52.462,"+1,"_IENS,.01)=CVAL
  1. .S FDA(52.462,"+1,"_IENS,.02)=CQUAL
  1. .D UPDATE^DIE(,"FDA") K FDA
  1. ; kill existing identification values in multiple
  1. K ^PS(52.46,IEN,5)
  1. S IDNM="" F S IDNM=$O(@GL@("Identification",0,IDNM)) Q:IDNM="" D
  1. .S IDVAL=$G(@GL@("Identification",0,IDNM,0))
  1. .I IDNM="SocialSecurity" S PATSSN=IDVAL
  1. .S IDARY(IDNM)=IDVAL
  1. .S IDFND=0
  1. .S SRCH=0 F S SRCH=$O(^PS(52.46,IEN,5,SRCH)) Q:'SRCH D
  1. ..I $$GET1^DIQ(52.465,SRCH_","_IEN_",",.01)=IDNM D
  1. ...S IDFND=1
  1. ...S FDA(52.465,SRCH_","_IEN_",",.02)=IDVAL D FILE^DIE(,"FDA") K FDA
  1. .Q:IDFND
  1. .S FDA(52.465,"+1,"_IEN_",",.01)=IDNM
  1. .S FDA(52.465,"+1,"_IEN_",",.02)=IDVAL
  1. .D UPDATE^DIE(,"FDA") K FDA
  1. I $G(PATSSN)]"" S FDA(52.46,IENS,1.4)=PATSSN D FILE^DIE(,"FDA") K FDA
  1. Q
  1. SPUSH(S,X) ;places X on the stack S and returns the current level of the stack
  1. N I S I=$O(S(""),-1)+1,S(I)=X
  1. Q I
  1. ;
  1. SPOP(S,X) ;removes the top item from the stack S and put it into the variable X and returns the level that X was at
  1. N I S I=$O(S(""),-1)
  1. I I S X=S(I) K S(I)
  1. N J S J=$O(S(I),-1) I J S S(J,X)=$G(S(J,X))+1
  1. Q I
  1. ;
  1. SPEEK(S,X) ;same as SPOP except the top item is not removed
  1. N I S I=$O(S(""),-1)
  1. I I S X=S(I)
  1. Q I
  1. ;
  1. SPUT(S,X) ;implementation specific, uses the stack to form a global node
  1. N I,STR
  1. S X=$TR(X,";","")
  1. S STR=$P(GL,")")
  1. S I=0 F S I=$O(S(I)) Q:'I D
  1. .S STR=STR_","_""""_S(I)_""""_","
  1. .N NUM S NUM=0
  1. .I $D(S(I-1,S(I))) S NUM=+$G(S(I-1,S(I)))
  1. .S STR=STR_NUM
  1. S STR=STR_")"
  1. I $D(@STR) S @STR=@STR_X
  1. I '$D(@STR) S @STR=X
  1. Q STR
  1. APUT(S,X,LN) ; what am i doing here?
  1. N I,STR
  1. S X=$TR(X,";","")
  1. S STR=$P(GL,")")
  1. S I=0 F S I=$O(S(I)) Q:'I D
  1. .S STR=STR_","_""""_S(I)_""""_","
  1. .N NUM S NUM="""A"""
  1. .S STR=STR_NUM_","_""""_LN_""""
  1. S STR=STR_")"
  1. I $D(@STR) S @STR=@STR_X
  1. I '$D(@STR) S @STR=X
  1. Q STR
  1. ;
  1. ; VAL - value to resolve
  1. ; TYPE - This is the code type, which will tell which 'C' index type to get the code from
  1. PRESOLV(VAL,TYPE) ;
  1. N MATCH
  1. S MATCH=""
  1. Q:'$L(TYPE)!('$L(VAL)) "" ; avoid null subscript
  1. S MATCH=$O(^PS(52.45,"C",TYPE,VAL,0))
  1. ; return the match found, null if no match
  1. Q MATCH
  1. CONVDTTM(VAL) ;
  1. N EDATE,ETIME,X,ETZ,Y
  1. I '$L(VAL) Q ""
  1. I VAL'["T" D Q VAL
  1. .S X=$E(VAL,1,10),X=$TR(X,"-","")
  1. .D ^%DT I 'Y S VAL="" Q
  1. .I $P(VAL,"-",4) S ETIME=$TR($P(VAL,"-",4),":","")
  1. .I $P(VAL,"+",2) S ETIME=$TR($P(VAL,"+",2),":","")
  1. .I '$G(ETIME) S VAL=Y Q
  1. .S VAL=Y_"."_ETIME
  1. S EDATE=$P(VAL,"T"),ETIME=$P(VAL,"T",2)
  1. ; split off time zone
  1. S ETZ=$P(ETIME,".",2)
  1. S ETIME=$P(ETIME,".")
  1. S X=EDATE D ^%DT I 'Y Q ""
  1. S VAL=Y_$S($L(ETIME):"."_$TR(ETIME,":",""),1:"")
  1. Q VAL
  1. ;
  1. CSERX() ; Determine if an Incoming eRx is for a Controlled Substance Medication or not
  1. ; Output: "1" (Controlled Substance) or "0" (Non-Controlled Substance)
  1. ;
  1. N DIGSIGVA
  1. S DIGSIGVA=$G(@GL@("DigitalSignature",0,"SignatureValue",0))
  1. I DIGSIGVA'="" Q 1
  1. Q 0