Changeset 173 for ccr/trunk


Ignore:
Timestamp:
Sep 28, 2008, 11:32:16 AM (16 years ago)
Author:
Sam Habiel
Message:

CCRMEDS: Processing of multiple directions.

Location:
ccr/trunk/p
Files:
2 edited

Legend:

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

    r166 r173  
    103103          . ;
    104104          . ; --- START OF DIRECTIONS ---
    105           . ;
    106           . S @MAP@("MEDDIRECTIONDESCRIPTIONTEXT")=""  ; This is reserved for systems not able to generate the sig in components.
    107           . S @MAP@("MEDDOSEINDICATOR")="1"  ; means that we are specifying it. See E2369-05.
    108105          . ; Sig data not in any API :-(  Oh yes, you can get the whole thing, but...
    109106          . ; we want the compoenents.
     
    114111          . ; ==>DURATION [5F] ^ (#5) CONJUNCTION [6S] ^ (#6) ROUTE
    115112          . ; ==>[7P:51.2] ^ (#7) SCHEDULE [8F] ^ (#8) VERB [9F] ^
    116           . N SIGDATA S SIGDATA=^PSRX(RXIEN,6,1,0)
    117           . S @MAP@("MEDDELIVERYMETHOD")=$P(SIGDATA,U,9)
    118           . S @MAP@("MEDDOSEVALUE")=$P(SIGDATA,U,1)
    119           . S @MAP@("MEDDOSEUNIT")=@MAP@("MEDCONCUNIT")
    120           . S @MAP@("MEDRATEVALUE")=""  ; For inpatient
    121           . S @MAP@("MEDRATEUNIT")=""  ; For inpatient
    122           . S @MAP@("MEDVEHICLETEXT")=""  ; For inpatient
    123           . S @MAP@("MEDDIRECTIONROUTETEXT")=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01)
    124           . S @MAP@("MEDFREQUENCYVALUE")=$P(SIGDATA,U,8)
    125           . ; Invervals... again another call.
    126           . ; In the wisdom of the original programmers, the schedule is a free text field
    127           . ; However, it gets translated by a call to the administration schedule file
    128           . ; to see if that schedule exists.
    129           . ; That's the same thing I am going to do.
    130           . ; The call is AP^PSS51P1(PSSPP,PSSFT,PSSWDIEN,PSSSTPY,LIST,PSSFREQ).
    131           . ; PSSPP is "PSJ" (for some reason, schedules are stored as PSJ, not PSO--
    132           . ; I looked), PSSFT is the name, and list is the ^TMP name to store the data in.
    133           . ; So...
    134           . D AP^PSS51P1("PSJ",$P(SIGDATA,U,8),,,"SCHEDULE")
    135           . N SCHEDATA M SCHEDATA=^TMP($J,"SCHEDULE")
    136           . N INTERVAL
    137           . I $P(SCHEDATA(0),U)=-1 S INTERVAL=""
    138           . E  D
    139           . . N SUB S SUB=$O(SCHEDATA(0))
    140           . . S INTERVAL=SCHEDATA(SUB,2)
    141           . S @MAP@("MEDINTERVALVALUE")=INTERVAL
    142           . S @MAP@("MEDINTERVALUNIT")="Minute"
    143           . S @MAP@("MEDDURATIONVALUE")=$P(SIGDATA,U,5)
    144           . S @MAP@("MEDDURATIONUNIT")=""
    145           . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U,8)["PRN"
    146           . S @MAP@("MEDPROBLEMOBJECTID")=""
    147           . S @MAP@("MEDPROBLEMTYPETXT")=""
    148           . S @MAP@("MEDPROBLEMDESCRIPTION")=""
    149           . S @MAP@("MEDPROBLEMCODEVALUE")=""
    150           . S @MAP@("MEDPROBLEMCODINGSYSTEM")=""
    151           . S @MAP@("MEDPROBLEMCODINGVERSION")=""
    152           . S @MAP@("MEDPROBLEMSOURCEACTORID")=""
    153           . S @MAP@("MEDSTOPINDICATOR")=""
    154           . S @MAP@("MEDDIRSEQ")=""
    155           . S @MAP@("MEDMULDIRMOD")=""
     113          . ;
     114                  . N DIRNUM S DIRNUM=0 ; Sigline number
     115                  . F  S DIRNUM=$O(^PSRX(RXIEN,6,DIRNUM)) Q:DIRNUM=""  D
     116          . . S @MAP@("MEDDIRECTIONDESCRIPTIONTEXT",DIRNUM)=""  ; This is reserved for systems not able to generate the sig in components.
     117          . . S @MAP@("MEDDOSEINDICATOR",DIRNUM)="1"  ; means that we are specifying it. See E2369-05.
     118          . . N SIGDATA S SIGDATA=^PSRX(RXIEN,6,DIRNUM,0)
     119          . . S @MAP@("MEDDELIVERYMETHOD",DIRNUM)=$P(SIGDATA,U,9)
     120          . . S @MAP@("MEDDOSEVALUE",DIRNUM)=$P(SIGDATA,U,1)
     121          . . S @MAP@("MEDDOSEUNIT",DIRNUM)=@MAP@("MEDCONCUNIT")
     122          . . S @MAP@("MEDRATEVALUE",DIRNUM)=""  ; For inpatient
     123          . . S @MAP@("MEDRATEUNIT",DIRNUM)=""  ; For inpatient
     124          . . S @MAP@("MEDVEHICLETEXT",DIRNUM)=""  ; For inpatient
     125          . . S @MAP@("MEDDIRECTIONROUTETEXT",DIRNUM)=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01)
     126          . . S @MAP@("MEDFREQUENCYVALUE",DIRNUM)=$P(SIGDATA,U,8)
     127          . . ; Invervals... again another call.
     128          . . ; In the wisdom of the original programmers, the schedule is a free text field
     129          . . ; However, it gets translated by a call to the administration schedule file
     130          . . ; to see if that schedule exists.
     131          . . ; That's the same thing I am going to do.
     132          . . ; The call is AP^PSS51P1(PSSPP,PSSFT,PSSWDIEN,PSSSTPY,LIST,PSSFREQ).
     133          . . ; PSSPP is "PSJ" (for some reason, schedules are stored as PSJ, not PSO--
     134          . . ; I looked), PSSFT is the name, and list is the ^TMP name to store the data in.
     135          . . ; So...
     136          . . D AP^PSS51P1("PSJ",$P(SIGDATA,U,8),,,"SCHEDULE")
     137          . . N SCHEDATA M SCHEDATA=^TMP($J,"SCHEDULE")
     138          . . N INTERVAL
     139          . . I $P(SCHEDATA(0),U)=-1 S INTERVAL=""
     140          . . E  D
     141          . . . N SUB S SUB=$O(SCHEDATA(0))
     142          . . . S INTERVAL=SCHEDATA(SUB,2)
     143          . . S @MAP@("MEDINTERVALVALUE",DIRNUM)=INTERVAL
     144          . . S @MAP@("MEDINTERVALUNIT",DIRNUM)="Minute"
     145          . . S @MAP@("MEDDURATIONVALUE",DIRNUM)=$P(SIGDATA,U,5)
     146          . . S @MAP@("MEDDURATIONUNIT",DIRNUM)=""
     147          . . S @MAP@("MEDPRNFLAG",DIRNUM)=$P(SIGDATA,U,8)["PRN"
     148          . . S @MAP@("MEDPROBLEMOBJECTID",DIRNUM)=""
     149          . . S @MAP@("MEDPROBLEMTYPETXT",DIRNUM)=""
     150          . . S @MAP@("MEDPROBLEMDESCRIPTION",DIRNUM)=""
     151          . . S @MAP@("MEDPROBLEMCODEVALUE",DIRNUM)=""
     152          . . S @MAP@("MEDPROBLEMCODINGSYSTEM",DIRNUM)=""
     153          . . S @MAP@("MEDPROBLEMCODINGVERSION",DIRNUM)=""
     154          . . S @MAP@("MEDPROBLEMSOURCEACTORID",DIRNUM)=""
     155          . . S @MAP@("MEDSTOPINDICATOR",DIRNUM)=""
     156          . . S @MAP@("MEDDIRSEQ",DIRNUM)=DIRNUM
     157                  . . N DIRMOD S DIRMOD=$P(SIGDATA,U,6)
     158          . . S @MAP@("MEDMULDIRMOD",DIRNUM)=$S(DIRMOD="T":"THEN",DIRMOD="A":"AND",DIRMOD="X":"EXCEPT",1:"")
    156159          . ;
    157160          . ; --- END OF DIRECTIONS ---
     
    162165          . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")=$G(^PSRX(RXIEN,"PRC",1,0))
    163166          . S @MAP@("MEDRFNO")=MED(9)
    164           . N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"RESULT"))
     167          . N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"MAPPED"))
    165168          . K @RESULT
    166           . ; D MAP^GPLXPATH($NA(INXML),MAP,RESULT)
    167           . D MAP^GPLXPATH(MINXML,MAP,RESULT)
     169                  . D MAP^GPLXPATH(MINXML,MAP,RESULT)
    168170          . ; D PARY^GPLXPATH(RESULT)
    169171          . D:MEDCOUNT=1 CP^GPLXPATH(RESULT,OUTXML) ; First one is a copy
  • ccr/trunk/p/CCRUNIT.m

    r162 r173  
    55MEDS
    66        N DEBUG S DEBUG=0
    7         N DFN S DFN=3
     7        N DFN S DFN=1
    88        K ^TMP($J)
    99        W "Loading CCR Template into T using LOAD^GPLCCR0($NA(^TMP($J,""CCR"")))",!!
     
    1111        N XPATH S XPATH="//ContinuityOfCareRecord/Body/Medications"
    1212        W "XPATH is: "_XPATH,!
    13         W "Getting Med Template into INXML using",!
    14         W "QUERY^GPLXPATH(T,XPATH,""INXML"")",!!
    15         D QUERY^GPLXPATH(T,XPATH,"INXML")
     13        W "Getting Med Template into MINXML using",!
     14        W "QUERY^GPLXPATH(T,XPATH,""MINXML"")",!!
     15        D QUERY^GPLXPATH(T,XPATH,"MINXML")
    1616        B
    17                 W "Executing EXTRACT^CCRMEDS(INXML,DFN,OUTXML)",!
     17                W "Executing EXTRACT^CCRMEDS(MINXML,DFN,OUTXML)",!
    1818        W "OUTXML will be ^TMP($J,""OUT"")",!
    1919        N OUTXML S OUTXML=$NA(^TMP($J,"OUT"))
    20         D EXTRACT^CCRMEDS(.INXML,DFN,OUTXML)
     20        D EXTRACT^CCRMEDS("MINXML",DFN,OUTXML)
    2121        Q
Note: See TracChangeset for help on using the changeset viewer.