source: WorldVistAEHR/trunk/r/SPINAL_CORD_DYSFUNCTION-SPN/SPNPSR13.m@ 1639

Last change on this file since 1639 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1SPNPSR13 ;HIRMFO/DAD,WAA-HUNT: IN/OUT PATIENT VISIT ;8/8/95 10:04
2 ;;2.0;Spinal Cord Dysfunction;**6**;01/02/1997
3 ;
4EN1(D0,VISITYPE,CLINIC,BDATE,EDATE) ; *** Search entry point
5 ; Input:
6 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
7 ; D0 = SCD (SPINAL CORD) REGISTRY file (#154) IEN
8 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"VISIT TYPE")= I ! O ! B ^ External
9 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"CLINIC") = Int ^ Ext (Visit type = O!B)
10 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"BEGINNING DATE") = Date ^ Date_(Ext)
11 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"ENDING DATE") = Date ^ Date_(Ext)
12 ; VISITYPE = Patient Visit Type (int)
13 ; CLINIC = Clinic (Int)
14 ; BDATE = Beginning Date
15 ; EDATE = Ending Date
16 ; Output:
17 ; $S( D0_Meets_Search_Criteria : 1 , 1 : 0 )
18 ;
19 N ADM1,ADM2,DFN,DSC1,I,MEETSRCH,VASD
20 S MEETSRCH=0
21 S DFN=D0
22 I "^O^B^"[(U_VISITYPE_U) D
23 . S VASD("F")=BDATE
24 . S VASD("T")=EDATE
25 . S VASD("W")=1 I CLINIC]"" S VASD("C",CLINIC)=""
26 . K ^UTILITY("VASD",$J)
27 . D SDA^VADPT
28 . I $O(^UTILITY("VASD",$J,0)) S MEETSRCH=1
29 . K ^UTILITY("VASD",$J)
30 . Q
31 I "^I^B^"[(U_VISITYPE_U) D
32 . S ADM1=+$O(^DGPM("ATID1",DFN,9999999.999999-BDATE))
33 . S ADM1=$S(ADM1:9999999.999999-ADM1,1:0)
34 . S ADM2=+$O(^DGPM("ATID1",DFN,9999999.999999-EDATE))
35 . S ADM2=$S(ADM2:9999999.999999-ADM2,1:0)
36 . S DSC1=+$O(^DGPM("ATID3",DFN,9999999.999999-EDATE))
37 . S DSC1=$S(DSC1:9999999.999999-DSC1,1:0)
38 . I ADM2'<BDATE S MEETSRCH=1
39 . I ADM1,((DSC1'>0)!(DSC1'<BDATE)) S MEETSRCH=1
40 . Q
41 Q MEETSRCH
42 ;
43EN2(ACTION,SEQUENCE) ; *** Prompt entry point
44 ; Input:
45 ; ACTION,SEQUENCE = Search ACTION,SEQUENCE number
46 ; Output:
47 ; SPNLEXIT = $S( User_Abort/Timeout : 1 , 1 : 0 )
48 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"VISIT TYPE")= I ! O ! B ^ External
49 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"CLINIC") = Int ^ Ext (Visit type = O!B)
50 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"BEGINNING DATE") = Date ^ Date_(Ext)
51 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"ENDING DATE") = Date ^ Date_(Ext)
52 ; ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0) = $$EN1^SPNPSR13(D0,VISITYPE,CLINIC,BDATE,EDATE)
53 ;
54 N CLINIC,DIR,DIRUT,DTOUT,DUOUT,I,VISITYPE
55 K ^TMP($J,"SPNPRT",ACTION,SEQUENCE),DIR
56 S DIR(0)="SOAM^I:INPATIENT;O:OUTPATIENT;B:BOTH INPATIENT & OUTPATIENT;"
57 S DIR("A")="Type of Visit: ",DIR("?")="Enter 'I', 'O', or 'B'"
58 D ^DIR
59 I Y'="" S Y=$$UP^XLFSTR(Y)
60 S VISITYPE=Y,VISITYPE(0)=$G(Y(0))
61 S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,1:0)
62 I 'SPNLEXIT,Y'="" D
63 .I "^O^B^"[(U_VISITYPE_U) D Q:SPNLEXIT
64 .. S DIR(0)="POA^44:AEMNQ^K:$P(^SC(+Y,0),U,3)'=""C"" X"
65 .. S DIR("A")="Clinic name: "
66 .. S DIR("?")="Enter the desired clinic or leave blank for ALL clinics"
67 .. D ^DIR S CLINIC=Y
68 .. S SPNLEXIT=$S($D(DTOUT):1,$D(DUOUT):1,$D(DIROUT):1,1:0)
69 .. Q
70 .S (BDATE,EDATE)=""
71 .D EN1^SPNPSR00(ACTION,SEQUENCE+.2,.BDATE,.EDATE)
72 .I 'SPNLEXIT D
73 .. I $G(CLINIC)]"" S ^TMP($J,"SPNPRT",ACTION,SEQUENCE+.1,"CLINIC")=CLINIC
74 .. S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,"VISIT TYPE")=VISITYPE_U_VISITYPE(0)
75 .. S ^TMP($J,"SPNPRT",ACTION,SEQUENCE,0)="$$EN1^SPNPSR13(D0,"""_VISITYPE_""","""_$P($G(CLINIC),U)_""","_BDATE_","_EDATE_")"
76 .. Q
77 .Q
78 Q
Note: See TracBrowser for help on using the repository browser.