Changeset 161


Ignore:
Timestamp:
Sep 21, 2008, 8:24:01 PM (16 years ago)
Author:
Sam Habiel
Message:

CCRMEDS again

Location:
ccr/trunk/p
Files:
2 edited

Legend:

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

    r158 r161  
    4545          I DEBUG ZWR MEDS
    4646          N RXIEN S RXIEN=0
     47          N MEDCOUNT S MEDCOUNT=0
    4748          F  S RXIEN=$O(MEDS(RXIEN)) Q:RXIEN=""  D  ; FOR EACH MEDICATION IN THE LIST
     49          . S MEDCOUNT=MEDCOUNT+1
    4850          . I DEBUG W "RXIEN IS ",RXIEN,!
    49           . S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP",J))
     51          . S MAP=$NA(^TMP("GPLCCR",$J,"MEDMAP"))
    5052          . K @MAP
    5153          . I DEBUG W "MAP= ",MAP,!
     
    7880          . ; These can be obtained using NDF^PSS50 (IEN,,,,,"SUBSCRIPT")
    7981          . ; 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)
    8384          . N NDFIEN S NDFIEN=$P(NDFDATA(20),U)
    8485          . N VAPROD S VAPROD=$P(NDFDATA(22),U)
     
    9394          . ; That would be DATA^PSS50(IEN,,,,,"SUBSCRIPT")
    9495          . ; 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)
    9798          . S @MAP@("MEDQUANTITYUNIT")=QTYDATA(14.5)
    9899          . ;
     
    106107          . ; So, here we go again
    107108          . ; ^PSRX(D0,6,D1,0)= (#.01) DOSAGE ORDERED [1F] ^ (#1) DISPENSE UNITS PER DOSE
    108             ; ==>[2N] ^ (#2) UNITS [3P:50.607] ^ (#3) NOUN [4F] ^ (#4)
    109             ; ==>DURATION [5F] ^ (#5) CONJUNCTION [6S] ^ (#6) ROUTE
    110             ; ==>[7P:51.2] ^ (#7) SCHEDULE [8F] ^ (#8) VERB [9F] ^
    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)
    112113          . S @MAP@("MEDDELIVERYMETHOD")=$P(SIGDATA,U,9)
    113114          . S @MAP@("MEDDOSEVALUE")=$P(SIGDATA,U,1)
     
    117118          . S @MAP@("MEDVEHICLETEXT")=""  ; For inpatient
    118119          . 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)
    120121          . ; Invervals... again another call.
    121122          . ; In the wisdom of the original programmers, the schedule is a free text field
     
    127128          . ; I looked), PSSFT is the name, and list is the ^TMP name to store the data in.
    128129          . ; So...
    129           . D AP^PSS51P1("PSJ",$P(SIGDATA,U,7),,,"SCHEDULE")
     130          . D AP^PSS51P1("PSJ",$P(SIGDATA,U,8),,,"SCHEDULE")
    130131          . N SCHEDATA M SCHEDATA=^TMP($J,"SCHEDULE")
    131132          . N INTERVAL
    132           . I SCHEDATA(0)=-1 S INTERVAL=""
     133          . I $P(SCHEDATA(0),U)=-1 S INTERVAL=""
    133134          . E  D
    134135          . . N SUB S SUB=$O(SCHEDATA(0))
     
    138139          . S @MAP@("MEDDURATIONVALUE")=$P(SIGDATA,U,5)
    139140          . S @MAP@("MEDDURATIONUNIT")=""
    140           . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U,7)["PRN"
     141          . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U,8)["PRN"
    141142          . S @MAP@("MEDPROBLEMOBJECTID")=""
    142143          . S @MAP@("MEDPROBLEMDESCRIPTION")=""
     
    152153          . ;
    153154          . ; ^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))
    155156          . ; ^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))
    157158          . 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"))
    159160          . K @RESULT
    160161          . D MAP^GPLXPATH(INXML,MAP,RESULT)
    161           . D:J=1 CP^GPLXPATH(RESULT,OUTXML) ; First one is a copy
    162           . D:J>1 INSINNER^GPLXPATH(OUTXML,RESULT) ; AFTER THE FIRST, INSERT INNER XML
     162          . 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
    163164          N MEDTMP,MEDI
    164165          D MISSING^GPLXPATH(OUTXML,"MEDTMP") ; SEARCH XML FOR MISSING VARS
  • ccr/trunk/p/CCRUNIT.m

    r122 r161  
    55MEDS
    66        N DEBUG S DEBUG=0
    7         N DFN S DFN=1
     7        N DFN S DFN=3
    88        K ^TMP($J)
    99        W "Loading CCR Template into T using LOAD^GPLCCR0($NA(^TMP($J,""CCR"")))",!!
    1010        N T S T=$NA(^TMP($J,"CCR"))     D LOAD^GPLCCR0(T)
    11         B
    1211        N XPATH S XPATH="//ContinuityOfCareRecord/Body/Medications"
    1312        W "XPATH is: "_XPATH,!
     
    1615        N INXML
    1716        D QUERY^GPLXPATH(T,XPATH,"INXML")
    18         B
    19         W "Executing EXTRACT^GPLMEDS(""INXML"",DFN,OUTXML)",!
     17        W "Executing EXTRACT^CCRMEDS(""INXML"",DFN,OUTXML)",!
    2018        W "OUTXML will be ^TMP($J,""OUT"")",!
    2119        N OUTXML S OUTXML=$NA(^TMP($J,"OUT"))
    22         D EXTRACT^GPLMEDS("INXML",DFN,OUTXML)
     20        D EXTRACT^CCRMEDS("INXML",DFN,OUTXML)
    2321        Q
Note: See TracChangeset for help on using the changeset viewer.