- Timestamp:
- Apr 8, 2013, 3:43:58 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmts/trunk/p/C0XPT3.m
r1609 r1613 1 C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-02-2 1 5:05PM1 C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-02-22 3:38 PM 2 2 ;;1.0;FILEMAN TRIPLE STORE;;Jun 26,2012;Build 29 3 3 ; … … 7 7 D ONETYPE^C0XGET3($NA(^TMP($J,"MEDS")),G,"sp:Medication") 8 8 ; 9 ; For each medication ( I = COUNTER; S = Medication Node as Subject)9 ; For each medication (C0XI = COUNTER; S = Medication Node as Subject) 10 10 N C0XI,S F C0XI=0:0 S C0XI=$O(^TMP($J,"MEDS",C0XI)) Q:'C0XI S S=^(C0XI) DO MED1(G,S,DFN) 11 11 K ^TMP($J,"MEDS") … … 68 68 . I FILDT S FILQTY=FILLS(RXN,FILDT,"sp:quantityDispensed.sp:value"),FILDAYS=FILLS(RXN,FILDT,"sp:dispenseDaysSupply") 69 69 . E S (FILQTY,FILDAYS)="" 70 . D PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS )70 . D PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,.FILLS) 71 71 ; 72 72 QUIT 73 PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS) ; 73 ; 74 PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,FILLS) ; 75 ; TODO: 76 ; 1. Resolve medication 77 ; 2. Figure out what to do with meds that have no fill history (omit?) 78 ; 3. Don't file a med twice! Check ^PXRMINDX to make sure it aint there first 79 ; 4. Compute the number of refills for original number so that remaining refills aren't displayed as negative 80 ; 5. Original fill doesn't have a dispense comment 81 ; 6. Coded sig (FVALUE, FUNIT, DOSE, DUNIT) 82 ; 7. Fill label log section of Rx? Maybe not. 74 83 N ORZPT,PSODFN S (ORZPT,PSODFN)=DFN ;"" ;POINTER TO PATIENT FILE (#2) 75 84 N PNTSTAT S PNTSTAT=20 ; NON-VA ;RX PATIENT STATUS FILE (#53) … … 99 108 N LDISPDT S LDISPDT=FILLDT ; 3;1 DATE 100 109 N REASON S REASON="E" ;Activity log ; SET ([E]dit) 101 N INIT S INIT= DUZ;NEW PERSON FILE (#200)110 N INIT S INIT=.5 ;NEW PERSON FILE (#200) 102 111 N COM S COM="Oupatient medication order." ;TEXT 103 112 N SIG S SIG=INST ;#51,.01 … … 115 124 S $P(^PSRX(0),U,3)=PSOIEN ; Reset next available number. 116 125 S $P(^PSRX(PSOIEN,0),"^",1)=RXNUM ; 0;1 FREE TEXT (Required) 126 L +^PSRX(PSOIEN):0 ; Lock record node 117 127 L -^PSRX(0) ; Unlock zero node, we now got it 118 128 ; 119 L +^PSRX(PSOIEN):0 ; Lock record node120 129 S $P(^PSRX(PSOIEN,0),"^",13)=ISSDT ; 0;13 DATE (Required) 121 130 S $P(^PSRX(PSOIEN,0),"^",2)=ORZPT ;POINTER TO PATIENT FILE (#2) … … 143 152 S $P(^PSRX(PSOIEN,3),U,1)=DISPDT ;LAST DISPENSED DATE 3;1 DATE 144 153 ; 145 S ^PSRX(PSOIEN,"A",0)="^52.3DA^1^1" 146 S $P(^PSRX(PSOIEN,"A",1,0),"^",1)=LOGDT ;DATE 147 S $P(^PSRX(PSOIEN,"A",1,0),"^",2)=REASON ;SET 148 S $P(^PSRX(PSOIEN,"A",1,0),"^",3)=INIT ;NEW PERSON FILE (#200) 149 S $P(^PSRX(PSOIEN,"A",1,0),"^",4)=0 ;NUMBER - RX REFERENCE 150 S $P(^PSRX(PSOIEN,"A",1,0),"^",5)="ISI automated entry." ;TEXT 154 N C0XFILL S C0XFILL="" 155 N C0XREFCT S C0XREFCT=0 156 F S C0XFILL=$O(FILLS(RXN,C0XFILL)) Q:C0XFILL="" D 157 . S ^PSRX(PSOIEN,"A",0)="^52.3DA"_U_(C0XREFCT+1)_U_(C0XREFCT+1) 158 . S $P(^PSRX(PSOIEN,"A",C0XREFCT+1,0),"^",1)=LOGDT ;DATE 159 . S $P(^PSRX(PSOIEN,"A",C0XREFCT+1,0),"^",2)="N" ;SET ; Dispensed using external interface 160 . S $P(^PSRX(PSOIEN,"A",C0XREFCT+1,0),"^",3)=INIT ;NEW PERSON FILE (#200) 161 . S $P(^PSRX(PSOIEN,"A",C0XREFCT+1,0),"^",4)=0 ;NUMBER - RX REFERENCE 162 . S $P(^PSRX(PSOIEN,"A",C0XREFCT+1,0),"^",5)="Imported from Smart" ;TEXT 163 . ; 164 . Q:C0XFILL=FILDT ; Don't add refill data for first fill! 165 . ; 166 . ; Increment counter 167 . S C0XREFCT=C0XREFCT+1 168 . ; 169 . S ^PSRX(PSOIEN,1,0)="^52.1DA"_U_(C0XREFCT)_U_(C0XREFCT) 170 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",1)=C0XFILL ; REFILL DATE [D] 171 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",2)=MLWIND ; MAIL/WINDOW [RS] 172 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",3)="Imported from Smart" ; REMARKS [F] 173 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",4)=FILLS(RXN,C0XFILL,"sp:quantityDispensed.sp:value") ; QTY [RNJ12,2X] 174 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",5)=.5 ; PHARMACIST NAME [*P200'] 175 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",6)="" ; LOT [F] 176 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",7)=.5 ; CLERK CODE [RP200'] 177 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",8)="" ; LOGIN DATE [D] 178 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",9)="" ; DIVISION [RP59'] 179 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",17)=PROV ; PROVIDER [R*P200X'I] 180 . S $P(^PSRX(PSOIEN,1,C0XREFCT,0),"^",19)=C0XFILL ; DISPENSED DATE [RD] 151 181 ; 152 182 S ^PSRX(PSOIEN,"OR1")=PORDITM ;PHARMACY ORDERABLE ITEM FILE (#50.7) … … 161 191 ;S ^PSRX(PSOIEN,"IB")=TRNSTYP ;COPAY TRANSACTION TYPE IB ACTION TYPE FILE (#350.1) 162 192 S ^PSRX(PSOIEN,"TYPE")=0 ;TYPE OF RX TYPE;1 NUMBER 163 D OERR(PSOIEN),F55,F52 ,F525193 D OERR(PSOIEN),F55,F52(PSOIEN),F525 164 194 L -PSRX(PSOIEN) ; Unlock record 165 195 Q … … 180 210 K PSOX1 181 211 Q 182 F52 ;; - Re-indexing file 52 entry183 KDIK,DA S DIK="^PSRX(",DA=PSOIEN D IX1^DIK K DIK212 F52(PSOIEN) ;; - Re-indexing file 52 entry 213 N DIK,DA S DIK="^PSRX(",DA=PSOIEN D IX1^DIK K DIK 184 214 Q 185 215 ;
Note:
See TracChangeset
for help on using the changeset viewer.