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

RAMAGU01.m

Go to the documentation of this file.
  1. RAMAGU01 ;HCIOFO/SG,GJC - ORDERS/EXAMS API (RAMISC UTILITIES) ; 4/12/13 6:27pm
  1. ;;5.0;Radiology/Nuclear Medicine;**90,116**;Mar 16, 1998;Build 1
  1. ;
  1. Q
  1. ;
  1. ;***** LOADS DEFINITIONS OF MISCELLANEOUS PARAMETERS
  1. ;
  1. ; .MSPSDEFS Reference to a local variable where descriptors
  1. ; of the miscellaneous parameters are loaded to
  1. ; (see description of the RAMSPSDEFS in the ^RAMAG
  1. ; routine for details).
  1. ;
  1. LDMSPRMS(MSPSDEFS) ;
  1. N BUF,FILE,I,NAME
  1. K MSPSDEFS
  1. F I=4:1 S BUF=$P($T(MSCPRMS+I),";;",2) Q:BUF="" D
  1. . S BUF=$P($TR(BUF,"| ",U),U,2,99)
  1. . S NAME=$P(BUF,U,1) Q:NAME=""
  1. . S FILE=$P(BUF,U,2) Q:FILE'>0
  1. . S MSPSDEFS("N",NAME)=$P(BUF,U,2,5)
  1. . S:$P(BUF,U,4)["*" MSPSDEFS("F",FILE,NAME)=""
  1. Q
  1. ;
  1. MSCPRMS ;+++++ DEFINITIONS OF MISCELLANEOUS PARAMETERS
  1. ;;==========================================================
  1. ;;| Parameter | File |Field|Type |Req#| Reference |
  1. ;;|------------+-------+-----+-----+----+------------------|
  1. ;;|ACLHIST |74 | 400 | W | |$$COMPLETE^RAMAG06|
  1. ;;|BEDSECT |70.03 | 19 | P | |$$REGISTER^RAMAG03|
  1. ;;|CLINHIST |70.03 | 400 | W | |$$REGISTER^RAMAG03|
  1. ;;|CMUSED |70.03 | 10 | | |$$EXAMINED^RAMAG07|
  1. ;;|COMPLICAT |70.03 | 16 | P | |$$EXAMINED^RAMAG07|
  1. ;;|CONTMEDIA |70.3225| .01 | M | |$$EXAMINED^RAMAG07|
  1. ;;|CPTMODS |70.3135| .01 | PM | 14 |$$EXAMINED^RAMAG07|
  1. ;;|EXAMCAT |70.03 | 4 | | |$$REGISTER^RAMAG03|
  1. ;;|FILMSIZE |70.04 | .01 | PM | 4 |$$REGISTER^RAMAG03|
  1. ;;|FLAGS | | | | | ^RAMAG |
  1. ;;|HOLDESC |75.1 | 25 | W | | $$ORDCANC^RAMAG04|
  1. ;;|IMPRESSION |74 | 300 | W | 16 |$$COMPLETE^RAMAG06|
  1. ;;|ISOLPROC |75.1 | 24 | | | $$ORDER^RAMAG02|
  1. ;;|PREGNANT |75.1 | 13 | | | $$ORDER^RAMAG02|
  1. ;;|PREOPDT |75.1 | 12 | D | | $$ORDER^RAMAG02|
  1. ;;|PRIMCAM |70.03 | 18 | P | 6 |$$EXAMINED^RAMAG07|
  1. ;;|PRIMDXCODE |70.03 | 13 | P | 5 |$$EXAMINED^RAMAG07|
  1. ;;|PRIMINTRES |70.03 | 12 | P | 2 |$$EXAMINED^RAMAG07|
  1. ;;|PRIMINTSTF |70.03 | 15 | P | 2 |$$EXAMINED^RAMAG07|
  1. ;;|PRINCLIN |70.03 | 8 | P | |$$REGISTER^RAMAG03|
  1. ;;|PROBSTAT |74 | 25 | | |$$COMPLETE^RAMAG06|
  1. ;;|RAPROC |70.03 | 2 | | |$$REGISTER^RAMAG03|
  1. ;;|RDPHARMS |70.21 | | M | 17 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-ACDR |70.21 | 4 | * | 19 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-DOSE |70.21 | 7 | * | 17 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-DRUG |70.21 | .01 | P * | 17 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-DTADM|70.21 | 8 | D * | 21 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-DTDRW|70.21 | 5 | D * | 19 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-FORM |70.21 | 15 | * | 25 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-LOTN |70.21 | 13 | P * | 24 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-PWADM|70.21 | 9 | P * | 21 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-PWMSD|70.21 | 6 | P * | 19 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-ROUTE|70.21 | 11 | P * | 23 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-SITE |70.21 | 12 | P * | 23 |$$EXAMINED^RAMAG07|
  1. ;;| RDPH-VOL |70.21 | 14 | * | 25 |$$EXAMINED^RAMAG07|
  1. ;;|REPORT |74 | 200 | W | 11 |$$COMPLETE^RAMAG06|
  1. ;;|REQNATURE |75.1 | 26 | | | $$ORDER^RAMAG02|
  1. ;;|REQURG |75.1 | 6 | | | $$ORDER^RAMAG02|
  1. ;;|RPTDTE |74 | 8 | D | |$$COMPLETE^RAMAG06|
  1. ;;|RPTSTATUS |74 | 5 | | |$$COMPLETE^RAMAG06|
  1. ;;|SECDXCODE |70.14 | .01 | PM | |$$COMPLETE^RAMAG06|
  1. ;;|SERVICE |70.03 | 7 | P | |$$REGISTER^RAMAG03|
  1. ;;|SINGLERPT |70.03 | 25 | | |$$REGISTER^RAMAG03|
  1. ;;|TECH |70.12 | .01 | PM | 1 |$$EXAMINED^RAMAG07|
  1. ;;|TECHCOMM |70.07 | 4 | | |$$REGISTER^RAMAG03|
  1. ;;|TRANSCRST |74 | 11 | P | |$$COMPLETE^RAMAG06|
  1. ;;|TRANSPMODE |75.1 | 19 | | | $$ORDER^RAMAG02|
  1. ;;|VERDTE |74 | 7 | D | |$$COMPLETE^RAMAG06|
  1. ;;|VERPHYS |74 | 9 | P | |$$COMPLETE^RAMAG06|
  1. ;;|WARD |70.03 | 6 | P | |$$REGISTER^RAMAG03|
  1. ;;==========================================================
  1. ;
  1. ; Type Field type that requires special processing:
  1. ; D - Date/time, M - Multiple,
  1. ; P - Pointer, W - Word processing,
  1. ; * - Add this parameter to the "F" index
  1. ; (see the VEXAMND^RAMAGU14 for details).
  1. ;
  1. ; Req# Number of the "^"-piece of the value returned by the
  1. ; $$EXMSTREQ^RAMAGU06. It determines if a non-empty
  1. ; field value is required.
  1. ;
  1. ; Reference Indicates where the parameter is described for the
  1. ; first time.
  1. ;
  1. ; NOTE #1: This table is here not only for documentation purposes;
  1. ; the data is processed by the LDMSPRMS^RAMAGU01 procedure.
  1. ;
  1. ; NOTE #2: If a parameter does not have the corresponding field
  1. ; and has the "M" flag, then this is a record tag (e.g.
  1. ; RDPHARMS). It encloses other parameters that define
  1. ; field values for a record of the sub-file.
  1. ;
  1. Q
  1. ;
  1. ;***** PARSES RAMSC RECORDS (RPC) INTO RAMISC SUBSCRIPTS (API)
  1. ;
  1. ; .RAMSC Reference to the RAMSC parameter of a remote
  1. ; procedure.
  1. ;
  1. ; .RAMISC Reference to a local variable that will store
  1. ; miscellaneous parameters as subscripts (for API
  1. ; functions).
  1. ;
  1. ; Return values:
  1. ; <0 Error descriptor (see $$ERROR^RAERR)
  1. ; 0 Success
  1. ;
  1. RPCMISC(RAMSC,RAMISC) ;
  1. N RAMSPSDEFS,RASRCI,RC
  1. K RAMISC S RASRCI=""
  1. D LDMSPRMS(.RAMSPSDEFS)
  1. S RC=$$RPCMISC1("RAMISC")
  1. Q $S(RC>0:$$ERROR^RAERR(-5),1:RC)
  1. ;
  1. ;+++++ RECURSIVE PARSER OF RAMSC RECORDS
  1. ;
  1. ; DSTNODE Node of the RAMISC where values will be stored.
  1. ;
  1. ; [RECNAME] Tag name and index of the current record. They are
  1. ; [RECNDX] used to detect the record boundaries.
  1. ;
  1. ; Input Variables:
  1. ; RAMSC, RAMSPSDEFS, RASRCI
  1. ;
  1. ; Output Variables:
  1. ; RAMISC, RASRCI
  1. ;
  1. ; Return values:
  1. ; <0 Error descriptor (see $$ERROR^RAERR)
  1. ; 0 Success
  1. ; >0 Number of validation errors
  1. ;
  1. ; NOTE: This is an internal entry point. Do not call
  1. ; it from outside of this routine.
  1. ;
  1. RPCMISC1(DSTNODE,RECNAME,RECNDX) ;
  1. N ERRCNT,NAME,NDX,RARC,TMP,TYPE
  1. S (ERRCNT,RARC)=0
  1. ;===
  1. F S RASRCI=$O(RAMSC(RASRCI)) Q:RASRCI="" D Q:RARC
  1. . S NAME=$$TRIM^XLFSTR($P(RAMSC(RASRCI),U)) Q:NAME=""
  1. . S NDX=+$$TRIM^XLFSTR($P(RAMSC(RASRCI),U,2))
  1. . S TYPE=$P($G(RAMSPSDEFS("N",NAME)),U,3)
  1. . ;=== Single value
  1. . I NDX'>0 D Q
  1. . . I $D(@DSTNODE@(NAME))#10 D S ERRCNT=ERRCNT+1 Q
  1. . . . D ERROR^RAERR(-6,,NAME)
  1. . . ;--- Convert date/time value from HL7 (TS) to FileMan
  1. . . I TYPE["D" D Q
  1. . . . S @DSTNODE@(NAME)=$$HL7TFM^XLFDT($P(RAMSC(RASRCI),U,3))
  1. . . . I @DSTNODE@(NAME)<0 D S ERRCNT=ERRCNT+1
  1. . . . . S TMP=$NA(@DSTNODE@(NAME))
  1. . . . . D ERROR^RAERR(-3,TMP_"='"_$P(RAMSC(RASRCI),U,3)_"'",TMP)
  1. . . ;--- Copy parameters of other types
  1. . . S @DSTNODE@(NAME)=$P(RAMSC(RASRCI),U,3,999)
  1. . ;=== Check for duplicate indexes
  1. . I $D(@DSTNODE@(NAME,NDX)) D S ERRCNT=ERRCNT+1 Q
  1. . . D ERROR^RAERR(-7,,NDX,NAME)
  1. . ;=== Check for record start/end
  1. . I (TYPE["M"),$P($G(RAMSPSDEFS("N",NAME)),U,2)'>0 D Q
  1. . . ;--- If the name is the same as that of the current record, then
  1. . . ; this either the end of the current record or a beginning of
  1. . . ;--- the next record of the same kind (and on the same level).
  1. . . I NAME=$G(RECNAME) D:NDX'=$G(RECNDX) S RARC=1 Q
  1. . . . ;--- If the index is different from that of the current record,
  1. . . . ; then this is a beginning of the next record. Let the
  1. . . . ;--- source line be re-processed on the upper execution level.
  1. . . . S RASRCI=$O(RAMSC(RASRCI),-1)
  1. . . ;--- Start processing field values of the record
  1. . . S TMP=$$RPCMISC1($NA(@DSTNODE@(NAME,NDX)),NAME,NDX)
  1. . . I TMP<0 S RARC=TMP Q
  1. . . S:TMP>0 ERRCNT=ERRCNT+TMP
  1. . . S:RASRCI="" RARC=1
  1. . ;=== List item or text line
  1. . S @DSTNODE@(NAME,NDX)=$P(RAMSC(RASRCI),U,3,999)
  1. ;===
  1. Q $S(RARC<0:RARC,1:ERRCNT)