fixed spacing issues

This commit is contained in:
cje 2008-07-04 01:02:47 +00:00
parent 6eab22cb4e
commit a1e7ca5d0a
9 changed files with 1069 additions and 1068 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +1,28 @@
CCRDPTT; Unit Tester...
CCRDPTT ; Unit Tester...
; Get the functions in the routine using Rick's routine
; STATS(0)="CCRDPT^3080626.190908^396^14094^6414499860"
; STATS(1,0)="CCRDPT ;CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08"
; STATS(2,0)=" ;;0.1;CCRCCD;;Jun 15, 2008;"
; STATS(84,0)="INIT(DFN) ; Copy DFN global to a local variable; PUBLIC"
; STATS(93,0)="DESTROY ; Kill local variable; PUBLIC"
; STATS(99,0)="FAMILY() ; Family Name; PUBLIC; Extrinsic"
; STATS(105,0)="GIVEN() ; Given Name; PUBLIC; Extrinsic"
; STATS(111,0)="MIDDLE() ; Middle Name; PUBLIC; Extrinsic "
; etc.
; Get the functions in the routine using Rick's routine
; STATS(0)="CCRDPT^3080626.190908^396^14094^6414499860"
; STATS(1,0)="CCRDPT ;CCRCCD/SMH - Routines to Extract Patient Data for CCDCCR; 6/15/08"
; STATS(2,0)=" ;;0.1;CCRCCD;;Jun 15, 2008;"
; STATS(84,0)="INIT(DFN) ; Copy DFN global to a local variable; PUBLIC"
; STATS(93,0)="DESTROY ; Kill local variable; PUBLIC"
; STATS(99,0)="FAMILY() ; Family Name; PUBLIC; Extrinsic"
; STATS(105,0)="GIVEN() ; Given Name; PUBLIC; Extrinsic"
; STATS(111,0)="MIDDLE() ; Middle Name; PUBLIC; Extrinsic "
; etc.
; Load Routine Entry points; We get a sweeeeeet array
D ANALYZE^ARJTXRD("CCRDPT",.OUT) ; Analyze a routine in the directory
N X,Y
; Select Patient
S DIC=2,DIC(0)="AEMQ" D ^DIC
; Load Routine Entry points; We get a sweeeeeet array
D ANALYZE^ARJTXRD("CCRDPT",.OUT) ; Analyze a routine in the directory
N X,Y
; Select Patient
S DIC=2,DIC(0)="AEMQ" D ^DIC
W "You have selected patient "_Y,!!
D INIT^CCRDPT($P(Y,"^"))
ZWR PT
N I S I=165 F S I=$O(OUT(I)) Q:I="" D
. W "OUT("_I_",0)"_" is "_$P(OUT(I,0)," ")_" "
. W "valued at "
. W @("$$"_$P(OUT(I,0),"()")_"^"_"CCRDPT"_"()")
. W !
Q
W "You have selected patient "_Y,!!
D INIT^CCRDPT($P(Y,"^"))
ZWR PT
N I S I=165 F S I=$O(OUT(I)) Q:I="" D
. W "OUT("_I_",0)"_" is "_$P(OUT(I,0)," ")_" "
. W "valued at "
. W @("$$"_$P(OUT(I,0),"()")_"^"_"CCRDPT"_"()")
. W !
Q

View File

