- Timestamp:
- Sep 21, 2008, 8:24:01 PM (16 years ago)
- Location:
- ccr/trunk/p
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/CCRMEDS.m
r158 r161 45 45 I DEBUG ZWR MEDS 46 46 N RXIEN S RXIEN=0 47 N MEDCOUNT S MEDCOUNT=0 47 48 F S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN="" D ; FOR EACH MEDICATION IN THE LIST 49 . S MEDCOUNT=MEDCOUNT+1 48 50 . I DEBUG W "RXIEN IS ",RXIEN,! 49 . S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP" ,J))51 . S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP")) 50 52 . K @MAP 51 53 . I DEBUG W "MAP= ",MAP,! … … 78 80 . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT") 79 81 . ; Documented in the same manual. 80 . N IEN S IEN=^PSDRUG($P(MED(6),U)) 81 . D NDF^PSS50(IEN,,,,,"CONC") 82 . N NDFDATA M NDFDATA=^TMP($J,"CONC",IEN) 82 . D NDF^PSS50(MEDIEN,,,,,"CONC") 83 . N NDFDATA M NDFDATA=^TMP($J,"CONC",MEDIEN) 83 84 . N NDFIEN S NDFIEN=$P(NDFDATA(20),U) 84 85 . N VAPROD S VAPROD=$P(NDFDATA(22),U) … … 93 94 . ; That would be DATA^PSS50(IEN,,,,,"SUBSCRIPT") 94 95 . ; Node 14.5 is the Dispense Unit 95 . D DATA^PSS50( IEN,,,,,"QTY")96 . N QTYDATA M QTYDATA=^TMP($J,"QTY", IEN)96 . D DATA^PSS50(MEDIEN,,,,,"QTY") 97 . N QTYDATA M QTYDATA=^TMP($J,"QTY",MEDIEN) 97 98 . S @MAP@("MEDQUANTITYUNIT")=QTYDATA(14.5) 98 99 . ; … … 106 107 . ; So, here we go again 107 108 . ; ^PSRX(D0,6,D1,0)= (#.01) DOSAGE ORDERED [1F] ^ (#1) DISPENSE UNITS PER DOSE 108 109 110 111 N SIGDATA S SIGDATA=^PSRX(IEN,6,1,0)109 . ; ==>[2N] ^ (#2) UNITS [3P:50.607] ^ (#3) NOUN [4F] ^ (#4) 110 . ; ==>DURATION [5F] ^ (#5) CONJUNCTION [6S] ^ (#6) ROUTE 111 . ; ==>[7P:51.2] ^ (#7) SCHEDULE [8F] ^ (#8) VERB [9F] ^ 112 . N SIGDATA S SIGDATA=^PSRX(RXIEN,6,1,0) 112 113 . S @MAP@("MEDDELIVERYMETHOD")=$P(SIGDATA,U,9) 113 114 . S @MAP@("MEDDOSEVALUE")=$P(SIGDATA,U,1) … … 117 118 . S @MAP@("MEDVEHICLETEXT")="" ; For inpatient 118 119 . S @MAP@("MEDDIRECTIONROUTETEXT")=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01) 119 . S @MAP@("MEDFREQUENCYVALUE")=$P(SIGDATA,U, 7)120 . S @MAP@("MEDFREQUENCYVALUE")=$P(SIGDATA,U,8) 120 121 . ; Invervals... again another call. 121 122 . ; In the wisdom of the original programmers, the schedule is a free text field … … 127 128 . ; I looked), PSSFT is the name, and list is the ^TMP name to store the data in. 128 129 . ; So... 129 . D AP^PSS51P1("PSJ",$P(SIGDATA,U, 7),,,"SCHEDULE")130 . D AP^PSS51P1("PSJ",$P(SIGDATA,U,8),,,"SCHEDULE") 130 131 . N SCHEDATA M SCHEDATA=^TMP($J,"SCHEDULE") 131 132 . N INTERVAL 132 . I SCHEDATA(0)=-1 S INTERVAL=""133 . I $P(SCHEDATA(0),U)=-1 S INTERVAL="" 133 134 . E D 134 135 . . N SUB S SUB=$O(SCHEDATA(0)) … … 138 139 . S @MAP@("MEDDURATIONVALUE")=$P(SIGDATA,U,5) 139 140 . S @MAP@("MEDDURATIONUNIT")="" 140 . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U, 7)["PRN"141 . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U,8)["PRN" 141 142 . S @MAP@("MEDPROBLEMOBJECTID")="" 142 143 . S @MAP@("MEDPROBLEMDESCRIPTION")="" … … 152 153 . ; 153 154 . ; ^PSRX(22,"INS1",1,0)="FOR BLOOD PRESSURE" 154 . S @MAP@("MEDPTINSTRUCTIONS")= ^PSRX(RXIEN,"INS1",1,0)155 . S @MAP@("MEDPTINSTRUCTIONS")=$G(^PSRX(RXIEN,"INS1",1,0)) 155 156 . ; ^PSRX(22,"PRC",1,0)="Pharmacist: you must obey my command" 156 . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")= ^PSRX(RXIEN,"PRC",1,0)157 . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")=$G(^PSRX(RXIEN,"PRC",1,0)) 157 158 . S @MAP@("MEDRFNO")=MED(9) 158 . N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"RESULT" ,J))159 . N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"RESULT")) 159 160 . K @RESULT 160 161 . D MAP^GPLXPATH(INXML,MAP,RESULT) 161 . D: J=1 CP^GPLXPATH(RESULT,OUTXML) ; First one is a copy162 . D: J>1 INSINNER^GPLXPATH(OUTXML,RESULT) ; AFTER THE FIRST, INSERT INNER XML162 . D:MEDCOUNT=1 CP^GPLXPATH(RESULT,OUTXML) ; First one is a copy 163 . D:MEDCOUNT>1 INSINNER^GPLXPATH(OUTXML,RESULT) ; AFTER THE FIRST, INSERT INNER XML 163 164 N MEDTMP,MEDI 164 165 D MISSING^GPLXPATH(OUTXML,"MEDTMP") ; SEARCH XML FOR MISSING VARS -
ccr/trunk/p/CCRUNIT.m
r122 r161 5 5 MEDS 6 6 N DEBUG S DEBUG=0 7 N DFN S DFN= 17 N DFN S DFN=3 8 8 K ^TMP($J) 9 9 W "Loading CCR Template into T using LOAD^GPLCCR0($NA(^TMP($J,""CCR"")))",!! 10 10 N T S T=$NA(^TMP($J,"CCR")) D LOAD^GPLCCR0(T) 11 B12 11 N XPATH S XPATH="//ContinuityOfCareRecord/Body/Medications" 13 12 W "XPATH is: "_XPATH,! … … 16 15 N INXML 17 16 D QUERY^GPLXPATH(T,XPATH,"INXML") 18 B 19 W "Executing EXTRACT^GPLMEDS(""INXML"",DFN,OUTXML)",! 17 W "Executing EXTRACT^CCRMEDS(""INXML"",DFN,OUTXML)",! 20 18 W "OUTXML will be ^TMP($J,""OUT"")",! 21 19 N OUTXML S OUTXML=$NA(^TMP($J,"OUT")) 22 D EXTRACT^ GPLMEDS("INXML",DFN,OUTXML)20 D EXTRACT^CCRMEDS("INXML",DFN,OUTXML) 23 21 Q
Note:
See TracChangeset
for help on using the changeset viewer.