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

AMH30P4C.m

Go to the documentation of this file.
AMH30P4C ; IHS/BJI/GRL - Routine to create bulletin [ 01/19/05  8:06 AM ]
 ;;3.0;IHS BEHAVIORAL HEALTH;**4**;JAN 27, 2003
 ;;
 S DA=$O(^AMHPROB("C","ADHD, COMBINED TYPE",0))
 I DA S DIE="^AMHPROB(",DR=".02///ATTENTION-DEFICIT/HYPERACTIVITY DIS. - COMBINED TYPE" D ^DIE K DA,DR,DIE
 S DA=$O(^AMHPROB("C","ADHD, PREDOMINANTLY HYPERACTIV",0))
 I DA S DIE="^AMHPROB(",DR=".02///ATTENTION-DEFICIT/HYPERACTIVITY DIS. - PREDOM. HYPERACTIVE-IMPULSIVE TYPE" D ^DIE K DA,DR,DIE
 D ^XBFMK
PINAC ;do inactivations
 W !,"Inactivating MHSS PROBLEM CODES and DSM Codes:"
 F AMHJ=1:1 S AMHX=$T(INAC+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I 'DA Q
 .W !?5,AMHC,?12," inactivated"
 .S DIE="^AMHPROB(",DR=".13////1;.14////"_DT
 .D ^DIE
 .I $D(Y) W !,"inactivating ",AMHC," failed."
 .K DA,DR,DIE,DIU,DIV,DIW
 .I $L($P(AMHC,"."))<3 S DA=$O(^AMHPROBC("B",AMHC,0)) D
 ..I 'DA D ^XBFMK Q
 ..W "  **"
 ..I DA S DIE="^AMHPROBC(",DR=".04////1" D ^DIE K DA,DIE,DR,DIU,DIV,DIW
 .Q
PNAME ;now do name changes
 W !!,"Name changes on codes:"
 F AMHJ=1:1 S AMHX=$T(NAME+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I 'DA Q
 .W !?5,AMHC,?12," changed from ",$P(^AMHPROB(DA,0),U,2)," to ",$P(AMHX,";;",3)
 .S DIE="^AMHPROB(",DR=".02///"_$P(AMHX,";;",3)
 .D ^DIE
 .I $D(Y) W !,"changing name ",AMHC," failed."
 .K DA,DR,DIE,DIU,DIV,DIW
 .I $L($P(AMHC,"."))<3 S DA=$O(^AMHPROBC("B",AMHC,0)) D
 ..I 'DA D ^XBFMK Q
 ..W "  **"
 ..I DA S DIE="^AMHPROBC(",DR=".02///"_$P(AMHX,";;",3) D ^DIE
 ..I $D(Y) W !,"   name change failed"
 ..D ^XBFMK
 .Q
PCHG ;change codes
 W !!,"changing codes:"
 F AMHJ=1:1 S AMHX=$T(CHG+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I 'DA Q
 .W !?5,"Changing ",AMHC," to ",$P(AMHX,";;",3)
 .S DIE="^AMHPROB(",DR=".01///"_$P(AMHX,";;",3)
 .D ^DIE
 .I $D(Y) W !,"changing code ",AMHC," failed."
 .K DA,DR,DIE,DIU,DIV,DIW
 .Q
PADDS ;process adds
 ;add 46.3 to problem code file
 I '$O(^AMHPROBC("B","46.3",0)) S AMHC=46.3 D ADDPC
 S DA=$O(^AMHPROBC("B","46.3",0))
 I DA D
 .S DIE="^AMHPROBC(",DR=".02///RAPE (ALLEGED/SUSPECTED);.03///ABUSE"
 .D ^DIE
 ;if non-dsm add to MHSS PROBLEM CODES first, then add to dsm file
 D ^XBFMK
 W !!,"adding new codes:"
 F AMHJ=1:1 S AMHX=$T(ADD+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)  ;CODE
 .S AMHD=$P(AMHX,";;",3)  ;DESCRIPTION .02
 .S AMHM=$P(AMHX,";;",4)  ;MAP TO ICD .05
 .S AMHP=$P(AMHX,";;",5)  ;MHSS PROBLEM CODE
 .S AMHCAT=$P(AMHX,";;",6)  ;CATEGORY
 .;add to mhss problem codes if appropriate
 .W !?5,"adding ",AMHC
 .I $L($P(AMHC,"."))<3 D
 ..D ^XBFMK
 ..S DA=$O(^AMHPROBC("B",AMHC,0))
 ..I 'DA D ADDPC
 ..I 'DA Q
 ..;now edit the code
 ..S DIE="^AMHPROBC(",DR=".02///"_AMHD_";.03///"_AMHCAT
 ..D ^DIE
 ..I $D(Y) W "    editing problem code failed"
 .D ^XBFMK
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I DA W "  Already have code ",AMHC," will edit." G PADDSE
 .S X=AMHC,DIC="^AMHPROB(",DIC(0)="L" K DD,D0,DO S DIADD=1,DLAYGO=9002012.2 D FILE^DICN K DIADD,DLAYGO,DD,DO,D0
 .I Y=-1 W "  adding failed in dsm file" D ^XBFMK Q
 .S DA=+Y
PADDSE .;
 .S DIE="^AMHPROB(",DR=".02///"_AMHD_";.05///"_AMHM_";.03///"_AMHP
 .D ^DIE
 .I $D(Y) W " editing ",AMHC," failed dsm file."
 .K DA,DR,DIE,DIU,DIV,DIW
 .Q
PCCHG ;change codes
 W !!,"changing codes:"
 F AMHJ=1:1 S AMHX=$T(PCHGS+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I 'DA Q
 .W !?5,"Changing ",AMHC," to MAP TO PROBLEM CODE",$P(AMHX,";;",3)
 .S DIE="^AMHPROB(",DR=".03///"_$P(AMHX,";;",3)
 .D ^DIE
 .I $D(Y) W !,"changing code ",AMHC," failed."
 .K DA,DR,DIE,DIU,DIV,DIW
 .Q
MAPC ;
 W !,"Remapping MHSS PROBLEM CODES and DSM Codes to ICD9 dx codes:"
 F AMHJ=1:1 S AMHX=$T(MAP+AMHJ) Q:$P(AMHX,";;",2)=""  D
 .S AMHC=$P(AMHX,";;",2)
 .S DA=$O(^AMHPROB("B",AMHC,0))
 .I 'DA Q
 .W !?5,AMHC,?12," mapped to ICD9"
 .S DIE="^AMHPROB(",DR=".05///"_$P(AMHX,";;",3)
 .D ^DIE
 .I $D(Y) W !,"mapping ",AMHC," failed."
 .K DA,DR,DIE,DIU,DIV,DIW
 .Q
NEWADDS ;
 ;loop through AMHTPCA and add
 S AMHX=0 F  S AMHX=$O(^AMHTPCAD(AMHX)) Q:AMHX'=+AMHX  D
 .S AMHC=$P(^AMHTPCAD(AMHX,0),U) I AMHC="" W !,"error in file ADDS ",AMHX Q
 .S AMHD=$P(^AMHTPCAD(AMHX,0),U,2) I AMHD="" W !,"error in description ADDS ",AMHX Q
 .S AMHI=$P(^AMHTPCAD(AMHX,0),U,5) I AMHI="" S AMHI=AMHC
 .S AMHP=$P(^AMHTPCAD(AMHX,0),U,3) I AMHP="" W !,"error in problem code adds ",AMHX Q
 .S AMHP=$O(^AMHPROBC("B",AMHP,0)) I AMHP="" W !,"error in problem code adds ",AMHX Q
 .;FIND CODE AND SKIP IF ALREADY THERE
 .S X=0,G=0 F  S X=$O(^AMHPROB("B",AMHC,X)) Q:X'=+X!(G)  I $P(^AMHPROB(X,0),U,2)=AMHD S G=X
 .I G D EDIT Q  ;already there
 .;add code, force add
 .K DD,D0,DO,DIADD,DLAYGO D ^XBFMK
 .S X=AMHC,DIC="^AMHPROB(",DIC(0)="L",DIADD=1,DLAYGO=9002012.2,DIC("DR")=".02///"_AMHD_";.03///`"_AMHP_";.05///"_AMHI D FILE^DICN
 .I Y=-1 W !,"error in file^dicn in adding new code ",AMHC
 .W !,"added ",AMHC," ",AMHD
 .D ^XBFMK K DD,D0,DO,DIADD,DLAYGO
 .Q
 Q
EDIT ;
 D ^XBFMK
 S DA=G,DIE="^AMHPROB(",DR=".02///"_AMHD_";.03///`"_AMHP_";.05///"_AMHI_";.14///@" D ^DIE
 D ^XBFMK
 Q
ADDPC ;
 S X=AMHC,DIC="^AMHPROBC(",DIC(0)="L" K DD,D0,DO S DIADD=1,DLAYGO=9002012.4 D FILE^DICN K DIADD,DLAYGO,DD,DO,D0
 I Y=-1 W "  adding failed." Q
 S DA=+Y
 Q
PCHGS ;;
 ;;89.1;;89.1
 ;;290.40;;12
 ;;290.41;;12
 ;;290.42;;12
 ;;290.43;;12
 ;;291.1;;12.1
 ;;291.2;;12.1
 ;;291.3;;17.1
 ;;291.5;;18.1
 ;;292.81;;12.1
 ;;292.82;;12.1
 ;;292.83;;12.1
 ;;293.81;;17
 ;;293.82;;17
 ;;293.83;;17
 ;;293.84;;17
 ;;300.11;;37.1
 ;;300.81;;37.1
 ;;305.90;;30
 ;;305.91;;30
 ;;305.92;;30
 ;;305.93;;30
 ;;292.9;;11
 ;;307.1;;23
 ;;307.80;;37.1
 ;;307.89;;37.1
 ;;317.;;35
 ;;318.0;;35
 ;;318.1;;35
 ;;318.2;;35
 ;;780.93;;38
 ;;995.53;;42.3
 ;;995.54;;42.1
 ;;
INAC ;;
 ;;6
 ;;9
 ;;33
 ;;34
 ;;45
 ;;45.2
 ;;46.1
 ;;46.3
 ;;47.2
 ;;48.2
 ;;49.2
 ;;290.0
 ;;290.10
 ;;290.11
 ;;290.12
 ;;290.13
 ;;290.20
 ;;290.21
 ;;290.3
 ;;291.0
 ;;291.8
 ;;291.89
 ;;292.0
 ;;292.11
 ;;292.12
 ;;292.81
 ;;292.82
 ;;292.83
 ;;292.84
 ;;292.89
 ;;292.9
 ;;294.8
 ;;296.40
 ;;299.80
 ;;300.19
 ;;300.7
 ;;302.6
 ;;302.72
 ;;302.9
 ;;304.60
 ;;305.90
 ;;305.91
 ;;305.92
 ;;305.93
 ;;307.42
 ;;307.44
 ;;307.46
 ;;307.47
 ;;314.01
 ;;608.89
 ;;625.8
 ;;780.59
 ;;799.9
 ;;294.1
 ;;312.8
 ;;347.
 ;;
CHG ;;
 ;;780.9;;780.93
 ;;
NAME ;;
 ;;2;;CROSS-CULTURAL CONFLICT
 ;;12.1;;SUBSTANCE-INDUCED DELIRIUM, DEMENTIA, AMNESTIC AND OTHER COGNITIVE DISORDERS
 ;;17;;PSYCHOTIC DISORDER NOS
 ;;21;;COMMUNICATION DISORDER NOS
 ;;25;;DISRUPTIVE BEHAVIOR DISORDER NOS
 ;;36;;PSYCHOLOGICAL FACTOR AFFECTING MEDICAL CONDITION
 ;;45.1;;ABUSIVE BEHAVIOR (ALLEGED),PHY/EMOT: ADULT VICTIM: FOCUS ON PERP (PARTNER)
 ;;45.3;;ABUSIVE BEHAVIOR (ALLEGED),SEXUAL: ADULT VICTIM: FOCUS ON PERP (PARTNER)
 ;;47;;CHILD NEGLECT (SUSPECTED) - NUTRITIONAL
 ;;47.1;;CHILD NEGLECT (SUSPECTED), OTHER THAN NUTRITIONAL
 ;;48;;ADULT NEGLECT (SUSPECTED), UNSPECIFIED
 ;;48.1;;ADULT NEGLECT (SUSPECTED), NUTRITIONAL
 ;;49;;PARTNER NEGLECT (SUSPECTED), UNSPECIFIED
 ;;49.1;;PARTNER NEGLECT (SUSPECTED), NUTRITIONAL
 ;;49.9;;EXPLOITATION (ADULT)
 ;;54.1;;DEATH (PATIENT EXPIRED)
 ;;54.2;;DYING, END OF LIFE CARE
 ;;64;;ADOPTION (REFERRAL)
 ;;84;;OCCUPATIONAL MALADJUSTMENT
 ;;89.1;;ALTERNATIVE EDUCATION SERVICES
 ;;92;;VOCATIONAL REHABILITATION SERVICES
 ;;312.39;;TRICHOTILLOMANIA
 ;;312.89;;CONDUCT DISORDER, UNSPECIFIED ONSET
 ;;291.1;;ALCOHOL INDUCED AMNESTIC DISORDER
 ;;300.81;;SOMATIZATION DISORDER
 ;;314.00;;ATTENTION-DEFICIT/HYPERACTIVITY DIS. - PREDOM. INATTENTIVE TYPE
 ;;314.9;;ATTENTION-DEFICIT/HYPERACTIVITY DIS. NOS
 ;;
MAP ;;
 ;;8.1;;@
 ;;8.2;;@
 ;;8.21;;@
 ;;9;;294.8
 ;;12;;294.9
 ;;12.1;;294.9
 ;;14;;311.
 ;;15;;296.80
 ;;16;;297.1
 ;;21.1;;995.2
 ;;25;;312.9
 ;;32;;299.80
 ;;42;;995.50
 ;;42.1;;995.54
 ;;42.2;;995.51
 ;;42.3;;995.53
 ;;43;;995.80
 ;;43.1;;995.81
 ;;43.2;;995.82
 ;;43.3;;995.83
 ;;44;;995.80
 ;;44.1;;995.81
 ;;44.2;;995.82
 ;;44.3;;995.83
 ;;45.1;;V61.12
 ;;45.3;;V61.12
 ;;46;;995.83
 ;;47;;995.52
 ;;47.1;;995.51
 ;;48;;995.80
 ;;48.1;;995.84
 ;;49;;995.80
 ;;49.1;;995.84
 ;;49.9;;995.80
 ;;54.1;;@
 ;;64;;V68.89
 ;;72;;V60.4
 ;;82;;V62.2
 ;;84;;V62.2
 ;;294.10;;294.1
 ;;95;;@
 ;;96;;@
 ;;97;;@
 ;;98;;@
 ;;99;;@
 ;;294.8;;290.0
 ;;305.10;;305.10
 ;;312.89;;312.89
 ;;314.9;;314.9
 ;;995.5;;995.50
 ;;780.93;;780.93
 ;;
ADD ;;
 ;;1.1;;HEALTH PROMOTION/DISEASE PREVENTION;;V65.49;;1.1;;MEDICAL/SOCIAL PROBLEMS
 ;;6.1;;PHYSICAL ILLNESS, CHRONIC;;V15.89;;6.1;;MEDICAL/SOCIAL PROBLEMS
 ;;6.2;;PHYSICAL ILLNESS, TERMINAL;;V15.89;;6.2;;MEDICAL/SOCIAL PROBLEMS
 ;;9.1;;PRE-SENILE CONDITION;;290.10;;9.1;;PSYCHOSOCIAL PROBLEMS
 ;;9.2;;SENILE CONDITION;;290.0;;9.2;;PSYCHOSOCIAL PROBLEMS
 ;;8.4;;MALINGERING;;V65.2;;8.4;;MEDICAL/SOCIAL PROBLEMS
 ;;12.1;;SUBSTANCE-INDUCED DELIRIUM, DEMENTIA, AMNESTIC AND OTHER COGNITIVE DISORDERS;;294.8;;12.1;;PSYCHOSOCIAL PROBLEMS
 ;;14.2;;ALCOHOL OR DRUG INDUCED MOOD DISORDER,NOS;;296.90;;14.2;;PSYCHOSOCIAL PROBLEMS
 ;;17.1;;ALCOHOL OR DRUG INDUCED PSYCHOTIC DISORDER, NOS;;298.9;;17.1;;PSYCHOSOCIAL PROBLEMS
 ;;18.1;;ALCOHOL OR DRUG INDUCED ANXIETY DISORDER;;300.00;;18.1;;PSYCHOSOCIAL PROBLEMS
 ;;20.1;;ALCOHOL OR DRUG INDUCED PSYCHOSEXUAL DISORDER;;302.9;;20.1;;PSYCHOSOCIAL PROBLEMS
 ;;22.1;;ALCOHOL OR DRUG INDUCED SLEEP DISORDER;;307.47;;22.1;;PSYCHOSOCIAL PROBLEMS
 ;;29.2;;SCREENING FOR DRUG ABUSE;;V79.8;;29.2;;SCREENING
 ;;37.1;;SOMATOFORM DISORDERS;;300.82;;37.1;;PSYCHOSOCIAL PROBLEMS
 ;;42.11;;SHAKEN BABY SYNDROME;;995.55;;42.11;;ABUSE
 ;;42.4;;OTHER CHILD ABUSE & NEGLECT (MULTIPLE FORMS OF ABUSE/NEGLECT);;995.59;;42.4;;ABUSE
 ;;43.4;;OTHER PARTNER ABUSE & NEGLECT (MULTIPLE FORMS OF ABUSE/NEGLECT);;995.85;;43.4;;ABUSE
 ;;44.4;;OTHER ADULT ABUSE AND NEGLECT (MULTIPLE FORMS OF ABUSE/NEGLECT);;995.85;;44.4;;ABUSE
 ;;45.11;;ABUSIVE BEH (ALLEGED), PHYS/EMOT: ADULT VICTIM: FOCUS ON PERP (NON-PARTNER);;V62.83;;45.11;;ABUSE
 ;;45.12;;ABUSIVE BEH (ALLEGED), PHYS/EMOT:CHILD VICTIM: FOCUS ON PERP (PARENT);;V61.22;;45.12;;ABUSE
 ;;45.13;;ABUSIVE BEH (ALLEGED), PHYS/EMOT: CHILD VICTIM: FOCUS ON PERP (NON-PARENT);;V62.83;;45.13;;ABUSE
 ;;45.31;;ABUSIVE BEH (ALLEGED), SEXUAL: ADULT VICTIM: FOCUS ON PERP (NON-PARTNER);;V62.83;;45.31;;ABUSE
 ;;45.32;;ABUSIVE BEH (ALLEGED), SEXUAL: CHILD VICTIM: FOCUS ON PERP (PARENT);;V61.22;;45.32;;ABUSE
 ;;45.33;;ABUSIVE BEH (ALLEGED), SEXUAL: CHILD VICTIM: FOCUS ON PERP (NON-PARENT);;V62.83;;45.33;;ABUSE
 ;;64.1;;ADOPTION (COUNSELING);;V61.29;;64.1;;PREGNANCY/CHILDBIRTH PROBLEMS
 ;;72.1;;FOSTER CARE (COUNSELING);;V61.29;;72.1;;OUT OF HOME CARE
 ;;82.1;;UNEMPLOYMENT;;V62.0;;82.1;;SOCIOECONOMIC PROBLEMS
 ;;89.1;;ALTERNATIVE EDUCATION SERVICES;;;;89.1;;EDUCATIONAL/LIFE PROBLEMS
 ;;94.1;;RELIGIOUS OR SPIRITUAL PROBLEM;;V62.89;;94.1;;EDUCATIONAL/LIFE PROBLEMS
 ;;94.2;;BORDERLINE INTELLECTUAL FUNCTIONING;;V62.89;;94.2;;EDUCATIONAL/LIFE PROBLEMS
 ;;315.32;;MIXED RECEPTIVE-EXPRESSIVE LANGUAGE DISORDER;;315.32;;32
 ;;995.51;;CHILD ABUSE (EMOTIONAL)/NEGLECT (SUSPECTED) - OTHER THAN NUTRITIONAL;;995.51;;42.2
 ;;995.55;;SHAKEN BABY SYNDROME;;995.55;;42.11
 ;;995.82;;ADULT ABUSE (SUSPECTED), EMOTIONAL;;995.82;;44.2
 ;;995.83;;ADULT ABUSE (SUSPECTED), SEXUAL;;995.83;;44.3
 ;;995.85;;OTHER ADULT ABUSE AND NEGLECT (MULTIPLE FORMS OF ABUSE/NEGLECT);;995.85;;44.4
 ;;347.00;;NARCOLEPSY WITHOUT CATAPLEXY;;347.00;;22
 ;;347.01;;NARCOLEPSY WITH CATAPLEXY;;347.01;;22
 ;;347.10;;NARCOLEPSY COND W/O CATAPLEXY;;347.10;;22
 ;;347.11;;NARCOLEPSY COND WITH CATAPLEXY;;347.11;;22
 ;;