Changeset 14


Ignore:
Timestamp:
Jun 22, 2008, 8:04:01 PM (16 years ago)
Author:
Sam Habiel
Message:

Updated UTIL to do UTC properly; worked on DPT

Location:
ccr/trunk/p
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/CCRDPT.m

    r12 r14  
    130130        N DOB S DOB=$P(PT(0),"^",3)
    131131        ; Date in FM Date Format. Convert to UTC/ISO 8601.
    132         Q $$FMDTOUTC^CCRUTIL(DOB)
     132        Q $$FMDTOUTC^CCRUTIL(DOB,"D")
    133133        ;
     134GENDER() ; Get Gender; PUBLIC; Extrinsic
     135        ; PREREQ: PT Defined
     136        Q $P(PT(0),"^",2)
     137        ;
     138SSN() ; Get SSN for ID; PUBLIC; Extrinsic
     139        ; PREREQ: PT Defined
     140        Q $P(PT(0),"^",9)
     141        ;
     142ADDRTYPE(ADDR) ; Get Home Address; PUBLIC; Extrinsic
     143        ; Vista only stores a home address for the patient.
     144        Q "Home"
     145        ;
     146ADDR1() ; Get Home Address line 1; PUBLIC; Extrinsic
     147        ; PREREQ: PT Defined
     148        Q $P(PT(.11),"^",1)
     149        ;
     150ADDR2() ; Get Home Address line 2; PUBLIC; Extrinsic
     151        ; PREREQ: PT Defined
     152        ; Vista has Lines 2,3; CCR has only line 1,2; so compromise
     153        Q $P(PT(.11),"^",2)_", "_$P(PT(.11),"^",3)
     154        ;
     155CITY() ; Get City for Home Address; PUBLIC; Extrinsic
     156        ; PREREQ: PT Defined
     157        Q $P(PT(.11),"^",4)
     158        ;
     159STATE() ; Get State for Home Address; PUBLIC; Extrinsic
     160        ; PREREQ: PT Defined
     161        ; State is stored as a pointer
     162        N STATENUM=$P(PT(.11)"^",5)
     163        ;
     164        ; State File Global is below
     165        ; ^DIC(5,D0,0)= (#.01) NAME [1] ^ (#1) ABBREVIATION [2F] ^ (#2) VA STATE CODE
     166    ; ==>[3F] ^ (#5) CAPITAL [4F] ^ (#2.1) AAC RECOGNIZED [5S] ^ (#2.2)
     167    ; ==>US STATE OR POSSESSION [6S] ^
     168        Q $P(^DIC(5,STATENUM,0),"^",1)
     169        ;
     170ZIP() ; Get Zip code for Home Address
     171        ; PREREQ: PT Defined
     172        Q $P(PT(.11),"^",6)
     173        ;
     174COUNTY() ; Get County for our Address
     175        ; PREREQ: PT Defined
     176        Q $P(PT(.11),"^",7)
     177        ;
  • ccr/trunk/p/CCRUTIL.m

    r12 r14  
    44        W "No Entry at Top!" Q
    55
    6 FMDTOUTC(DATE) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic
    7         N UTC,Y,M,D ; UTC, Year, Month, Day
     6FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic
     7        ; FORMAT is Format of Date. Can be either D (Day) or DT (Date and Time)
     8        ; If not passed, or passed incorrectly, it's assumed that it is D.
     9        ; FM Date format is "YYYMMDD.HHMMSS" HHMMSS may not be supplied.
     10        ; UTC date is formatted as follows: YYYY-MM-DDThh:mm:ss_offsetfromUTC
     11        ; UTC, Year, Month, Day, Hours, Minutes, Seconds, Time offset (obtained from Mailman Site Parameters)
     12        N UTC,Y,M,D,H,MM,S,OFF
    813        S Y=1700+$E(DATE,1,3)
    914        S M=$E(DATE,4,5)
    1015        S D=$E(DATE,6,7)
    11         S UTC=Y_"-"_M_"-"_D
    12         Q UTC
     16        S H=$E(DATE,9,10)
     17        S MM=$E(DATE,11,12)
     18        S S=$E(DATE,12,13)
     19        S OFF=$$TZ^XLFDT ; See Kernel Manual for documentation.
     20        ; If H, MM and S are empty, it means that the FM date didn't supply the time.
     21        ; In this case, set H, MM and S to "00"
     22        S:('$L(H)&'$L(MM)&'$L(S)) (H,MM,S)="00"
     23        S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_":"_S_OFF
     24        I $L(FORMAT),FORMAT="DT" Q UTC ; Date with time.
     25        E  Q $P(UTC,"T")
    1326        ;
Note: See TracChangeset for help on using the changeset viewer.