Changeset 1624 for fmts/trunk/p/C0XPT3.m
- Timestamp:
- May 6, 2013, 7:19:54 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fmts/trunk/p/C0XPT3.m
r1623 r1624 1 C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-05-06 10:21 AM1 C0XPT3 ;ISI/MLS,VEN/SMH -- MEDS IMPORT ;2013-05-06 4:35 PM 2 2 ;;1.0;FILEMAN TRIPLE STORE;;Jun 26,2012;Build 29 3 3 ; (C) Sam Habiel 2013 … … 65 65 . I FILLDATE<2000000 W $EC=",U1," ; Converstion error 66 66 . ; 67 . S FILLS=$G(FILLS)+1 ; Counter for number of dispenses 67 68 . S FILLS(RXN,FILLDATE,"sp:dispenseDaysSupply")=$$GSPO1^C0XGET3(G,S,"sp:dispenseDaysSupply") ; Self Explanatory? 68 69 . ; … … 71 72 . S FILLS(RXN,FILLDATE,"sp:quantityDispensed.sp:unit")=$TR($$GSPO1^C0XGET3(G,S,"sp:quantityDispensed.sp:unit"),"{}") 72 73 ; 73 ZWRITE:$D(FILLS) FILLS 74 ; 74 ; ZWRITE:$D(FILLS) FILLS 75 ; 76 ; Prepare to add drug to patient record 75 77 D 76 78 . N FILDT,FILQTY,FILDAYS 77 . S FILDT=$O(FILLS(RXN,"")) 78 . I FILDT S FILQTY=FILLS(RXN,FILDT,"sp:quantityDispensed.sp:value"),FILDAYS=FILLS(RXN,FILDT,"sp:dispenseDaysSupply") 79 . E S (FILQTY,FILDAYS)="" 80 . D PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,.FILLS) 79 . S FILDT=$O(FILLS(RXN,"")) ; Get first fill. 80 . I FILDT S FILQTY=FILLS(RXN,FILDT,"sp:quantityDispensed.sp:value"),FILDAYS=FILLS(RXN,FILDT,"sp:dispenseDaysSupply") ; extract fill data 81 . E S (FILQTY,FILDAYS)="",FILDT=STARTDT ; Technically, the drug is invalid since there is no fill. But this is a kludge. 82 . D PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,.FILLS) ; Add drug to patient record 81 83 ; 82 84 QUIT 83 85 ; 84 PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,FILLS) ; 86 PREP(DFN,RXN,INST,FILDT,FILQTY,FILDAYS,FILLS) ; Private EP to add drug to patient record 87 ; - DFN 88 ; - RXN - RxNorm CUI 89 ; - INST - Instructions (1 tablet daily etc) 90 ; - FILDT - Earliest Fill Date 91 ; - FILQTY - Fill quantity of earliest fill date, used as default 92 ; - FILDAYS - Days Supply 93 ; - FILLS - Array specificed above - ByRef 94 ; 85 95 ; TODO: 86 ; 1. Resolve medication87 ; 2. Figure out what to do with meds that have no fill history (omit?)88 96 ; 3. Don't file a med twice! Check ^PXRMINDX to make sure it aint there first 89 ; 4. Compute the number of refills for original number so that remaining refills aren't displayed as negative 90 ; 5. Original fill doesn't have a dispense comment 91 ; 6. Coded sig (FVALUE, FUNIT, DOSE, DUNIT) 92 ; 7. Fill label log section of Rx? Maybe not. 97 ; 6. Coded sig (FVALUE, FUNIT, DOSE, DUNIT) - goes into SIG1 multiple and Med Instructions multiple 98 ; 7. Fill label log section of Rx? Maybe not - goes into Label Date/Time multiple 99 ; 8. ICD Diangosis multiple if we have the data 93 100 ; 94 101 I '$$EXIST^C0CRXNLK(RXN) S $EC=",U1," ; Invalid RxNorm code passed. … … 107 114 N QTY S QTY=FILQTY ; NUMBER ;0;7 NUMBER (Required) 108 115 N DAYSUPLY S DAYSUPLY=FILDAYS ;NUMBER ; 0;8 NUMBER (Required); 109 N REFIL S REFIL= 0 ;NUMBER ; 0;9 NUMBER (Required)116 N REFIL S REFIL=$S($G(FILLS):FILLS-1,1:0) ;NUMBER ; 0;9 NUMBER (Required) ; # of dispenses - 1, if there are any 110 117 N ORDCONV S ORDCONV=1 ;'1' FOR ORDER CONVERTED;'2' FOR EXPIRATION TO CPRS; 111 118 N COPIES S COPIES=1 ;NUMBER … … 149 156 S $P(^PSRX(PSOIEN,0),"^",3)=PNTSTAT ;RX PATIENT STATUS FILE (#53) 150 157 S $P(^PSRX(PSOIEN,0),"^",4)=PROV ;NEW PERSON FILE (#200) 151 S $P(^PSRX(PSOIEN,0),"^",5)= "" ; Outpatient ; LOC ;HOSPITAL LOCATION FILE (#44)158 S $P(^PSRX(PSOIEN,0),"^",5)=$$HL^C0XPT0() ; Outpatient ; LOC ;HOSPITAL LOCATION FILE (#44); Default smart location 152 159 S $P(^PSRX(PSOIEN,0),"^",6)=PSODRUG ;POINTER TO DRUG FILE (#50) 153 160 S $P(^PSRX(PSOIEN,0),"^",7)=QTY ;NUMBER ;0;7 NUMBER (Required) … … 158 165 S $P(^PSRX(PSOIEN,0),"^",17)=UNITPRICE ;NUMBER 159 166 S $P(^PSRX(PSOIEN,0),"^",18)=COPIES ;COPIES 160 S $P(^PSRX(PSOIEN,0),"^",19)=ORDCONV ;ORDER CONVERTED 0;19 SET ['1' FOR ORDER CONVERTED;'2' FOR EXPIRATION TO CPRS;]161 167 ; 162 168 S $P(^PSRX(PSOIEN,2),"^",1)=LOGDT ;LOGIN DATE ; 2;1 DATE (Required) … … 169 175 ; 170 176 S $P(^PSRX(PSOIEN,3),U,1)=DISPDT ;LAST DISPENSED DATE 3;1 DATE 177 S $P(^PSRX(PSOIEN,3),U,7)="Imported from Smart" ; REMARKS FT 178 ; 179 S $P(^PSRX(PSOIEN,"EPH"),U,1)=0 ; DAW Code 171 180 ; 172 181 N C0XFILL S C0XFILL="" … … 199 208 ; 200 209 S ^PSRX(PSOIEN,"OR1")=PORDITM ;PHARMACY ORDERABLE ITEM FILE (#50.7) 201 ; 202 S $P(^PSRX(PSOIEN,"POE"),"^",1)=1 ; POE RX POE;1 SET ['1' FOR YES;] 210 S $P(^PSRX(PSOIEN,"OR1"),U,5)=.5 ; Finishing Person 211 S $P(^PSRX(PSOIEN,"OR1"),U,8)=$$NOW^XLFDT() ; Finish Date/Time; seconds required. 212 ; 203 213 ; 204 214 S $P(^PSRX(PSOIEN,"SIG"),"^",1)=SIG ;SIG;1 FREE TEXT (Required) medication instruction DIC(51) … … 209 219 ;S ^PSRX(PSOIEN,"IB")=TRNSTYP ;COPAY TRANSACTION TYPE IB ACTION TYPE FILE (#350.1) 210 220 S ^PSRX(PSOIEN,"TYPE")=0 ;TYPE OF RX TYPE;1 NUMBER 221 ; 211 222 D OERR(PSOIEN),F55,F52(PSOIEN),F525 223 ; 212 224 L -PSRX(PSOIEN) ; Unlock record 213 225 Q
Note:
See TracChangeset
for help on using the changeset viewer.