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

RORRP014.m

Go to the documentation of this file.
  1. RORRP014 ;HCIOFO/SG - RPC: REGISTRY INFO & PARAMETERS ; 11/14/05 8:31am
  1. ;;1.5;CLINICAL CASE REGISTRIES;;Feb 17, 2006
  1. ;
  1. Q
  1. ;
  1. ;***** RETURNS THE REGISTRY INFORMATION
  1. ; RPC: [ROR GET REGISTRY INFO]
  1. ;
  1. ; .RESULTS Reference to a local variable where the results
  1. ; are returned to.
  1. ;
  1. ; REGISTRY Either a registry IEN or a registry name
  1. ;
  1. ; Return Values:
  1. ;
  1. ; A negative value of the first "^"-piece of the RESULTS(0) indicates
  1. ; an error (see the RPCSTK^RORERR procedure for more details).
  1. ;
  1. ; Otherwise, 0 is returned in the RESULTS(0) and the subsequent
  1. ; nodes of the RESULTS array contain the registry information.
  1. ;
  1. ; RESULTS(0) 0
  1. ;
  1. ; RESULTS(1) Registry
  1. ; ^01: IEN
  1. ; ^02: Name
  1. ;
  1. ; RESULTS(2) National (0/1)
  1. ;
  1. ; RESULTS(3) Registry Description
  1. ;
  1. ; RESULTS(4) Last registry update date (int)
  1. ;
  1. ; RESULTS(5) Last data extraction date (int)
  1. ;
  1. ; RESULTS(6) Number of Active Patients
  1. ;
  1. ; RESULTS(7) Number of Pending Patients
  1. ;
  1. ; RESULTS(8) Registry Status
  1. ; ^01: Internal value (0-Active, 1-Inactive)
  1. ; ^02: External value
  1. ;
  1. ; RESULTS(9) reserved
  1. ;
  1. ; RESULTS(10) Version information
  1. ; ^01: Package version
  1. ; ^02: Latest patch number
  1. ; ^03: Date of the latest patch (int)
  1. ;
  1. REGINFO(RESULTS,REGISTRY) ;
  1. N IENS,RC,REGIEN,RORBUF,RORERRDL,RORMSG,TMP
  1. D CLEAR^RORERR("REGINFO^RORRP014",1)
  1. ;--- Check the parameters
  1. S TMP=$$UP^XLFSTR($G(REGISTRY)),REGIEN=+TMP
  1. I TMP'=REGIEN D:TMP?3.UNP
  1. . S REGIEN=$$REGIEN^RORUTL02(TMP)
  1. . S:REGIEN<0 TMP=$$ERROR^RORERR(REGIEN)
  1. I REGIEN'>0 D D RPCSTK^RORERR(.RESULTS,RC) Q
  1. . S RC=$$ERROR^RORERR(-88,,,,"REGISTRY",$G(REGISTRY))
  1. ;--- Initialize the variables
  1. K RESULTS
  1. ;--- Load the registry info
  1. S IENS=REGIEN_",",TMP=".01;.09;1;2;4;11;19.1;19.2"
  1. D GETS^DIQ(798.1,IENS,TMP,"I","RORBUF","RORMSG")
  1. I $G(DIERR) D D RPCSTK^RORERR(.RESULTS,RC) Q
  1. . S RC=$$DBS^RORERR("RORMSG",-9,,,798.1,IENS)
  1. ;--- Registry IEN and Name
  1. S RESULTS(1)=REGIEN_"^"_$G(RORBUF(798.1,IENS,.01,"I"))
  1. ;--- National
  1. S RESULTS(2)=+$G(RORBUF(798.1,IENS,.09,"I"))
  1. ;--- Registry Description
  1. S RESULTS(3)=$G(RORBUF(798.1,IENS,4,"I"))
  1. ;--- Registry Updated Until
  1. S RESULTS(4)=$G(RORBUF(798.1,IENS,1,"I"))
  1. ;--- Data Extracted Until
  1. S RESULTS(5)=$G(RORBUF(798.1,IENS,2,"I"))
  1. ;--- Number of Active Patients
  1. S RESULTS(6)=+$G(RORBUF(798.1,IENS,19.1,"I"))
  1. ;--- Number of Pending Patients
  1. S RESULTS(7)=+$G(RORBUF(798.1,IENS,19.2,"I"))
  1. ;--- Registry Status
  1. S TMP=+$G(RORBUF(798.1,IENS,11,"I"))
  1. S $P(TMP,"^",2)=$$EXTERNAL^DILFD(798.1,11,,TMP,"RORMSG")
  1. S RESULTS(8)=TMP
  1. ;--- reserved (former Awaiting Acknowledgement)
  1. S RESULTS(9)=""
  1. ;--- Version information
  1. S TMP="CLINICAL CASE REGISTRIES"
  1. S RESULTS(10)=$$VERSION^XPDUTL(TMP),TMP=$$LAST^XPDUTL(TMP)
  1. S:TMP>0 $P(RESULTS(10),"^",2,3)=+TMP_"^"_$P(TMP,U,2)
  1. ;---
  1. S RESULTS(0)=0
  1. Q
  1. ;
  1. ;***** RETURNS LIST OF REGISTRY SELECTION RULES
  1. ; RPC: [ROR LIST SELECTION RULES]
  1. ;
  1. ; .RESULTS Reference to a local variable where the results
  1. ; are returned to.
  1. ;
  1. ; REGIEN Registry IEN
  1. ;
  1. ; See the description of the ROR LIST SELECTION RULES remote
  1. ; procedure for more details.
  1. ;
  1. ; Return Values:
  1. ;
  1. ; A negative value of the first "^"-piece of the RESULTS(0) node
  1. ; indicates an error (see the RPCSTK^RORERR procedure for details).
  1. ;
  1. SELRULES(RESULTS,REGIEN) ;
  1. N CNT,IEN,IENS,IRL,RC,RORBUF,RORLST,RORMSG
  1. D CLEAR^RORERR("SELRULES^RORRP014",1)
  1. K RESULTS S (RESULTS(0),CNT)=0
  1. ;
  1. ;=== Check the parameters
  1. S RC=0 D I RC<0 D RPCSTK^RORERR(.RESULTS,RC) Q
  1. . ;--- Registry IEN
  1. . I $G(REGIEN)'>0 D Q
  1. . . S RC=$$ERROR^RORERR(-88,,,,"REGIEN",$G(REGIEN))
  1. . S REGIEN=+REGIEN
  1. ;
  1. ;=== Load the list of selection rules
  1. S IENS=","_REGIEN_","
  1. D LIST^DIC(798.13,IENS,"@;.01",,,,,"B",,,"RORLST","RORMSG")
  1. I $G(DIERR) D D RPCSTK^RORERR(.RESULTS,RC) Q
  1. . S RC=$$DBS^RORERR("RORMSG",-9,,,798.13,IENS)
  1. ;
  1. ;=== Add rule definitions to the results
  1. S IRL=0
  1. F S IRL=$O(RORLST("DILIST","ID",IRL)) Q:IRL'>0 D
  1. . K RORBUF,RORMSG
  1. . S NAME=RORLST("DILIST","ID",IRL,.01)
  1. . S IEN=$$SRLIEN^RORUTL02(NAME,".01;4",.RORBUF) Q:IEN'>0
  1. . S CNT=CNT+1,RESULTS(CNT)=IEN
  1. . S $P(RESULTS(CNT),U,2)=$G(RORBUF("DILIST","ID",1,.01))
  1. . S $P(RESULTS(CNT),U,3)=$G(RORBUF("DILIST","ID",1,4))
  1. ;
  1. ;=== Success
  1. S RESULTS(0)=CNT
  1. Q