- DGICDGT ;BIR/SJA - ALB/AAS - ADT ICD DIAGNOSIS SEARCH ;02-Feb-2012
- ;;5.3;Registration;**850,884**;Aug 13, 1993;Build 31
- ;
- ;This routine does not conform to Standard & Conventions routine naming conventions
- ;since package routine names of DG_I* (with the exceptions of Kernel, VA FileMan, and
- ;routines created to support the INIT process) should not be used. The SACC has granted
- ;an exemption for this routine.
- ;
- ; CSI^ICDEX ICR 5747
- ; SYS^ICDEX ICR 5747
- ; LS^ICDEX ICR 5747
- ;
- ;Reference to $$ICDDATA^ICDXCODE supported by DBIA #5699
- ;
- GETAPI(APP,TYPE,PTF,CHK,DGNODE) ;ICD-9/ICD-10 selection - called by input transform
- ; - INPUT: X := the initial user input to be searched on (REQUIRED)
- ; APP := application name "DG PTF" ;drp removed file ref in file 130.4;.01 (REQUIRED)
- ; TYPE := type of call "DIAG or "PROC" ;drp removed file ref in file 130.4;.04 (REQUIRED)
- ; PTF := top level entry in file 130 (DA) used to get date to compute correct version (OPTIONAL but needs DA)
- ; CHK := additional screening logic
- ; Note: applications using this as an example will need to modify the code that uses this.
- ; DGNODE := node variable needed to account for increased DX code storage across different
- ; PTF global nodes, default=0 (OPTIONAL)
- ; - OUTPUT: X := the internal value to be stored in the field.
- ; Y := the internal value to be stored in the field
- ;
- N DIC,DIE,DGPTDA,DGDT,IMPDATE,ENTRY,CODE,VERSION,DGX,LEXI,EFFDATE,IMPDATE,DGPTDAT,DGER,KEY,DUOUT,DTOUT
- ;
- S DGNODE=$G(DGNODE,0) ;default to 0 node if not passed
- ;
- I X="?BAD" S X="" D MSG("") Q
- I X="@" K X Q
- I '$L($G(APP)) D MSG("The Application making the call was not specified.") K X Q
- I '$L($G(TYPE)) D MSG("The Search Type (diagnosis or procedure) was not specified.") K X Q
- I $L($G(X))>100!($L($G(X))<1) D MSG("Answer must be 1-100 characters in length.") K X Q
- ;
- ;I $G(PTF)=-1 S DGPTDAT=$S($G(DGPTDAT)?7N:DGPTDAT,1:DT) D G GO ; special case for call not related to PTF record
- ;. K CHK
- ;. S DGTEMP=$$IMPDATE^DGPTIC10("10D")
- ;. S EFFDATE=+DGTEMP
- ;. S IMPDATE=$P(DGTEMP,U,1)
- ;. I DGPTDAT'<IMPDATE,+$P(DGTEMP,U,2)?7N S EFFDATE=+$P(DGTEMP,U,2)
- ;
- ; -- next FOUR lines are DG PTF Specific, plus one more line further below
- ; - Note: X and EFFDATE are used inside the executed code
- S DGPTDA=$S($G(PTF):PTF,$D(DA(2)):DA(2),$D(DA(1)):DA(1),$D(DA):DA,$D(D0):D0,1:"")
- I DGPTDA="" S EFFDATE=$G(DGDRGDT),CHK="" D EFFDAT1^DGPTIC10(EFFDATE) G GO
- I $G(^DGPT($G(DGPTDA),0))="" D MSG("Entry in the PTF file was not found.") K X Q
- ; DGTYPE determines which EFFDATE is used inside executable code. 701 is default.
- N DGTYPE S DGTYPE=$P($G(X1,"^701"),U,2) D EFFDATE^DGPTIC10(DGPTDA,DGTYPE)
- ;
- GO ; -- Jump for DRG calculation
- S VERSION=$$SYS^ICDEX(TYPE,EFFDATE)
- I VERSION'>0 D MSG("Could not acquire the correct ICD Version for '"_TYPE_"' on "_$$FMTE^XLFDT(EFFDATE)) K X Q
- I X["?" D K X,Y Q
- . N TAG S TAG=""
- . I VERSION=30 S TAG=$S(X["???":"D3",X["??":"D2",X["?":"D1",1:"D1") D @TAG Q
- . I VERSION=31 S TAG=$S(X["???":"P3",X["??":"P2",X["?":"P1",1:"P1") D @TAG Q
- . I VERSION=1 S TAG="Answer with ICD-9 DIAGNOSIS CODE NUMBER, or DESCRIPTION."
- . I VERSION=2 S TAG="Answer with ICD-9 OPERATION/PROCEDURE, or CODE NUMBER, or DESCRIPTION."
- . S FORMAT=$S(X["??":"!?8",1:"!?5")
- . D EN^DDIOL(TAG,"",FORMAT)
- . Q
- I VERSION=31,X["*" S X=$P(X,"*",1)_$P(X,"*",2)
- ;
- ;References to file 130.4 removed to eliminate dependency on Surgery SR*3.0*177
- ;I VERSION=30,X?1L1N S X=$$TR(X)
- ;S ENTRY=$O(^DIC(130.4,"C",APP,TYPE,VERSION,0))
- ;I ENTRY'>0 D MSG("Search Entry in ICD SEARCH API file for application '"_APP_"' of type '"_TYPE_"' for Version '"_VERSION_"' is missing.") K X Q
- ;S CODE=$G(^DIC(130.4,ENTRY,1))
- ;Replaced previous lines with lines below.
- S CODE=$S(VERSION=1:"S Y=$$GETICD9^DGPTF5(EFFDATE)",VERSION=30:"D LEX^DGICD",VERSION=2:"S Y=$$SEARCH^ICDSAPI(""PROC"",(""I $$LS^ICDEX(80.1,+Y,""""""_EFFDATE_"""""")=1""),""QEMZ"",EFFDATE)",VERSION=31:"D ASK^DGICP",1:-1)
- I CODE=-1 D MSG("Search Entry in ICD SEARCH API file for application '"_APP_"' of type '"_TYPE_"' for Version '"_VERSION_"' is missing.") K X Q
- ;
- I '$L(CODE) D MSG("No Executable Code found for a ICD code search for type '"_TYPE_"'.") K X Q
- I $L(CODE) X CODE
- ;
- ; -- execute additional checks for DG PTF
- ; no code entered twice, gender specific codes, requires other codes,
- ; can't be used with other current codes, etc
- S DGER=0 I $G(CHK)'="",$G(Y)>0 D @(CHK_"^DGPTFJC") I $G(DGER) K X,Y Q
- ;
- I $G(Y)>0 S X=+Y Q
- K X,Y
- Q
- MSG(TEXT) ;
- D EN^DDIOL(TEXT)
- Q
- ;
- TR(X) ;
- S X=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- Q X
- D1 ; -- Diagnosis ? Help
- I X["???" D D3 Q ;For calls from ^DIR, doesn't support ??? help
- I X["??" D D2 Q
- D EN^DDIOL("Enter code or ""text"" for more information.","","!?5")
- D EN^DDIOL(" ")
- Q
- ;
- D2 ; -- Diagnosis ?? Help
- D EN^DDIOL("Enter a ""free text"" term or part of a term such as ""femur fracture"".","","!?8")
- D EN^DDIOL(" or","","!?8")
- D EN^DDIOL("Enter a ""classification code"" (ICD/CPT, etc.) to find the single term","","!?8")
- D EN^DDIOL("associated with the code","","!?8")
- D EN^DDIOL(" or","","!?8")
- D EN^DDIOL("Enter a ""partial code"". Include the decimal when a search criterion","","!?8")
- D EN^DDIOL("includes 3 characters or more for code searches.","","!?8")
- D EN^DDIOL(" ")
- Q
- ;
- D3 ; -- Diagnosis ??? Help
- N HLP
- S HLP(1)="Number of Code Matches"
- S HLP(1,"F")="!?8"
- S HLP(2)="----------------------"
- S HLP(2,"F")="!?8"
- S HLP(3)="The ICD-10 Diagnosis Code search will show the user the number of"
- S HLP(3,"F")="!!?8"
- S HLP(4)="matches found, indicate if additional characters in ICD code exist,"
- S HLP(4,"F")="!?8"
- S HLP(5)="and the number of codes within the category or subcategory that are"
- S HLP(5,"F")="!?8"
- S HLP(6)="available for selection. For example:"
- S HLP(6,"F")="!?8"
- S HLP(8)="19 matches found"
- S HLP(8,"F")="!!?8"
- S HLP(10)="M91. - Juvenile osteochondrosis of hip and pelvis (19)"
- S HLP(10,"F")="!!?8"
- S HLP(12)="This indicates that 19 unique matches or matching groups have been"
- S HLP(12,"F")="!!?8"
- S HLP(13)="found and will be displayed."
- S HLP(13,"F")="!?8"
- S HLP(15)="M91. - the ""-"" indicates that there are additional characters"
- S HLP(15,"F")="!!?8"
- S HLP(16)="that specify unique ICD-10 codes available."
- S HLP(16,"F")="!?8"
- S HLP(18)="(19) Indicates that there are 19 additional ICD-10 codes in the"
- S HLP(18,"F")="!!?8"
- S HLP(19)="M91 ""family"" that are possible selections."
- S HLP(19,"F")="!?8"
- D EN^DDIOL(.HLP)
- Q
- ;
- P1 ;
- I X["???" D P3 Q ;For calls from ^DIR, doesn't support ??? help
- I X["??" D P2 Q
- D EN^DDIOL("Enter the initial character(s) of an ICD-10 partial code or an","","!?5")
- D EN^DDIOL("asterisk (*) for more information.","","!?5")
- D EN^DDIOL(" ")
- Q
- ;
- P2 ;
- D EN^DDIOL("1. Enter an ICD-10 Procedure Code.","","!?8")
- D EN^DDIOL(" or ","","!?8")
- D EN^DDIOL("2. Enter any alphanumeric char values of the procedure code to ""build""","","!?8")
- D EN^DDIOL(" an ICD-10 Procedure Code.","","!?8")
- D EN^DDIOL(" or ","","!?8")
- D EN^DDIOL("3. Enter an asterisk (*) to initiate a procedure code build search. ","","!?8")
- D EN^DDIOL(" ")
- Q
- ;
- P3 ;
- D EN^DDIOL("The procedure code search provides a ""decision tree"" type structure","","!?8")
- D EN^DDIOL("that makes use of the specific ICD-10-PCS code format and structure,","","!?8")
- D EN^DDIOL("where all codes consist of 7 alphanumeric characters, with each","","!?8")
- D EN^DDIOL("position in the code having a specific meaning.","","!?8")
- D EN^DDIOL(" ")
- Q
- ;
- ;TEST ; -- test api calls
- S X="F1" W !,"1" D GETAPI^DGICDGT(,"DIAG",1) ;no application
- S X="F1" W !,"2" D GETAPI^DGICDGT("DG PTF",,1) ;no Type
- S X="F1" W !,"3" D GETAPI^DGICDGT("DG PTF","DIAG",199999) ;no entry is PTFF file
- S X="" W !,"4" D GETAPI^DGICDGT("DG PTF","DIAG",1) ;Answer too short
- S X="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- W !,"5" D GETAPI^DGICDGT("DG PTF","PROC",1) ;answer too long
- S X="F1" W !,"6" D GETAPI^DGICDGT("DG PTF","DAIG",1) ; NO VERSION found
- S X="F1" W !,"7" D GETAPI^DGICDGT("DG PTF","DIAG",1) ; no entry for Daig
- S X="F1" W !,"8" D GETAPI^DGICDGT("DG PTF","PROC",1) ;no executable code
- ;
- S X="330" W !,"9 - SHOULD WORK" D GETAPI^DGICDGT("DG PTF","DIAG",1) ; This one is icd-9
- S X="S62" W !,"10 - SHOULD WORK" D GETAPI^DGICDGT("DG PTF","DIAG",21) ; This one is icd-10
- S X="COCAINE" W !,"11 'COCAINE' - SHOULD WORK" D GETAPI^DGICDGT("DG PTF","DIAG",21) ; This one is icd-10
- T12 S X="fracture" W !,"12 'FRACTURE'- TOO LONG" D GETAPI^DGICDGT("DG PTF","DIAG",14) ; This one is icd-10
- Q
- D19 ;
- I X["???" D D29 Q ;For calls from ^DIR, doesn't support ?? OR ??? help
- D EN^DDIOL("Enter a ""free text"" term. Best results occur using one to")
- D EN^DDIOL(" three full or partial words without a suffix.")
- D EN^DDIOL(" or ")
- D EN^DDIOL(" Enter a classification code (ICD/CPT etc) to find the single")
- D EN^DDIOL(" term associated with the code.")
- D EN^DDIOL(" or ")
- D EN^DDIOL(" Enter a classification code (ICD/CPT etc) followed by a plus")
- D EN^DDIOL(" sign (+) to retrieve all terms associated with the code. ")
- Q
- ;
- D29 ;
- D EN^DDIOL(" Enter a ""free text"" term. Best results occur using one to ")
- D EN^DDIOL(" three full or partial words without a suffix (i.e., ""DIABETES"",")
- D EN^DDIOL(" ""DIAB MELL"",""DIAB MELL INSUL"")")
- D EN^DDIOL(" or ")
- D EN^DDIOL(" Enter a classification code (ICD/CPT etc) to find the single ")
- D EN^DDIOL(" term associated with the code. Example, a lookup of code 239.0 ")
- D EN^DDIOL(" returns one and only one term, that is the preferred ")
- D EN^DDIOL(" term for the code 239.0, ""Neoplasm of unspecified nature ")
- D EN^DDIOL(" of digestive system""")
- D EN^DDIOL(" or ")
- D EN^DDIOL(" Enter a classification code (ICD/CPT etc) followed by a plus")
- D EN^DDIOL(" sign (+) to retrieve all terms associated with the code. Example,")
- D EN^DDIOL(" a lookup of 239.0+ returns all terms that are linked to the ")
- D EN^DDIOL(" code 239.0.")
- Q
- ;
- P19 ;
- N DGYN S DGYN=1
- D EN^DDIOL("Answer with ICD-9 OPERATION/PROCEDURE, or CODE NUMBER, or DESCRIPTION")
- I X="?" D EN^DDIOL("Do you want the entire ICD-9 OPERATION/PROCEDURE List") S %=0 D YN^DICN S DGYN=%
- S DIC("S")="I $$CSI^ICDEX(80.1,+Y)=2"
- S DIC("W")="N C,DINAME S IEN=+Y W "" "" D EN^DDIOL(("" ""_$$IDOPS^ICDID(+Y)),"""",""?0"")"
- S DIC="^ICD0(",DIC("0")="AEQMZ",DZ="??",D="B",DO="ICD OPERATION/PROCEDURE^80.1OI^4487^4480",DO(2)="80.1OI"
- D:DGYN=1 DQ^DICQ
- Q
- ;
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDGICDGT 10976 printed Jan 18, 2025@03:44:34 Page 2
- DGICDGT ;BIR/SJA - ALB/AAS - ADT ICD DIAGNOSIS SEARCH ;02-Feb-2012
- +1 ;;5.3;Registration;**850,884**;Aug 13, 1993;Build 31
- +2 ;
- +3 ;This routine does not conform to Standard & Conventions routine naming conventions
- +4 ;since package routine names of DG_I* (with the exceptions of Kernel, VA FileMan, and
- +5 ;routines created to support the INIT process) should not be used. The SACC has granted
- +6 ;an exemption for this routine.
- +7 ;
- +8 ; CSI^ICDEX ICR 5747
- +9 ; SYS^ICDEX ICR 5747
- +10 ; LS^ICDEX ICR 5747
- +11 ;
- +12 ;Reference to $$ICDDATA^ICDXCODE supported by DBIA #5699
- +13 ;
- GETAPI(APP,TYPE,PTF,CHK,DGNODE) ;ICD-9/ICD-10 selection - called by input transform
- +1 ; - INPUT: X := the initial user input to be searched on (REQUIRED)
- +2 ; APP := application name "DG PTF" ;drp removed file ref in file 130.4;.01 (REQUIRED)
- +3 ; TYPE := type of call "DIAG or "PROC" ;drp removed file ref in file 130.4;.04 (REQUIRED)
- +4 ; PTF := top level entry in file 130 (DA) used to get date to compute correct version (OPTIONAL but needs DA)
- +5 ; CHK := additional screening logic
- +6 ; Note: applications using this as an example will need to modify the code that uses this.
- +7 ; DGNODE := node variable needed to account for increased DX code storage across different
- +8 ; PTF global nodes, default=0 (OPTIONAL)
- +9 ; - OUTPUT: X := the internal value to be stored in the field.
- +10 ; Y := the internal value to be stored in the field
- +11 ;
- +12 NEW DIC,DIE,DGPTDA,DGDT,IMPDATE,ENTRY,CODE,VERSION,DGX,LEXI,EFFDATE,IMPDATE,DGPTDAT,DGER,KEY,DUOUT,DTOUT
- +13 ;
- +14 ;default to 0 node if not passed
- SET DGNODE=$GET(DGNODE,0)
- +15 ;
- +16 IF X="?BAD"
- SET X=""
- DO MSG("")
- QUIT
- +17 IF X="@"
- KILL X
- QUIT
- +18 IF '$LENGTH($GET(APP))
- DO MSG("The Application making the call was not specified.")
- KILL X
- QUIT
- +19 IF '$LENGTH($GET(TYPE))
- DO MSG("The Search Type (diagnosis or procedure) was not specified.")
- KILL X
- QUIT
- +20 IF $LENGTH($GET(X))>100!($LENGTH($GET(X))<1)
- DO MSG("Answer must be 1-100 characters in length.")
- KILL X
- QUIT
- +21 ;
- +22 ;I $G(PTF)=-1 S DGPTDAT=$S($G(DGPTDAT)?7N:DGPTDAT,1:DT) D G GO ; special case for call not related to PTF record
- +23 ;. K CHK
- +24 ;. S DGTEMP=$$IMPDATE^DGPTIC10("10D")
- +25 ;. S EFFDATE=+DGTEMP
- +26 ;. S IMPDATE=$P(DGTEMP,U,1)
- +27 ;. I DGPTDAT'<IMPDATE,+$P(DGTEMP,U,2)?7N S EFFDATE=+$P(DGTEMP,U,2)
- +28 ;
- +29 ; -- next FOUR lines are DG PTF Specific, plus one more line further below
- +30 ; - Note: X and EFFDATE are used inside the executed code
- +31 SET DGPTDA=$SELECT($GET(PTF):PTF,$DATA(DA(2)):DA(2),$DATA(DA(1)):DA(1),$DATA(DA):DA,$DATA(D0):D0,1:"")
- +32 IF DGPTDA=""
- SET EFFDATE=$GET(DGDRGDT)
- SET CHK=""
- DO EFFDAT1^DGPTIC10(EFFDATE)
- GOTO GO
- +33 IF $GET(^DGPT($GET(DGPTDA),0))=""
- DO MSG("Entry in the PTF file was not found.")
- KILL X
- QUIT
- +34 ; DGTYPE determines which EFFDATE is used inside executable code. 701 is default.
- +35 NEW DGTYPE
- SET DGTYPE=$PIECE($GET(X1,"^701"),U,2)
- DO EFFDATE^DGPTIC10(DGPTDA,DGTYPE)
- +36 ;
- GO ; -- Jump for DRG calculation
- +1 SET VERSION=$$SYS^ICDEX(TYPE,EFFDATE)
- +2 IF VERSION'>0
- DO MSG("Could not acquire the correct ICD Version for '"_TYPE_"' on "_$$FMTE^XLFDT(EFFDATE))
- KILL X
- QUIT
- +3 IF X["?"
- Begin DoDot:1
- +4 NEW TAG
- SET TAG=""
- +5 IF VERSION=30
- SET TAG=$SELECT(X["???":"D3",X["??":"D2",X["?":"D1",1:"D1")
- DO @TAG
- QUIT
- +6 IF VERSION=31
- SET TAG=$SELECT(X["???":"P3",X["??":"P2",X["?":"P1",1:"P1")
- DO @TAG
- QUIT
- +7 IF VERSION=1
- SET TAG="Answer with ICD-9 DIAGNOSIS CODE NUMBER, or DESCRIPTION."
- +8 IF VERSION=2
- SET TAG="Answer with ICD-9 OPERATION/PROCEDURE, or CODE NUMBER, or DESCRIPTION."
- +9 SET FORMAT=$SELECT(X["??":"!?8",1:"!?5")
- +10 DO EN^DDIOL(TAG,"",FORMAT)
- +11 QUIT
- End DoDot:1
- KILL X,Y
- QUIT
- +12 IF VERSION=31
- IF X["*"
- SET X=$PIECE(X,"*",1)_$PIECE(X,"*",2)
- +13 ;
- +14 ;References to file 130.4 removed to eliminate dependency on Surgery SR*3.0*177
- +15 ;I VERSION=30,X?1L1N S X=$$TR(X)
- +16 ;S ENTRY=$O(^DIC(130.4,"C",APP,TYPE,VERSION,0))
- +17 ;I ENTRY'>0 D MSG("Search Entry in ICD SEARCH API file for application '"_APP_"' of type '"_TYPE_"' for Version '"_VERSION_"' is missing.") K X Q
- +18 ;S CODE=$G(^DIC(130.4,ENTRY,1))
- +19 ;Replaced previous lines with lines below.
- +20 SET CODE=$SELECT(VERSION=1:"S Y=$$GETICD9^DGPTF5(EFFDATE)",VERSION=30:"D LEX^DGICD",VERSION=2:"S Y=$$SEARCH^ICDSAPI(""PROC"",(""I $$LS^ICDEX(80.1,+Y,""""""_EFFDATE_"""""")=1""),""QEMZ"",EFFDATE)",VERSION=31:"D ASK^DGICP",1:-1)
- +21 IF CODE=-1
- DO MSG("Search Entry in ICD SEARCH API file for application '"_APP_"' of type '"_TYPE_"' for Version '"_VERSION_"' is missing.")
- KILL X
- QUIT
- +22 ;
- +23 IF '$LENGTH(CODE)
- DO MSG("No Executable Code found for a ICD code search for type '"_TYPE_"'.")
- KILL X
- QUIT
- +24 IF $LENGTH(CODE)
- XECUTE CODE
- +25 ;
- +26 ; -- execute additional checks for DG PTF
- +27 ; no code entered twice, gender specific codes, requires other codes,
- +28 ; can't be used with other current codes, etc
- +29 SET DGER=0
- IF $GET(CHK)'=""
- IF $GET(Y)>0
- DO @(CHK_"^DGPTFJC")
- IF $GET(DGER)
- KILL X,Y
- QUIT
- +30 ;
- +31 IF $GET(Y)>0
- SET X=+Y
- QUIT
- +32 KILL X,Y
- +33 QUIT
- MSG(TEXT) ;
- +1 DO EN^DDIOL(TEXT)
- +2 QUIT
- +3 ;
- TR(X) ;
- +1 SET X=$TRANSLATE(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
- +2 QUIT X
- D1 ; -- Diagnosis ? Help
- +1 ;For calls from ^DIR, doesn't support ??? help
- IF X["???"
- DO D3
- QUIT
- +2 IF X["??"
- DO D2
- QUIT
- +3 DO EN^DDIOL("Enter code or ""text"" for more information.","","!?5")
- +4 DO EN^DDIOL(" ")
- +5 QUIT
- +6 ;
- D2 ; -- Diagnosis ?? Help
- +1 DO EN^DDIOL("Enter a ""free text"" term or part of a term such as ""femur fracture"".","","!?8")
- +2 DO EN^DDIOL(" or","","!?8")
- +3 DO EN^DDIOL("Enter a ""classification code"" (ICD/CPT, etc.) to find the single term","","!?8")
- +4 DO EN^DDIOL("associated with the code","","!?8")
- +5 DO EN^DDIOL(" or","","!?8")
- +6 DO EN^DDIOL("Enter a ""partial code"". Include the decimal when a search criterion","","!?8")
- +7 DO EN^DDIOL("includes 3 characters or more for code searches.","","!?8")
- +8 DO EN^DDIOL(" ")
- +9 QUIT
- +10 ;
- D3 ; -- Diagnosis ??? Help
- +1 NEW HLP
- +2 SET HLP(1)="Number of Code Matches"
- +3 SET HLP(1,"F")="!?8"
- +4 SET HLP(2)="----------------------"
- +5 SET HLP(2,"F")="!?8"
- +6 SET HLP(3)="The ICD-10 Diagnosis Code search will show the user the number of"
- +7 SET HLP(3,"F")="!!?8"
- +8 SET HLP(4)="matches found, indicate if additional characters in ICD code exist,"
- +9 SET HLP(4,"F")="!?8"
- +10 SET HLP(5)="and the number of codes within the category or subcategory that are"
- +11 SET HLP(5,"F")="!?8"
- +12 SET HLP(6)="available for selection. For example:"
- +13 SET HLP(6,"F")="!?8"
- +14 SET HLP(8)="19 matches found"
- +15 SET HLP(8,"F")="!!?8"
- +16 SET HLP(10)="M91. - Juvenile osteochondrosis of hip and pelvis (19)"
- +17 SET HLP(10,"F")="!!?8"
- +18 SET HLP(12)="This indicates that 19 unique matches or matching groups have been"
- +19 SET HLP(12,"F")="!!?8"
- +20 SET HLP(13)="found and will be displayed."
- +21 SET HLP(13,"F")="!?8"
- +22 SET HLP(15)="M91. - the ""-"" indicates that there are additional characters"
- +23 SET HLP(15,"F")="!!?8"
- +24 SET HLP(16)="that specify unique ICD-10 codes available."
- +25 SET HLP(16,"F")="!?8"
- +26 SET HLP(18)="(19) Indicates that there are 19 additional ICD-10 codes in the"
- +27 SET HLP(18,"F")="!!?8"
- +28 SET HLP(19)="M91 ""family"" that are possible selections."
- +29 SET HLP(19,"F")="!?8"
- +30 DO EN^DDIOL(.HLP)
- +31 QUIT
- +32 ;
- P1 ;
- +1 ;For calls from ^DIR, doesn't support ??? help
- IF X["???"
- DO P3
- QUIT
- +2 IF X["??"
- DO P2
- QUIT
- +3 DO EN^DDIOL("Enter the initial character(s) of an ICD-10 partial code or an","","!?5")
- +4 DO EN^DDIOL("asterisk (*) for more information.","","!?5")
- +5 DO EN^DDIOL(" ")
- +6 QUIT
- +7 ;
- P2 ;
- +1 DO EN^DDIOL("1. Enter an ICD-10 Procedure Code.","","!?8")
- +2 DO EN^DDIOL(" or ","","!?8")
- +3 DO EN^DDIOL("2. Enter any alphanumeric char values of the procedure code to ""build""","","!?8")
- +4 DO EN^DDIOL(" an ICD-10 Procedure Code.","","!?8")
- +5 DO EN^DDIOL(" or ","","!?8")
- +6 DO EN^DDIOL("3. Enter an asterisk (*) to initiate a procedure code build search. ","","!?8")
- +7 DO EN^DDIOL(" ")
- +8 QUIT
- +9 ;
- P3 ;
- +1 DO EN^DDIOL("The procedure code search provides a ""decision tree"" type structure","","!?8")
- +2 DO EN^DDIOL("that makes use of the specific ICD-10-PCS code format and structure,","","!?8")
- +3 DO EN^DDIOL("where all codes consist of 7 alphanumeric characters, with each","","!?8")
- +4 DO EN^DDIOL("position in the code having a specific meaning.","","!?8")
- +5 DO EN^DDIOL(" ")
- +6 QUIT
- +7 ;
- +8 ;TEST ; -- test api calls
- +9 ;no application
- SET X="F1"
- WRITE !,"1"
- DO GETAPI^DGICDGT(,"DIAG",1)
- +10 ;no Type
- SET X="F1"
- WRITE !,"2"
- DO GETAPI^DGICDGT("DG PTF",,1)
- +11 ;no entry is PTFF file
- SET X="F1"
- WRITE !,"3"
- DO GETAPI^DGICDGT("DG PTF","DIAG",199999)
- +12 ;Answer too short
- SET X=""
- WRITE !,"4"
- DO GETAPI^DGICDGT("DG PTF","DIAG",1)
- +13 SET X="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
- +14 ;answer too long
- WRITE !,"5"
- DO GETAPI^DGICDGT("DG PTF","PROC",1)
- +15 ; NO VERSION found
- SET X="F1"
- WRITE !,"6"
- DO GETAPI^DGICDGT("DG PTF","DAIG",1)
- +16 ; no entry for Daig
- SET X="F1"
- WRITE !,"7"
- DO GETAPI^DGICDGT("DG PTF","DIAG",1)
- +17 ;no executable code
- SET X="F1"
- WRITE !,"8"
- DO GETAPI^DGICDGT("DG PTF","PROC",1)
- +18 ;
- +19 ; This one is icd-9
- SET X="330"
- WRITE !,"9 - SHOULD WORK"
- DO GETAPI^DGICDGT("DG PTF","DIAG",1)
- +20 ; This one is icd-10
- SET X="S62"
- WRITE !,"10 - SHOULD WORK"
- DO GETAPI^DGICDGT("DG PTF","DIAG",21)
- +21 ; This one is icd-10
- SET X="COCAINE"
- WRITE !,"11 'COCAINE' - SHOULD WORK"
- DO GETAPI^DGICDGT("DG PTF","DIAG",21)
- T12 ; This one is icd-10
- SET X="fracture"
- WRITE !,"12 'FRACTURE'- TOO LONG"
- DO GETAPI^DGICDGT("DG PTF","DIAG",14)
- +1 QUIT
- D19 ;
- +1 ;For calls from ^DIR, doesn't support ?? OR ??? help
- IF X["???"
- DO D29
- QUIT
- +2 DO EN^DDIOL("Enter a ""free text"" term. Best results occur using one to")
- +3 DO EN^DDIOL(" three full or partial words without a suffix.")
- +4 DO EN^DDIOL(" or ")
- +5 DO EN^DDIOL(" Enter a classification code (ICD/CPT etc) to find the single")
- +6 DO EN^DDIOL(" term associated with the code.")
- +7 DO EN^DDIOL(" or ")
- +8 DO EN^DDIOL(" Enter a classification code (ICD/CPT etc) followed by a plus")
- +9 DO EN^DDIOL(" sign (+) to retrieve all terms associated with the code. ")
- +10 QUIT
- +11 ;
- D29 ;
- +1 DO EN^DDIOL(" Enter a ""free text"" term. Best results occur using one to ")
- +2 DO EN^DDIOL(" three full or partial words without a suffix (i.e., ""DIABETES"",")
- +3 DO EN^DDIOL(" ""DIAB MELL"",""DIAB MELL INSUL"")")
- +4 DO EN^DDIOL(" or ")
- +5 DO EN^DDIOL(" Enter a classification code (ICD/CPT etc) to find the single ")
- +6 DO EN^DDIOL(" term associated with the code. Example, a lookup of code 239.0 ")
- +7 DO EN^DDIOL(" returns one and only one term, that is the preferred ")
- +8 DO EN^DDIOL(" term for the code 239.0, ""Neoplasm of unspecified nature ")
- +9 DO EN^DDIOL(" of digestive system""")
- +10 DO EN^DDIOL(" or ")
- +11 DO EN^DDIOL(" Enter a classification code (ICD/CPT etc) followed by a plus")
- +12 DO EN^DDIOL(" sign (+) to retrieve all terms associated with the code. Example,")
- +13 DO EN^DDIOL(" a lookup of 239.0+ returns all terms that are linked to the ")
- +14 DO EN^DDIOL(" code 239.0.")
- +15 QUIT
- +16 ;
- P19 ;
- +1 NEW DGYN
- SET DGYN=1
- +2 DO EN^DDIOL("Answer with ICD-9 OPERATION/PROCEDURE, or CODE NUMBER, or DESCRIPTION")
- +3 IF X="?"
- DO EN^DDIOL("Do you want the entire ICD-9 OPERATION/PROCEDURE List")
- SET %=0
- DO YN^DICN
- SET DGYN=%
- +4 SET DIC("S")="I $$CSI^ICDEX(80.1,+Y)=2"
- +5 SET DIC("W")="N C,DINAME S IEN=+Y W "" "" D EN^DDIOL(("" ""_$$IDOPS^ICDID(+Y)),"""",""?0"")"
- +6 SET DIC="^ICD0("
- SET DIC("0")="AEQMZ"
- SET DZ="??"
- SET D="B"
- SET DO="ICD OPERATION/PROCEDURE^80.1OI^4487^4480"
- SET DO(2)="80.1OI"
- +7 if DGYN=1
- DO DQ^DICQ
- +8 QUIT
- +9 ;