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

VENPCCX1.m

Go to the documentation of this file.
VENPCCX1 ; ILC/SLC/GIS - FUNCTION CALLS TO SUPPORT GUI CONFIGURATION INTERFACE ;  
 ;;1.2t1;PCC+;;NOV 15, 2001
 ;
 ; COPYRITE INFORMATIX LABORATORIES, 2000
 ; 
GET(EF,LIST,GRP) ; EP-GIVEN EF NAME, LIST NAME, & PT GRP NAME, RETURNT LIST OF ITEMS
 ; OUTPUT FORMAT: EF^LIST^PT GRP^MAX ITEMS ALLOWED^ITEM #1^...
NEW N EIEN,LIEN,GNO,CNT,X,Y,%,IEN,IX,LMN,STG,MAX
 I $L($G(EF)),$L($G(LIST)),$L($G(GRP))
 E  Q ""
INIT ;
 I EF S EIEN=EF,EF=$P($G(^VEN(7.41,+EIEN,0)),U)
 E  S EIEN=$O(^VEN(7.41,"B",EF,0)) I 'EIEN Q ""
 I LIST S LIEN=LIST,LIST=$P($G(^VEN(7.98,+LIEN,0)),U)
 E  S LIEN=$O(^VEN(7.98,"B",LIST,0)) I 'LIEN Q ""
 I GRP S %=$$GRP1(GRP),GNO=+%,GRP=$P(%,U,2) I 'GNO Q ""
 E  S GNO=$$GNO(GRP) I 'GNO Q ""
 I $D(^VEN(7.98,LIEN,0)),$D(^VEN(7.41,EIEN,0))
 E  Q ""
 S LMN=$P($G(^VEN(7.98,LIEN,0)),U,3) I '$L(LMN) Q ""
 S IX=GNO_LMN
 S MAX=$$MAX^VENPCCMP(EIEN,LIEN) I 'MAX Q ""
BLD S IEN=0,STG=EF_U_LIST_U_GRP_U_MAX
 F  S IEN=$O(^VEN(7.93,"AC",IX,IEN)) Q:'IEN  D
 . S X=$G(^VEN(7.93,IEN,0))
 . S STG=STG_U_$P(X,U)_";"_$P(X,U,6)_";"_IEN_";"_$P(X,U,5)
 . Q
 Q STG
 ; 
GNO(GRP) ; EP-GROUP NUMBER
 I '$L(GRP) Q ""
 N X,Y
 S X=$P($G(^DD(19707.93,.09,0)),U,3)
 S Y=$F(X,GRP),X=$E(X,1,Y)
 S X=$P(X,";",$L(X,";")-1)
 Q +X
 ; 
STUFF(STG) ; EP-STUFF A LIST INTO THE SYSTEM PREF FILE
 ; INPUT FORMAT: EF NAME^LIST NAME^PATIENT GRP NAME^MAX ALLOWED^ITEM1;CODE1^ITEM2;CODE2^...
 N LIST,LIEN,GRP,GNO,X
 I '$L(STG) Q
 S LIST=$P(STG,U,2)
 S LIEN=$O(^VEN(7.98,"B",LIST,0)) I 'LIEN Q
 S GRP=$P(STG,U,3)
 S GNO=$$GNO(GRP) I 'GNO Q
 S X=$P(STG,U,5,99)
 D SAVE^VENPCCMP(X,LIEN,GNO)
 Q
 ; 
EF() ; EP-RETURN A LIST OF AVAILABLE ENCOUNTER FORMS
 S EIEN=0 S STG=""
 F  S EIEN=$O(^VEN(7.41,EIEN)) Q:'EIEN  D
 . S X=$P($G(^VEN(7.41,EIEN,0)),U)
 . I $L(STG) S STG=STG_U
 . S STG=STG_X_";"_EIEN
 . Q
 Q STG
 ; 
LIST(EF) ; EP-RETURN A ^ DELIMITED STRING CONTAINING ALL LISTS
 N STG,LIST,LIEN
 S STG="",LIST=0
 F  S LIST=$O(^VEN(7.98,"B",LIST)) Q:LIST=""  D
 . I LIST="HEALTH MAINTENANCE REMINDERS" Q
 . I LIST="PHYSICAL EXAM" Q
 . S LIEN=$O(^VEN(7.98,"B",LIST,0)) I 'LIEN Q
 . I $L(STG) S STG=STG_U
 . S STG=STG_LIST_";"_LIEN
 . Q
 Q STG
 ; 
GRP() ; RETURN NAMES OF PATIENT GROUPS
 S X=$P($G(^DD(19707.93,.09,0)),U,3) I '$L(X) Q
 S STG=""
 F I=1:1 S Y=$P(X,";",I) Q:Y=""  D
 . S Z=$P(Y,":",2)
 . I $L(STG) S STG=STG_U
 . S STG=STG_Z_";"_I
 . Q
 Q STG
 ; 
