From cb4cb68ec8a567acf7e241ee1ef758db82f49a6c Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 21 Sep 2008 22:29:04 +0000 Subject: [PATCH] CCRMED a testing version --- p/CCRMEDS.m | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/p/CCRMEDS.m b/p/CCRMEDS.m index bf4af6d..775af43 100644 --- a/p/CCRMEDS.m +++ b/p/CCRMEDS.m @@ -117,12 +117,27 @@ EXTRACT(INXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE . S @MAP@("MEDVEHICLETEXT")="" ; For inpatient . S @MAP@("MEDDIRECTIONROUTETEXT")=$$GET1^DIQ(51.2,$P(SIGDATA,U,7),.01) . S @MAP@("MEDFREQUENCYVALUE")=$P(SIGDATA,U,7) - . S @MAP@("MEDFREQUENCYUNIT") - . S @MAP@("MEDINTERVALVALUE") - . S @MAP@("MEDINTERVALUNIT") + . ; Invervals... again another call. + . ; In the wisdom of the original programmers, the schedule is a free text field + . ; However, it gets translated by a call to the administration schedule file + . ; to see if that schedule exists. + . ; That's the same thing I am going to do. + . ; The call is AP^PSS51P1(PSSPP,PSSFT,PSSWDIEN,PSSSTPY,LIST,PSSFREQ). + . ; PSSPP is "PSJ" (for some reason, schedules are stored as PSJ, not PSO-- + . ; I looked), PSSFT is the name, and list is the ^TMP name to store the data in. + . ; So... + . D AP^PSS51P1("PSJ",$P(SIGDATA,U,7),,,"SCHEDULE") + . N SCHEDATA M SCHEDATA=^TMP($J,"SCHEDULE") + . N INTERVAL + . I SCHEDATA(0)=-1 S INTERVAL="" + . E D + . . N SUB S SUB=$O(SCHEDATA(0)) + . . S INTERVAL=SCHEDATA(SUB,2) + . S @MAP@("MEDINTERVALVALUE")=INTERVAL + . S @MAP@("MEDINTERVALUNIT")="Minute" . S @MAP@("MEDDURATIONVALUE")=$P(SIGDATA,U,5) - . S @MAP@("MEDDURATIONUNIT") - . S @MAP@("MEDPRNFLAG") + . S @MAP@("MEDDURATIONUNIT")="" + . S @MAP@("MEDPRNFLAG")=$P(SIGDATA,U,7)["PRN" . S @MAP@("MEDPROBLEMOBJECTID")="" . S @MAP@("MEDPROBLEMDESCRIPTION")="" . S @MAP@("MEDPROBLEMCODEVALUE")="" @@ -135,8 +150,10 @@ EXTRACT(INXML,DFN,OUTXML) ; EXTRACT MEDICATIONS INTO PROVIDED XML TEMPLATE . ; . ; --- END OF DIRECTIONS --- . ; - . S @MAP@("MEDPTINSTRUCTIONS") - . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS") + . ; ^PSRX(22,"INS1",1,0)="FOR BLOOD PRESSURE" + . S @MAP@("MEDPTINSTRUCTIONS")=^PSRX(RXIEN,"INS1",1,0) + . ; ^PSRX(22,"PRC",1,0)="Pharmacist: you must obey my command" + . S @MAP@("MEDFULLFILLMENTINSTRUCTIONS")=^PSRX(RXIEN,"PRC",1,0) . S @MAP@("MEDRFNO")=MED(9) . N RESULT S RESULT=$NA(^TMP("GPLCCR",$J,"RESULT",J)) . K @RESULT