@ -1,27 +1,27 @@
CCRUTIL ;CCRCCD/SMH - Various Utilites for generating the CCR/CCD;06/15/08
;;0.1;CCRCCD;;Jun 15, 2008;
CCRUTIL ;CCRCCD/SMH - Various Utilites for generating the CCR/CCD;06/15/08
;;0.1;CCRCCD;;Jun 15, 2008;
W "No Entry at Top!" Q
W "No Entry at Top!" Q
FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic
; FORMAT is Format of Date. Can be either D (Day) or DT (Date and Time)
; If not passed, or passed incorrectly, it's assumed that it is D.
; FM Date format is "YYYMMDD.HHMMSS" HHMMSS may not be supplied.
; UTC date is formatted as follows: YYYY-MM-DDThh:mm:ss_offsetfromUTC
; UTC, Year, Month, Day, Hours, Minutes, Seconds, Time offset (obtained from Mailman Site Parameters)
N UTC,Y,M,D,H,MM,S,OFF
S Y=1700+$E(DATE,1,3)
S M=$E(DATE,4,5)
S D=$E(DATE,6,7)
S H=$E(DATE,9,10)
S MM=$E(DATE,11,12)
S S=$E(DATE,13,14)
S OFF=$$TZ^XLFDT ; See Kernel Manual for documentation.
; If H, MM and S are empty, it means that the FM date didn't supply the time.
; In this case, set H, MM and S to "00"
S:('$L(H)&'$L(MM)&'$L(S)) (H,MM,S)="00"
I S="" S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_OFF
E S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_":"_S_OFF
I $L($G(FORMAT)),FORMAT="DT" Q UTC ; Date with time.
E Q $P(UTC,"T")
;
FMDTOUTC(DATE,FORMAT) ; Convert Fileman Date to UTC Date Format; PUBLIC; Extrinsic
; FORMAT is Format of Date. Can be either D (Day) or DT (Date and Time)
; If not passed, or passed incorrectly, it's assumed that it is D.
; FM Date format is "YYYMMDD.HHMMSS" HHMMSS may not be supplied.
; UTC date is formatted as follows: YYYY-MM-DDThh:mm:ss_offsetfromUTC
; UTC, Year, Month, Day, Hours, Minutes, Seconds, Time offset (obtained from Mailman Site Parameters)
N UTC,Y,M,D,H,MM,S,OFF
S Y=1700+$E(DATE,1,3)
S M=$E(DATE,4,5)
S D=$E(DATE,6,7)
S H=$E(DATE,9,10)
S MM=$E(DATE,11,12)
S S=$E(DATE,13,14)
S OFF=$$TZ^XLFDT ; See Kernel Manual for documentation.
; If H, MM and S are empty, it means that the FM date didn't supply the time.
; In this case, set H, MM and S to "00"
S:('$L(H)&'$L(MM)&'$L(S)) (H,MM,S)="00"
I S="" S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_OFF
E S UTC=Y_"-"_M_"-"_D_"T"_H_":"_MM_":"_S_OFF
I $L($G(FORMAT)),FORMAT="DT" Q UTC ; Date with time.
E Q $P(UTC,"T")
;

View File

@ -1,10 +1,10 @@
GPLACTORS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR ACTORS ; 7/3/08
;;0.1;CCDCCR;nopatch;noreleasedate
;
; PROCESS THE ACTORS SECTION OF THE CCR
;
;;0.1;CCDCCR;nopatch;noreleasedate
;
; PROCESS THE ACTORS SECTION OF THE CCR
;
EXTRACT(IPXML,ALST,OUTXML) ; EXTRACT ACTOR FROM ALST INTO PROVIDED XML TEMPLATE
;
;
N I,J,ATMP,FIRST,AMAP,AOID,ATYP,AIEN
S FIRST=1 ; NEED TO KNOW WHICH IS THE FIRST ACTOR
F I=1:1:@ALST@(0) D ; PROCESS ALL ACTORS IN THE LIST

View File

@ -1,223 +1,223 @@
GPLCCD0 ; CCDCCR/GPL - CCD TEMPLATE AND ACCESS ROUTINES; 6/7/08
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a CCD TEMPLATE with processing routines",!
W !
Q
;
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a CCD TEMPLATE with processing routines",!
W !
Q
;
ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
; ZARY IS PASSED BY NAME
; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D
. S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count
S @ZARY@(CNT)=LINE ; put the line in the array
; S @ZARY@(BAT,CNT)="" ; index the test by battery
S @ZARY@(0)=CNT ; update the array counter
Q
;
ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY S @ZARY=""
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the TEMPLATE section
N SECTION S SECTION="[anonymous]" ; NO section LABEL
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
. I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
. I INTEST D ; within the section
. . I LINE?." "1";><".E D ; sub-section name found
. . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
. . I LINE?." "1";;".E D ; line found
. . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
Q
;
; ZARY IS PASSED BY NAME
; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D
. S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count
S @ZARY@(CNT)=LINE ; put the line in the array
; S @ZARY@(BAT,CNT)="" ; index the test by battery
S @ZARY@(0)=CNT ; update the array counter
Q
;
ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY S @ZARY=""
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the TEMPLATE section
N SECTION S SECTION="[anonymous]" ; NO section LABEL
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
. I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
. I INTEST D ; within the section
. . I LINE?." "1";><".E D ; sub-section name found
. . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
. . I LINE?." "1";;".E D ; line found
. . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
Q
;
LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
D ZLOAD(ARY,"GPLCCD0")
; ZWR @ARY
Q
;
D ZLOAD(ARY,"GPLCCD0")
; ZWR @ARY
Q
;
;<TEMPLATE>
;;<?xml version="1.0"?>
;;<?xml-stylesheet type="text/xsl" href="CCD.xsl"?>
;;<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:voc="urn:hl7-org:v3/voc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hl7-org:v3 CDA.xsd">
;; <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
;; <templateId root="2.16.840.1.113883.10.20.1"/>
;; <id root="db734647-fc99-424c-a864-7e3cda82e703"/>
;; <code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
;; <title>< value="DOCTITLE"/>@@DOCTITLE@@Good Health Clinic Continuity of Care Document</title>
;; <effectiveTime value="@@EFFECTIVETIME@@20000407130000+0500"/>
;; <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
;; <languageCode code="en-US"/>
;; <recordTarget>
;; <patientRole>
;; <id extension="996-756-495" root="2.16.840.1.113883.19.5"/>
;; <patient>
;; <name>
;; <given>@@PATIENTGIVENNAME@@</given>
;; <family>@@PATIENTFAMILYNAME@@</family>
;; <suffix>@@PATIENTNAMESUFFIX@@</suffix>
;; </name>
;; <administrativeGenderCode code="@@PATIENTGENDER@@M" codeSystem="2.16.840.1.113883.5.1"/>
;; <birthTime value="@@PATIENTDATEOFBIRTH@@19320924"/>
;; </patient>
;; <providerOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@SITENAME@@Good Health Clinic</name>
;; </providerOrganization>
;; </patientRole>
;; </recordTarget>
;; <author>
;; <time value="20000407130000+0500"/>
;; <assignedAuthor>
;; <id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
;; <assignedPerson>
;; <name><prefix>Dr.</prefix><given>@@AUTHORGIVENNAME@@Robert</given><family>@@AUTHORFAMILYNAME@@Dolin</family></name>
;; </assignedPerson>
;; <representedOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@AUTHORSITE@@Good Health Clinic</name>
;; </representedOrganization>
;; </assignedAuthor>
;; </author>
;; <informant>
;; <assignedEntity>
;; <id nullFlavor="NI"/>
;; <representedOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@INFORMANTORG@@Good Health Clinic</name>
;; </representedOrganization>
;; </assignedEntity>
;; </informant>
;; <custodian>
;; <assignedCustodian>
;; <representedCustodianOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@CUSTODIANORG@@Good Health Clinic</name>
;; </representedCustodianOrganization>
;; </assignedCustodian>
;; </custodian>
;; <legalAuthenticator>
;; <time value="20000407130000+0500"/>
;; <signatureCode code="S"/>
;; <assignedEntity>
;; <id nullFlavor="NI"/>
;; <representedOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@LEGALORG@@Good Health Clinic</name>
;; </representedOrganization>
;; </assignedEntity>
;; </legalAuthenticator>
;; <participant typeCode="IND">
;; <associatedEntity classCode="GUAR">
;; <id root="4ff51570-83a9-47b7-91f2-93ba30373141"/>
;; <addr>
;; <streetAddressLine>@@GUARSTREET@@17 Daws Rd.</streetAddressLine>
;; <city>@@GUARCITY@@Blue Bell</city>
;; <state>@@GUARSTATE@@MA</state>
;; <postalCode>@@GUARZIP@@02368</postalCode>
;; </addr>
;; <telecom value="tel:@@GUARTELE@@(888)555-1212"/>
;; <associatedPerson>
;; <name>
;; <given>@@GUARGIVENNAME@@Kenneth</given>
;; <family>@@GUARFAMILYNAME@@Ross</family>
;; </name>
;; </associatedPerson>
;; </associatedEntity>
;; </participant>
;; <participant typeCode="IND">
;; <associatedEntity classCode="NOK">
;; <id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
;; <code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="@@NOKRELATION@@Biiological mother"/>
;; <telecom value="tel:@@NOKTELE@@(999)555-1212"/>
;; <associatedPerson>
;; <name>
;; <given>@@NOKGIVENNAME@@Henrietta</given>
;; <family>@@NOKFAMILYNAME@@Levin</family>
;; </name>
;; </associatedPerson>
;; </associatedEntity>
;; </participant>
;; <documentationOf>
;; <serviceEvent classCode="PCPR">
;; <effectiveTime><low value="@@DOCPERIODLOW@@19320924"/><high value="@@DOCPERIODHIGH@@20000407"/></effectiveTime>
;; <performer typeCode="PRF">
;; <functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
;; <time><low value="@@PCPPERIODLOW@@1990"/><high value='@@PCPPERIODHIGH@@20000407'/></time>
;; <assignedEntity>
;; <id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
;; <assignedPerson>
;; <name><prefix>@@PCPNAMEPREFIX@@Dr.</prefix><given>@@PCPNAMEGIVEN@@Robert</given><family>@@PCPNAMEFAMILY@@Dolin</family></name>
;; </assignedPerson>
;; <representedOrganization>
;; <id root="2.16.840.1.113883.19.5"/>
;; <name>@@PCPORG@@Good Health Clinic</name>
;; </representedOrganization>
;; </assignedEntity>
;; </performer>
;; </serviceEvent>
;; </documentationOf>
;; <component>
;; <structuredBody>
;;<typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040"/>
;;<templateId root="2.16.840.1.113883.10.20.1"/>
;;<id root="db734647-fc99-424c-a864-7e3cda82e703"/>
;;<code code="34133-9" codeSystem="2.16.840.1.113883.6.1" displayName="Summarization of episode note"/>
;;<title>< value="DOCTITLE"/>@@DOCTITLE@@Good Health Clinic Continuity of Care Document</title>
;;<effectiveTime value="@@EFFECTIVETIME@@20000407130000+0500"/>
;;<confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25"/>
;;<languageCode code="en-US"/>
;;<recordTarget>
;;<patientRole>
;;<id extension="996-756-495" root="2.16.840.1.113883.19.5"/>
;;<patient>
;;<name>
;;<given>@@PATIENTGIVENNAME@@</given>
;;<family>@@PATIENTFAMILYNAME@@</family>
;;<suffix>@@PATIENTNAMESUFFIX@@</suffix>
;;</name>
;;<administrativeGenderCode code="@@PATIENTGENDER@@M" codeSystem="2.16.840.1.113883.5.1"/>
;;<birthTime value="@@PATIENTDATEOFBIRTH@@19320924"/>
;;</patient>
;;<providerOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@SITENAME@@Good Health Clinic</name>
;;</providerOrganization>
;;</patientRole>
;;</recordTarget>
;;<author>
;;<time value="20000407130000+0500"/>
;;<assignedAuthor>
;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
;;<assignedPerson>
;;<name><prefix>Dr.</prefix><given>@@AUTHORGIVENNAME@@Robert</given><family>@@AUTHORFAMILYNAME@@Dolin</family></name>
;;</assignedPerson>
;;<representedOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@AUTHORSITE@@Good Health Clinic</name>
;;</representedOrganization>
;;</assignedAuthor>
;;</author>
;;<informant>
;;<assignedEntity>
;;<id nullFlavor="NI"/>
;;<representedOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@INFORMANTORG@@Good Health Clinic</name>
;;</representedOrganization>
;;</assignedEntity>
;;</informant>
;;<custodian>
;;<assignedCustodian>
;;<representedCustodianOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@CUSTODIANORG@@Good Health Clinic</name>
;;</representedCustodianOrganization>
;;</assignedCustodian>
;;</custodian>
;;<legalAuthenticator>
;;<time value="20000407130000+0500"/>
;;<signatureCode code="S"/>
;;<assignedEntity>
;;<id nullFlavor="NI"/>
;;<representedOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@LEGALORG@@Good Health Clinic</name>
;;</representedOrganization>
;;</assignedEntity>
;;</legalAuthenticator>
;;<participant typeCode="IND">
;;<associatedEntity classCode="GUAR">
;;<id root="4ff51570-83a9-47b7-91f2-93ba30373141"/>
;;<addr>
;;<streetAddressLine>@@GUARSTREET@@17 Daws Rd.</streetAddressLine>
;;<city>@@GUARCITY@@Blue Bell</city>
;;<state>@@GUARSTATE@@MA</state>
;;<postalCode>@@GUARZIP@@02368</postalCode>
;;</addr>
;;<telecom value="tel:@@GUARTELE@@(888)555-1212"/>
;;<associatedPerson>
;;<name>
;;<given>@@GUARGIVENNAME@@Kenneth</given>
;;<family>@@GUARFAMILYNAME@@Ross</family>
;;</name>
;;</associatedPerson>
;;</associatedEntity>
;;</participant>
;;<participant typeCode="IND">
;;<associatedEntity classCode="NOK">
;;<id root="4ac71514-6a10-4164-9715-f8d96af48e6d"/>
;;<code code="65656005" codeSystem="2.16.840.1.113883.6.96" displayName="@@NOKRELATION@@Biiological mother"/>
;;<telecom value="tel:@@NOKTELE@@(999)555-1212"/>
;;<associatedPerson>
;;<name>
;;<given>@@NOKGIVENNAME@@Henrietta</given>
;;<family>@@NOKFAMILYNAME@@Levin</family>
;;</name>
;;</associatedPerson>
;;</associatedEntity>
;;</participant>
;;<documentationOf>
;;<serviceEvent classCode="PCPR">
;;<effectiveTime><low value="@@DOCPERIODLOW@@19320924"/><high value="@@DOCPERIODHIGH@@20000407"/></effectiveTime>
;;<performer typeCode="PRF">
;;<functionCode code="PCP" codeSystem="2.16.840.1.113883.5.88"/>
;;<time><low value="@@PCPPERIODLOW@@1990"/><high value='@@PCPPERIODHIGH@@20000407'/></time>
;;<assignedEntity>
;;<id root="20cf14fb-b65c-4c8c-a54d-b0cca834c18c"/>
;;<assignedPerson>
;;<name><prefix>@@PCPNAMEPREFIX@@Dr.</prefix><given>@@PCPNAMEGIVEN@@Robert</given><family>@@PCPNAMEFAMILY@@Dolin</family></name>
;;</assignedPerson>
;;<representedOrganization>
;;<id root="2.16.840.1.113883.19.5"/>
;;<name>@@PCPORG@@Good Health Clinic</name>
;;</representedOrganization>
;;</assignedEntity>
;;</performer>
;;</serviceEvent>
;;</documentationOf>
;;<component>
;;<structuredBody>
;;<component>
;;<section>
;; <templateId root='2.16.840.1.113883.10.20.1.13'/>
;; <code code="48764-5" codeSystem="2.16.840.1.113883.6.1"/>
;; <title>Summary Purpose</title>
;; <text>Transfer of care</text>
;; <entry typeCode="DRIV">
;; <act classCode="ACT" moodCode="EVN">
;; <templateId root='2.16.840.1.113883.10.20.1.30'/>
;; <code code="23745001" codeSystem="2.16.840.1.113883.6.96" displayName="Documentation procedure"/>
;; <statusCode code="completed"/>
;; <entryRelationship typeCode="RSON">
;; <act classCode="ACT" moodCode="EVN">
;; <code code="308292007" codeSystem="2.16.840.1.113883.6.96" displayName="@@DOCPURPOSE@@Transfer of care"/>
;; <statusCode code="completed"/>
;; </act>
;; </entryRelationship>
;; </act>
;; </entry>
;;<templateId root='2.16.840.1.113883.10.20.1.13'/>
;;<code code="48764-5" codeSystem="2.16.840.1.113883.6.1"/>
;;<title>Summary Purpose</title>
;;<text>Transfer of care</text>
;;<entry typeCode="DRIV">
;;<act classCode="ACT" moodCode="EVN">
;;<templateId root='2.16.840.1.113883.10.20.1.30'/>
;;<code code="23745001" codeSystem="2.16.840.1.113883.6.96" displayName="Documentation procedure"/>
;;<statusCode code="completed"/>
;;<entryRelationship typeCode="RSON">
;;<act classCode="ACT" moodCode="EVN">
;;<code code="308292007" codeSystem="2.16.840.1.113883.6.96" displayName="@@DOCPURPOSE@@Transfer of care"/>
;;<statusCode code="completed"/>
;;</act>
;;</entryRelationship>
;;</act>
;;</entry>
;;</section>
;;</component>
;;<component>
;;<section>
;; <templateId root="2.16.840.1.113883.10.20.1.14"/>
;; <code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
;; <entry typeCode="DRIV">
;; <organizer classCode="BATTERY" moodCode="EVN">
;; <templateId root="2.16.840.1.113883.10.20.1.32"/>
;; <id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/>
;; <code code="@@BATTERYCODE@@43789009" codeSystem="@@BATTERYSYSTEM@@2.16.840.1.113883.6.96" displayName="@@BATTERYNAME@@CBC WO DIFFERENTIAL"/>
;; <statusCode code="completed"/>
;; <effectiveTime value="@@BATTERYTIME@@200003231430"/>
;; <component>
;; <observation classCode="OBS" moodCode="EVN">
;; <templateId root="2.16.840.1.113883.10.20.1.31"/>
;; <id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/>
;; <code code="@@COMPONENTCODE@@30313-1" codeSystem="@@COMPONENTSYSTEM@@2.16.840.1.113883.6.1" displayName="@@COMPONENTNAME@@HGB"/>
;; <statusCode code="completed"/>
;; <effectiveTime value="@@COMPONENTTIME@@200003231430"/>
;; <value xsi:type="@@COMPONENTTYPE@@PQ" value="@@COMPONENTVALUE@13.2" unit="@@COMPONENTUNIT@@g/dl"/>
;; <interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/>
;; <referenceRange>
;; < value="OBSERVATIONRANGE"/>
;; <observationRange>
;; <text>@@OBSRANGETEXT@@M 13-18 g/dl; F 12-16 g/dl</text>
;; </observationRange>
;; </referenceRange>
;; </observation>
;; </component>
;; </organizer>
;; </entry>
;;<templateId root="2.16.840.1.113883.10.20.1.14"/>
;;<code code="30954-2" codeSystem="2.16.840.1.113883.6.1"/>
;;<entry typeCode="DRIV">
;;<organizer classCode="BATTERY" moodCode="EVN">
;;<templateId root="2.16.840.1.113883.10.20.1.32"/>
;;<id root="7d5a02b0-67a4-11db-bd13-0800200c9a66"/>
;;<code code="@@BATTERYCODE@@43789009" codeSystem="@@BATTERYSYSTEM@@2.16.840.1.113883.6.96" displayName="@@BATTERYNAME@@CBC WO DIFFERENTIAL"/>
;;<statusCode code="completed"/>
;;<effectiveTime value="@@BATTERYTIME@@200003231430"/>
;;<component>
;;<observation classCode="OBS" moodCode="EVN">
;;<templateId root="2.16.840.1.113883.10.20.1.31"/>
;;<id root="107c2dc0-67a5-11db-bd13-0800200c9a66"/>
;;<code code="@@COMPONENTCODE@@30313-1" codeSystem="@@COMPONENTSYSTEM@@2.16.840.1.113883.6.1" displayName="@@COMPONENTNAME@@HGB"/>
;;<statusCode code="completed"/>
;;<effectiveTime value="@@COMPONENTTIME@@200003231430"/>
;;<value xsi:type="@@COMPONENTTYPE@@PQ" value="@@COMPONENTVALUE@13.2" unit="@@COMPONENTUNIT@@g/dl"/>
;;<interpretationCode code="N" codeSystem="2.16.840.1.113883.5.83"/>
;;<referenceRange>
;;<value="OBSERVATIONRANGE"/>
;;<observationRange>
;;<text>@@OBSRANGETEXT@@M 13-18 g/dl; F 12-16 g/dl</text>
;;</observationRange>
;;</referenceRange>
;;</observation>
;;</component>
;;</organizer>
;;</entry>
;;</section>
;;</component>
;;</structuredBody>

View File

@ -1,49 +1,49 @@
GPLCCR0 ; CCDCCR/GPL - CCR TEMPLATE AND ACCESS ROUTINES; 5/31/08
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a CCR TEMPLATE with processing routines",!
W !
Q
;
GPLCCR0 ; CCDCCR/GPL - CCR TEMPLATE AND ACCESS ROUTINES; 5/31/08
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a CCR TEMPLATE with processing routines",!
W !
Q
;
ZT(ZARY,BAT,LINE) ; private routine to add a line to the ZARY array
; ZARY IS PASSED BY NAME
; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D
. S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count
S @ZARY@(CNT)=LINE ; put the line in the array
; S @ZARY@(BAT,CNT)="" ; index the test by battery
S @ZARY@(0)=CNT ; update the array counter
Q
;
; ZARY IS PASSED BY NAME
; BAT is a string identifying the section
; LINE is a test which will evaluate to true or false
; I '$G(@ZARY) D
. S @ZARY@(0)=0 ; initially there are no elements
. W "GOT HERE LOADING "_LINE,!
N CNT ; count of array elements
S CNT=@ZARY@(0) ; contains array count
S CNT=CNT+1 ; increment count
S @ZARY@(CNT)=LINE ; put the line in the array
; S @ZARY@(BAT,CNT)="" ; index the test by battery
S @ZARY@(0)=CNT ; update the array counter
Q
;
ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY S @ZARY=""
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the TEMPLATE section
N SECTION S SECTION="[anonymous]" ; NO section LABEL
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
. I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
. I INTEST D ; within the section
. . I LINE?." "1";><".E D ; sub-section name found
. . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
. . I LINE?." "1";;".E D ; line found
. . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
Q
;
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY S @ZARY=""
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the TEMPLATE section
N SECTION S SECTION="[anonymous]" ; NO section LABEL
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";<TEMPLATE>".E S INTEST=1 ; entering section
. I LINE?." "1";</TEMPLATE>".E S INTEST=0 ; leaving section
. I INTEST D ; within the section
. . I LINE?." "1";><".E D ; sub-section name found
. . . S SECTION=$P($P(LINE,";><",2),">",1) ; pull out name
. . I LINE?." "1";;".E D ; line found
. . . D ZT(ZARY,SECTION,$P(LINE,";;",2)) ; put the line in the array
Q
;
LOAD(ARY) ; LOAD A CCR TEMPLATE INTO ARY PASSED BY NAME
D ZLOAD(ARY,"GPLCCR0")
; ZWR @ARY
Q
;
D ZLOAD(ARY,"GPLCCR0")
; ZWR @ARY
Q
;
;<TEMPLATE>
;;<?xml version="1.0" encoding="UTF-8"?>
;;<?xml-stylesheet type="text/xsl" href="ccr_20060420.xsl"?>

View File

@ -1,63 +1,64 @@
GPLPROBS ; CCDCCR/GPL - CCR/CCD PROCESSING FOR PROBLEMS ; 6/6/08
;;0.1;CCDCCR;nopatch;noreleasedate
;
; PROCESS THE PROBLEMS SECTION OF THE CCR
;
;;0.1;CCDCCR;nopatch;noreleasedate
;
; PROCESS THE PROBLEMS SECTION OF THE CCR
;
EXTRACT(IPXML,DFN,OUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
;
; INXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
; INXML WILL CONTAIN ONLY THE PROBLEM SECTION OF THE OVERALL TEMPLATE
; ONLY THE XML FOR ONE PROBLEM WILL BE PASSED. THIS ROUTINE WILL MAKE
; COPIES AS NECESSARY TO REPRESENT MULTIPLE PROBLEMS
; INSERT^GPLXPATH IS USED TO APPEND THE PROBLEMS TO THE OUTPUT
;
N RPCRSLT,J,K,PTMP,X,VMAP,TBUF
D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC
I '$D(RPCRSLT(0)) W "ERROR CALLING LIST^ORQQPL3 ",! Q
ZWR RPCRSLT
S TVMAP=$NA(^TMP($J,"PROBVALS"))
S TARYTMP=$NA(^TMP($J,"PROBARYTMP"))
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
. S VMAP=$NA(@TVMAP@(J))
. K @VMAP
. I DEBUG W "VMAP= ",VMAP,!
. S PTMP=RPCRSLT(J) ; PULL OUT PROBLEM FROM RPC RETURN ARRAY
. S @VMAP@("PROBLEMOBJECTID")="PROBLEM"_J ; UNIQUE OBJID FOR PROBLEM
. S @VMAP@("PROBLEMIEN")=$P(PTMP,U,1)
. S @VMAP@("PROBLEMSTATUS")=$P(PTMP,U,2)
. S @VMAP@("PROBLEMDESCRIPTION")=$P(PTMP,U,3)
. S @VMAP@("PROBLEMCODEVALUE")=$P(PTMP,U,4)
. S @VMAP@("PROBLEMDATEOFONSET")=$P(PTMP,U,5)
. S @VMAP@("PROBLEMDATEMOD")=$P(PTMP,U,6)
. S @VMAP@("PROBLEMSC")=$P(PTMP,U,7)
. S @VMAP@("PROBLEMSE")=$P(PTMP,U,8)
. S @VMAP@("PROBLEMCONDITION")=$P(PTMP,U,9)
. S @VMAP@("PROBLEMLOC")=$P(PTMP,U,10)
. S @VMAP@("PROBLEMLOCTYPE")=$P(PTMP,U,11)
. S @VMAP@("PROBLEMPROVIDER")=$P(PTMP,U,12)
. S X=@VMAP@("PROBLEMPROVIDER") ; FORMAT Y;NAME Y IS IEN OF PROVIDER
. S @VMAP@("PROBLEMSOURCEACTORID")="ACTORPROVIDER_"_$P(X,";",1)
. S @VMAP@("PROBLEMSERVICE")=$P(PTMP,U,13)
. S @VMAP@("PROBLEMHASCMT")=$P(PTMP,U,14)
. S @VMAP@("PROBLEMDTREC")=$P(PTMP,U,15)
. S @VMAP@("PROBLEMINACT")=$P(PTMP,U,16)
. S ARYTMP=$NA(@TARYTMP@(J))
. ; W "ARYTMP= ",ARYTMP,!
. K @ARYTMP
. D MAP^GPLXPATH(IPXML,VMAP,ARYTMP) ;
. I J=1 D ; FIRST ONE IS JUST A COPY
. . ; W "FIRST ONE",!
. . D CP^GPLXPATH(ARYTMP,OUTXML)
. . ; W "OUTXML ",OUTXML,!
. I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . D INSINNER^GPLXPATH(OUTXML,ARYTMP)
; ZWR ^TMP($J,"PROBVALS",*)
; ZWR ^TMP($J,"PROBARYTMP",*) ; SHOW THE RESULTS
; ZWR @OUTXML
; $$HTML^DILF(
N PROBSTMP,I
D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS
I PROBSTMP(0)>0 D ; IF THERE ARE MISSING VARS - STRINGS MARKED AS @@X@@
. W "PROBLEMS Missing list: ",!
. F I=1:1:PROBSTMP(0) W PROBSTMP(I),!
Q
;
; INXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
; INXML WILL CONTAIN ONLY THE PROBLEM SECTION OF THE OVERALL TEMPLATE
; ONLY THE XML FOR ONE PROBLEM WILL BE PASSED. THIS ROUTINE WILL MAKE
; COPIES AS NECESSARY TO REPRESENT MULTIPLE PROBLEMS
; INSERT^GPLXPATH IS USED TO APPEND THE PROBLEMS TO THE OUTPUT
;
N RPCRSLT,J,K,PTMP,X,VMAP,TBUF
D LIST^ORQQPL3(.RPCRSLT,DFN,"") ; CALL THE PROBLEM LIST RPC
I '$D(RPCRSLT(0)) W "ERROR CALLING LIST^ORQQPL3 ",! Q
ZWR RPCRSLT
S TVMAP=$NA(^TMP($J,"PROBVALS"))
S TARYTMP=$NA(^TMP($J,"PROBARYTMP"))
F J=1:1:RPCRSLT(0) D ; FOR EACH PROBLEM IN THE LIST
. S VMAP=$NA(@TVMAP@(J))
. K @VMAP
. I DEBUG W "VMAP= ",VMAP,!
. S PTMP=RPCRSLT(J) ; PULL OUT PROBLEM FROM RPC RETURN ARRAY
. S @VMAP@("PROBLEMOBJECTID")="PROBLEM"_J ; UNIQUE OBJID FOR PROBLEM
. S @VMAP@("PROBLEMIEN")=$P(PTMP,U,1)
. S @VMAP@("PROBLEMSTATUS")=$P(PTMP,U,2)
. S @VMAP@("PROBLEMDESCRIPTION")=$P(PTMP,U,3)
. S @VMAP@("PROBLEMCODEVALUE")=$P(PTMP,U,4)
. S @VMAP@("PROBLEMDATEOFONSET")=$P(PTMP,U,5)
. S @VMAP@("PROBLEMDATEMOD")=$P(PTMP,U,6)
. S @VMAP@("PROBLEMSC")=$P(PTMP,U,7)
. S @VMAP@("PROBLEMSE")=$P(PTMP,U,8)
. S @VMAP@("PROBLEMCONDITION")=$P(PTMP,U,9)
. S @VMAP@("PROBLEMLOC")=$P(PTMP,U,10)
. S @VMAP@("PROBLEMLOCTYPE")=$P(PTMP,U,11)
. S @VMAP@("PROBLEMPROVIDER")=$P(PTMP,U,12)
. S X=@VMAP@("PROBLEMPROVIDER") ; FORMAT Y;NAME Y IS IEN OF PROVIDER
. S @VMAP@("PROBLEMSOURCEACTORID")="ACTORPROVIDER_"_$P(X,";",1)
. S @VMAP@("PROBLEMSERVICE")=$P(PTMP,U,13)
. S @VMAP@("PROBLEMHASCMT")=$P(PTMP,U,14)
. S @VMAP@("PROBLEMDTREC")=$P(PTMP,U,15)
. S @VMAP@("PROBLEMINACT")=$P(PTMP,U,16)
. S ARYTMP=$NA(@TARYTMP@(J))
. ; W "ARYTMP= ",ARYTMP,!
. K @ARYTMP
. D MAP^GPLXPATH(IPXML,VMAP,ARYTMP) ;
. I J=1 D ; FIRST ONE IS JUST A COPY
. . ; W "FIRST ONE",!
. . D CP^GPLXPATH(ARYTMP,OUTXML)
. . ; W "OUTXML ",OUTXML,!
. I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . D INSINNER^GPLXPATH(OUTXML,ARYTMP)
; ZWR ^TMP($J,"PROBVALS",*)
; ZWR ^TMP($J,"PROBARYTMP",*) ; SHOW THE RESULTS
; ZWR @OUTXML
; $$HTML^DILF(
N PROBSTMP,I
D MISSING^GPLXPATH(ARYTMP,"PROBSTMP") ; SEARCH XML FOR MISSING VARS
I PROBSTMP(0)>0 D ; IF THERE ARE MISSING VARS - STRINGS MARKED AS @@X@@
. W "PROBLEMS Missing list: ",!
. F I=1:1:PROBSTMP(0) W PROBSTMP(I),!
Q
;

View File

@ -1,140 +1,140 @@
GPLUNIT ; CCDCCR/GPL - Unit Testing Library; 5/07/08
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a unit testing library",!
W !
Q
;
;;0.1;CCDCCR;nopatch;noreleasedate
W "This is a unit testing library",!
W !
Q
;
ZT(ZARY,BAT,TST) ; private routine to add a test case to the ZARY array
; ZARY IS PASSED BY REFERENCE
; BAT is a string identifying the test battery
; TST is a test which will evaluate to true or false
; I '$G(ZARY) D
; . S ZARY(0)=0 ; initially there are no elements
; W "GOT HERE LOADING "_TST,!
N CNT ; count of array elements
S CNT=ZARY(0) ; contains array count
S CNT=CNT+1 ; increment count
S ZARY(CNT)=TST ; put the test in the array
I $D(ZARY(BAT)) D ; NOT THE FIRST TEST IN BATTERY
. N II,TN ; TEMP FOR ENDING TEST IN BATTERY
. S II=$P(ZARY(BAT),"^",2)
. S $P(ZARY(BAT),"^",2)=II+1
I '$D(ZARY(BAT)) D ; FIRST TEST IN THIS BATTERY
. S ZARY(BAT)=CNT_"^"_CNT ; FIRST AND LAST TESTS IN BATTERY
. S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
. ; S TN=$NA(ZARY("TESTS"))
. ; D PUSH^GPLXPATH(TN,BAT)
S ZARY(0)=CNT ; update the array counter
Q
;
; ZARY IS PASSED BY REFERENCE
; BAT is a string identifying the test battery
; TST is a test which will evaluate to true or false
; I '$G(ZARY) D
; . S ZARY(0)=0 ; initially there are no elements
; W "GOT HERE LOADING "_TST,!
N CNT ; count of array elements
S CNT=ZARY(0) ; contains array count
S CNT=CNT+1 ; increment count
S ZARY(CNT)=TST ; put the test in the array
I $D(ZARY(BAT)) D ; NOT THE FIRST TEST IN BATTERY
. N II,TN ; TEMP FOR ENDING TEST IN BATTERY
. S II=$P(ZARY(BAT),"^",2)
. S $P(ZARY(BAT),"^",2)=II+1
I '$D(ZARY(BAT)) D ; FIRST TEST IN THIS BATTERY
. S ZARY(BAT)=CNT_"^"_CNT ; FIRST AND LAST TESTS IN BATTERY
. S ZARY("TESTS",BAT)="" ; PUT THE BATTERY IN THE TESTS INDEX
. ; S TN=$NA(ZARY("TESTS"))
. ; D PUSH^GPLXPATH(TN,BAT)
S ZARY(0)=CNT ; update the array counter
Q
;
ZLOAD(ZARY,ROUTINE) ; load tests into ZARY which is passed by reference
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the test case section
N SECTION S SECTION="[anonymous]" ; test case section
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";;><TEST>".E S INTEST=1 ; entering test section
. I LINE?." "1";;><TEMPLATE>".E S INTEST=1 ; entering TEMPLATE section
. I LINE?." "1";;></TEST>".E S INTEST=0 ; leaving test section
. I LINE?." "1";;></TEMPLATE>".E S INTEST=0 ; leaving TEMPLATE section
. I INTEST D ; within the testing section
. . I LINE?." "1";;><".E D ; section name found
. . . S SECTION=$P($P(LINE,";;><",2),">",1) ; pull out name
. . I LINE?." "1";;>>".E D ; test case found
. . . D ZT(.@ZARY,SECTION,$P(LINE,";;>>",2)) ; put the test in the array
S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
Q
;
; ZARY IS PASSED BY NAME
; ZARY = name of the root, closed array format (e.g., "^TMP($J)")
; ROUTINE = NAME OF THE ROUTINE - PASSED BY VALUE
K @ZARY
S @ZARY@(0)=0 ; initialize array count
N LINE,LABEL,BODY
N INTEST S INTEST=0 ; switch for in the test case section
N SECTION S SECTION="[anonymous]" ; test case section
;
N NUM F NUM=1:1 S LINE=$T(+NUM^@ROUTINE) Q:LINE="" D
. I LINE?." "1";;><TEST>".E S INTEST=1 ; entering test section
. I LINE?." "1";;><TEMPLATE>".E S INTEST=1 ; entering TEMPLATE section
. I LINE?." "1";;></TEST>".E S INTEST=0 ; leaving test section
. I LINE?." "1";;></TEMPLATE>".E S INTEST=0 ; leaving TEMPLATE section
. I INTEST D ; within the testing section
. . I LINE?." "1";;><".E D ; section name found
. . . S SECTION=$P($P(LINE,";;><",2),">",1) ; pull out name
. . I LINE?." "1";;>>".E D ; test case found
. . . D ZT(.@ZARY,SECTION,$P(LINE,";;>>",2)) ; put the test in the array
S @ZARY@("ALL")="1"_"^"_@ZARY@(0) ; MAKE A BATTERY FOR ALL
Q
;
ZTEST(ZARY,WHICH) ; try out the tests using a passed array ZTEST
N I,ZX,ZR,ZP
S DEBUG=0
; I WHICH="ALL" D Q ; RUN ALL THE TESTS
; . W "DOING ALL",!
; . N J,NT
; . S NT=$NA(ZARY("TESTS"))
; . W NT,@NT@(0),!
; . F J=1:1:@NT@(0) D ;
; . . W @NT@(J),!
; . . D ZTEST^GPLUNIT(@ZARY,@NT@(J))
I '$D(ZARY(WHICH)) D ; TEST SECTION DOESN'T EXIST
. W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,!
. Q ; EXIT
N FIRST,LAST
S FIRST=$P(ZARY(WHICH),"^",1)
S LAST=$P(ZARY(WHICH),"^",2)
F I=FIRST:1:LAST D
. I ZARY(I)?1">"1.E D ; NOT A TEST, JUST RUN THE STATEMENT
. . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
. . ; W ZP,!
. . S ZX=ZP
. . W "RUNNING: "_ZP
. . X ZX
. . W "..SUCCESS: ",WHICH,!
. I ZARY(I)?1"?"1.E D ; THIS IS A TEST
. . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
. . S ZX="S ZR="_ZP
. . W "TRYING: "_ZP
. . X ZX
. . W $S(ZR=1:"..PASSED ",1:"..FAILED "),!
. . I '$D(TPASSED) D ; NOT INITIALIZED YET
. . . S TPASSED=0 S TFAILED=0
. . I ZR S TPASSED=TPASSED+1
. . I 'ZR S TFAILED=TFAILED+1
Q
;
N I,ZX,ZR,ZP
S DEBUG=0
; I WHICH="ALL" D Q ; RUN ALL THE TESTS
; . W "DOING ALL",!
; . N J,NT
; . S NT=$NA(ZARY("TESTS"))
; . W NT,@NT@(0),!
; . F J=1:1:@NT@(0) D ;
; . . W @NT@(J),!
; . . D ZTEST^GPLUNIT(@ZARY,@NT@(J))
I '$D(ZARY(WHICH)) D ; TEST SECTION DOESN'T EXIST
. W "ERROR -- TEST SECTION DOESN'T EXIST -> ",WHICH,!
. Q ; EXIT
N FIRST,LAST
S FIRST=$P(ZARY(WHICH),"^",1)
S LAST=$P(ZARY(WHICH),"^",2)
F I=FIRST:1:LAST D
. I ZARY(I)?1">"1.E D ; NOT A TEST, JUST RUN THE STATEMENT
. . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
. . ; W ZP,!
. . S ZX=ZP
. . W "RUNNING: "_ZP
. . X ZX
. . W "..SUCCESS: ",WHICH,!
. I ZARY(I)?1"?"1.E D ; THIS IS A TEST
. . S ZP=$E(ZARY(I),2,$L(ZARY(I)))
. . S ZX="S ZR="_ZP
. . W "TRYING: "_ZP
. . X ZX
. . W $S(ZR=1:"..PASSED ",1:"..FAILED "),!
. . I '$D(TPASSED) D ; NOT INITIALIZED YET
. . . S TPASSED=0 S TFAILED=0
. . I ZR S TPASSED=TPASSED+1
. . I 'ZR S TFAILED=TFAILED+1
Q
;
TEST ; RUN ALL THE TEST CASES
N ZTMP
D ZLOAD(.ZTMP)
D ZTEST(.ZTMP,"ALL")
W "PASSED: ",TPASSED,!
W "FAILED: ",TFAILED,!
W !
W "THE TESTS!",!
ZWR ZTMP
Q
;
N ZTMP
D ZLOAD(.ZTMP)
D ZTEST(.ZTMP,"ALL")
W "PASSED: ",TPASSED,!
W "FAILED: ",TFAILED,!
W !
W "THE TESTS!",!
ZWR ZTMP
Q
;
GTSTS(GTZARY,RTN) ; return an array of test names
N I,J S I="" S I=$O(GTZARY("TESTS",I))
F J=0:0 Q:I="" D
. D PUSH^GPLXPATH(RTN,I)
. S I=$O(GTZARY("TESTS",I))
Q
;
N I,J S I="" S I=$O(GTZARY("TESTS",I))
F J=0:0 Q:I="" D
. D PUSH^GPLXPATH(RTN,I)
. S I=$O(GTZARY("TESTS",I))
Q
;
TESTALL(RNM) ; RUN ALL THE TESTS
N I,J,TZTMP,TSTS,TOTP,TOTF
S TOTP=0 S TOTF=0
D ZLOAD^GPLUNIT("TZTMP",RNM)
D GTSTS(.TZTMP,"TSTS")
F I=1:1:TSTS(0) D ;
. S TPASSED=0 S TFAILED=0
. D ZTEST^GPLUNIT(.TZTMP,TSTS(I))
. S TOTP=TOTP+TPASSED
. S TOTF=TOTF+TFAILED
. S $P(TSTS(I),"^",2)=TPASSED
. S $P(TSTS(I),"^",3)=TFAILED
F I=1:1:TSTS(0) D ;
. W "TEST=> ",$P(TSTS(I),"^",1)
. W " PASSED=>",$P(TSTS(I),"^",2)
. W " FAILED=>",$P(TSTS(I),"^",3),!
W "TOTAL=> PASSED:",TOTP," FAILED:",TOTF,!
Q
;
N I,J,TZTMP,TSTS,TOTP,TOTF
S TOTP=0 S TOTF=0
D ZLOAD^GPLUNIT("TZTMP",RNM)
D GTSTS(.TZTMP,"TSTS")
F I=1:1:TSTS(0) D ;
. S TPASSED=0 S TFAILED=0
. D ZTEST^GPLUNIT(.TZTMP,TSTS(I))
. S TOTP=TOTP+TPASSED
. S TOTF=TOTF+TFAILED
. S $P(TSTS(I),"^",2)=TPASSED
. S $P(TSTS(I),"^",3)=TFAILED
F I=1:1:TSTS(0) D ;
. W "TEST=> ",$P(TSTS(I),"^",1)
. W " PASSED=>",$P(TSTS(I),"^",2)
. W " FAILED=>",$P(TSTS(I),"^",3),!
W "TOTAL=> PASSED:",TOTP," FAILED:",TOTF,!
Q
;
TLIST(ZARY) ; LIST ALL THE TESTS
; THEY ARE MARKED AS ;;><TESTNAME> IN THE TEST CASES
; ZARY IS PASSED BY REFERENCE
N I,J,K S I="" S I=$O(ZARY("TESTS",I))
S K=1
F J=0:0 Q:I="" D
. ; W "I IS NOW=",I,!
. W I," "
. S I=$O(ZARY("TESTS",I))
. S K=K+1 I K=6 D
. . W !
. . S K=1
Q
;
; THEY ARE MARKED AS ;;><TESTNAME> IN THE TEST CASES
; ZARY IS PASSED BY REFERENCE
N I,J,K S I="" S I=$O(ZARY("TESTS",I))
S K=1
F J=0:0 Q:I="" D
. ; W "I IS NOW=",I,!
. W I," "
. S I=$O(ZARY("TESTS",I))
. S K=K+1 I K=6 D
. . W !
. . S K=1
Q
;

View File

@ -1,85 +1,85 @@
GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/03/08
;;0.1;CCDCCR;;JUL 3,2008;
EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
;
; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
; IVITXML WILL CONTAIN ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE
;
N VITRSLT,J,K,VITPTMP,X,VITVMAP,TBUF
D VITALS^ORQQVI(.VITRSLT,DFN,"","")
I '$D(VITRSLT(1)) W "ERROR RUNNINIG VITALS RPC",! Q
; ZWR RPCRSLT
S VITTVMAP=$NA(^TMP($J,"VITALS"))
S VITTARYTMP=$NA(^TMP($J,"VITALARYTMP"))
F J=1:1:VITRSLT(1) D ; FOR EACH VITAL IN THE LIST
. I $D(VITRSLT(J)) D
. . S VITVMAP=$NA(@VITTVMAP@(J))
. . K @VITVMAP
. . I DEBUG W "VMAP= ",VMAP,!
. . S VITPTMP=VITRSLT(J) ; PULL OUT VITAL FROM RPC RETURN ARRAY
. . S @VITVMAP@("VITALSIGNSDATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR VITAL
. . I $P(VITPTMP,U,2)="HT" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . W "CONVERTED DATE TIME: ",@VITVMAP@("VITALSIGNSEXACTDATETIME"),!
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="in"
. . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
. . E I $P(VITPTMP,U,2)="WT" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="lbs"
. . E D
. . . ;W "IN VITAL: OTHER",!
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER VITAL"
. . . S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="UNKNOWN"
. . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
. . S VITARYTMP=$NA(@VITTARYTMP@(J))
. . K @VITARYTMP
. . D MAP^GPLXPATH(VITXML,VITVMAP,VITARYTMP)
. . I J=1 D ; FIRST ONE IS JUST A COPY
. . . ; W "FIRST ONE",!
. . . D CP^GPLXPATH(VITARYTMP,VITOUTXML)
. . . ; W "OUTXML ",OUTXML,!
. . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
; ZWR ^TMP($J,"VITALS",*)
; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
; ZWR @OUTXML
N VITTMP,I
D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
. W "VITALS MISSING ",!
. F I=1:1:VITTMP(0) W VITTMP(I),!
Q
;
GPLVITALS ; CCDCCR/CJE - CCR/CCD PROCESSING FOR VITALS ; 07/03/08
;;0.1;CCDCCR;;JUL 3,2008;
EXTRACT(VITXML,DFN,VITOUTXML) ; EXTRACT PROBLEMS INTO PROVIDED XML TEMPLATE
;
; VITXML AND OUTXML ARE PASSED BY NAME SO GLOBALS CAN BE USED
; IVITXML WILL CONTAIN ONLY THE VITALS SECTION OF THE OVERALL TEMPLATE
;
N VITRSLT,J,K,VITPTMP,X,VITVMAP,TBUF
D VITALS^ORQQVI(.VITRSLT,DFN,"","")
I '$D(VITRSLT(1)) W "ERROR RUNNINIG VITALS RPC",! Q
; ZWR RPCRSLT
S VITTVMAP=$NA(^TMP($J,"VITALS"))
S VITTARYTMP=$NA(^TMP($J,"VITALARYTMP"))
F J=1:1:VITRSLT(1) D ; FOR EACH VITAL IN THE LIST
. I $D(VITRSLT(J)) D
. . S VITVMAP=$NA(@VITTVMAP@(J))
. . K @VITVMAP
. . I DEBUG W "VMAP= ",VMAP,!
. . S VITPTMP=VITRSLT(J) ; PULL OUT VITAL FROM RPC RETURN ARRAY
. . S @VITVMAP@("VITALSIGNSDATAOBJECTID")="VITAL"_J ; UNIQUE OBJID FOR VITAL
. . I $P(VITPTMP,U,2)="HT" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . W "CONVERTED DATE TIME: ",@VITVMAP@("VITALSIGNSEXACTDATETIME"),!
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="HEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="in"
. . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
. . E I $P(VITPTMP,U,2)="WT" D
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="WEIGHT"
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . ;S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . ;S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="lbs"
. . E D
. . . ;W "IN VITAL: OTHER",!
. . . S @VITVMAP@("VITALSIGNSDATETIMETYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSEXACTDATETIME")=$$FMDTOUTC^CCRUTIL($P(VITPTMP,U,4),"DT")
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER VITAL"
. . . S @VITVMAP@("VITALSIGNSSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTOBJECTID")="VITALTEST"_J
. . . S @VITVMAP@("VITALSIGNSTESTTYPETEXT")="OBSERVED"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONTEXT")="OTHER"
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVALUE")=""
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODINGSYSTEM")=""
. . . S @VITVMAP@("VITALSIGNSDESCRIPTIONCODEVERSION")=""
. . . S @VITVMAP@("VITALSIGNSTESTSOURCEACTORID")=""
. . . S @VITVMAP@("VITALSIGNSTESTRESULTVALUE")=$P(VITPTMP,U,3)
. . . S @VITVMAP@("VITALSIGNSTESTRESULTUNIT")="UNKNOWN"
. . . ;S @VITVMAP@("HEIGHTWEIGHTSOURCE")=$P(VITPTMP,U,7)
. . S VITARYTMP=$NA(@VITTARYTMP@(J))
. . K @VITARYTMP
. . D MAP^GPLXPATH(VITXML,VITVMAP,VITARYTMP)
. . I J=1 D ; FIRST ONE IS JUST A COPY
. . . ; W "FIRST ONE",!
. . . D CP^GPLXPATH(VITARYTMP,VITOUTXML)
. . . ; W "OUTXML ",OUTXML,!
. . I J>1 D ; AFTER THE FIRST, INSERT INNER XML
. . . D INSINNER^GPLXPATH(VITOUTXML,VITARYTMP)
; ZWR ^TMP($J,"VITALS",*)
; ZWR ^TMP($J,"VITALARYTMP",*) ; SHOW THE RESULTS
; ZWR @OUTXML
N VITTMP,I
D MISSING^GPLXPATH(VITOUTXML,"VITTMP") ; SEARCH XML FOR MISSING VARS
I VITTMP(0)>0 D ; IF THERE ARE MISSING VARS - MARKED AS @@X@@
. W "VITALS MISSING ",!
. F I=1:1:VITTMP(0) W VITTMP(I),!
Q
;