DEPT() ; EP-SUPER BILL DEPTS
 N NAME,IEN,STG
 S NAME="" S STG=""
 F  S NAME=$O(^VEN(7.95,"B",NAME)) Q:NAME=""  D
 . I NAME["TELEPHONE" Q
 . I NAME="CHART REVIEW" Q
 . S IEN=$O(^VEN(7.95,"B",NAME,0)) I 'IEN Q
 . I $L(STG) S STG=STG_U
 . S STG=STG_NAME_";"_IEN
 . Q
 Q STG
 ; 
GRP1(GNO) ; 
 N X,Y,Z
 I 'GNO Q ""
 S X=$P($G(^DD(19707.93,.09,0)),U,3) I '$L(X) Q ""
 I X'[(GNO_":") Q ""
 S Y=$P(X,(GNO_":"),2)
 S Z=$P(Y,";") I '$L(Z) Q ""
 Q GNO_U_Z
 ; 
HS() ; EP-RETURN A LIST OF HEALTH SUMMARY TYPES
 N NAME,HIEN,X,%,STG
 S STG="",NAME=""
 F  S NAME=$O(^APCHSCTL("B",NAME)) Q:NAME=""  D
 . S HIEN=$O(^APCHSCTL("B",NAME,0))
 . I 'HIEN Q
 . I $L(STG) S STG=STG_U
 . S STG=STG_NAME_";"_HIEN
 . Q
 Q STG
 ; 
ADD(EF,CPT,PGRP,NAME,CODE) ; EP-ADD AN ENTRY TO A LIST
 N LIST
 I '$D(^VEN(7.41,+$G(EF),0)) Q 0
 I '$D(^VEN(7.98,+$G(CPT),0)) Q 0
 I $G(PGRP),PGRP=PGRP\1,PGRP>0,PGRP<5
 E  Q 0
 I $G(NAME)="" Q 0
 S LIST=$$LIST^VENPCCMP(+EF,+CPT,PGRP) I '$L(LIST) Q 0
 S LIST=LIST_U_NAME_";"_$G(CODE)_";;"
 Q $$SUB^VENPCCMP(LIST,EF,CPT,PGRP)
 ; 
DEL(IEN) ; EP-DELETE AN ENTRY FROM THE LIST
 S X=$G(^VEN(7.93,+$G(IEN),0)) I X="" Q 0
 S EF=$P(X,U,11) I 'EF Q 0
 S PGRP=$P(X,U,9) I 'PGRP Q 0
 S %=$P(X,U,8) I %="" Q 0
 S %=$E(%) I %="" Q
 S CPT=$O(^VEN(7.98,"AD",%,0)) I 'CPT Q 0
 I '$D(^VEN(7.41,+$G(EF),0)) Q 0
 I '$D(^VEN(7.98,+$G(CPT),0)) Q 0
 I $G(PGRP),PGRP=PGRP\1,PGRP>0,PGRP<5
 E  Q 0
 I '$D(^VEN(7.93,+$G(IEN),0)) Q 0
 S DIK="^VEN(7.93,",DA=IEN D ^DIK ; DELETE THE ENTRY AND RESET
 S LIST=$$LIST^VENPCCMP(+EF,+CPT,PGRP) I '$L(LIST) Q 0
 Q $$SUB^VENPCCMP(LIST,EF,CPT,PGRP)
 ; 
 ; 
CP(CIEN) ; EP-CLINIC PREFERENCES
 N STG,X,Y,%,PIEN,HIEN,EIEN,CLIEN,ENAME,HNAME,PNAME,CLNAME
 S STG=$G(^VEN(7.95,+$G(CIEN),2)) I STG="" Q ""
 S PIEN=$P(STG,U,2),HIEN=$P(STG,U,6),EIEN=$P(STG,U,5)
 S PNAME=$P($G(^VA(200,+PIEN,0)),U)
 S ENAME=$P($G(^VEN(7.41,+EIEN,0)),U)
 S HNAME=$P($G(^APCHSCTL(+HIEN,0)),U)
 S CLIEN=$P(^VEN(7.95,+$G(CIEN),0),U,4)
 S CLNAME=$P($G(^DIC(40.7,CLIEN,0)),U)
 S X=PNAME_";"_PIEN_U_ENAME_";"_EIEN_U_HNAME_";"_HIEN_U_CLIEN_";"_CLNAME
 Q X
 ; 
ER() ; EP-EMERGENCY DEPARTMENTS
 N CIEN,X,STG,CNAME
 S STG="",CIEN=0
 F  S CIEN=$O(^VEN(7.95,CIEN)) Q:'CIEN  D
 . S X=$P($G(^VEN(7.95,CIEN,2)),U,12) I 'X Q
 . S CNAME=$P($G(^VEN(7.95,CIEN,0)),U)
 . I $L(STG) S STG=STG_U
 . S STG=STG_CNAME_";"_CIEN
 . Q
 Q STG
 ;