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

BQI202PU.m

Go to the documentation of this file.
  1. BQI202PU ;VNGT/HS/ALA-2.0.2 Install Utility Program ; 07 May 2009 10:03 AM
  1. ;;2.1;ICARE MANAGEMENT SYSTEM;;Feb 07, 2011
  1. ;
  1. TPS ; Set tooltips
  1. NEW TEXT,BQIUPD,ERROR,BI,BJ,HELP,IEN
  1. F BI=1:1 S TEXT=$P($T(TIP+BI),";;",2) Q:TEXT="" D
  1. . S CODE=$P(TEXT,"~",1)
  1. . S IEN=$O(^BQI(90506.1,"B",CODE,"")) I IEN="" Q
  1. . F BJ=1:1 S TXT=$P($T(@CODE+BJ),";;",2) Q:TXT="" D
  1. .. S HELP(BJ)=TXT
  1. . D WP^DIE(90506.1,IEN_",",4,"","HELP","ERROR")
  1. . K HELP
  1. ;
  1. TAX ; Update taxonomies
  1. ; Add new taxonomies OR update existing ones
  1. D ^BQIITX
  1. ;
  1. TX ; Reset the variable pointer values for the taxonomies
  1. NEW BQIDA,N,X,IEN,VAL,BQIUPD,REG,RP,TIEN
  1. S BQIDA=1
  1. S N=0
  1. F S N=$O(^BQI(90508,BQIDA,10,N)) Q:'N D
  1. . S X=$P(^BQI(90508,BQIDA,10,N,0),U,1)
  1. . S IEN=N_","_BQIDA_","
  1. . I $P(^BQI(90508,BQIDA,10,N,0),U,5)="T" S VAL=$$STXPT(X,"L")
  1. . E S VAL=$$STXPT(X,"N")
  1. . S BQIUPD(90508.03,IEN,.02)=VAL
  1. I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR")
  1. ;
  1. S REG=0
  1. F S REG=$O(^BQI(90507,REG)) Q:'REG D
  1. . S N=0
  1. . F S N=$O(^BQI(90507,REG,10,N)) Q:'N D
  1. .. S X=$P(^BQI(90507,REG,10,N,0),U,1)
  1. .. S IEN=N_","_REG_","
  1. .. I $P(^BQI(90507,REG,10,N,0),U,5)="T" S VAL=$$STXPT(X,"L")
  1. .. E S VAL=$$STXPT(X,"N")
  1. .. S BQIUPD(90507.01,IEN,.02)=VAL
  1. . I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR")
  1. . ;
  1. . S RP=0
  1. . F S RP=$O(^BQI(90507,REG,20,RP)) Q:'RP D
  1. .. S N=0
  1. .. F S N=$O(^BQI(90507,REG,20,RP,10,N)) Q:'N D
  1. ... S X=$P(^BQI(90507,REG,20,RP,10,N,0),U,1)
  1. ... S IEN=N_","_RP_","_REG_","
  1. ... S TIEN=$O(^BQI(90507,REG,10,"B",X,""))
  1. ... I $P(^BQI(90507,REG,10,TIEN,0),U,5)="T" S VAL=$$STXPT(X,"L")
  1. ... E S VAL=$$STXPT(X,"N")
  1. ... S BQIUPD(90507.03,IEN,.02)=VAL
  1. . I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR")
  1. Q
  1. ;
  1. CTX ; Set community taxonomies
  1. NEW DATA,DA,DIK
  1. S DA(1)=$$SPM^BQIGPUTL(),DA=0,DIK="^BQI(90508,"_DA(1)_",10,"
  1. F S DA=$O(^BQI(90508,DA(1),10,DA)) Q:'DA D
  1. . I $P(^BQI(90508,DA(1),10,DA,0),U,5)'="CM" Q
  1. . D ^DIK
  1. S DATA="TEST",II=0
  1. D COMMTX^BQIUTB(.DATA)
  1. K @DATA
  1. Q
  1. ;
  1. DX ; Check diagnosis code pointers
  1. NEW CN,DN,DXC,DXN
  1. S CN=0
  1. F S CN=$O(^BQI(90507.8,CN)) Q:'CN D
  1. . S DN=0
  1. . F S DN=$O(^BQI(90507.8,CN,10,DN)) Q:'DN D
  1. .. S DXC=$P(^BQI(90507.8,CN,10,DN,0),U,2)_" "
  1. .. S DXN=$$FIND1^DIC(80,"","X",DXC,"BA","","ERROR")
  1. .. I $P(^BQI(90507.8,CN,10,DN,0),U,1)=DXN Q
  1. .. NEW DA,IENS
  1. .. S DA(1)=CN,DA=DN,IENS=$$IENS^DILF(.DA)
  1. .. S BQIUPD(90507.801,IENS,.01)=DXN
  1. I $D(BQIUPD) D FILE^DIE("","BQIUPD","ERROR")
  1. K BQIUPD
  1. Q
  1. ;
  1. CAT ; Change NEW CATEGORY value
  1. NEW DIEN,TEXT
  1. F TEXT="DPCP","DCAT" D
  1. . S DIEN=$O(^BQI(90506.1,"B",TEXT,""))
  1. . S $P(^BQI(90506.1,DIEN,3),U,3)="Other Patient Data"
  1. F TEXT="LVD","LVPR","LVCL","LVDN","LVPN","NAPD","NAPC","NAPV","LVDTM","NAPDTM" D
  1. . S DIEN=$O(^BQI(90506.1,"B",TEXT,"")) I DIEN="" Q
  1. . S $P(^BQI(90506.1,DIEN,3),U,3)="Visit Related"
  1. F TEXT="MSTRT","MCTY","MSTAT","MZIP","HPHN","WPHN","OPHN" D
  1. . S DIEN=$O(^BQI(90506.1,"B",TEXT,"")) I DIEN="" Q
  1. . S $P(^BQI(90506.1,DIEN,3),U,3)="Address"
  1. F TEXT="PN","HRN","DOB","AGE","SX","CM","COM","MFLG","GPRM","PADD","DOD","UPOP","BEN" D
  1. . S DIEN=$O(^BQI(90506.1,"B",TEXT,""))
  1. . S $P(^BQI(90506.1,DIEN,3),U,3)="Demographics"
  1. . I TEXT="HRN" S $P(^BQI(90506.1,DIEN,0),U,8)="T00040HRN"
  1. Q
  1. ;
  1. STXPT(TXNM,TYP) ; Set taxonomy pointer
  1. ;
  1. ;Input
  1. ; TXNM - Taxonomy name
  1. ; TYP - Taxonomy Type (L = LAB, N = Non Lab)
  1. NEW IEN,SIEN,DA,IENS,BQUPD,VALUE,GLB
  1. S VALUE=""
  1. I TYP="L" D
  1. . S IEN=$O(^ATXLAB("B",TXNM,"")),GLB="ATXLAB("
  1. . I IEN="" S TYP="N"
  1. I TYP="N" S IEN=$O(^ATXAX("B",TXNM,"")),GLB="ATXAX("
  1. I IEN="" S VALUE="@"
  1. I IEN'="" S VALUE=IEN_";"_GLB
  1. Q VALUE
  1. ;
  1. PNLFX ; Loop through existing panels and fix layout related issues
  1. ;
  1. N CML,FLN,OWNR,PNL,SHR
  1. ;
  1. S OWNR=0 F S OWNR=$O(^BQICARE(OWNR)) Q:'OWNR D
  1. . S PNL=0 F S PNL=$O(^BQICARE(OWNR,1,PNL)) Q:'PNL D
  1. .. ;
  1. .. ;Revert templates entries back to system default or customized
  1. .. K ^BQICARE(OWNR,1,PNL,4)
  1. .. ;
  1. .. ;Validate sub-file file numbers - Fix if needed
  1. .. S FLN=$P($G(^BQICARE(OWNR,1,PNL,20,0)),U,2) I FLN]"",FLN'="90505.05P" S $P(^BQICARE(OWNR,1,PNL,20,0),U,2)="90505.05P"
  1. .. S FLN=$P($G(^BQICARE(OWNR,1,PNL,22,0)),U,2) I FLN]"",FLN'="90505.122" S $P(^BQICARE(OWNR,1,PNL,22,0),U,2)="90505.122"
  1. .. S FLN=$P($G(^BQICARE(OWNR,1,PNL,25,0)),U,2) I FLN]"",FLN'="90505.125" S $P(^BQICARE(OWNR,1,PNL,25,0),U,2)="90505.125"
  1. .. S FLN=$P($G(^BQICARE(OWNR,1,PNL,23,0)),U,2) I FLN]"",FLN'="90505.123" S $P(^BQICARE(OWNR,1,PNL,23,0),U,2)="90505.123"
  1. .. S CML=0 F S CML=$O(^BQICARE(OWNR,1,PNL,23,CML)) Q:'CML S FLN=$P($G(^BQICARE(OWNR,1,PNL,23,CML,1,0)),U,2) I FLN]"",FLN'="90505.1231" S $P(^BQICARE(OWNR,1,PNL,23,CML,1,0),U,2)="90505.1231"
  1. .. ;
  1. .. ;Loop through shared user layouts
  1. .. S SHR=0 F S SHR=$O(^BQICARE(OWNR,1,PNL,30,SHR)) Q:'SHR D
  1. ... ;
  1. ... ;Revert shared user entries from templates to system default or customized
  1. ... K ^BQICARE(OWNR,1,PNL,30,SHR,4)
  1. ... ;
  1. ... ;Validate sub-file file number - Fix if needed
  1. ... S FLN=$P($G(^BQICARE(OWNR,1,PNL,30,SHR,20,0)),U,2) I FLN]"",FLN'="90505.06P" S $P(^BQICARE(OWNR,1,PNL,30,SHR,20,0),U,2)="90505.06P"
  1. ... S FLN=$P($G(^BQICARE(OWNR,1,PNL,30,SHR,22,0)),U,2) I FLN]"",FLN'="90505.322" S $P(^BQICARE(OWNR,1,PNL,30,SHR,22,0),U,2)="90505.322"
  1. ... S FLN=$P($G(^BQICARE(OWNR,1,PNL,30,SHR,25,0)),U,2) I FLN]"",FLN'="90505.325" S $P(^BQICARE(OWNR,1,PNL,30,SHR,25,0),U,2)="90505.325"
  1. ... S FLN=$P($G(^BQICARE(OWNR,1,PNL,30,SHR,23,0)),U,2) I FLN]"",FLN'="90505.323" S $P(^BQICARE(OWNR,1,PNL,30,SHR,23,0),U,2)="90505.323"
  1. ... S CML=0 F S CML=$O(^BQICARE(OWNR,1,PNL,30,SHR,23,CML)) Q:'CML S FLN=$P($G(^BQICARE(OWNR,1,PNL,30,SHR,23,CML,1,0)),U,2) I FLN]"",FLN'="90505.3231" S $P(^BQICARE(OWNR,1,PNL,30,SHR,23,CML,1,0),U,2)="90505.3231"
  1. ;
  1. Q
  1. ;
  1. TIP ; Tooltips
  1. ;;ASACON
  1. ;;ASACT
  1. ;;ASAQC
  1. ;;ASCNTRL
  1. ;;ASFHX
  1. ;;ASFLU
  1. ;;ASIHSD
  1. ;;ASLADM
  1. ;;ASLBPF
  1. ;;ASLEUV
  1. ;;ASLFD
  1. ;;ASLFEV
  1. ;;ASLHSV
  1. ;;ASLPF
  1. ;;ASLV
  1. ;;ASRLVR
  1. ;;ASSEV
  1. ;;ASSTAT
  1. ;;ASTBHF
  1. ;;ASTRIG
  1. ;;DPCP
  1. Q
  1. ;
  1. ASACON ;
  1. ;;Asthma Control: Most recent Control value from Measurements file. The
  1. ;;visit date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASACT ;
  1. ;;Asthma Action Plan: Date of most recent Action Plan provided to this
  1. ;;patient. Action Plans are available from the PCC Patient Wellness
  1. ;;Handout menus or from the iCare Patient Record.
  1. Q
  1. ;
  1. ASAQC ;
  1. ;;Asthma Quality of Care: If this patient has an Active Asthma diagnostic
  1. ;;tag (Proposed or Accepted), are ALL of the following key elements
  1. ;;documented: Asthma Severity value ever; Asthma Control and Peak Flow or
  1. ;;FEV1 measurement and Asthma Action Plan and Flu Shot in past year; and
  1. ;;current Controller medication prescription if Severity is Persistent (2,3 ~or 4).
  1. ;;"N/A" will display if this patient does not have an active Asthma
  1. ;;diagnostic tag.
  1. Q
  1. ;
  1. ASCNTRL ;
  1. ;;On Controller Meds? Is this patient currently prescribed with Asthma
  1. ;;Controller medications?
  1. ;;"N/A" will display if this patient does not have an active Asthma
  1. ;;diagnostic tag. Open this patient's record to PCC/Medications tab to
  1. ;;view specific asthma-related medications list.
  1. Q
  1. ;
  1. ASFHX ;
  1. ;;Asthma Family History: "Y" indicates this patient has at least one Family
  1. ;;History entry for asthma. Detailed asthma FHX data will display if your
  1. ;;cursor hovers over the cell.
  1. ;;Open this patient's record to FHX tab to view, add or edit any Family
  1. ;;History.
  1. Q
  1. ;
  1. ASFLU ;
  1. ;;Last Flu Shot: Date of most recent Influenza immunization.
  1. Q
  1. ;
  1. ASIHSD ;
  1. ;;On Inhaled Steroids? Is this patient currently prescribed with Inhaled
  1. ;;Steroid medications?
  1. ;;"N/A" will display if this patient does not have an active Asthma
  1. ;;diagnostic tag. Open this patient's record to PCC/Medications tab to
  1. ;;view specific asthma-related medications list.
  1. Q
  1. ;
  1. ASLADM ;
  1. ;;Asthma Work/School Days Missed: Value of most recent Work/School Missed.
  1. ;;Available values are 0-14 (days), documented in V Measurements. The
  1. ;;visit date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASLBPF ;
  1. ;;Best Peak Flow: Most recent Best Peak Flow value from Measurements file.
  1. ;;BPF is the highest PEF the patient is able to achieve over a 2 to 3 week
  1. ;;period of using the peak flow meter while asthma is under control.
  1. ;;The visit date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASLEUV ;
  1. ;;Last Asthma ER/UC Visit: Date of most recent visit to the ER or Urgent
  1. ;;Care (clinic codes 80 or 30) with Asthma as the primary POV.
  1. Q
  1. ;
  1. ASLFD ;
  1. ;;Asthma Symptom Free Days: Value of most recent Symptom Free Days.
  1. ;;Available values are 0-14 (days), documented in V Measurements. The
  1. ;;visit date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASLFEV ;
  1. ;;FEV1/FVC: Most recent FEV1/FVC values from Measurements file, obtained
  1. ;;from spirometry measurements during a visit. The visit date will display
  1. ;;if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASLHSV ;
  1. ;;Last Asthma Hospital Visit: Date of most recent hospitalization (service
  1. ;;category H) with Asthma as the primary POV.
  1. Q
  1. ;
  1. ASLPF ;
  1. ;;Peak Flow: Most recent Peak Flow value from Measurements file, obtained
  1. ;;from a peak flow meter during a visit. If multiple PFs were documented
  1. ;;on the same date, the value displayed is the highest.
  1. ;;The visit date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASLV ;
  1. ;;Last Asthma Visit: Date of most recent Asthma visit, defined as a
  1. ;;face-to-face visit with ANY of the following asthma-related data elements
  1. ;;documented: Severity, Control, Symptom Free Days, Work/School Missed,
  1. ;;and/or Patient Education.
  1. ;;Click the date to link directly to the Visit Record.
  1. Q
  1. ;
  1. ASRLVR ;
  1. ;;On Reliever Meds? Is this patient currently prescribed with Asthma
  1. ;;Reliever medications?
  1. ;;"N/A" will display if this patient does not have an active Asthma
  1. ;;diagnostic tag. Open this patient's record to PCC/Medications tab to
  1. ;;view specific asthma-related medications list.
  1. Q
  1. ;
  1. ASSEV ;
  1. ;;Asthma Severity: Most recent Severity, documented in Problem List
  1. ;;Classification field. Values are: 1-Intermittent; 2-Mild Persistent;
  1. ;;3-Moderate Persistent; 4-Severe Persistent.
  1. Q
  1. ;
  1. ASSTAT ;
  1. ;;Asthma Diagnostic Tag Status: Most recent diagnostic tag status for
  1. ;;Asthma only, if any. Open this patient's record to DX Tag tab to view a
  1. ;;complete history of all diagnostic tags.
  1. Q
  1. ;
  1. ASTBHF ;
  1. ;;Last Tobacco Health Factor: Most recent Tobacco Health Factor. The visit
  1. ;;date will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. ASTRIG ;
  1. ;;Asthma Triggers List: A list of the most recent of ANY Asthma Triggers
  1. ;;(Health Factors) documented ever for this patient. The visit date(s)
  1. ;;will display if your cursor hovers over the cell.
  1. Q
  1. ;
  1. DPCP ;
  1. ;;Designated Primary Care Provider (DPCP): Name of this patient's
  1. ;;DPCP, if any.
  1. Q