Ignore:
Timestamp:
Jul 6, 2012, 2:28:15 PM (12 years ago)
Author:
Sam Habiel
Message:

Updated version number on all routines to be 1.7T1.
Minor fixes here and there for XINDEX errors.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Scheduling/trunk/m/BSDXUT.m

    r1464 r1472  
    1 BSDXUT ; VEN/SMH - Unit Tests for Scheduling GUI ; 6/29/12 12:20pm
    2         ;;1.7T1;BSDX;;Aug 31, 2011;Build 18
     1BSDXUT  ; VEN/SMH - Unit Tests for Scheduling GUI ; 6/29/12 12:20pm
     2        ;;1.7T1;BSDX;;Jul 06, 2012;Build 18
    33        ; Licensed under LGPL
    44        ;
     
    242242        QUIT
    243243        ;
    244 UTCR(RESNAM) ; $$ - Create Unit Test Clinic and Resource Pair ; Private
    245  ; Input: Resource Name By Value
    246  ; Output: -1^Error or HLIEN^RESIEN for Success (file 44 IEN^file 9002018.1 IEN)
    247  ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
    248  N HLIEN S HLIEN=$$UTCR44(RESNAM)
    249  I +HLIEN=-1 QUIT HLIEN
    250  ;
    251  N RESIEN S RESIEN=$$UTCRRES(RESNAM,HLIEN)
    252  I +RESIEN=-1 QUIT RESIEN
    253  E  QUIT HLIEN_U_RESIEN
    254  ;
    255 UTCR44(HLNAME) ; $$ - Create Unit Test Clinic in File 44; Private ; TESTING ONLY CODE
    256  ; Output: -1^Error or IEN for Success
    257  ; Input: Hosp Location Name by Value
    258  ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
    259  ;
    260  I $D(^SC("B",HLNAME)) Q $O(^(HLNAME,""))
    261  ;
    262  N SAM
    263  S SAM(44,"?+1,",.01)=HLNAME            ; Name
    264  S SAM(44,"?+1,",2)="C"                 ; Type = Clinic
    265  S SAM(44,"?+1,",2.1)=1                 ; Type Extension (not used)
    266  S SAM(44,"?+1,",3.5)=$O(^DG(40.8,0))   ; Division (not yet used)
    267  S SAM(44,"?+1,",8)=295                 ; Stop Code Number (not used)
    268  S SAM(44,"?+1,",9)="M"          ; Service (not used)
    269  S SAM(44,"?+1,",1912)=15               ; Length of Appt (not used)
    270  S SAM(44,"?+1,",1917)=4                ; Display increments per hour (not used)
    271  S SAM(44,"?+1,",1918)=8                ; Overbooks/day max (not used)
    272  S SAM(44,"?+1,",2000.5)=0              ; Require Action Profiles: Yes (not used)
    273  S SAM(44,"?+1,",2001)=999              ; Allowable consecutive no-shows (not used)
    274  S SAM(44,"?+1,",2002)=999              ; Max # days for Future Booking (not used)
    275  S SAM(44,"?+1,",2005)=365              ; Max # days for Auto Rebook (not used)
    276  S SAM(44,"?+1,",2502)="N"             ; Non-Count Clinic (not used)
    277  S SAM(44,"?+1,",2504)="Y"            ; Clinic meets at this Facility? (not used)
    278  S SAM(44,"?+1,",2507)=9              ; Appointment Type (not used)
    279  ;
    280  N BSDXERR,BSDXIEN
    281  D UPDATE^DIE("",$NA(SAM),$NA(BSDXIEN),$NA(BSDXERR))
    282  Q $S($D(BSDXERR):-1_U_BSDXERR("DIERR",1,"TEXT",1),1:BSDXIEN(1))
    283  ;
    284 UTCRRES(NAME,HLIEN) ; $$ - Create Unit Test Resource in 9002018.1 (BSDX RESOURCE); Private
    285  ; Input: Hospital Location IEN
    286  ; Output: -1^Error or IEN for Success
    287  ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
    288  I $D(^BSDXRES("B",NAME)) Q $O(^(NAME,""))
    289  S HLIEN=$G(HLIEN) ; If we don't send one in
    290  N RES ; garbage variable
    291  D RSRC^BSDX16(.RES,"|"_NAME_"||"_HLIEN)
    292  N RTN S RTN=@$Q(^BSDXTMP($J,0)) ; return array next value
    293  Q $S(RTN=0:-1_U_RTN,1:+RTN) ; 0 means an error has occurred; 1 means IEN returned
    294  ;
    295 TIMES() ; $$ - Create a next available appointment time^ending time; Private
    296  ; Output: appttime^endtime
    297  N NOW S NOW=$$NOW^XLFDT() ; Now time
    298  N LAST S LAST=$O(^BSDXAPPT("B"," "),-1) ; highest time in file
    299  N TIME2USE S TIME2USE=$S(NOW>LAST:NOW,1:LAST) ; Which time to use?
    300  S TIME2USE=$E(TIME2USE,1,12) ; Strip away seconds
    301  N APPTIME S APPTIME=$$FMADD^XLFDT(TIME2USE,0,0,15,0) ; Add 15 min
    302  N ENDTIME S ENDTIME=$$FMADD^XLFDT(APPTIME,0,0,15,0) ; Add 15 more min
    303  Q APPTIME_U_ENDTIME ; quit with apptime^endtime
    304  ;
    305 TIMEHL(HLIEN) ; $$ - Create a next available appointment time^ending time by HL; Private
    306  ; Input: HLIEN
    307  ; Output: Next available appointment time for the HLIEN
    308  N LAST S LAST=$O(^SC(HLIEN,"S",""),-1)
    309  Q $$FMADD^XLFDT(LAST,1,0,15,0) ; Add 1 day and 15 minutes
     244UTCR(RESNAM)    ; $$ - Create Unit Test Clinic and Resource Pair ; Private
     245        ; Input: Resource Name By Value
     246        ; Output: -1^Error or HLIEN^RESIEN for Success (file 44 IEN^file 9002018.1 IEN)
     247        ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
     248        N HLIEN S HLIEN=$$UTCR44(RESNAM)
     249        I +HLIEN=-1 QUIT HLIEN
     250        ;
     251        N RESIEN S RESIEN=$$UTCRRES(RESNAM,HLIEN)
     252        I +RESIEN=-1 QUIT RESIEN
     253        E  QUIT HLIEN_U_RESIEN
     254        ;
     255UTCR44(HLNAME)  ; $$ - Create Unit Test Clinic in File 44; Private ; TESTING ONLY CODE
     256        ; Output: -1^Error or IEN for Success
     257        ; Input: Hosp Location Name by Value
     258        ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
     259        ;
     260        I $D(^SC("B",HLNAME)) Q $O(^(HLNAME,""))
     261        ;
     262        N SAM
     263        S SAM(44,"?+1,",.01)=HLNAME            ; Name
     264        S SAM(44,"?+1,",2)="C"                 ; Type = Clinic
     265        S SAM(44,"?+1,",2.1)=1                 ; Type Extension (not used)
     266        S SAM(44,"?+1,",3.5)=$O(^DG(40.8,0))   ; Division (not yet used)
     267        S SAM(44,"?+1,",8)=295                 ; Stop Code Number (not used)
     268        S SAM(44,"?+1,",9)="M"          ; Service (not used)
     269        S SAM(44,"?+1,",1912)=15               ; Length of Appt (not used)
     270        S SAM(44,"?+1,",1917)=4                ; Display increments per hour (not used)
     271        S SAM(44,"?+1,",1918)=8                ; Overbooks/day max (not used)
     272        S SAM(44,"?+1,",2000.5)=0              ; Require Action Profiles: Yes (not used)
     273        S SAM(44,"?+1,",2001)=999              ; Allowable consecutive no-shows (not used)
     274        S SAM(44,"?+1,",2002)=999              ; Max # days for Future Booking (not used)
     275        S SAM(44,"?+1,",2005)=365              ; Max # days for Auto Rebook (not used)
     276        S SAM(44,"?+1,",2502)="N"             ; Non-Count Clinic (not used)
     277        S SAM(44,"?+1,",2504)="Y"            ; Clinic meets at this Facility? (not used)
     278        S SAM(44,"?+1,",2507)=9              ; Appointment Type (not used)
     279        ;
     280        N BSDXERR,BSDXIEN
     281        D UPDATE^DIE("",$NA(SAM),$NA(BSDXIEN),$NA(BSDXERR))
     282        Q $S($D(BSDXERR):-1_U_BSDXERR("DIERR",1,"TEXT",1),1:BSDXIEN(1))
     283        ;
     284UTCRRES(NAME,HLIEN)     ; $$ - Create Unit Test Resource in 9002018.1 (BSDX RESOURCE); Private
     285        ; Input: Hospital Location IEN
     286        ; Output: -1^Error or IEN for Success
     287        ; DO NOT USE IN A PRODUCTION ENVIRONTMENT. INTENDED FOR TESTING ONLY
     288        I $D(^BSDXRES("B",NAME)) Q $O(^(NAME,""))
     289        S HLIEN=$G(HLIEN) ; If we don't send one in
     290        N RES ; garbage variable
     291        D RSRC^BSDX16(.RES,"|"_NAME_"||"_HLIEN)
     292        N RTN S RTN=@$Q(^BSDXTMP($J,0)) ; return array next value
     293        Q $S(RTN=0:-1_U_RTN,1:+RTN) ; 0 means an error has occurred; 1 means IEN returned
     294        ;
     295TIMES() ; $$ - Create a next available appointment time^ending time; Private
     296        ; Output: appttime^endtime
     297        N NOW S NOW=$$NOW^XLFDT() ; Now time
     298        N LAST S LAST=$O(^BSDXAPPT("B"," "),-1) ; highest time in file
     299        N TIME2USE S TIME2USE=$S(NOW>LAST:NOW,1:LAST) ; Which time to use?
     300        S TIME2USE=$E(TIME2USE,1,12) ; Strip away seconds
     301        N APPTIME S APPTIME=$$FMADD^XLFDT(TIME2USE,0,0,15,0) ; Add 15 min
     302        N ENDTIME S ENDTIME=$$FMADD^XLFDT(APPTIME,0,0,15,0) ; Add 15 more min
     303        Q APPTIME_U_ENDTIME ; quit with apptime^endtime
     304        ;
     305TIMEHL(HLIEN)   ; $$ - Create a next available appointment time^ending time by HL; Private
     306        ; Input: HLIEN
     307        ; Output: Next available appointment time for the HLIEN
     308        N LAST S LAST=$O(^SC(HLIEN,"S",""),-1)
     309        Q $$FMADD^XLFDT(LAST,1,0,15,0) ; Add 1 day and 15 minutes
Note: See TracChangeset for help on using the changeset viewer.